changeset 181:bfd6434d15b3 r20-3b17

Import from CVS: tag r20-3b17
author cvs
date Mon, 13 Aug 2007 09:53:19 +0200
parents add28d59e586
children f07455f06202
files CHANGES-beta ChangeLog configure configure.in etc/gnuserv.1 etc/toolbar/ediff-A-up.xpm etc/toolbar/ediff-A-xx.xpm etc/toolbar/ediff-B-up.xpm etc/toolbar/ediff-B-xx.xpm etc/toolbar/ediff-refine.xpm etc/toolbar/ediff-update.xpm etc/viperCard.tex info/dir lib-src/ChangeLog lib-src/Makefile.in.in lib-src/config.values.in lib-src/config.values.sh lib-src/gnuclient.c lib-src/gzip-el.sh lib-src/update-autoloads.sh lib-src/update-elc.sh lisp/ChangeLog lisp/cc-mode/auto-autoloads.el lisp/cc-mode/cc-align.el lisp/cc-mode/cc-cmds.el lisp/cc-mode/cc-compat.el lisp/cc-mode/cc-defs.el lisp/cc-mode/cc-engine.el lisp/cc-mode/cc-langs.el lisp/cc-mode/cc-menus.el lisp/cc-mode/cc-mode.el lisp/cc-mode/cc-styles.el lisp/cc-mode/cc-vars.el lisp/comint/custom-load.el lisp/custom/cus-edit.el lisp/custom/cus-face.el lisp/custom/custom-load.el lisp/custom/custom.el lisp/custom/wid-browse.el lisp/custom/wid-edit.el lisp/custom/widget-example.el lisp/custom/widget.el lisp/ediff/Makefile lisp/ediff/ediff-diff.el lisp/ediff/ediff-init.el lisp/ediff/ediff-merg.el lisp/ediff/ediff-mult.el lisp/ediff/ediff-ptch.el lisp/ediff/ediff-tbar.el lisp/ediff/ediff-util.el lisp/ediff/ediff-vers.el lisp/ediff/ediff-wind.el lisp/ediff/ediff.el lisp/efs/dired.el lisp/egg/egg.el lisp/hm--html-menus/custom-load.el lisp/mh-e/custom-load.el lisp/modes/auto-autoloads.el lisp/modes/pascal.el lisp/packages/custom-load.el lisp/packages/func-menu.el lisp/packages/info.el lisp/packages/man.el lisp/prim/custom-load.el lisp/prim/files.el lisp/prim/obsolete.el lisp/prim/simple.el lisp/psgml/custom-load.el lisp/utils/custom-load.el lisp/viper/Makefile lisp/viper/auto-autoloads.el lisp/viper/custom-load.el lisp/viper/viper-cmd.el lisp/viper/viper-ex.el lisp/viper/viper-init.el lisp/viper/viper-keym.el lisp/viper/viper-macs.el lisp/viper/viper-mous.el lisp/viper/viper-util.el lisp/viper/viper.el lisp/vm/vm-autoload.el lisp/w3/custom-load.el lwlib/xlwmenu.c man/ChangeLog man/cc-mode.texi man/ediff.texi man/texinfo.tex man/texinfo.texi man/viper.texi man/widget.texi man/xemacs/text.texi man/xemacs/xemacs.texi src/ChangeLog src/Makefile.in.in src/buffer.h src/chartab.c src/console-x.h src/emacsfns.h src/eval.c src/event-stream.c src/faces.c src/lread.c src/mule-coding.c version.sh
diffstat 104 files changed, 8345 insertions(+), 9776 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 09:52:21 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 09:53:19 2007 +0200
@@ -1,4 +1,14 @@
 							-*- indented-text -*-
+to 20.3 beta17 "Bucharest"
+-- ediff-2.67
+-- viper-2.96
+-- cc-mode-5.15
+-- Various patches by Karl Hegbloom
+   Interface change:  info mode now behaves like Emacs by default.
+-- Custom-1.9954
+-- texinfo documentation updated from texinfo-3.11
+-- Miscellaneous bug fixes
+
 to 20.3 beta16 "Budapest"
 -- New lisp finding functions courtesy of Jens Petersen
    New keybindings:  C-c f -- find-function
--- a/ChangeLog	Mon Aug 13 09:52:21 2007 +0200
+++ b/ChangeLog	Mon Aug 13 09:53:19 2007 +0200
@@ -1,3 +1,30 @@
+1997-08-09  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta17 is released.
+
+1997-08-07  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+	* etc/gnuserv.1: Described Hrvoje's mods in manpage
+
+1997-08-09  Martin Buchholz  <mrb@eng.sun.com>
+
+	* configure.in:
+	- use-system-malloc renamed to with-system-malloc.
+	- config.el reimplemented for improved accuracy.
+	- new variable `blddir' introduced for informational purposes.
+	* lib-src/config.values.in: new config.el implementation
+	* lib-src/config.values.sh: new config.el implementation
+	* lisp/modes/pascal.el: Sync with GNU Emacs, fix infloop problem 
+	(thanks to Espen Skoglund, pascal.el maintainer)
+	* src/chartab.c: maintainability improvements.
+	* src/mule-coding.c: FIX for: editing DOS files with ISO2022*
+	coding systems results in extra CR's inserted into file on saving.
+
+1997-08-06  SL Baur  <steve@altair.xemacs.org>
+
+	* configure.in: Crash & burn if db-2 is detected.
+	From Soren Dayton <csdayton@cs.uchicago.edu>
+
 1997-07-31  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta16 is released.
--- a/configure	Mon Aug 13 09:52:21 2007 +0200
+++ b/configure	Mon Aug 13 09:53:19 2007 +0200
@@ -44,7 +44,6 @@
 ac_help="$ac_help
   --with-x                use the X Window System"
 
-build=NONE
 exec_prefix=NONE
 host=NONE
 no_create=
@@ -238,7 +237,7 @@
 dynamic=''
 with_x11=''
 rel_alloc='default'
-use_system_malloc='default'
+with_system_malloc='default'
 energize_version=''
 native_sound_lib=''
 use_assertions="yes"
@@ -431,9 +430,8 @@
   			is system-dependent).
 --with-clash-detection	Use lock files to detect multiple edits of the same file.
 			The default is to not do clash detection.
---use-system-malloc	Force use of the system malloc, rather than GNU
-			malloc.
---use-debug-malloc	Use the debugging malloc package.
+--with-system-malloc	Force use of the system malloc, rather than GNU malloc.
+--with-debug-malloc	Use the debugging malloc package.
 
 You may also specify any of the \`path' variables found in
 Makefile.in, including --bindir, --libdir, --lispdir, --datadir, and
@@ -579,18 +577,18 @@
 	;;
 
 		rel_alloc | \
-	use_debug_malloc | \
-	use_system_malloc )
+	with_debug_malloc  | use_debug_malloc | \
+	with_system_malloc | use_system_malloc )
 	  case "$val" in
 	    y | ye | yes )	val=yes ;;
 	    n | no )		val=no  ;;
-	    d | de | def | defa | defau | defaul | default )
-				val=default ;;
+	    d | de | def | defa | defau | defaul | default ) val=default ;;
 	    * ) (echo "$progname: Usage error:"
 echo " " "The \`--$optname' option requires one of these values:
   \`yes', \`no', or \`default'."
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
 	  esac
+	  case "$opt" in use_* ) opt="`echo $opt | sed /use/with/`" ;; esac
           eval "$opt=\"$val\""
         ;;
 
@@ -846,7 +844,7 @@
 esac
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:850: checking whether ln -s works" >&5
+echo "configure:848: checking whether ln -s works" >&5
 
 rm -f conftestdata
 if ln -s X conftestdata 2>/dev/null
@@ -871,16 +869,17 @@
   fi
 done
 
+absolute_pwd="`pwd`";
+if test -n "$PWD" && "`cd $PWD && pwd`" = "$absolute_pwd"
+then blddir="$PWD"
+else blddir="$absolute_pwd"
+fi
+
+
 case "$srcdir" in
   /* ) ;;
-  . )
-            if test "$PWD" != "" -a "`(cd $PWD ; sh -c pwd)`" = "`pwd`"; then
-      srcdir="$PWD"
-    else
-      srcdir="`(cd $srcdir && pwd)`"
-    fi
-  ;;
-  *  ) srcdir="`(cd $srcdir && pwd)`" ;;
+  .  ) srcdir="$blddir" ;;
+  *  ) srcdir="`cd $srcdir && pwd`" ;;
 esac
 
 if test `pwd` != `sh -c cd $srcdir && pwd`  \
@@ -1022,7 +1021,7 @@
 
 
 echo "checking "the configuration name"" 1>&6
-echo "configure:1026: checking "the configuration name"" >&5
+echo "configure:1025: checking "the configuration name"" >&5
 internal_configuration=`echo $configuration | sed 's/-\(energize\|workshop\)//'`
 if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
   exit $?
@@ -1476,7 +1475,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1480: checking for $ac_word" >&5
+echo "configure:1479: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1502,7 +1501,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1506: checking for $ac_word" >&5
+echo "configure:1505: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1547,7 +1546,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1551: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1550: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1559,11 +1558,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+#line 1562 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1583,19 +1582,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1587: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1586: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1592: checking whether we are using GNU C" >&5
+echo "configure:1591: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1609,7 +1608,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1613: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1612: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1638,7 +1637,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1642: checking for $ac_word" >&5
+echo "configure:1641: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1664,7 +1663,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1668: checking for $ac_word" >&5
+echo "configure:1667: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1709,7 +1708,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1713: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1712: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1721,11 +1720,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1725 "configure"
+#line 1724 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1745,19 +1744,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1749: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1748: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1754: checking whether we are using GNU C" >&5
+echo "configure:1753: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1771,7 +1770,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1775: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1774: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1800,7 +1799,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1804: checking for $ac_word" >&5
+echo "configure:1803: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1826,7 +1825,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1830: checking for $ac_word" >&5
+echo "configure:1829: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1871,7 +1870,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1875: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1874: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1883,11 +1882,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1887 "configure"
+#line 1886 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1907,19 +1906,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1911: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1910: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1916: checking whether we are using GNU C" >&5
+echo "configure:1915: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1933,7 +1932,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1937: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1936: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1966,7 +1965,7 @@
 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1970: checking how to run the C preprocessor" >&5
+echo "configure:1969: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1979,13 +1978,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1983 "configure"
+#line 1982 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1996,13 +1995,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2000 "configure"
+#line 1999 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -2025,9 +2024,9 @@
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2029: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2031 "configure"
+echo "configure:2028: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2030 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2054,9 +2053,9 @@
 
 
 echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6
-echo "configure:2058: checking whether we are using SunPro C" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2060 "configure"
+echo "configure:2057: checking whether we are using SunPro C" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2059 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2067,7 +2066,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   __sunpro_c=yes
 else
@@ -2354,7 +2353,7 @@
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2358: checking for dynodump" >&5
+echo "configure:2357: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2425,19 +2424,19 @@
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2429: checking "for runtime libraries flag"" >&5
+echo "configure:2428: checking "for runtime libraries flag"" >&5
   dash_r=""
   for try_dash_r in "-R" "-R " "-rpath "; do
     xe_check_libs="${try_dash_r}/no/such/file-or-directory"
     cat > conftest.$ac_ext <<EOF
-#line 2434 "configure"
+#line 2433 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -2521,11 +2520,11 @@
   GNU_MALLOC=no
   GNU_MALLOC_reason="
   (The GNU allocators don't work with this system configuration)."
-elif test "$use_system_malloc" = "yes" ; then
+elif test "$with_system_malloc" = "yes" ; then
   GNU_MALLOC=no
   GNU_MALLOC_reason="
   (User chose not to use GNU allocators)."
-elif test "$use_debug_malloc" = "yes" ; then
+elif test "$with_debug_malloc" = "yes" ; then
   GNU_MALLOC=no
   GNU_MALLOC_reason="
   (User chose to use Debugging Malloc)."
@@ -2535,7 +2534,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2539: checking for $ac_word" >&5
+echo "configure:2538: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2588,7 +2587,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2592: checking for a BSD compatible install" >&5
+echo "configure:2591: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
@@ -2639,7 +2638,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2643: checking for $ac_word" >&5
+echo "configure:2642: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2670,15 +2669,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2674: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2677 "configure"
+echo "configure:2673: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2676 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2711,15 +2710,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2715: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2718 "configure"
+echo "configure:2714: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2717 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2752,15 +2751,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2756: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2759 "configure"
+echo "configure:2755: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2758 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2790,10 +2789,10 @@
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2794: checking for sys/wait.h that is POSIX.1 compatible" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2797 "configure"
+echo "configure:2793: checking for sys/wait.h that is POSIX.1 compatible" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2796 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2809,7 +2808,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2833,10 +2832,10 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2837: checking for ANSI C header files" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2840 "configure"
+echo "configure:2836: checking for ANSI C header files" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2839 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2844,7 +2843,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2861,7 +2860,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2865 "configure"
+#line 2864 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2879,7 +2878,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2883 "configure"
+#line 2882 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2897,7 +2896,7 @@
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 cat > conftest.$ac_ext <<EOF
-#line 2901 "configure"
+#line 2900 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2908,7 +2907,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
@@ -2933,10 +2932,10 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2937: checking whether time.h and sys/time.h may both be included" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2940 "configure"
+echo "configure:2936: checking whether time.h and sys/time.h may both be included" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2939 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2945,7 +2944,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2969,10 +2968,10 @@
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2973: checking for sys_siglist declaration in signal.h or unistd.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2976 "configure"
+echo "configure:2972: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2975 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2984,7 +2983,7 @@
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:2988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -3009,9 +3008,9 @@
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:3013: checking for struct utimbuf" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3015 "configure"
+echo "configure:3012: checking for struct utimbuf" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3014 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3030,7 +3029,7 @@
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:3034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3033: \"$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
@@ -3050,10 +3049,10 @@
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3054: checking return type of signal handlers" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3057 "configure"
+echo "configure:3053: checking return type of signal handlers" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3056 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3070,7 +3069,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3092,10 +3091,10 @@
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3096: checking for size_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3099 "configure"
+echo "configure:3095: checking for size_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3098 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3126,10 +3125,10 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3130: checking for pid_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3133 "configure"
+echo "configure:3129: checking for pid_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3132 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3160,10 +3159,10 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3164: checking for uid_t in sys/types.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3167 "configure"
+echo "configure:3163: checking for uid_t in sys/types.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3166 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3199,10 +3198,10 @@
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3203: checking for mode_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3206 "configure"
+echo "configure:3202: checking for mode_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3205 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3233,10 +3232,10 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3237: checking for off_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3240 "configure"
+echo "configure:3236: checking for off_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3239 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3268,9 +3267,9 @@
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3272: checking for struct timeval" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3274 "configure"
+echo "configure:3271: checking for struct timeval" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3273 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3286,7 +3285,7 @@
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -3308,10 +3307,10 @@
 rm -f conftest*
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3312: checking whether struct tm is in sys/time.h or time.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3315 "configure"
+echo "configure:3311: checking whether struct tm is in sys/time.h or time.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3314 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3319,7 +3318,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3343,10 +3342,10 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3347: checking for tm_zone in struct tm" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3350 "configure"
+echo "configure:3346: checking for tm_zone in struct tm" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3349 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3354,7 +3353,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3377,10 +3376,10 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3381: checking for tzname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3384 "configure"
+echo "configure:3380: checking for tzname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3383 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3390,7 +3389,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3416,10 +3415,10 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3420: checking for working const" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3423 "configure"
+echo "configure:3419: checking for working const" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3422 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3468,7 +3467,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3493,7 +3492,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:3497: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:3496: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -3518,12 +3517,12 @@
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3522: checking whether byte ordering is bigendian" >&5
+echo "configure:3521: checking whether byte ordering is bigendian" >&5
 
 ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3527 "configure"
+#line 3526 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3534,11 +3533,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3542 "configure"
+#line 3541 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3549,7 +3548,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3566,7 +3565,7 @@
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 3570 "configure"
+#line 3569 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3579,7 +3578,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
@@ -3605,10 +3604,10 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3609: checking size of short" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3612 "configure"
+echo "configure:3608: checking size of short" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3611 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3619,7 +3618,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -3646,10 +3645,10 @@
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3650: checking size of int" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3653 "configure"
+echo "configure:3649: checking size of int" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3652 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3660,7 +3659,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3681,10 +3680,10 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3685: checking size of long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3688 "configure"
+echo "configure:3684: checking size of long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3687 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3695,7 +3694,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3716,10 +3715,10 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:3720: checking size of long long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3723 "configure"
+echo "configure:3719: checking size of long long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3722 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3730,7 +3729,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -3751,10 +3750,10 @@
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:3755: checking size of void *" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3758 "configure"
+echo "configure:3754: checking size of void *" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3757 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3765,7 +3764,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_void_p=`cat conftestval`
 else
@@ -3787,7 +3786,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:3791: checking for long file names" >&5
+echo "configure:3790: checking for long file names" >&5
 
 ac_cv_sys_long_file_names=yes
 # Test for long file names in all the places we know might matter:
@@ -3834,12 +3833,12 @@
 
 
 echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
-echo "configure:3838: checking for sqrt in -lm" >&5
+echo "configure:3837: checking for sqrt in -lm" >&5
 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lm "
 cat > conftest.$ac_ext <<EOF
-#line 3843 "configure"
+#line 3842 "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
@@ -3850,7 +3849,7 @@
 sqrt()
 ; return 0; }
 EOF
-if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3853: \"$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
@@ -3892,7 +3891,7 @@
 
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:3896: checking type of mail spool file locking" >&5
+echo "configure:3895: checking type of mail spool file locking" >&5
 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
@@ -3916,12 +3915,12 @@
 
 
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:3920: checking for kstat_open in -lkstat" >&5
+echo "configure:3919: checking for kstat_open in -lkstat" >&5
 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkstat "
 cat > conftest.$ac_ext <<EOF
-#line 3925 "configure"
+#line 3924 "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
@@ -3932,7 +3931,7 @@
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:3936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3935: \"$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
@@ -3966,12 +3965,12 @@
 
 
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:3970: checking for kvm_read in -lkvm" >&5
+echo "configure:3969: checking for kvm_read in -lkvm" >&5
 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkvm "
 cat > conftest.$ac_ext <<EOF
-#line 3975 "configure"
+#line 3974 "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
@@ -3982,7 +3981,7 @@
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:3986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3985: \"$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
@@ -4016,12 +4015,12 @@
 
 
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:4020: checking for cma_open in -lpthreads" >&5
+echo "configure:4019: checking for cma_open in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpthreads "
 cat > conftest.$ac_ext <<EOF
-#line 4025 "configure"
+#line 4024 "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
@@ -4032,7 +4031,7 @@
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4035: \"$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
@@ -4068,7 +4067,7 @@
 fi
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:4072: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:4071: checking whether the -xildoff compiler flag is required" >&5
 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
     then echo "$ac_t""no" 1>&6;
@@ -4079,7 +4078,7 @@
 
 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:4083: checking for \"-z ignore\" linker flag" >&5
+echo "configure:4082: checking for \"-z ignore\" linker flag" >&5
   case "`ld -h 2>&1`" in
     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
@@ -4089,7 +4088,7 @@
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:4093: checking "for specified window system"" >&5
+echo "configure:4092: checking "for specified window system"" >&5
 
 if test "$x_includes $x_libraries" = "NONE NONE"; then
   if test -n "$OPENWINHOME" \
@@ -4110,7 +4109,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:4114: checking for X" >&5
+echo "configure:4113: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4170,12 +4169,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4174 "configure"
+#line 4173 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4244,14 +4243,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4248 "configure"
+#line 4247 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4360,17 +4359,17 @@
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:4364: checking whether -R must be followed by a space" >&5
+echo "configure:4363: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4367 "configure"
+#line 4366 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4386,14 +4385,14 @@
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 4390 "configure"
+#line 4389 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4429,12 +4428,12 @@
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4433: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4432: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet "
 cat > conftest.$ac_ext <<EOF
-#line 4438 "configure"
+#line 4437 "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
@@ -4445,7 +4444,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4448: \"$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
@@ -4469,12 +4468,12 @@
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       
 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:4473: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4472: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet_stub "
 cat > conftest.$ac_ext <<EOF
-#line 4478 "configure"
+#line 4477 "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
@@ -4485,7 +4484,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4488: \"$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
@@ -4514,10 +4513,10 @@
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:4518: checking for gethostbyname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4521 "configure"
+echo "configure:4517: checking for gethostbyname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4520 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4540,7 +4539,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4561,12 +4560,12 @@
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4565: checking for gethostbyname in -lnsl" >&5
+echo "configure:4564: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lnsl "
 cat > conftest.$ac_ext <<EOF
-#line 4570 "configure"
+#line 4569 "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
@@ -4577,7 +4576,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4580: \"$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
@@ -4607,10 +4606,10 @@
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4611: checking for connect" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4614 "configure"
+echo "configure:4610: checking for connect" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4613 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4633,7 +4632,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4656,12 +4655,12 @@
 xe_msg_checking="for connect in -lsocket"
 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:4660: checking "$xe_msg_checking"" >&5
+echo "configure:4659: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4665 "configure"
+#line 4664 "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
@@ -4672,7 +4671,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4675: \"$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
@@ -4696,10 +4695,10 @@
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:4700: checking for remove" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4703 "configure"
+echo "configure:4699: checking for remove" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4702 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -4722,7 +4721,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -4743,12 +4742,12 @@
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:4747: checking for remove in -lposix" >&5
+echo "configure:4746: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lposix "
 cat > conftest.$ac_ext <<EOF
-#line 4752 "configure"
+#line 4751 "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
@@ -4759,7 +4758,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4762: \"$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
@@ -4783,10 +4782,10 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:4787: checking for shmat" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4790 "configure"
+echo "configure:4786: checking for shmat" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4789 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -4809,7 +4808,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -4830,12 +4829,12 @@
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:4834: checking for shmat in -lipc" >&5
+echo "configure:4833: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lipc "
 cat > conftest.$ac_ext <<EOF
-#line 4839 "configure"
+#line 4838 "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
@@ -4846,7 +4845,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:4850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4849: \"$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
@@ -4880,12 +4879,12 @@
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   
 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:4884: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4883: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE "
 cat > conftest.$ac_ext <<EOF
-#line 4889 "configure"
+#line 4888 "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
@@ -4896,7 +4895,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4899: \"$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
@@ -5029,7 +5028,7 @@
   fi
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:5033: checking for X defines extracted by xmkmf" >&5
+echo "configure:5032: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -5061,15 +5060,15 @@
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:5065: checking for X11/Intrinsic.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5068 "configure"
+echo "configure:5064: checking for X11/Intrinsic.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5067 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5093,12 +5092,12 @@
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5097: checking for XOpenDisplay in -lX11" >&5
+echo "configure:5096: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 5102 "configure"
+#line 5101 "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
@@ -5109,7 +5108,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5112: \"$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
@@ -5134,12 +5133,12 @@
 xe_msg_checking="for XGetFontProperty in -lX11"
 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5138: checking "$xe_msg_checking"" >&5
+echo "configure:5137: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 -b i486-linuxaout"
 cat > conftest.$ac_ext <<EOF
-#line 5143 "configure"
+#line 5142 "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
@@ -5150,7 +5149,7 @@
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:5154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5153: \"$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
@@ -5177,12 +5176,12 @@
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:5181: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:5180: checking for XShapeSelectInput in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXext "
 cat > conftest.$ac_ext <<EOF
-#line 5186 "configure"
+#line 5185 "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
@@ -5193,7 +5192,7 @@
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5196: \"$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
@@ -5216,12 +5215,12 @@
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:5220: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:5219: checking for XtOpenDisplay in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXt "
 cat > conftest.$ac_ext <<EOF
-#line 5225 "configure"
+#line 5224 "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
@@ -5232,7 +5231,7 @@
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5235: \"$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
@@ -5255,14 +5254,14 @@
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:5259: checking the version of X11 being used" >&5
+echo "configure:5258: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5261 "configure"
+#line 5260 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:5266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
@@ -5286,15 +5285,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5290: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5293 "configure"
+echo "configure:5289: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5292 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5298: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5325,7 +5324,7 @@
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:5329: checking for XFree86" >&5
+echo "configure:5328: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
 	  -f "/etc/X11/XF86Config" -o \
@@ -5345,12 +5344,12 @@
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:5349: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:5348: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXmu "
 cat > conftest.$ac_ext <<EOF
-#line 5354 "configure"
+#line 5353 "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
@@ -5361,7 +5360,7 @@
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:5365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5364: \"$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
@@ -5391,19 +5390,19 @@
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:5395: checking for main in -lXbsd" >&5
+echo "configure:5394: checking for main in -lXbsd" >&5
 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXbsd "
 cat > conftest.$ac_ext <<EOF
-#line 5400 "configure"
+#line 5399 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5406: \"$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
@@ -5426,12 +5425,12 @@
 
     
 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:5430: checking for XawScrollbarSetThumb in -lXaw" >&5
+echo "configure:5429: 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 5435 "configure"
+#line 5434 "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
@@ -5442,7 +5441,7 @@
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5445: \"$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
@@ -5466,15 +5465,15 @@
   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:5470: checking for X11/Xaw/Reports.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5473 "configure"
+echo "configure:5469: checking for X11/Xaw/Reports.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5472 "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:5478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5531,7 +5530,7 @@
 esac
 
 echo "checking for session-management option" 1>&6
-echo "configure:5535: checking for session-management option" >&5;
+echo "configure:5534: checking for session-management option" >&5;
 if test "$with_session" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SESSION
@@ -5546,15 +5545,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:5550: checking for X11/Xauth.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5553 "configure"
+echo "configure:5549: checking for X11/Xauth.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5552 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5577,12 +5576,12 @@
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:5581: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5580: 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 5586 "configure"
+#line 5585 "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
@@ -5593,7 +5592,7 @@
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:5597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5596: \"$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
@@ -5634,15 +5633,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:5638: checking for OffiX/DragAndDrop.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5641 "configure"
+echo "configure:5637: checking for OffiX/DragAndDrop.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5640 "configure"
 #include "confdefs.h"
 #include <OffiX/DragAndDrop.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5665,12 +5664,12 @@
  }
 test -z "$with_offix" && { 
 echo $ac_n "checking for DndInitialize in -lDnd""... $ac_c" 1>&6
-echo "configure:5669: checking for DndInitialize in -lDnd" >&5
+echo "configure:5668: 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 5674 "configure"
+#line 5673 "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
@@ -5681,7 +5680,7 @@
 DndInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5684: \"$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
@@ -5720,15 +5719,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:5724: checking for ${dir}tt_c.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5727 "configure"
+echo "configure:5723: checking for ${dir}tt_c.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5726 "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:5732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5757,12 +5756,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:5761: checking "$xe_msg_checking"" >&5
+echo "configure:5760: 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 5766 "configure"
+#line 5765 "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
@@ -5773,7 +5772,7 @@
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:5777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5776: \"$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
@@ -5822,15 +5821,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:5826: checking for Dt/Dt.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5829 "configure"
+echo "configure:5825: checking for Dt/Dt.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5828 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5853,12 +5852,12 @@
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:5857: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:5856: 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 5862 "configure"
+#line 5861 "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
@@ -5869,7 +5868,7 @@
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:5873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5872: \"$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
@@ -5916,19 +5915,19 @@
 
   
 echo $ac_n "checking for main in -lenergize""... $ac_c" 1>&6
-echo "configure:5920: checking for main in -lenergize" >&5
+echo "configure:5919: 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 5925 "configure"
+#line 5924 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5931: \"$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
@@ -5960,19 +5959,19 @@
   if test -z "$energize_version"; then
     
 echo $ac_n "checking for main in -lconn""... $ac_c" 1>&6
-echo "configure:5964: checking for main in -lconn" >&5
+echo "configure:5963: 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 5969 "configure"
+#line 5968 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5975: \"$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
@@ -6005,15 +6004,15 @@
   fi
   ac_safe=`echo "editorconn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for editorconn.h""... $ac_c" 1>&6
-echo "configure:6009: checking for editorconn.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6012 "configure"
+echo "configure:6008: checking for editorconn.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6011 "configure"
 #include "confdefs.h"
 #include <editorconn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6055,7 +6054,7 @@
 
 
 echo "checking for graphics libraries" 1>&6
-echo "configure:6059: checking for graphics libraries" >&5
+echo "configure:6058: checking for graphics libraries" >&5
 test -z "$with_gif" && with_gif=yes;
 if test "$with_gif" = "yes"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
@@ -6072,10 +6071,10 @@
 fi
 
 echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:6076: checking for Xpm - no older than 3.4f" >&5
+echo "configure:6075: checking for Xpm - no older than 3.4f" >&5
 xe_check_libs=-lXpm
 test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF
-#line 6079 "configure"
+#line 6078 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
 int main(int c, char **v) {
@@ -6085,7 +6084,7 @@
 		0 ;
 }
 EOF
-if { (eval echo configure:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:6088: \"$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;
@@ -6123,15 +6122,15 @@
 
 test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
-echo "configure:6127: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6130 "configure"
+echo "configure:6126: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6129 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6154,12 +6153,12 @@
  }
 test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:6158: checking for UnGenFace in -lcompface" >&5
+echo "configure:6157: 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 6163 "configure"
+#line 6162 "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
@@ -6170,7 +6169,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:6174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6173: \"$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
@@ -6206,15 +6205,15 @@
 
 test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:6210: checking for jpeglib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6213 "configure"
+echo "configure:6209: checking for jpeglib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6212 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6237,12 +6236,12 @@
  }
 test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6241: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6240: 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 6246 "configure"
+#line 6245 "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
@@ -6253,7 +6252,7 @@
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6256: \"$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
@@ -6289,15 +6288,15 @@
 
 test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for png.h""... $ac_c" 1>&6
-echo "configure:6293: checking for png.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6296 "configure"
+echo "configure:6292: checking for png.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6295 "configure"
 #include "confdefs.h"
 #include <png.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6319,10 +6318,10 @@
 fi
  }
 test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6323: checking for pow" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6326 "configure"
+echo "configure:6322: checking for pow" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6325 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6345,7 +6344,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6370,12 +6369,12 @@
 xe_msg_checking="for png_read_image in -lpng"
 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6374: checking "$xe_msg_checking"" >&5
+echo "configure:6373: 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 6379 "configure"
+#line 6378 "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
@@ -6386,7 +6385,7 @@
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:6390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6389: \"$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
@@ -6436,15 +6435,15 @@
 
   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:6440: checking for Xm/Xm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6443 "configure"
+echo "configure:6439: checking for Xm/Xm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6442 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6461,12 +6460,12 @@
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:6465: checking for XmStringFree in -lXm" >&5
+echo "configure:6464: 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 6470 "configure"
+#line 6469 "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
@@ -6477,7 +6476,7 @@
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:6481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6480: \"$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
@@ -6725,7 +6724,7 @@
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:6729: checking for Mule-related features" >&5
+echo "configure:6728: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -6742,15 +6741,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6746: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6749 "configure"
+echo "configure:6745: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6748 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6781,12 +6780,12 @@
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:6785: checking for strerror in -lintl" >&5
+echo "configure:6784: 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 6790 "configure"
+#line 6789 "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
@@ -6797,7 +6796,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:6801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6800: \"$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
@@ -6830,19 +6829,19 @@
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:6834: checking for Mule input methods" >&5
+echo "configure:6833: 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:6838: checking for XIM" >&5
+echo "configure:6837: checking for XIM" >&5
     
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:6841: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:6840: 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 6846 "configure"
+#line 6845 "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
@@ -6853,7 +6852,7 @@
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:6857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6856: \"$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
@@ -6916,15 +6915,15 @@
     fi
   else     case "$with_xfs" in  "yes" )
       echo "checking for XFontSet" 1>&6
-echo "configure:6920: checking for XFontSet" >&5
+echo "configure:6919: checking for XFontSet" >&5
       
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:6923: checking for XmbDrawString in -lX11" >&5
+echo "configure:6922: 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 6928 "configure"
+#line 6927 "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
@@ -6935,7 +6934,7 @@
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:6939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6938: \"$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
@@ -6974,15 +6973,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:6978: checking for wnn/jllib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6981 "configure"
+echo "configure:6977: checking for wnn/jllib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6980 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7007,10 +7006,10 @@
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7011: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7014 "configure"
+echo "configure:7010: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7013 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7033,7 +7032,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7062,12 +7061,12 @@
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7066: checking for crypt in -lcrypt" >&5
+echo "configure:7065: 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 7071 "configure"
+#line 7070 "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
@@ -7078,7 +7077,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7081: \"$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
@@ -7112,12 +7111,12 @@
   fi
     test -z "$with_wnn" && { 
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:7116: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:7115: 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 7121 "configure"
+#line 7120 "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
@@ -7128,7 +7127,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:7132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7131: \"$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
@@ -7165,12 +7164,12 @@
  fi
     
 echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
-echo "configure:7169: checking for jl_fi_dic_list in -lwnn" >&5
+echo "configure:7168: 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 7174 "configure"
+#line 7173 "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
@@ -7181,7 +7180,7 @@
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:7185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7184: \"$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
@@ -7213,15 +7212,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:7217: checking for canna/RK.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7220 "configure"
+echo "configure:7216: checking for canna/RK.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7219 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7244,12 +7243,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:7248: checking for RkBgnBun in -lRKC" >&5
+echo "configure:7247: 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 7253 "configure"
+#line 7252 "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
@@ -7260,7 +7259,7 @@
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:7264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7263: \"$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
@@ -7283,12 +7282,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:7287: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:7286: 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 7292 "configure"
+#line 7291 "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
@@ -7299,7 +7298,7 @@
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:7303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7302: \"$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
@@ -7399,10 +7398,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:7403: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7406 "configure"
+echo "configure:7402: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7405 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7425,7 +7424,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7462,10 +7461,10 @@
     for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7466: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7469 "configure"
+echo "configure:7465: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7468 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7488,7 +7487,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7521,16 +7520,16 @@
 esac
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:7525: checking whether netdb declares h_errno" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7527 "configure"
+echo "configure:7524: checking whether netdb declares h_errno" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7526 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:7534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7533: \"$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
@@ -7550,16 +7549,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7554: checking for sigsetjmp" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7556 "configure"
+echo "configure:7553: checking for sigsetjmp" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7555 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:7563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7562: \"$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
@@ -7579,11 +7578,11 @@
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:7583: checking whether localtime caches TZ" >&5
+echo "configure:7582: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 7587 "configure"
+#line 7586 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -7618,7 +7617,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:7622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -7647,9 +7646,9 @@
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6
-echo "configure:7651: checking whether gettimeofday cannot accept two arguments" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7653 "configure"
+echo "configure:7650: checking whether gettimeofday cannot accept two arguments" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7652 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -7671,7 +7670,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
 else
@@ -7693,19 +7692,19 @@
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:7697: checking for inline" >&5
+echo "configure:7696: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 7702 "configure"
+#line 7701 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:7709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -7755,17 +7754,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:7759: checking for working alloca.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7762 "configure"
+echo "configure:7758: checking for working alloca.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7761 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:7769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -7789,10 +7788,10 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:7793: checking for alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7796 "configure"
+echo "configure:7792: checking for alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7795 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -7815,7 +7814,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:7819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -7854,10 +7853,10 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:7858: checking whether alloca needs Cray hooks" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7861 "configure"
+echo "configure:7857: checking whether alloca needs Cray hooks" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7860 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -7881,10 +7880,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:7885: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7888 "configure"
+echo "configure:7884: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7887 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7907,7 +7906,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7937,10 +7936,10 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:7941: checking stack direction for C alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7944 "configure"
+echo "configure:7940: checking stack direction for C alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7943 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -7959,7 +7958,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:7963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -7987,15 +7986,15 @@
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:7991: checking for vfork.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7994 "configure"
+echo "configure:7990: checking for vfork.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7993 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8023,10 +8022,10 @@
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:8027: checking for working vfork" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8030 "configure"
+echo "configure:8026: checking for working vfork" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8029 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -8121,7 +8120,7 @@
   }
 }
 EOF
-if { (eval echo configure:8125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
@@ -8146,10 +8145,10 @@
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:8150: checking for working strcoll" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8153 "configure"
+echo "configure:8149: checking for working strcoll" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8152 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -8159,7 +8158,7 @@
 	strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:8163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -8186,10 +8185,10 @@
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8190: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8193 "configure"
+echo "configure:8189: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8192 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8212,7 +8211,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8240,10 +8239,10 @@
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8244: checking whether getpgrp takes no argument" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8247 "configure"
+echo "configure:8243: checking whether getpgrp takes no argument" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8246 "configure"
 #include "confdefs.h"
 
 /*
@@ -8298,7 +8297,7 @@
 }
 
 EOF
-if { (eval echo configure:8302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
@@ -8324,10 +8323,10 @@
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8328: checking for working mmap" >&5
+echo "configure:8327: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 8331 "configure"
+#line 8330 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -8360,7 +8359,7 @@
   return 1;
 }
 EOF
-if { (eval echo configure:8364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   have_mmap=yes
 else
@@ -8394,15 +8393,15 @@
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:8398: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8401 "configure"
+echo "configure:8397: checking for termios.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8400 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8445,15 +8444,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:8449: checking for termio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8452 "configure"
+echo "configure:8448: checking for termio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8451 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8485,10 +8484,10 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:8489: checking for socket" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8492 "configure"
+echo "configure:8488: checking for socket" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8491 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -8511,7 +8510,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -8526,15 +8525,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:8530: checking for netinet/in.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8533 "configure"
+echo "configure:8529: checking for netinet/in.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8532 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8551,15 +8550,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:8555: checking for arpa/inet.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8558 "configure"
+echo "configure:8554: checking for arpa/inet.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8557 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8563: \"$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*
@@ -8584,9 +8583,9 @@
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:8588: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:8587: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 8590 "configure"
+#line 8589 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -8597,7 +8596,7 @@
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8600: \"$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
@@ -8628,10 +8627,10 @@
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:8632: checking for msgget" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8635 "configure"
+echo "configure:8631: checking for msgget" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8634 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -8654,7 +8653,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -8669,15 +8668,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:8673: checking for sys/ipc.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8676 "configure"
+echo "configure:8672: checking for sys/ipc.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8675 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8694,15 +8693,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:8698: checking for sys/msg.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8701 "configure"
+echo "configure:8697: checking for sys/msg.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8700 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8706: \"$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*
@@ -8740,15 +8739,15 @@
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:8744: checking for dirent.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8747 "configure"
+echo "configure:8743: checking for dirent.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8746 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8775,15 +8774,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:8779: checking for sys/dir.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8782 "configure"
+echo "configure:8778: checking for sys/dir.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8781 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8816,15 +8815,15 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:8820: checking for nlist.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8823 "configure"
+echo "configure:8819: checking for nlist.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8822 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8865,7 +8864,7 @@
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:8869: checking "for sound support"" >&5
+echo "configure:8868: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -8876,15 +8875,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:8880: checking for multimedia/audio_device.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8883 "configure"
+echo "configure:8879: checking for multimedia/audio_device.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8882 "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:8888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8932,12 +8931,12 @@
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:8936: checking for ALopenport in -laudio" >&5
+echo "configure:8935: 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 8941 "configure"
+#line 8940 "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
@@ -8948,7 +8947,7 @@
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:8952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8951: \"$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
@@ -8979,12 +8978,12 @@
       if test -z "$native_sound_lib"; then
 	
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:8983: checking for AOpenAudio in -lAlib" >&5
+echo "configure:8982: 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 8988 "configure"
+#line 8987 "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
@@ -8995,7 +8994,7 @@
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:8999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8998: \"$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
@@ -9033,15 +9032,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:9037: checking for ${dir}/soundcard.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9040 "configure"
+echo "configure:9036: checking for ${dir}/soundcard.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9039 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9111,7 +9110,7 @@
  fi
   LIBS="-laudio $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$LIBS"; fi
       cat > conftest.$ac_ext <<EOF
-#line 9115 "configure"
+#line 9114 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -9138,7 +9137,7 @@
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:9142: checking for TTY-related features" >&5
+echo "configure:9141: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -9154,12 +9153,12 @@
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:9158: checking for tgetent in -lncurses" >&5
+echo "configure:9157: 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 9163 "configure"
+#line 9162 "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
@@ -9170,7 +9169,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9173: \"$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
@@ -9203,15 +9202,15 @@
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:9207: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9210 "configure"
+echo "configure:9206: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9209 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9233,15 +9232,15 @@
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:9237: checking for ncurses/term.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9240 "configure"
+echo "configure:9236: checking for ncurses/term.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9239 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9271,15 +9270,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:9275: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9278 "configure"
+echo "configure:9274: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9277 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9314,12 +9313,12 @@
 	for lib in curses termlib termcap; do
 	  
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:9318: checking for tgetent in -l$lib" >&5
+echo "configure:9317: 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 9323 "configure"
+#line 9322 "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
@@ -9330,7 +9329,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9333: \"$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
@@ -9361,12 +9360,12 @@
       else
 	
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:9365: checking for tgetent in -lcurses" >&5
+echo "configure:9364: 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 9370 "configure"
+#line 9369 "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
@@ -9377,7 +9376,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9380: \"$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
@@ -9395,12 +9394,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:9399: checking for tgetent in -ltermcap" >&5
+echo "configure:9398: 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 9404 "configure"
+#line 9403 "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
@@ -9411,7 +9410,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9414: \"$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
@@ -9459,15 +9458,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:9463: checking for gpm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9466 "configure"
+echo "configure:9462: checking for gpm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9465 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9490,12 +9489,12 @@
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:9494: checking for Gpm_Open in -lgpm" >&5
+echo "configure:9493: 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 9499 "configure"
+#line 9498 "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
@@ -9506,7 +9505,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:9510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9509: \"$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
@@ -9555,17 +9554,17 @@
 
 
 echo "checking for database support" 1>&6
-echo "configure:9559: checking for database support" >&5
+echo "configure:9558: 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:9564: checking for dbm_open in -lgdbm" >&5
+echo "configure:9563: 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 9569 "configure"
+#line 9568 "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
@@ -9576,7 +9575,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9579: \"$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
@@ -9598,10 +9597,10 @@
 
   if test "$with_database_gnudbm" != "yes"; then
     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:9602: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9605 "configure"
+echo "configure:9601: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9604 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -9624,7 +9623,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -9660,10 +9659,10 @@
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:9664: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9667 "configure"
+echo "configure:9663: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9666 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -9686,7 +9685,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -9707,12 +9706,12 @@
   if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:9711: checking for dbm_open in -ldbm" >&5
+echo "configure:9710: 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 9716 "configure"
+#line 9715 "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
@@ -9723,7 +9722,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9726: \"$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
@@ -9760,10 +9759,10 @@
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:9764: checking for dbopen" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9767 "configure"
+echo "configure:9763: checking for dbopen" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9766 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -9786,7 +9785,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -9807,12 +9806,12 @@
   if test "$need_libdb" != "no"; then
     
 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:9811: checking for dbopen in -ldb" >&5
+echo "configure:9810: 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 9816 "configure"
+#line 9815 "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
@@ -9823,7 +9822,7 @@
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:9827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9826: \"$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
@@ -9847,7 +9846,7 @@
   if test "$with_database_berkdb" = "yes"; then
     for path in "db/db.h" "db.h"; do
 cat > conftest.$ac_ext <<EOF
-#line 9851 "configure"
+#line 9850 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -9860,12 +9859,17 @@
 #endif
 #endif
 #include <$path>
+#ifdef DB_VERSION_MAJOR
+#if DB_VERSION_MAJOR > 1
+choke me;
+#endif
+#endif
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -9917,12 +9921,12 @@
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:9921: checking for SOCKSinit in -lsocks" >&5
+echo "configure:9925: 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 9926 "configure"
+#line 9930 "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
@@ -9933,7 +9937,7 @@
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:9937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9941: \"$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
@@ -10247,7 +10251,7 @@
 }
 
 
-if   test "$GNU_MALLOC"        = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
+if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
     Defining GNU_MALLOC
 EOF
 cat >> confdefs.h <<\EOF
@@ -10255,7 +10259,7 @@
 EOF
 }
 
-elif test "$use_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
+elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
     Defining USE_SYSTEM_MALLOC
 EOF
 cat >> confdefs.h <<\EOF
@@ -10263,7 +10267,7 @@
 EOF
 }
 
-elif test "$use_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
+elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
     Defining USE_DEBUG_MALLOC
 EOF
 cat >> confdefs.h <<\EOF
@@ -10271,7 +10275,7 @@
 EOF
 }
 
-					     { test "$extra_verbose" = "yes" && cat << \EOF
+					      { test "$extra_verbose" = "yes" && cat << \EOF
     Defining USE_SYSTEM_MALLOC
 EOF
 cat >> confdefs.h <<\EOF
@@ -10572,7 +10576,7 @@
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "$internal_makefile_list src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$internal_makefile_list lib-src/config.values src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -10603,6 +10607,7 @@
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
 s%@LN_S@%$LN_S%g
+s%@blddir@%$blddir%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
 s%@ld_switch_shared@%$ld_switch_shared%g
@@ -10702,7 +10707,7 @@
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"$internal_makefile_list"}
+CONFIG_FILES=\${CONFIG_FILES-"$internal_makefile_list lib-src/config.values"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -10913,12 +10918,11 @@
 )
 done
 
-sed < config.status > lib-src/config.values \
--e 's/^s%@\(.*\)@%\(.*\)%g$/\1 "\2"/p' \
--e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
--e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
--e 's/^\([^ ]*\) $/\1 ""/' \
--e 's/ 1$/ t/'
+sed < config.status >> lib-src/config.values \
+  -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
+  -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
+  -e 's/^\([^ ]*\) $/\1 ""/' \
+  -e 's/ 1$/ t/'
 
 
 exit 0
--- a/configure.in	Mon Aug 13 09:52:21 2007 +0200
+++ b/configure.in	Mon Aug 13 09:53:19 2007 +0200
@@ -97,7 +97,6 @@
 dnl XEmacs is unlikely to ever cross-compile
 define([AC_TRY_RUN],[AC_TRY_RUN_NATIVE([$1], [$2], [$3])])dnl
 
-
 dnl Redefine AC_DEFINE* to provide more output if extra_verbose
 dnl Set VARIABLE to VALUE, verbatim, or 1.
 dnl AC_DEFINE(VARIABLE [, VALUE])
@@ -241,7 +240,6 @@
 dnl Initialize some variables set by options.
 dnl The variables have the same names as the options, with
 dnl dashes changed to underlines.
-build=NONE
 exec_prefix=NONE
 host=NONE
 no_create=
@@ -347,7 +345,7 @@
 dynamic=''
 with_x11=''
 rel_alloc='default'
-use_system_malloc='default'
+with_system_malloc='default'
 energize_version=''
 native_sound_lib=''
 dnl use-assertions should be 'yes' by default.  Too many people in this
@@ -546,9 +544,8 @@
   			is system-dependent).
 --with-clash-detection	Use lock files to detect multiple edits of the same file.
 			The default is to not do clash detection.
---use-system-malloc	Force use of the system malloc, rather than GNU
-			malloc.
---use-debug-malloc	Use the debugging malloc package.
+--with-system-malloc	Force use of the system malloc, rather than GNU malloc.
+--with-debug-malloc	Use the debugging malloc package.
 
 You may also specify any of the \`path' variables found in
 Makefile.in, including --bindir, --libdir, --lispdir, --datadir, and
@@ -727,16 +724,16 @@
 
 	dnl Options that take "yes", "no", or "default" values
 	rel_alloc | \
-	use_debug_malloc | \
-	use_system_malloc )
+	with_debug_malloc  | use_debug_malloc | \
+	with_system_malloc | use_system_malloc )
 	  case "$val" in
 	    y | ye | yes )	val=yes ;;
 	    n | no )		val=no  ;;
-	    d | de | def | defa | defau | defaul | default )
-				val=default ;;
+	    d | de | def | defa | defau | defaul | default ) val=default ;;
 	    * ) USAGE_ERROR(["The \`--$optname' option requires one of these values:
   \`yes', \`no', or \`default'."]) ;;
 	  esac
+	  case "$opt" in use_* ) opt="`echo $opt | sed /use/with/`" ;; esac
           eval "$opt=\"$val\""
         ;;
 
@@ -1024,21 +1021,23 @@
   fi
 done
 
+dnl Calculate canonical name for blddir (i.e. current directory).
+dnl PWD may already be the preferable absolute name for ".",
+dnl but we can't trust it - it is sometimes inaccurate.
+absolute_pwd="`pwd`";
+if test -n "$PWD" && "`cd $PWD && pwd`" = "$absolute_pwd"
+then blddir="$PWD"
+else blddir="$absolute_pwd"
+fi
+AC_SUBST(blddir)
+
 dnl Make srcdir absolute, if not already.  It is important to
 dnl avoid running the path through pwd unnecessary, since pwd can
 dnl give you automounter prefixes, which can go away.
 case "$srcdir" in
   /* ) ;;
-  . )
-    dnl We may be able to use the $PWD environment variable to make this
-    dnl absolute.  But sometimes PWD is inaccurate.
-    if test "$PWD" != "" -a "`(cd $PWD ; sh -c pwd)`" = "`pwd`"; then
-      srcdir="$PWD"
-    else
-      srcdir="`(cd $srcdir && pwd)`"
-    fi
-  ;;
-  *  ) srcdir="`(cd $srcdir && pwd)`" ;;
+  .  ) srcdir="$blddir" ;;
+  *  ) srcdir="`cd $srcdir && pwd`" ;;
 esac
 
 dnl Check if the source directory already has a configured system in it.
@@ -2061,11 +2060,11 @@
   GNU_MALLOC=no
   GNU_MALLOC_reason="
   (The GNU allocators don't work with this system configuration)."
-elif test "$use_system_malloc" = "yes" ; then
+elif test "$with_system_malloc" = "yes" ; then
   GNU_MALLOC=no
   GNU_MALLOC_reason="
   (User chose not to use GNU allocators)."
-elif test "$use_debug_malloc" = "yes" ; then
+elif test "$with_debug_malloc" = "yes" ; then
   GNU_MALLOC=no
   GNU_MALLOC_reason="
   (User chose to use Debugging Malloc)."
@@ -3196,6 +3195,11 @@
 #endif
 #endif
 #include <$path>
+#ifdef DB_VERSION_MAJOR
+#if DB_VERSION_MAJOR > 1
+choke me;
+#endif
+#endif
 ],[], db_h_path="$path"; break)
     done
     test -z "$db_h_path" && with_database_berkdb=no
@@ -3390,10 +3394,10 @@
 
 test -n "$puresize" && AC_DEFINE_UNQUOTED(RAW_PURESIZE, $puresize)
 
-if   test "$GNU_MALLOC"        = "yes"; then AC_DEFINE(GNU_MALLOC)
-elif test "$use_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC)
-elif test "$use_debug_malloc"  = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC)
-					     AC_DEFINE(USE_SYSTEM_MALLOC)
+if   test "$GNU_MALLOC"         = "yes"; then AC_DEFINE(GNU_MALLOC)
+elif test "$with_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC)
+elif test "$with_debug_malloc"  = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC)
+					      AC_DEFINE(USE_SYSTEM_MALLOC)
 fi
 test "$with_i18n3"         = "yes" && AC_DEFINE(I18N3)
 test "$GCC"                = "yes" && AC_DEFINE(USE_GCC)
@@ -3560,7 +3564,7 @@
 dnl Build Makefile.in's from Makefile.in.in's
 dnl except ./Makefile from $srcdir/Makefile.in
 
-AC_OUTPUT($internal_makefile_list,[
+AC_OUTPUT($internal_makefile_list lib-src/config.values,[
 for dir in $MAKE_SUBDIR; do
   echo creating $dir/Makefile
   (
@@ -3598,13 +3602,13 @@
 )
 done
 
-dnl Create a file of config variables for use by the lisp code
-sed < config.status > lib-src/config.values \
--e 's/^s%@\(.*\)@%\(.*\)%g$/\1 "\2"/p' \
--e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
--e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
--e 's/^\([[^ ]]*\) $/\1 ""/' \
--e 's/ 1$/ t/'
+dnl Append AC_DEFINE information to lib-src/config.values
+dnl (AC_SUBST information is already there (see config.values.sh).
+sed < config.status >> lib-src/config.values \
+  -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
+  -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
+  -e 's/^\([[^ ]]*\) $/\1 ""/' \
+  -e 's/ 1$/ t/'
 
 ],
 [CPP="$CPP"
--- a/etc/gnuserv.1	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/gnuserv.1	Mon Aug 13 09:53:19 2007 +0200
@@ -4,24 +4,55 @@
 gnuserv, gnuclient \- Server and Clients for XEmacs
 .SH SYNOPSIS
 .B gnuclient
-[-q] [-nw] [-l library] [-f function] [-eval form] [[-h hostname]
-[-p port] [-r pathname]] [[+line] path] ...
+[-nw] [-display display] [-q] [-v] [-l library] [-batch] [-f function] [-eval form] 
+[-h hostname] [-p port] [-r remote-pathname] [[+line] file] ...
+.br
+.B gnudoit [-q] 
+form
 .br
 .B gnuserv
+.br
+.B gnuattach   
+Removed as of gnuserv 3.x
 .SH DESCRIPTION
 
 .PP
 \fIgnuclient\fP allows the user to request a running XEmacs process to
-edit the named files or directories in a new frame.  Depending on your
-environment, it can be an X frame or a TTY frame.  One typical use for
-this is with a dialup connection to a machine on which an XEmacs
-process is currently running.
+edit the named files or directories and/or evaluate lisp forms.
+Depending on your environment, it can be an X frame or a TTY frame.
+One typical use for this is with a dialup connection to a machine on
+which an XEmacs process is currently running.
+.PP
+\fIgnudoit\fP is a shell script frontend to ``gnuclient -batch -eval form''.
+Its use is depreciated. Try to get used to calling gnuclient directly.
 .PP
 \fIgnuserv\fP is the server program that is set running by XEmacs to
 handle all incoming and outgoing requests. It is not usually invoked
 directly, but is started from XEmacs by loading the \fIgnuserv\fP
 package and evaluating the Lisp form (gnuserv-start).
+.PP
+\fIgnuattach\fP no longer exists. Its functionality has been replaced by
+\fIgnuclient -nw\fP.
 .SH OPTIONS
+.PP 
+\fIgnuclient\fP supports as much of the command line options of Emacs as
+makes sense in this context. In addition it adds a few of its own. 
+.br
+Options with long names can also be specified using a double
+hyphen instead of a single one.
+.TP 8
+.BI \-nw
+This option makes \fIgnuclient\fP act as a frontend such that XEmacs
+can attach to the current TTY. XEmacs will then open a new TTY frame.
+The effect is similar to having started a new XEmacs on this TTY with
+the ``-nw'' option. It currently only works if XEmacs is running on
+the same machine as gnuclient. This is the default if the `DISPLAY'
+environment variable is not set.
+.TP 8
+.BI \-display " display, " \--display " display" 
+If this option is given or the `DISPLAY' environment variable is set
+then gnuclient will tell XEmacs to edit files in a frame on the
+specified X device.
 .TP 8
 .BI \-q
 This option informs \fIgnuclient\fP to exit once connection has been
@@ -30,15 +61,37 @@
 buffers killed) by the XEmacs process, and all the forms have been
 evaluated.
 .TP 8
+.BI \-v
+When this option is specified \fIgnuclient\fP will request for the
+specified files to be viewed instead of edited.
+.TP 8
+.BI \-l " library"
+Tell Emacs to load the specified library.
+.TP 8
+.BI \-batch
+Tell Emacs not to open any frames. Just load libraries and evaluate lisp code.  You
+must use the
+.BR \-l ,
+.BR \-f ,
+and
+.B \-eval
+options to specify files to execute and functions to call.
+.TP 8
+.BI \-f " function," 
+Make Emacs execute the lisp function.
+.TP 8
+.BI \-eval " form"
+Make Emacs execute the lisp form.
+.TP 8
 .BI \-h " hostname"
 Used only with Internet-domain sockets, this option specifies the host
-machine which should be running \fIgnuserv\fP.  If this option is not
+machine which should be running \fIgnuserv\fP. If this option is not
 specified then the value of the environment variable GNU_HOST is used
-if set.  If no hostname is specified, and the GNU_HOST variable is not
-set, an internet connection will not be attempted.  N\.B.:
-\fIgnuserv\fP does NOT allow internet connections unless the
-GNU_SECURE variable has been specified and points at a file listing
-all trusted hosts. (See SECURITY below.)
+if set. If no hostname is specified, and the GNU_HOST variable is not
+set, an internet connection will not be attempted. N\.B.:
+\fIgnuserv\fP does NOT allow internet connections unless XAUTH
+authentication is used or the GNU_SECURE variable has been specified
+and points at a file listing all trusted hosts. (See SECURITY below.)
 
 .br
 Note that an internet address may be specified instead of a hostname
@@ -73,21 +126,23 @@
 taken from the environment variable GNU_NODE, if set, or the empty
 string otherwise.
 .TP 8
-.BI "path"
+.BI "[+n] file"
 This is the path of the file to be edited.  If the file is a directory, then
 the directory browsers dired or monkey are usually invoked instead.
-.TP 8
-.BI "sexpr"
-This is part of an XEmacs LISP expression to evaluate.  All the sexprs
-are concatenated together and wrapped in a progn form before sending
-to XEmacs.
+The cursor is put at line number 'n' if specified.
 
-.PP
 .SH SETUP
 \fIgnuserv\fP is packaged standardly with recent versions of XEmacs.
 Therefore, you should be able to start the server simply by evaluating
 the XEmacs Lisp form (gnuserv-start), or equivalently by typing
 `M-x gnuserv-start'.
+
+.SH CONFIGURATION
+The behavior of this suite of program is mostly controlled on the lisp 
+side in Emacs and its behavior can be customized to a large extent.
+Type `M-x customize-group RET gnuserv RET' for easy access. More
+documentation can be found in the file `gnuserv.el'
+
 .SH EXAMPLE
 .RS 4
 gnuclient -q -f mh-smail
@@ -96,6 +151,12 @@
 .br
 gnuclient -nw ../src/listproc.c
 .RE
+.br
+
+.br
+More examples and sample wrapper scripts are provided in the
+etc/gnuserv directory of the Emacs installation.
+
 
 .SH SYSV IPC
 SysV IPC is used to communicate between \fIgnuclient\fP and
@@ -198,6 +259,13 @@
 significant!
 .RE
 
+
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+Default X device to put edit frame.
+
 .SH FILES
 .PP
 .TP 8
@@ -212,7 +280,7 @@
 .SH SEE ALSO
 .PP
 .TP 8
-xauth(1X11), Xsecurity(1X11)
+xauth(1X11), Xsecurity(1X11), gnuserv.el
 .SH BUGS
 .PP 
 NULs occurring in result strings don't get passed back to gnudoit properly.
--- a/etc/toolbar/ediff-A-up.xpm	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/toolbar/ediff-A-up.xpm	Mon Aug 13 09:53:19 2007 +0200
@@ -21,4 +21,4 @@
 "###############",
 "###############",
 "###############",
-};
\ No newline at end of file
+};
--- a/etc/toolbar/ediff-A-xx.xpm	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/toolbar/ediff-A-xx.xpm	Mon Aug 13 09:53:19 2007 +0200
@@ -21,4 +21,4 @@
 "###############",
 "###############",
 "###############",
-};
\ No newline at end of file
+};
--- a/etc/toolbar/ediff-B-up.xpm	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/toolbar/ediff-B-up.xpm	Mon Aug 13 09:53:19 2007 +0200
@@ -22,4 +22,4 @@
 "###############",
 "###############",
 "###############"
-};
\ No newline at end of file
+};
--- a/etc/toolbar/ediff-B-xx.xpm	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/toolbar/ediff-B-xx.xpm	Mon Aug 13 09:53:19 2007 +0200
@@ -22,4 +22,4 @@
 "###############",
 "###############",
 "###############"
-};
\ No newline at end of file
+};
--- a/etc/toolbar/ediff-refine.xpm	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/toolbar/ediff-refine.xpm	Mon Aug 13 09:53:19 2007 +0200
@@ -21,4 +21,4 @@
 "aa#aaaa#aaaa#aa",
 "aaaaaaa#aaaaaaa",
 "aaaaaaaaaaaaaaa",
-};
\ No newline at end of file
+};
--- a/etc/toolbar/ediff-update.xpm	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/toolbar/ediff-update.xpm	Mon Aug 13 09:53:19 2007 +0200
@@ -22,4 +22,4 @@
 "ccacccaaccca.cc",
 "ccccccccaaa.ccc",
 "ccccccccccccccc",
-};
\ No newline at end of file
+};
--- a/etc/viperCard.tex	Mon Aug 13 09:52:21 2007 +0200
+++ b/etc/viperCard.tex	Mon Aug 13 09:53:19 2007 +0200
@@ -1,4 +1,4 @@
-% ViperCard -- The Reference Card for Viper under GNU Emacs 19 and XEmacs 19
+% ViperCard -- The Reference Card for Viper under GNU Emacs 20 and XEmacs 20
 %**start of header
 \newcount\columnsperpage
 
@@ -7,7 +7,7 @@
 
 \columnsperpage=2
 
-% Copyright (c) 1987 Free Software Foundation, Inc.
+% Copyright (c) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 % This file is part of GNU Emacs.
 
@@ -44,26 +44,25 @@
 %
 % Author of Viper:
 %  Michael Kifer
-%  Internet: kifer@cs.sunysb.edu
+%  email: kifer@cs.sunysb.edu
 %
 % Author of VIP 4.3:
 %  Aamod Sane
-%  Internet: sane@cs.uiuc.edu
+%  email: sane@cs.uiuc.edu
 %
 % Author of VIP 3.5:
 %  Masahiko Sato
-%  Internet: ms@sail.stanford.edu
-%  Junet: masahiko@sato.riec.tohoku.junet
+%  email: ms@sail.stanford.edu
 %
 % The original TeX code for formatting the reference card was written by:
 %  Stephen Gildea
 %  UUCP: mit-erl!gildea
-%  Internet: gildea@erl.mit.edu
+%  email: gildea@erl.mit.edu
 
 
-\def\versionnumber{2.94}
+\def\versionnumber{2.96}
 \def\year{1997}
-\def\version{June \year\ v\versionnumber}
+\def\version{August \year\ v\versionnumber}
 
 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
   \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
@@ -263,7 +262,7 @@
 
 \title{ViperCard: Viper Reference Pal}
 
-\centerline{(For Version 2.94 under Emacs and XEmacs 19 \& 20)}
+\centerline{(For Version 2.96 under Emacs 20 and XEmacs 20)}
 
 %\copyrightnotice
 
@@ -594,7 +593,7 @@
 You can change this by including the following line in your \kbd{\~{}/.vip} file.
 
 \hskip 5ex
-\kbd{(setq vip-case-fold-search t)}
+\kbd{(setq viper-case-fold-search t)}
 
 The following is a subset of the variety of
 options available for customizing Viper.
@@ -604,18 +603,18 @@
 
 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
 \twocol{{\bf variable}}{{\bf default value}}
-\twocol{vip-search-wrap-around}{t}
-\twocol{vip-case-fold-search}{nil}
-\twocol{vip-re-search}{t}
-\twocol{vip-re-replace}{t}
-\twocol{vip-re-query-replace}{t}
-\twocol{vip-auto-indent}{nil}
-\twocol{vip-shift-width}{8}
-\twocol{vip-tags-file-name}{"TAGS"}
-\twocol{vip-no-multiple-ESC}{t}
-\twocol{vip-ex-style-motion}{t}
-\twocol{vip-always}{t}
-\twocol{vip-custom-file-name}{"\~{}/.vip"}
+\twocol{viper-search-wrap-around}{t}
+\twocol{viper-case-fold-search}{nil}
+\twocol{viper-re-search}{t}
+\twocol{viper-re-replace}{t}
+\twocol{viper-re-query-replace}{t}
+\twocol{viper-auto-indent}{nil}
+\twocol{viper-shift-width}{8}
+\twocol{viper-tags-file-name}{"TAGS"}
+\twocol{viper-no-multiple-ESC}{t}
+\twocol{viper-ex-style-motion}{t}
+\twocol{viper-always}{t}
+\twocol{viper-custom-file-name}{"\~{}/.vip"}
 \twocol{ex-find-file-shell}{"csh"}
 \twocol{ex-cycle-other-window}{t}
 \twocol{ex-cycle-through-non-buffers}{t}
@@ -627,8 +626,8 @@
 \kbd{\~{}/.vip} file:
 
 \beginexample
-(define-key vip-vi-global-user-map "\\C-v" 'scroll-down)
-(define-key vip-vi-global-user-map "\\C-cm" 'smail)
+(define-key viper-vi-global-user-map "\\C-v" 'scroll-down)
+(define-key viper-vi-global-user-map "\\C-cm" 'smail)
 \endexample
 
 
--- a/info/dir	Mon Aug 13 09:52:21 2007 +0200
+++ b/info/dir	Mon Aug 13 09:53:19 2007 +0200
@@ -90,4 +90,3 @@
 * tm-mh-e-ja::	Tools for Mime for MH-E (Japanese version)
 * gnus-mime-ja::
 		Tools for Mime for Gnus (Japanese version)
-* Locals:
--- a/lib-src/ChangeLog	Mon Aug 13 09:52:21 2007 +0200
+++ b/lib-src/ChangeLog	Mon Aug 13 09:53:19 2007 +0200
@@ -1,3 +1,11 @@
+1997-08-07  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+	* gnuclient.c (main): Made help string correspond to options.
+
+1997-08-01  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in.in (distclean): Remove config.values here only.
+
 1997-07-27  SL Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in.in (UTILITIES): Add config.values so it can be
--- a/lib-src/Makefile.in.in	Mon Aug 13 09:52:21 2007 +0200
+++ b/lib-src/Makefile.in.in	Mon Aug 13 09:53:19 2007 +0200
@@ -67,7 +67,7 @@
 ## which should not be installed in bindir.
 UTILITIES= make-path wakeup profile make-docfile digest-doc \
 	sorted-doc movemail cvtmail fakemail yow hexl \
-	gnuserv mmencode config.values
+	gnuserv mmencode
 ## These need to be conditional on I18N3 make-msgfile make-po
 
 ## Like UTILITIES, but they are not system-dependent, and should not be
@@ -237,7 +237,7 @@
 	$(RM) ${INSTALLABLES} ${UTILITIES}
 distclean: clean
 	$(RM) DOC *.tab.c *.tab.h aixcc.c TAGS
-	$(RM) Makefile Makefile.in blessmail
+	$(RM) Makefile Makefile.in blessmail config.values
 realclean: distclean
 extraclean: distclean
 	$(RM) *~ \#*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/config.values.in	Mon Aug 13 09:53:19 2007 +0200
@@ -0,0 +1,105 @@
+;;; Do not edit this file!
+;;; This file was automatically generated, by the config.values.sh script,
+;;; from configure, which was itself automatically generated from configure.in
+;;;
+;;; See lisp/util/config.el for details on how this file is used.
+;;;
+;;; You are trapped in a twisty maze of strange-looking files, all autogenerated...
+
+;;; configure        is created, from configure.in,     by autoconf
+;;; config.values.in is created, from configure,        by config.values.sh
+;;; config.values    is created, from config.values.in, by configure
+;;; config.values    is read by lisp/utils/config.el,
+;;;                  to create the (Lisp object) config-value-hash-table
+
+;;; Variables defined in configure by AC_SUBST follow:
+;;; (These are used in Makefiles)
+
+ALLOCA "@ALLOCA@"
+CC "@CC@"
+CFLAGS "@CFLAGS@"
+CPP "@CPP@"
+CPPFLAGS "@CPPFLAGS@"
+CXXFLAGS "@CXXFLAGS@"
+DEFS "@DEFS@"
+INSTALL "@INSTALL@"
+INSTALL_ARCH_DEP_SUBDIR "@INSTALL_ARCH_DEP_SUBDIR@"
+INSTALL_DATA "@INSTALL_DATA@"
+INSTALL_PROGRAM "@INSTALL_PROGRAM@"
+LDFLAGS "@LDFLAGS@"
+LIBS "@LIBS@"
+LN_S "@LN_S@"
+MAKE_SUBDIR "@MAKE_SUBDIR@"
+RANLIB "@RANLIB@"
+RECURSIVE_MAKE "@RECURSIVE_MAKE@"
+SET_MAKE "@SET_MAKE@"
+SRC_SUBDIR_DEPS "@SRC_SUBDIR_DEPS@"
+SUBDIR_MAKEFILES "@SUBDIR_MAKEFILES@"
+X_CFLAGS "@X_CFLAGS@"
+X_EXTRA_LIBS "@X_EXTRA_LIBS@"
+X_LIBS "@X_LIBS@"
+X_PRE_LIBS "@X_PRE_LIBS@"
+YACC "@YACC@"
+archlibdir "@archlibdir@"
+archlibdir_user_defined "@archlibdir_user_defined@"
+bindir "@bindir@"
+bitmapdir "@bitmapdir@"
+blddir "@blddir@"
+c_switch_all "@c_switch_all@"
+c_switch_general "@c_switch_general@"
+c_switch_window_system "@c_switch_window_system@"
+canonical "@canonical@"
+configuration "@configuration@"
+configure_input "@configure_input@"
+datadir "@datadir@"
+docdir "@docdir@"
+dynodump_arch "@dynodump_arch@"
+etcdir "@etcdir@"
+etcdir_user_defined "@etcdir_user_defined@"
+exec_prefix "@exec_prefix@"
+extra_objs "@extra_objs@"
+includedir "@includedir@"
+infodir "@infodir@"
+infodir_user_defined "@infodir_user_defined@"
+internal_makefile_list "@internal_makefile_list@"
+ld "@ld@"
+ld_libs_all "@ld_libs_all@"
+ld_libs_general "@ld_libs_general@"
+ld_libs_window_system "@ld_libs_window_system@"
+ld_switch_all "@ld_switch_all@"
+ld_switch_general "@ld_switch_general@"
+ld_switch_shared "@ld_switch_shared@"
+ld_switch_window_system "@ld_switch_window_system@"
+lib_gcc "@lib_gcc@"
+libdir "@libdir@"
+libexecdir "@libexecdir@"
+libs_xauth "@libs_xauth@"
+lispdir "@lispdir@"
+lispdir_user_defined "@lispdir_user_defined@"
+localstatedir "@localstatedir@"
+lockdir "@lockdir@"
+lockdir_user_defined "@lockdir_user_defined@"
+lwlib_objs "@lwlib_objs@"
+machfile "@machfile@"
+mandir "@mandir@"
+native_sound_lib "@native_sound_lib@"
+oldincludedir "@oldincludedir@"
+opsysfile "@opsysfile@"
+pkgdir "@pkgdir@"
+prefix "@prefix@"
+program_transform_name "@program_transform_name@"
+sbindir "@sbindir@"
+sharedstatedir "@sharedstatedir@"
+sitelispdir "@sitelispdir@"
+sound_cflags "@sound_cflags@"
+srcdir "@srcdir@"
+start_files "@start_files@"
+start_flags "@start_flags@"
+statedir "@statedir@"
+sysconfdir "@sysconfdir@"
+top_srcdir "@top_srcdir@"
+version "@version@"
+
+;;; Variables defined in configure by AC_DEFINE and AC_DEFINE_UNQUOTED follow:
+;;; (These are used in C code)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/config.values.sh	Mon Aug 13 09:53:19 2007 +0200
@@ -0,0 +1,76 @@
+#! /bin/sh
+# config.values.sh --- create config.values.in from ../configure
+
+# Author:	Martin Buchholz
+# Maintainer:	Martin Buchholz
+# Keywords:	configure elisp report-xemacs-bugs
+
+# 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.
+
+### Commentary:
+
+## Extract all the @foo@ configuration symbols from ../configure
+## to make them available to elisp later (see util/config.el)
+## Primarily useful for creating ridiculously verbose bug reports.
+##
+## See lisp/utils/config.el, ../configure.in,
+## and the Autoconf documentation on AC_OUTPUT, for more details.
+##
+## This script needs only to be run occasionally (before a Net release)
+## by an XEmacs Maintainer (consider yourself so blessed, if you are
+## actually reading this commentary).
+##
+if test ! -r ./configure; then
+  cd ..
+  if test ! -r ./configure; then
+    echo "Can't find configure!";
+    exit 1;
+  fi
+fi
+
+exec < ./configure > "lib-src/config.values.in"
+cat <<\EOF
+;;; Do not edit this file!
+;;; This file was automatically generated, by the config.values.sh script,
+;;; from configure, which was itself automatically generated from configure.in
+;;;
+;;; See lisp/util/config.el for details on how this file is used.
+;;;
+;;; You are trapped in a twisty maze of strange-looking files, all autogenerated...
+
+;;; configure        is created, from configure.in,     by autoconf
+;;; config.values.in is created, from configure,        by config.values.sh
+;;; config.values    is created, from config.values.in, by configure
+;;; config.values    is read by lisp/utils/config.el,
+;;;                  to create the (Lisp object) config-value-hash-table
+
+;;; Variables defined in configure by AC_SUBST follow:
+;;; (These are used in Makefiles)
+
+EOF
+sed -n '/^s%@\([A-Za-z_][A-Za-z_]*\)@%\$\1%g$/ {
+  s/^s%@\([A-Za-z_][A-Za-z_]*\)@%\$\1%g$/\1 "@\1@"/
+  p
+}' | \
+sort -u
+cat <<\EOF
+
+;;; Variables defined in configure by AC_DEFINE and AC_DEFINE_UNQUOTED follow:
+;;; (These are used in C code)
+
+EOF
--- a/lib-src/gnuclient.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/lib-src/gnuclient.c	Mon Aug 13 09:53:19 2007 +0200
@@ -406,10 +406,11 @@
     {
       fprintf (stderr,
 #ifdef INTERNET_DOMAIN_SOCKETS
-	       "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval expr]\n"
-	       "       [-h host] [-p port] [-r file-name] [[+line] file] ...\n",
+	       "usage: %s [-nw] [-display display] [-q] [-v] [-l library]\n"
+               "       [-batch] [-f function] [-eval form]\n"
+	       "       [-h host] [-p port] [-r remote-path] [[+line] file] ...\n",
 #else /* !INTERNET_DOMAIN_SOCKETS */
-	       "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval expr] "
+	       "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval form] "
 	       "[[+line] path] ...\n",
 #endif /* !INTERNET_DOMAIN_SOCKETS */
 	       progname);
--- a/lib-src/gzip-el.sh	Mon Aug 13 09:52:21 2007 +0200
+++ b/lib-src/gzip-el.sh	Mon Aug 13 09:53:19 2007 +0200
@@ -8,6 +8,22 @@
 # Version:	1.0
 # Keywords:	internal
 
+# 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.
 
 #
 #
--- a/lib-src/update-autoloads.sh	Mon Aug 13 09:52:21 2007 +0200
+++ b/lib-src/update-autoloads.sh	Mon Aug 13 09:53:19 2007 +0200
@@ -5,7 +5,22 @@
 # Maintainer: Steve Baur
 # Keywords: internal
 
-### This file is part of XEmacs
+# 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.
 
 ### Commentary:
 
--- a/lib-src/update-elc.sh	Mon Aug 13 09:52:21 2007 +0200
+++ b/lib-src/update-elc.sh	Mon Aug 13 09:53:19 2007 +0200
@@ -5,6 +5,23 @@
 # Maintainer:	Martin Buchholz
 # Keywords:	recompile byte-compile .el .elc
 
+# 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.
+
 ### Commentary:
 ##  Recompile all .elc files that need recompilation.  Requires a
 ##  working version of "xemacs".  Correctly handles the case where the
--- a/lisp/ChangeLog	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 09:53:19 2007 +0200
@@ -1,3 +1,219 @@
+1997-08-09  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* packages/info.el: (info::toolbar) swap next and prev buttons to
+ 	match the order of the node headings in info files.
+
+1997-08-09  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* packages/info.el: (Info-fontify-node) will now split top line
+ 	that spans 3 lines.  (Info-extract-pointer) adjust to match.
+
+1997-08-08  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* packages/info.el: (Info-extract-pointer) make it move forward
+ 	one more line so when the top line has been split, the toolbar
+ 	arrows, u, and p will find the link they need.
+
+Thu Aug  7 18:13:12 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/Release 5.15
+
+Thu Aug  7 19:21:32 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-styles.el (c-set-offset): Added autoload cookie.
+
+	* cc-mode/cc-langs.el (c++-mode-syntax-table, java-mode-syntax-table,
+	objc-mode-syntax-table, idl-mode-syntax-table):	Added autoload
+	cookies. c-mode-syntax-table already has one.
+
+Wed Aug  6 21:50:08 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-mode.el (c-initialize-cc-mode):
+	Check all cc-mode-19 interface requirements.
+
+Tue Aug  5 21:56:02 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-align.el (c-lineup-java-throws):
+	Change the `when' clause to an `if-progn' :-(
+
+	* cc-mode/cc-langs.el (c-common-init):
+	Make comment-line-break-function buffer local iff it's boundp.
+
+	* cc-mode/cc-cmds.el:
+	defadvice for indent-new-comment-line keys off of c-buffer-is-cc-mode
+	instead of an explicit major-mode list.  this means non-CC Mode
+	derived modes will work properly
+
+	* cc-mode/cc-mode.el (c-initialize-cc-mode): Set
+	c-buffer-is-cc-mode to t.
+
+	* cc-mode/cc-vars.el (c-buffer-is-cc-mode): New variable
+
+	* cc-mode/cc-mode.el (c-initialize-cc-mode):
+	Give in to the pressure.  require 'cc-mode-19
+	if functionp is not bound.  Too many novice errors without this.
+
+	* cc-mode/cc-cmds.el:
+	Added advice for indent-new-comment-line so older Emacsen work if they
+	don't have the variable comment-line-break-function.
+
+Mon Aug  4 14:55:40 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-langs.el (c-mode-base-map, c++-mode-map):
+	Move `/' as an electric character
+	from c++-mode-map to c-mode-base-map for all languages.
+
+	* cc-mode/cc-cmds.el (c-electric-slash):
+	Make this work as the final slash in a */ block
+	oriented comment closing token.
+
+	* cc-mode/cc-vars.el (c-comment-continuation-stars):
+	Can take a nil value.  Also, the default value is "* ".
+
+	* cc-mode/cc-cmds.el (c-comment-line-break-function): nil value for
+	c-comment-continuation-stars means use old semantics
+
+Fri Aug  1 22:44:49 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-cmds.el (c-comment-line-break-function):
+	Added optional soft argument
+
+	* cc-mode/cc-langs.el (c-common-init): Set comment-multi-line and
+	comment-line-break-function here for all modes.
+
+	* cc-mode/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode,
+	idl-mode):
+	Don't set comment-multi-line here.
+
+	* cc-mode/cc-vars.el (c-comment-continuation-stars): New variable
+
+	* cc-mode/cc-cmds.el (c-comment-line-break-function): New function
+	for proposed mode-specific comment-line-break-function variable.
+
+	* cc-mode/cc-mode.el (c-mode): comment-multi-line => nil
+
+	* cc-mode/cc-langs.el (c-C-comment-start-regexp): Obsolete.
+
+	(c-comment-start-regexp): Initialize from c-C++-comment-start-regexp.
+
+	(c-populate-syntax-table, c-setup-dual-comments): Merge both functions
+	into c-populate-syntax-table.  With the new 9X draft C standard, both
+	line and block oriented comments are supported in all modes, so always
+	set up the syntax tables to support both comment styles.
+
+	(c-mode-syntax-table, c++-mode-syntax-table, java-mode-syntax-table,
+	objc-mode-syntax-table, idl-mode-syntax-table): Use the new syntax
+	table initialization idioms.
+
+	(c-enable-//-in-c-mode): Obsolete.
+
+	* cc-mode/cc-mode.el (c-mode):
+	c-comment-start-regexp uses c-C++-comment-start-regexp to
+	support line oriented comments.
+
+Wed Jul 30 00:01:45 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-engine.el (c-guess-basic-syntax):
+	CASE 5D.4: template argument continuation
+	lines are now analyzed as template-args-cont.
+
+	* cc-mode/cc-styles.el (c-offsets-alist):
+	Added template-args-cont syntactic symbol
+
+Sat Jul 26 16:03:33 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode/cc-styles.el (c-styles-alist):
+	In "java" style, set c-hanging-comment-starter-p to
+	nil to preserve Javadoc starter lines.
+
+1997-08-08  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+	* prim/obsolete.el (define-obsolete-variable-alias): If the
+	obsolete variable was setq'ed before the code was loaded we want
+	that value.
+
+1997-08-06  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* packages/man.el: Several modifications
+
+		* (manual-entry) buffers are named without *'s, when
+ 		`buffers-menu-submenus-for-groups-p' is t, so they show up
+ 		in a subsection of the Buffer's menu now, rather than
+ 		lumped under *Misc*.
+
+		* (Manual-mode) added a local `kill-buffer-hook' to remove
+ 		a killed manual from the `Manual-page-history'
+
+		* (Manual-last-page) begun rewrite of manuvering and
+ 		viewing mode code
+
+		* (Manual-mouseify-xrefs) hyphenated xrefs are highlighted
+ 		now, and properly handled when the second line is
+ 		indented.  They end up on the menus too.
+
+		* (Manual-popup-menu) made the far button popup menus look
+ 		better by removing the prefix string and adding a title.
+
+1997-08-06  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* packages/info.el: (Info-highlight-region) Fixed it to not
+ 	highlight the indention spaces in xrefs split across lines with
+ 	indention on the second line.
+
+1997-08-06  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* packages/info.el: Numerous modifications, including:
+
+		* support for "dir" merging 'ala Emacs-19.34, with
+ 		fallback to cheap localdir files in the secondary info
+ 		directories.
+ 	
+		* changed default `Info-annotations-path' from
+ 		~/.infonotes to ~/.xemacs/info.notes
+	
+		* added `Info-additional-directory-list'
+	
+		* changed a call to w3-fetch to browse-url
+ 	
+		* added new variables and functions from GNU Emacs 19.34:
+ 		`Info-dir-contents', `Info-dir-contents-directory',
+ 		`Info-dir-file-attributes', and the function
+ 		`Info-insert-dir'
+ 	
+		* rewrote `Info-suffixed-file' to a cond block rather than
+ 		nested if's for aesthetic reasons.
+ 	
+		* made the top line get split if it's longer than 79
+ 		characters and tweaked fontification to handle that.
+ 	
+		* changed the look of the pop-up mouse menus by utilizing
+ 		the "--:etchedThing" dividers.
+	
+		* several docstring reformats and typo fixes, a few
+ 		comments deleted.
+
+	* info/dir: deleted the Locals: line.  I think it's obsolete since
+ 	the "dir" merge can put things from like-named nodes in separated
+ 	"dir" files all under one menu, which is more versatile than just
+ 	a "Locals:" section.  If you still want a "Locals:" section, make
+ 	yourself a node for it.
+
+1997-08-07  SL Baur  <steve@altair.xemacs.org>
+
+	* egg/egg.el (hiragana-region): Ebola cleanup.
+	(katakana-region): Ditto.
+
+1997-08-02  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+	* prim/files.el (save-buffers-kill-emacs):
+	If there are active processes, then list them before querying if
+	it is ok to exit emacs.
+
+1997-08-01  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+        * efs/dired.el (dired-get-filename) Move the skipping of the
+        ending carriage return on NT to inside the setq so `and' won't
+        fail on Unix.
+
 1997-07-30  SL Baur  <steve@altair.xemacs.org>
 
 	* prim/startup.el (find-emacs-root-internal-1): Remove diagnostic.
@@ -53,10 +269,6 @@
 	* cc-mode/cc-styles.el (c-set-style-2):
 	Fixed broken implementation of inherited styles.
 
-	* cc-mode.texi:
-	Document c-initialization-hook.  Also rewrite the "Getting Connected"
-	section on byte compiling the source.
-
 	* cc-mode/cc-mode.el (c-initialize-cc-mode):
 	Run the c-initialization-hook, but only once
 	per Emacs session.
--- a/lisp/cc-mode/auto-autoloads.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/auto-autoloads.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,6 +7,18 @@
 (defvar c-mode-syntax-table nil "\
 Syntax table used in c-mode buffers.")
 
+(defvar c++-mode-syntax-table nil "\
+Syntax table used in c++-mode buffers.")
+
+(defvar objc-mode-syntax-table nil "\
+Syntax table used in objc-mode buffers.")
+
+(defvar java-mode-syntax-table nil "\
+Syntax table used in java-mode buffers.")
+
+(defvar idl-mode-syntax-table nil "\
+Syntax table used in idl-mode buffers.")
+
 ;;;***
 
 ;;;### (autoloads (idl-mode java-mode objc-mode c++-mode c-mode c-initialize-cc-mode) "cc-mode" "cc-mode/cc-mode.el")
@@ -101,7 +113,7 @@
 
 ;;;***
 
-;;;### (autoloads (c-add-style c-set-style) "cc-styles" "cc-mode/cc-styles.el")
+;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles" "cc-mode/cc-styles.el")
 
 (autoload 'c-set-style "cc-styles" "\
 Set CC Mode variables to use one of several different indentation styles.
@@ -123,6 +135,12 @@
 VARIABLE and VALUE.  This function also sets the current style to
 STYLE using `c-set-style' if the optional SET-P flag is non-nil." t nil)
 
+(autoload 'c-set-offset "cc-styles" "\
+Change the value of a syntactic element symbol in `c-offsets-alist'.
+SYMBOL is the syntactic element symbol to change and OFFSET is the new
+offset for that syntactic element.  Optional ADD says to add SYMBOL to
+`c-offsets-alist' if it doesn't already appear there." t nil)
+
 ;;;***
 
 (provide 'cc-mode-autoloads)
--- a/lisp/cc-mode/cc-align.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-align.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -146,9 +146,10 @@
 	     (looking-at "throws[ \t\n]"))
 	(forward-word 1)
 	(skip-chars-forward " \t")
-	(when (eolp)
-	  (back-to-indentation)
-	  (setq extra c-basic-offset)))
+	(if (eolp)
+	    (progn
+	      (back-to-indentation)
+	      (setq extra c-basic-offset))))
        (t (goto-char iopl)))
       (+ (- (current-column) langelem-col) extra))))
 
--- a/lisp/cc-mode/cc-cmds.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-cmds.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -354,17 +354,28 @@
       
 (defun c-electric-slash (arg)
   "Insert a slash character.
-If slash is second of a double-slash C++ style comment introducing
-construct, and we are on a comment-only-line, indent line as comment.
+
+Indent the line as a comment, if:
+
+  1. The slash is second of a `//' line oriented comment introducing
+     token and we are on a comment-only-line, or
+
+  2. The slash is part of a `*/' token that closes a block oriented
+     comment.
+
 If numeric ARG is supplied or point is inside a literal, indentation
 is inhibited."
   (interactive "P")
-  (let ((indentp (and (not arg)
-		      (eq (char-before) ?/)
-		      (eq last-command-char ?/)
-		      (not (c-in-literal))))
-	;; shut this up
-	(c-echo-syntactic-information-p nil))
+  (let* ((ch (char-before))
+	 (indentp (and (not arg)
+		       (eq last-command-char ?/)
+		       (or (and (eq ch ?/)
+				(not (c-in-literal)))
+			   (and (eq ch ?*)
+				(c-in-literal)))
+		       ))
+	 ;; shut this up
+	 (c-echo-syntactic-information-p nil))
     (self-insert-command (prefix-numeric-value arg))
     (if indentp
 	(c-indent-line))))
@@ -735,6 +746,38 @@
 		 comment-column))
 	 )))))
 
+;; for proposed new variable comment-line-break-function
+(defun c-comment-line-break-function (&optional soft)
+  ;; we currently don't do anything with soft line breaks
+  (if (not c-comment-continuation-stars)
+      (indent-new-comment-line soft)
+    (let ((here (point))
+	  (leader c-comment-continuation-stars))
+      (back-to-indentation)
+      ;; are we looking at a block or lines style comment?
+      (if (and (looking-at (concat "\\(" c-comment-start-regexp "\\)[ \t]+"))
+	       (string-equal (match-string 1) "//"))
+	  ;; line style
+	  (setq leader "// "))
+      (goto-char here)
+      (delete-region (progn (skip-chars-backward " \t") (point))
+		     (progn (skip-chars-forward " \t") (point)))
+      (newline)
+      ;; to avoid having an anchored comment that c-indent-line will
+      ;; trip up on
+      (insert " " leader)
+      (c-indent-line))))
+
+;; advice for indent-new-comment-line for older Emacsen
+(if (boundp 'comment-line-break-function)
+    nil
+  (require 'advice)
+  (defadvice indent-new-comment-line (around c-line-break-advice activate)
+    (if (or (not c-buffer-is-cc-mode)
+	    (not c-comment-continuation-stars))
+	ad-do-it
+      (c-comment-line-break-function (ad-get-arg 0)))))
+
 ;; used by outline-minor-mode
 (defun c-outline-level ()
   (save-excursion
--- a/lisp/cc-mode/cc-compat.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-compat.el	Mon Aug 13 09:53:19 2007 +0200
@@ -5,7 +5,7 @@
 ;; Author:     1994-1997 Barry A. Warsaw
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    August 1994, split from cc-mode.el
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
--- a/lisp/cc-mode/cc-defs.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-defs.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
--- a/lisp/cc-mode/cc-engine.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-engine.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -1145,13 +1145,14 @@
 	      (c-add-syntax 'inher-cont (c-point 'boi)))
 	     ;; CASE 5D.4: perhaps a template list continuation?
 	     ((save-excursion
+		(goto-char indent-point)
 		(skip-chars-backward "^<" lim)
 		;; not sure if this is the right test, but it should
 		;; be fast and mostly accurate.
 		(and (eq (char-before) ?<)
 		     (not (c-in-literal lim))))
-	      ;; we can probably indent it just like and arglist-cont
-	      (c-add-syntax 'arglist-cont (point)))
+	      ;; we can probably indent it just like an arglist-cont
+	      (c-add-syntax 'template-args-cont (point)))
 	     ;; CASE 5D.5: perhaps a top-level statement-cont
 	     (t
 	      (c-beginning-of-statement-1 lim)
--- a/lisp/cc-mode/cc-langs.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-langs.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -123,12 +123,11 @@
 
 
 ;; comment starter definitions for various languages.  language specific
-(defconst c-C-comment-start-regexp "/[*]")
 (defconst c-C++-comment-start-regexp "/[/*]")
 ;; We need to match all 3 Java style comments
 ;; 1) Traditional C block; 2) javadoc /** ...; 3) C++ style
 (defconst c-Java-comment-start-regexp "/\\(/\\|[*][*]?\\)")
-(defvar c-comment-start-regexp c-C-comment-start-regexp)
+(defvar c-comment-start-regexp c-C++-comment-start-regexp)
 (make-variable-buffer-local 'c-comment-start-regexp)
 
 
@@ -215,6 +214,9 @@
   (make-local-variable 'outline-level)
   (make-local-variable 'adaptive-fill-regexp)
   (make-local-variable 'imenu-generic-expression) ;set in the mode functions
+  ;; X/Emacs 20 only
+  (and (boundp 'comment-line-break-function)
+       (make-local-variable 'comment-line-break-function))
   ;; Emacs 19.30 and beyond only, AFAIK
   (if (boundp 'fill-paragraph-function)
       (progn
@@ -232,6 +234,8 @@
 	outline-level 'c-outline-level
 	comment-column 32
 	comment-start-skip "/\\*+ *\\|// *"
+	comment-multi-line nil
+	comment-line-break-function 'c-comment-line-break-function
 	adaptive-fill-regexp nil)
   ;; we have to do something special for c-offsets-alist so that the
   ;; buffer local value has its own alist structure.
@@ -297,28 +301,26 @@
   (modify-syntax-entry ?>  "."     table)
   (modify-syntax-entry ?&  "."     table)
   (modify-syntax-entry ?|  "."     table)
-  (modify-syntax-entry ?\' "\""    table))
-
-(defun c-setup-dual-comments (table)
-  ;; Set up TABLE to handle block and line style comments
+  (modify-syntax-entry ?\' "\""    table)
+  ;; Set up block and line oriented comments.  The new C standard
+  ;; mandates both comment styles even in C, so since all languages
+  ;; now require dual comments, we make this the default.
   (cond
    ;; XEmacs 19 & 20
    ((memq '8-bit c-emacs-features)
     (modify-syntax-entry ?/  ". 1456" table)
-    (modify-syntax-entry ?*  ". 23"   table)
-    (modify-syntax-entry ?\n "> b"    table)
-    ;; Give CR the same syntax as newline, for selective-display
-    (modify-syntax-entry ?\^m "> b"    table))
-   ;; Emacs 19
+    (modify-syntax-entry ?*  ". 23"   table))
+   ;; Emacs 19 & 20
    ((memq '1-bit c-emacs-features)
     (modify-syntax-entry ?/  ". 124b" table)
-    (modify-syntax-entry ?*  ". 23"   table)
-    (modify-syntax-entry ?\n "> b"    table)
-    ;; Give CR the same syntax as newline, for selective-display
-    (modify-syntax-entry ?\^m "> b"   table))
+    (modify-syntax-entry ?*  ". 23"   table))
    ;; incompatible
    (t (error "CC Mode is incompatible with this version of Emacs"))
-   ))
+   )
+  (modify-syntax-entry ?\n "> b"  table)
+  ;; Give CR the same syntax as newline, for selective-display
+  (modify-syntax-entry ?\^m "> b" table))
+
 
 (defvar c-mode-base-map ()
   "Keymap shared by all CC Mode related modes.")
@@ -367,6 +369,7 @@
   ;; these are new keybindings, with no counterpart to BOCM
   (define-key c-mode-base-map ","         'c-electric-semi&comma)
   (define-key c-mode-base-map "*"         'c-electric-star)
+  (define-key c-mode-base-map "/"         'c-electric-slash)
   (define-key c-mode-base-map "\C-c\C-q"  'c-indent-defun)
   (define-key c-mode-base-map "\C-c\C-\\" 'c-backslash-region)
   ;; TBD: where if anywhere, to put c-backward|forward-into-nomenclature
@@ -436,19 +439,7 @@
 (if c-mode-syntax-table
     ()
   (setq c-mode-syntax-table (make-syntax-table))
-  (c-populate-syntax-table c-mode-syntax-table)
-  ;; add extra comment syntax
-  (modify-syntax-entry ?/  ". 14"  c-mode-syntax-table)
-  (modify-syntax-entry ?*  ". 23"  c-mode-syntax-table))
-
-(defun c-enable-//-in-c-mode ()
-  "Enables // as a comment delimiter in `c-mode'.
-ANSI C currently does *not* allow this, although many C compilers
-support optional C++ style comments.  To use, call this function from
-your `.emacs' file before you visit any C files.  The changes are
-global and affect all future `c-mode' buffers."
-  (c-setup-dual-comments c-mode-syntax-table)
-  (setq-default c-C-comment-start-regexp c-C++-comment-start-regexp))
+  (c-populate-syntax-table c-mode-syntax-table))
 
 (easy-menu-define c-c-menu c-mode-map "C Mode Commands"
 		  (c-mode-menu "C"))
@@ -467,18 +458,16 @@
   (setq c++-mode-map (c-make-inherited-keymap))
   ;; add bindings which are only useful for C++
   (define-key c++-mode-map "\C-c:"  'c-scope-operator)
-  (define-key c++-mode-map "/"      'c-electric-slash)
   (define-key c++-mode-map "<"      'c-electric-lt-gt)
   (define-key c++-mode-map ">"      'c-electric-lt-gt))
 
+;;;###autoload
 (defvar c++-mode-syntax-table nil
   "Syntax table used in c++-mode buffers.")
 (if c++-mode-syntax-table
     ()
   (setq c++-mode-syntax-table (make-syntax-table))
   (c-populate-syntax-table c++-mode-syntax-table)
-  ;; add extra comment syntax
-  (c-setup-dual-comments c++-mode-syntax-table)
   ;; TBD: does it make sense for colon to be symbol class in C++?
   ;; I'm not so sure, since c-label-key is busted on lines like:
   ;; Foo::bar( i );
@@ -506,17 +495,15 @@
   ;; add bindings which are only useful for Objective-C
   (define-key objc-mode-map "/"      'c-electric-slash))
 
+;;;###autoload
 (defvar objc-mode-syntax-table nil
   "Syntax table used in objc-mode buffers.")
 (if objc-mode-syntax-table
     ()
   (setq objc-mode-syntax-table (make-syntax-table))
   (c-populate-syntax-table objc-mode-syntax-table)
-  ;; add extra comment syntax
-  (c-setup-dual-comments objc-mode-syntax-table)
-  ;; everyone gets these
-  (modify-syntax-entry ?@ "_" objc-mode-syntax-table)
-  )
+  ;; add extra Objective-C only syntax
+  (modify-syntax-entry ?@ "_" objc-mode-syntax-table))
 
 (easy-menu-define c-objc-menu objc-mode-map "ObjC Mode Commands"
 		  (c-mode-menu "ObjC"))
@@ -536,17 +523,13 @@
   ;; add bindings which are only useful for Java
   (define-key java-mode-map "/"      'c-electric-slash))
 
+;;;###autoload
 (defvar java-mode-syntax-table nil
   "Syntax table used in java-mode buffers.")
 (if java-mode-syntax-table
     ()
   (setq java-mode-syntax-table (make-syntax-table))
-  (c-populate-syntax-table java-mode-syntax-table)
-  ;; add extra comment syntax
-  (c-setup-dual-comments java-mode-syntax-table)
-  ;; everyone gets these
-  (modify-syntax-entry ?@ "_" java-mode-syntax-table)
-  )
+  (c-populate-syntax-table java-mode-syntax-table))
 
 (easy-menu-define c-java-menu java-mode-map "Java Mode Commands"
 		  (c-mode-menu "Java"))
@@ -566,15 +549,13 @@
   ;; additional bindings
   (define-key idl-mode-map "/" 'c-electric-slash))
 
+;;;###autoload
 (defvar idl-mode-syntax-table nil
   "Syntax table used in idl-mode buffers.")
 (if idl-mode-syntax-table
     nil
   (setq idl-mode-syntax-table (make-syntax-table))
-  (c-populate-syntax-table idl-mode-syntax-table)
-  ;; add extra comment syntax
-  (c-setup-dual-comments idl-mode-syntax-table)
-  )
+  (c-populate-syntax-table idl-mode-syntax-table))
 
 (easy-menu-define c-idl-menu idl-mode-map "IDL Mode Commands"
 		  (c-mode-menu "IDL"))
--- a/lisp/cc-mode/cc-menus.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-menus.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
--- a/lisp/cc-mode/cc-mode.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-mode.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    a long, long, time ago. adapted from the original c-mode.el
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; NOTE: Read the commentary below for the right way to submit bug reports!
@@ -91,6 +91,13 @@
 
 ;;;###autoload
 (defun c-initialize-cc-mode ()
+  (setq c-buffer-is-cc-mode t)
+  ;; sigh.  give in to the pressure, but make really sure all the
+  ;; definitions we need are here
+  (if (or (not (fboundp 'functionp))
+	  (not (fboundp 'char-before))
+	  (not (c-safe (char-after) t)))
+      (require 'cc-mode-19))
   ;; make sure all necessary components of CC Mode are loaded in.
   (let ((initprop 'cc-mode-is-initialized))
     (require 'cc-vars)
@@ -136,11 +143,10 @@
   (c-common-init)
   (setq comment-start "/* "
 	comment-end   " */"
-	comment-multi-line t
 	c-conditional-key c-C-conditional-key
 	c-class-key c-C-class-key
 	c-baseclass-key nil
-	c-comment-start-regexp c-C-comment-start-regexp
+	c-comment-start-regexp c-C++-comment-start-regexp
 	imenu-generic-expression cc-imenu-c-generic-expression)
   (run-hooks 'c-mode-common-hook)
   (run-hooks 'c-mode-hook)
@@ -175,7 +181,6 @@
   (c-common-init)
   (setq comment-start "// "
 	comment-end ""
-	comment-multi-line nil
 	c-conditional-key c-C++-conditional-key
 	c-comment-start-regexp c-C++-comment-start-regexp
 	c-class-key c-C++-class-key
@@ -216,7 +221,6 @@
   (c-common-init)
   (setq comment-start "// "
 	comment-end   ""
-	comment-multi-line nil
 	c-conditional-key c-C-conditional-key
 	c-comment-start-regexp c-C++-comment-start-regexp
  	c-class-key c-ObjC-class-key
@@ -259,7 +263,6 @@
   (c-common-init)
   (setq comment-start "// "
  	comment-end   ""
- 	comment-multi-line nil
  	c-conditional-key c-Java-conditional-key
  	c-comment-start-regexp c-Java-comment-start-regexp
   	c-class-key c-Java-class-key
@@ -305,7 +308,6 @@
   (c-common-init)
   (setq comment-start "// "
 	comment-end ""
-	comment-multi-line nil
 	c-conditional-key c-C++-conditional-key
 	c-comment-start-regexp c-C++-comment-start-regexp
 	c-class-key c-C++-class-key
@@ -319,7 +321,7 @@
 
 
 ;; defuns for submitting bug reports
-(defconst c-version "5.14"
+(defconst c-version "5.15"
   "CC Mode version number.")
 
 (defconst c-mode-help-address
--- a/lisp/cc-mode/cc-styles.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-styles.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -330,6 +330,7 @@
     (extern-lang-open      . 0)
     (extern-lang-close     . 0)
     (inextern-lang         . +)
+    (template-args-cont    . +)
     )
   "Association list of syntactic element symbols and indentation offsets.
 As described below, each cons cell in this list has the form:
@@ -428,6 +429,7 @@
  extern-lang-open       -- brace that opens an external language block
  extern-lang-close      -- brace that closes an external language block
  inextern-lang          -- analogous to `inclass' syntactic symbol
+ template-args-cont     -- C++ template argument list continuations
 ")
 
 (defun c-get-offset (langelem)
@@ -505,6 +507,7 @@
 			    nil))))
     offset))
 
+;;;###autoload
 (defun c-set-offset (symbol offset &optional add-p)
   "Change the value of a syntactic element symbol in `c-offsets-alist'.
 SYMBOL is the syntactic element symbol to change and OFFSET is the new
--- a/lisp/cc-mode/cc-vars.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/cc-mode/cc-vars.el	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.14
+;; Version:    5.15
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -105,6 +105,17 @@
   :type 'boolean
   :group 'c)
 
+(defcustom c-comment-continuation-stars "* "
+  "*Specifies the leader of continued block comments.
+You should set this variable to the literal string that gets inserted
+at the front of continued block style comment lines.  This should
+either be the empty string, or some number of stars followed by a
+single space.  Note that for line style comments, this variable is not
+used."
+  :type '(choice (const :tag "Use old semantics" nil)
+		 string)
+  :group 'c)
+
 (defcustom c-cleanup-list '(scope-operator)
   "*List of various C/C++/ObjC constructs to \"clean up\".
 These clean ups only take place when the auto-newline feature is
@@ -398,6 +409,14 @@
 (defvar c-indentation-style c-site-default-style
   "Name of style installed in the current buffer.")
 
+(defvar c-buffer-is-cc-mode nil
+  "Non-nil for all buffers with a `major-mode' derived from CC Mode.
+Otherwise, this variable is nil.  I.e. this variable is non-nil for
+`c-mode', `c++-mode', `objc-mode', `java-mode', `idl-mode', and any
+other non-CC Mode mode that calls `c-initialize-cc-mode'
+\(e.g. `awk-mode').")
+(make-variable-buffer-local 'c-buffer-is-cc-mode)
+
 
 (provide 'cc-vars)
 ;;; cc-vars.el ends here
--- a/lisp/comint/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/comint/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,10 +1,10 @@
-(custom-put 'background 'custom-loads '("background"))
-(custom-put 'comint 'custom-loads '("comint-xemacs" "comint" "telnet"))
-(custom-put 'comint-completion 'custom-loads '("comint"))
-(custom-put 'comint-source 'custom-loads '("comint"))
+(custom-put 'telnet 'custom-loads '("telnet"))
+(custom-put 'ssh 'custom-loads '("ssh"))
+(custom-put 'shell-faces 'custom-loads '("shell"))
+(custom-put 'shell-directories 'custom-loads '("shell"))
+(custom-put 'shell 'custom-loads '("shell"))
 (custom-put 'rlogin 'custom-loads '("rlogin"))
-(custom-put 'shell 'custom-loads '("shell"))
-(custom-put 'shell-directories 'custom-loads '("shell"))
-(custom-put 'shell-faces 'custom-loads '("shell"))
-(custom-put 'ssh 'custom-loads '("ssh"))
-(custom-put 'telnet 'custom-loads '("telnet"))
+(custom-put 'comint-source 'custom-loads '("comint"))
+(custom-put 'comint-completion 'custom-loads '("comint"))
+(custom-put 'comint 'custom-loads '("comint-xemacs" "comint" "telnet"))
+(custom-put 'background 'custom-loads '("background"))
--- a/lisp/custom/cus-edit.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/custom/cus-edit.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9953
+;; Version: 1.9954
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
@@ -1428,7 +1428,7 @@
 	 (text (or (and (eq category 'group)
 			(nth 4 entry))
 		   (nth 3 entry)))
-	 (lisp (eq (widget-get parent :custom-form) 'lisp))
+	 (form (widget-get parent :custom-form))
 	 children)
     (while (string-match "\\`\\(.*\\)%c\\(.*\\)\\'" text)
       (setq text (concat (match-string 1 text) 
@@ -1457,8 +1457,10 @@
 	(if (eq custom-magic-show 'long)
 	    (insert text)
 	  (insert (symbol-name state)))
-	(when lisp 
-	  (insert " (lisp)"))
+	(cond ((eq form 'lisp)
+	       (insert " (lisp)"))
+	      ((eq form 'mismatch)
+	       (insert " (mismatch)")))
 	(put-text-property start (point) 'face 'custom-state-face))
       (insert "\n"))
     (when (and (eq category 'group)
@@ -1479,7 +1481,7 @@
 	     :button-suffix ""
 	     :help-echo "Change the state."
 	     :format (if hidden "%t" "%[%t%]")
-	     :tag (if lisp 
+	     :tag (if (memq form '(lisp mismatch))
 		      (concat "(" magic ")")
 		    (concat "[" magic "]")))
 	    children)
@@ -1790,7 +1792,7 @@
     (when (eq state 'unknown)
       (unless (widget-apply conv :match value)
 	;; (widget-apply (widget-convert type) :match value)
-	(setq form 'lisp)))
+	(setq form 'mismatch)))
     ;; Now we can create the child widget.
     (cond ((eq custom-buffer-style 'tree)
 	   (insert prefix (if last " `--- " " |--- "))
@@ -1814,7 +1816,7 @@
 		  :action 'custom-toggle-parent
 		  nil)
 		 buttons))
-	  ((eq form 'lisp)
+	  ((memq form '(lisp mismatch))
 	   ;; In lisp mode edit the saved value when possible.
 	   (let* ((value (cond ((get symbol 'saved-value)
 				(car (get symbol 'saved-value)))
@@ -1957,10 +1959,10 @@
     ("---" ignore ignore)
     ("Don't show as Lisp expression" custom-variable-edit 
      (lambda (widget)
-       (not (eq (widget-get widget :custom-form) 'edit))))
+       (eq (widget-get widget :custom-form) 'lisp)))
     ("Show as Lisp expression" custom-variable-edit-lisp
      (lambda (widget)
-       (not (eq (widget-get widget :custom-form) 'lisp)))))
+       (eq (widget-get widget :custom-form) 'edit))))
   "Alist of actions for the `custom-variable' widget.
 Each entry has the form (NAME ACTION FILTER) where NAME is the name of
 the menu entry, ACTION is the function to call on the widget when the
@@ -2011,7 +2013,7 @@
 	  ((setq val (widget-apply child :validate))
 	   (goto-char (widget-get val :from))
 	   (error "%s" (widget-get val :error)))
-	  ((eq form 'lisp)
+	  ((memq form '(lisp mismatch))
 	   (funcall set symbol (eval (setq val (widget-value child))))
 	   (put symbol 'customized-value (list val)))
 	  (t
@@ -2033,7 +2035,7 @@
 	  ((setq val (widget-apply child :validate))
 	   (goto-char (widget-get val :from))
 	   (error "%s" (widget-get val :error)))
-	  ((eq form 'lisp)
+	  ((memq form '(lisp mismatch))
 	   (put symbol 'saved-value (list (widget-value child)))
 	   (funcall set symbol (eval (widget-value child))))
 	  (t
@@ -2482,6 +2484,13 @@
 
 (define-widget 'hook 'list
   "A emacs lisp hook"
+  :value-to-internal (lambda (widget value)
+		       (if (symbolp value)
+			   (list value)
+			 value))
+  :match (lambda (widget value)
+	   (or (symbolp value)
+	       (widget-editable-list-match widget value)))
   :convert-widget 'custom-hook-convert-widget
   :tag "Hook")
 
--- a/lisp/custom/cus-face.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/custom/cus-face.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9953
+;; Version: 1.9954
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;;; Commentary:
--- a/lisp/custom/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/custom/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,53 +1,53 @@
-(custom-put 'emacs 'custom-loads '("cus-edit"))
-(custom-put 'editing 'custom-loads '("cus-edit"))
-(custom-put 'abbrev 'custom-loads '("cus-edit"))
-(custom-put 'matching 'custom-loads '())
-(custom-put 'mouse 'custom-loads '())
-(custom-put 'external 'custom-loads '("cus-edit"))
-(custom-put 'processes 'custom-loads '("cus-edit"))
-(custom-put 'programming 'custom-loads '("cus-edit"))
-(custom-put 'languages 'custom-loads '("cus-edit"))
-(custom-put 'lisp 'custom-loads '())
-(custom-put 'applications 'custom-loads '("cus-edit"))
-(custom-put 'calendar 'custom-loads '())
-(custom-put 'development 'custom-loads '("cus-edit"))
-(custom-put 'extensions 'custom-loads '("wid-edit"))
-(custom-put 'internal 'custom-loads '("cus-edit"))
-(custom-put 'maint 'custom-loads '())
-(custom-put 'environment 'custom-loads '("cus-edit"))
-(custom-put 'i18n 'custom-loads '("cus-edit"))
-(custom-put 'x 'custom-loads '())
-(custom-put 'frames 'custom-loads '())
-(custom-put 'data 'custom-loads '())
-(custom-put 'files 'custom-loads '("cus-edit"))
-(custom-put 'wp 'custom-loads '("cus-edit"))
-(custom-put 'faces 'custom-loads '("cus-edit" "wid-edit"))
-(custom-put 'hypermedia 'custom-loads '("wid-edit"))
-(custom-put 'help 'custom-loads '("cus-edit"))
+(custom-put 'widget-button 'custom-loads '("wid-edit"))
+(custom-put 'widget-faces 'custom-loads '("wid-edit"))
+(custom-put 'widget-documentation 'custom-loads '("wid-edit"))
+(custom-put 'widgets 'custom-loads '("wid-browse" "wid-edit"))
+(custom-put 'widget-browse 'custom-loads '("wid-browse"))
+(custom-put 'custom-magic-faces 'custom-loads '("cus-edit"))
+(custom-put 'windows 'custom-loads '())
+(custom-put 'processes-basics 'custom-loads '())
+(custom-put 'auto-save 'custom-loads '())
+(custom-put 'keyboard 'custom-loads '())
+(custom-put 'minibuffer 'custom-loads '())
+(custom-put 'debug 'custom-loads '())
+(custom-put 'limits 'custom-loads '())
+(custom-put 'dired 'custom-loads '())
+(custom-put 'execute 'custom-loads '())
+(custom-put 'display 'custom-loads '())
+(custom-put 'editing-basics 'custom-loads '())
+(custom-put 'fill 'custom-loads '())
+(custom-put 'modeline 'custom-loads '())
+(custom-put 'undo 'custom-loads '())
+(custom-put 'alloc 'custom-loads '())
+(custom-put 'custom-menu 'custom-loads '("cus-edit"))
+(custom-put 'custom-buffer 'custom-loads '("cus-edit"))
+(custom-put 'custom-browse 'custom-loads '("cus-edit"))
+(custom-put 'custom-faces 'custom-loads '("cus-edit"))
+(custom-put 'customize 'custom-loads '("cus-edit" "wid-edit" "cus-face"))
 (custom-put 'local 'custom-loads '())
-(custom-put 'customize 'custom-loads '("cus-edit" "wid-edit" "cus-face"))
-(custom-put 'custom-faces 'custom-loads '("cus-edit"))
-(custom-put 'custom-browse 'custom-loads '("cus-edit"))
-(custom-put 'custom-buffer 'custom-loads '("cus-edit"))
-(custom-put 'custom-menu 'custom-loads '("cus-edit"))
-(custom-put 'alloc 'custom-loads '())
-(custom-put 'undo 'custom-loads '())
-(custom-put 'modeline 'custom-loads '())
-(custom-put 'fill 'custom-loads '())
-(custom-put 'editing-basics 'custom-loads '())
-(custom-put 'display 'custom-loads '())
-(custom-put 'execute 'custom-loads '())
-(custom-put 'dired 'custom-loads '())
-(custom-put 'limits 'custom-loads '())
-(custom-put 'debug 'custom-loads '())
-(custom-put 'minibuffer 'custom-loads '())
-(custom-put 'keyboard 'custom-loads '())
-(custom-put 'auto-save 'custom-loads '())
-(custom-put 'processes-basics 'custom-loads '())
-(custom-put 'windows 'custom-loads '())
-(custom-put 'custom-magic-faces 'custom-loads '("cus-edit"))
-(custom-put 'widget-browse 'custom-loads '("wid-browse"))
-(custom-put 'widgets 'custom-loads '("wid-browse" "wid-edit"))
-(custom-put 'widget-documentation 'custom-loads '("wid-edit"))
-(custom-put 'widget-faces 'custom-loads '("wid-edit"))
-(custom-put 'widget-button 'custom-loads '("wid-edit"))
+(custom-put 'help 'custom-loads '("cus-edit"))
+(custom-put 'hypermedia 'custom-loads '("wid-edit"))
+(custom-put 'faces 'custom-loads '("cus-edit" "wid-edit"))
+(custom-put 'wp 'custom-loads '("cus-edit"))
+(custom-put 'files 'custom-loads '("cus-edit"))
+(custom-put 'data 'custom-loads '())
+(custom-put 'frames 'custom-loads '())
+(custom-put 'x 'custom-loads '())
+(custom-put 'i18n 'custom-loads '("cus-edit"))
+(custom-put 'environment 'custom-loads '("cus-edit"))
+(custom-put 'maint 'custom-loads '())
+(custom-put 'internal 'custom-loads '("cus-edit"))
+(custom-put 'extensions 'custom-loads '("wid-edit"))
+(custom-put 'development 'custom-loads '("cus-edit"))
+(custom-put 'calendar 'custom-loads '())
+(custom-put 'applications 'custom-loads '("cus-edit"))
+(custom-put 'lisp 'custom-loads '())
+(custom-put 'languages 'custom-loads '("cus-edit"))
+(custom-put 'programming 'custom-loads '("cus-edit"))
+(custom-put 'processes 'custom-loads '("cus-edit"))
+(custom-put 'external 'custom-loads '("cus-edit"))
+(custom-put 'mouse 'custom-loads '())
+(custom-put 'matching 'custom-loads '())
+(custom-put 'abbrev 'custom-loads '("cus-edit"))
+(custom-put 'editing 'custom-loads '("cus-edit"))
+(custom-put 'emacs 'custom-loads '("cus-edit"))
--- a/lisp/custom/custom.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/custom/custom.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9953
+;; Version: 1.9954
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/custom/wid-browse.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/custom/wid-browse.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.9953
+;; Version: 1.9954
 ;; 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:52:21 2007 +0200
+++ b/lisp/custom/wid-edit.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.9953
+;; Version: 1.9954
 ;; 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:52:21 2007 +0200
+++ b/lisp/custom/widget-example.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.9953
+;; Version: 1.9954
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 (require 'widget)
--- a/lisp/custom/widget.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/custom/widget.el	Mon Aug 13 09:53:19 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.9953
+;; Version: 1.9954
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/ediff/Makefile	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/Makefile	Mon Aug 13 09:53:19 2007 +0200
@@ -7,9 +7,9 @@
 # variables VERSION, EMACS, DATADIR and comment out the Emacs-specific
 # versions.
 
-VERSION = 19.34
+VERSION = 20.0
 EMACS = emacs-$(VERSION)
-#VERSION = 19.14
+#VERSION = 20.3
 #EMACS = xemacs-$(VERSION)  
 PREFIX = /usr/local
 DATADIR = $(PREFIX)/share
@@ -17,6 +17,7 @@
 LISPDIR = $(DATADIR)/emacs/site-lisp
 INFODIR = $(PREFIX)/info
 ETCDIR = $(DATADIR)/emacs/$(VERSION)/etc
+COMPDIR =
 
 # --------- YOU PROBABLY DON'T WANT TO CHANGE THESE ----------------
 TeX = tex
@@ -28,9 +29,20 @@
 EDIFF    = ediff-init.el ediff-help.el ediff-diff.el ediff-merg.el \
            ediff-wind.el ediff-util.el ediff-mult.el ediff-vers.el \
            ediff-ptch.el ediff.el ediff-hook.el ediff-tbar.el
-EDIFFelc = ediff-init.elc ediff-help.elc ediff-diff.elc ediff-merg.elc \
-           ediff-wind.elc ediff-util.elc ediff-mult.elc ediff-vers.elc \
-           ediff-ptch.elc ediff.elc ediff-hook.elc ediff-tbar.elc
+EDIFFelc = $(COMPDIR)ediff-init.elc \
+	   $(COMPDIR)ediff-help.elc \
+	   $(COMPDIR)ediff-diff.elc \
+	   $(COMPDIR)ediff-merg.elc \
+           $(COMPDIR)ediff-wind.elc \
+	   $(COMPDIR)ediff-util.elc \
+	   $(COMPDIR)ediff-mult.elc \
+	   $(COMPDIR)ediff-vers.elc \
+           $(COMPDIR)ediff-ptch.elc \
+	   $(COMPDIR)ediff.elc \
+	   $(COMPDIR)ediff-hook.elc \
+	   $(COMPDIR)ediff-tbar.elc
+
+COMPILE_ARGS = -batch -f batch-byte-compile
 
 
 all: hello elc goodbye dvi info
@@ -51,7 +63,7 @@
 hello:
 	@echo ""
 	@echo ""
-	@echo "Byte compiling using Emacs 19"
+	@echo "Byte compiling using Emacs"
 	@echo "Use  make EMACS=xemacs  to compile under XEmacs"
 	@echo ""
 	@echo ""
@@ -60,53 +72,53 @@
 	@echo ""
 	@echo ""
 
-ediff-init.elc: ediff-init.el
+$(COMPDIR)ediff-init.elc: ediff-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-init.el
+	$(EMACS) $(COMPILE_ARGS) ediff-init.el
 
-ediff-help.elc: ediff-help.el
+$(COMPDIR)ediff-help.elc: ediff-help.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-help.el
+	$(EMACS) $(COMPILE_ARGS) ediff-help.el
 
-ediff-hook.elc: ediff-hook.el
+$(COMPDIR)ediff-hook.elc: ediff-hook.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-hook.el
+	$(EMACS) $(COMPILE_ARGS) ediff-hook.el
 
-ediff-tbar.elc: ediff-tbar.el
+$(COMPDIR)ediff-tbar.elc: ediff-tbar.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-tbar.el
+	$(EMACS) $(COMPILE_ARGS) ediff-tbar.el
 
-ediff-diff.elc: ediff-init.el ediff-diff.el
+$(COMPDIR)ediff-diff.elc: ediff-init.el ediff-diff.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-diff.el
+	$(EMACS) $(COMPILE_ARGS) ediff-diff.el
 
-ediff-merg.elc: ediff-init.el ediff-merg.el
+$(COMPDIR)ediff-merg.elc: ediff-init.el ediff-merg.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-merg.el
+	$(EMACS) $(COMPILE_ARGS) ediff-merg.el
 
-ediff-mult.elc: ediff-init.el ediff-mult.el
+$(COMPDIR)ediff-mult.elc: ediff-init.el ediff-mult.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-mult.el
+	$(EMACS) $(COMPILE_ARGS) ediff-mult.el
 
-ediff-vers.elc: ediff-init.el ediff-vers.el
+$(COMPDIR)ediff-vers.elc: ediff-init.el ediff-vers.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-vers.el
+	$(EMACS) $(COMPILE_ARGS) ediff-vers.el
 
-ediff-ptch.elc: ediff-init.el ediff-ptch.el
+$(COMPDIR)ediff-ptch.elc: ediff-init.el ediff-ptch.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-ptch.el
+	$(EMACS) $(COMPILE_ARGS) ediff-ptch.el
 
-ediff.elc: ediff-init.el ediff.el
+$(COMPDIR)ediff.elc: ediff-init.el ediff.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff.el
+	$(EMACS) $(COMPILE_ARGS) ediff.el
 
-ediff-util.elc: ediff-init.el ediff-util.el
+$(COMPDIR)ediff-util.elc: ediff-init.el ediff-util.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-util.el
+	$(EMACS) $(COMPILE_ARGS) ediff-util.el
 
-ediff-wind.elc: ediff-init.el ediff-wind.el
+$(COMPDIR)ediff-wind.elc: ediff-init.el ediff-wind.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile ediff-wind.el
+	$(EMACS) $(COMPILE_ARGS) ediff-wind.el
 
 ediff.dvi: ediff.texi
 	@echo ""
@@ -125,7 +137,7 @@
 	$(TeX) ediff.texi
 	@echo ""
 
-ediff.info:  ediff.texi
+ediff:  ediff.texi
 	@echo ""
 	@echo ""
 	@echo "Making Info Files for the Ediff Manual"
@@ -135,7 +147,7 @@
 
 dvi: ediff.dvi
 
-info: ediff.info
+info: ediff
 
 install: all
 	$(INSTALL) -m444 $(EDIFF) $(LISPDIR)
@@ -152,7 +164,7 @@
 distclean: clean
  
 realclean: clean
-	rm -f *.dvi ediff.info*
+	rm -f *.dvi ../info/ediff ../info/ediff-?
 	rm -f ediff.aux ediff.cp ediff.cps ediff.fn ediff.fns ediff.ky \
 	      ediff.kys ediff.log ediff.pg ediff.pgs ediff.toc ediff.tp \
 	      ediff.tps ediff.vr ediff.vrs
--- a/lisp/ediff/ediff-diff.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-diff.el	Mon Aug 13 09:53:19 2007 +0200
@@ -212,7 +212,7 @@
 				 ediff-diff-options file1 file2)
 	     ;;(message "Computing differences ... done")
 	     (message "")
-	     (ediff-eval-in-buffer diff-buffer
+	     (ediff-with-current-buffer diff-buffer
 	       (buffer-size))))))
   
 
@@ -283,15 +283,15 @@
       (setq ediff-error-buffer
 	    (get-buffer-create (ediff-unique-buffer-name
 				"*ediff-errors" "*"))))
-  (ediff-eval-in-buffer ediff-error-buffer
+  (ediff-with-current-buffer ediff-error-buffer
     (erase-buffer)
-    (insert (ediff-eval-in-buffer diff-buff (buffer-string)))
+    (insert (ediff-with-current-buffer diff-buff (buffer-string)))
     (goto-char (point-min))
     (delete-matching-lines ok-regexp)
     (if (memq system-type '(vax-vms axp-vms))
 	(delete-matching-lines "^$")))
   ;; If diff reports errors, show them then quit.
-  (if (/= 0 (ediff-eval-in-buffer ediff-error-buffer (buffer-size)))
+  (if (/= 0 (ediff-with-current-buffer ediff-error-buffer (buffer-size)))
       (let ((ctl-buf ediff-control-buffer)
 	    (error-buf ediff-error-buffer))
 	(ediff-skip-unsuitable-frames)
@@ -328,15 +328,15 @@
 	       (ediff-get-value-according-to-buffer-type 'B bounds))))
     
     ;; reset point in buffers A/B/C
-    (ediff-eval-in-buffer A-buffer
+    (ediff-with-current-buffer A-buffer
       (goto-char (if shift-A shift-A (point-min))))
-    (ediff-eval-in-buffer B-buffer
+    (ediff-with-current-buffer B-buffer
       (goto-char (if shift-B shift-B (point-min))))
     (if (ediff-buffer-live-p C-buffer)
-	(ediff-eval-in-buffer C-buffer
+	(ediff-with-current-buffer C-buffer
 	  (goto-char (point-min))))
     
-    (ediff-eval-in-buffer diff-buffer
+    (ediff-with-current-buffer diff-buffer
       (goto-char (point-min))
       (while (re-search-forward ediff-match-diff-line nil t)
        (let* ((a-begin (string-to-int (buffer-substring (match-beginning 1)
@@ -404,20 +404,20 @@
 		   b-prev b-end
 		   c-prev c-end)
 	   ;; else convert lines to points
-	   (ediff-eval-in-buffer A-buffer
+	   (ediff-with-current-buffer A-buffer
 	     (forward-line (- a-begin a-prev))
 	     (setq a-begin-pt (point))
 	     (forward-line (- a-end a-begin))
 	     (setq a-end-pt (point)
 		   a-prev a-end))
-	   (ediff-eval-in-buffer B-buffer
+	   (ediff-with-current-buffer B-buffer
 	     (forward-line (- b-begin b-prev))
 	     (setq b-begin-pt (point))
 	     (forward-line (- b-end b-begin))
 	     (setq b-end-pt (point)
 		   b-prev b-end))
 	   (if (ediff-buffer-live-p C-buffer)
-	       (ediff-eval-in-buffer C-buffer
+	       (ediff-with-current-buffer C-buffer
 		 (forward-line (- c-begin c-prev))
 		 (setq c-begin-pt (point))
 		 (forward-line (- c-end c-begin))
@@ -447,7 +447,7 @@
 			     ))) 
 		  )))
 		  
-	 ))) ; end ediff-eval-in-buffer
+	 ))) ; end ediff-with-current-buffer
     diff-list
     ))
     
@@ -495,7 +495,7 @@
     (setq total-diffs (length diff-list))
       
     ;; shift, if necessary
-    (ediff-eval-in-buffer buff (setq pt-saved shift))
+    (ediff-with-current-buffer buff (setq pt-saved shift))
 	   
     (while diff-list
       (setq current-diff (1+ current-diff)
@@ -524,12 +524,12 @@
       ;; convert word numbers to points, if necessary
       (if (eq diff-list-type 'words)
 	  (progn
-	    (ediff-eval-in-buffer buff (goto-char pt-saved))
+	    (ediff-with-current-buffer buff (goto-char pt-saved))
 	    (setq begin (ediff-goto-word (1+ begin) buff)
 		  end (ediff-goto-word end buff 'end))
 	    (if (> end limit) (setq end limit))
 	    (if (> begin end) (setq begin end))
-	    (setq pt-saved (ediff-eval-in-buffer buff (point)))))
+	    (setq pt-saved (ediff-with-current-buffer buff (point)))))
       (setq overlay (ediff-make-bullet-proof-overlay begin end buff))
       
       (ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
@@ -553,7 +553,7 @@
 	    (cdr diff-list))
       ) ; while
       
-    (set (intern (format "ediff-difference-vector-%S" buf-type))
+    (set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist)
 	 (vconcat diff-overlay-list))
     ))
 
@@ -761,14 +761,15 @@
 	(face (if default 
 		  'default
 		(face-name
-		 (intern (format "ediff-fine-diff-face-%S" buf-type)))))
+		 (ediff-get-symbol-from-alist
+		  buf-type ediff-fine-diff-face-alist))))
 	(priority (if default
 		      0
 		    (1+ (or (ediff-overlay-get
 			     (symbol-value
-			      (intern
-			       (format
-				"ediff-current-diff-overlay-%S" buf-type)))
+			      (ediff-get-symbol-from-alist
+			       buf-type
+			       ediff-current-diff-overlay-alist))
 			     'priority)
 			    0)))))
     (mapcar
@@ -806,7 +807,7 @@
 
     (ediff-clear-fine-differences-in-one-buffer region-num buf-type)
     (setq diff-list (cdr diff-list)) ; discard list type (words or points)
-    (ediff-eval-in-buffer buff (goto-char reg-start))
+    (ediff-with-current-buffer buff (goto-char reg-start))
     
     ;; if it is a combined merge then set overlays in buff C specially
     (if (and ediff-merge-job (eq buf-type 'C)
@@ -909,18 +910,18 @@
 		   (ediff-get-value-according-to-buffer-type 'C bounds)))))
     
     ;; reset point in buffers A, B, C
-    (ediff-eval-in-buffer A-buffer
+    (ediff-with-current-buffer A-buffer
       (goto-char (if shift-A shift-A (point-min))))
-    (ediff-eval-in-buffer B-buffer
+    (ediff-with-current-buffer B-buffer
       (goto-char (if shift-B shift-B (point-min))))
     (if three-way-comp
-	(ediff-eval-in-buffer C-buffer
+	(ediff-with-current-buffer C-buffer
 	  (goto-char (if shift-C shift-C (point-min)))))
     (if (ediff-buffer-live-p anc-buffer)
-	(ediff-eval-in-buffer anc-buffer
+	(ediff-with-current-buffer anc-buffer
 	  (goto-char (point-min))))
     
-    (ediff-eval-in-buffer diff-buffer
+    (ediff-with-current-buffer diff-buffer
       (goto-char (point-min))
       (while (re-search-forward ediff-match-diff3-line nil t)
 	;; leave point after matched line
@@ -983,26 +984,26 @@
 			 b-prev b-end
 			 c-prev c-end)
 		 ;; else convert lines to points
-		 (ediff-eval-in-buffer A-buffer
+		 (ediff-with-current-buffer A-buffer
 		   (forward-line (- a-begin a-prev))
 		   (setq a-begin-pt (point))
 		   (forward-line (- a-end a-begin))
 		   (setq a-end-pt (point)
 			 a-prev a-end))
-		 (ediff-eval-in-buffer B-buffer
+		 (ediff-with-current-buffer B-buffer
 		   (forward-line (- b-begin b-prev))
 		   (setq b-begin-pt (point))
 		   (forward-line (- b-end b-begin))
 		   (setq b-end-pt (point)
 			 b-prev b-end))
-		 (ediff-eval-in-buffer C-buffer
+		 (ediff-with-current-buffer C-buffer
 		   (forward-line (- c-begin c-prev))
 		   (setq c-begin-pt (point))
 		   (forward-line (- c-end c-begin))
 		   (setq c-end-pt (point)
 			 c-prev c-end))
 		 (if (ediff-buffer-live-p anc-buffer)
-		     (ediff-eval-in-buffer anc-buffer
+		     (ediff-with-current-buffer anc-buffer
 		       (forward-line (- c-or-anc-begin anc-prev))
 		       (setq anc-begin-pt (point))
 		       (forward-line (- c-or-anc-end c-or-anc-begin))
@@ -1034,7 +1035,7 @@
 			)))
 	       ))
 	       
-	 ))) ; end ediff-eval-in-buffer
+	 ))) ; end ediff-with-current-buffer
     diff-list
     ))
     
@@ -1065,15 +1066,15 @@
    
 
 ;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
-;; SYNCH is non-nil.  BUFFER must be a buffer object, and must be alive.  All
-;; arguments in ARGS must be strings. The first arg may be a blank string, in
-;; which case we delete it from ARGS list. We also delete nil from args.
-(defun ediff-exec-process (program buffer synch &rest args)
-  (let ((data (match-data)))
-    (if (string-match "^[ \t]*$" (car args)) ; delete blank string
-	(setq args (cdr args)))
-    (setq args (delq nil args)) ; delete nil from arguments
-    (setq args (ediff-split-string (mapconcat 'identity args " ")))
+;; SYNCH is non-nil.  BUFFER must be a buffer object, and must be alive.  The
+;; OPTIONS arg is a list of options to pass to PROGRAM. It may be a blank
+;; string.  All elements in FILES must be strings.  We also delete nil from
+;; args.
+(defun ediff-exec-process (program buffer synch options &rest files)
+  (let ((data (match-data))
+	args)
+    (setq args (append (split-string options) files))
+    (setq args (delete "" (delq nil args))) ; delete nil and "" from arguments
     (unwind-protect
 	(let ((directory default-directory)
 	      proc)
@@ -1191,7 +1192,7 @@
   (let (sv-point string)
     (save-excursion
      (set-buffer in-buffer)
-     (setq string (buffer-substring beg end))
+     (setq string (buffer-substring-no-properties beg end))
 
      (set-buffer out-buffer)
      (erase-buffer)
@@ -1205,7 +1206,7 @@
        ;; different invocations
        (if control-buf
 	   (funcall 
-	    (ediff-eval-in-buffer control-buf ediff-forward-word-function))
+	    (ediff-with-current-buffer control-buf ediff-forward-word-function))
 	 (funcall ediff-forward-word-function))
        (setq sv-point (point))
        (skip-chars-forward ediff-whitespace)
@@ -1232,7 +1233,7 @@
 (defun ediff-goto-word (n buf &optional flag)
   ;; remember val ediff-forward-word-function has in ctl buf
   (let ((fwd-word-fun ediff-forward-word-function))
-    (ediff-eval-in-buffer buf
+    (ediff-with-current-buffer buf
       (skip-chars-forward ediff-whitespace)
       (while (> n 1)
 	(funcall fwd-word-fun)
@@ -1245,8 +1246,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 
--- a/lisp/ediff/ediff-init.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-init.el	Mon Aug 13 09:53:19 2007 +0200
@@ -97,6 +97,13 @@
 ;; The Ediff control buffer
 (ediff-defvar-local ediff-control-buffer nil "")
 
+
+;; Association between buff-type and ediff-buffer-*
+(defconst ediff-buffer-alist
+  '((?A . ediff-buffer-A)
+    (?B . ediff-buffer-B)
+    (?C . ediff-buffer-C)))
+
 ;;; Macros
 (defmacro ediff-odd-p (arg)
   (` (eq (logand (, arg) 1) 1)))
@@ -123,11 +130,27 @@
 	   ((memq (, arg) '(?c ?C)) 'C)
 	   )
   ))
+
+
+;; A-list is supposed to be of the form (A . symb) (B . symb)...)
+;; where the first part of any association is a buffer type and the second is
+;; an appropriate symbol. Given buffer-type, this function returns the
+;; symbol. This is used to avoid using `intern'
+(defsubst ediff-get-symbol-from-alist (buf-type alist)
+  (cdr (assoc buf-type alist)))
   
+(defconst ediff-difference-vector-alist
+  '((A . ediff-difference-vector-A)
+    (B . ediff-difference-vector-B)
+    (C . ediff-difference-vector-C)
+    (Ancestor . ediff-difference-vector-Ancestor)))
+
 (defmacro ediff-get-difference (n buf-type)
   (` (aref
       (symbol-value
-       (intern (format "ediff-difference-vector-%S" (, buf-type)))) (, n))))
+       (ediff-get-symbol-from-alist
+	(, buf-type) ediff-difference-vector-alist))
+      (, n))))
   
 ;; Tell if it has been previously determined that the region has
 ;; no diffs other than the white space and newlines
@@ -189,21 +212,18 @@
   (` (ediff-get-fine-diff-vector-from-diff-record
       (ediff-get-difference (, n) (, buf-type)))))
   
-;; Macro to switch to BUFFER, evaluate FORMS, returns to original buffer.
-;; Differs from `save-excursion' in that it doesn't save the point and mark.
-;; This is essentially `emerge-eval-in-buffer' with the test for live buffers."
-(defmacro ediff-eval-in-buffer (buffer &rest forms)
-  (` (let ((StartBuffer (current-buffer)))
-       (if (ediff-buffer-live-p (, buffer))
-	   (unwind-protect
-	       (progn
-		 (set-buffer (, buffer))
-		 (,@ forms))
-	     (set-buffer StartBuffer))
-	 (or (eq this-command 'ediff-quit)
-	     (error ediff-KILLED-VITAL-BUFFER))
-	 ))))
-	 
+;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer.
+;; Doesn't save the point and mark.
+;; This is `with-current-buffer' with the added test for live buffers."
+(defmacro ediff-with-current-buffer (buffer &rest body)
+  (` (if (ediff-buffer-live-p (, buffer))
+       (save-current-buffer
+	 (set-buffer (, buffer))
+	 (,@ body))
+     (or (eq this-command 'ediff-quit)
+	 (error ediff-KILLED-VITAL-BUFFER))
+     )))
+     
 
 (defsubst ediff-multiframe-setup-p ()
   (and (ediff-window-display-p) ediff-multiframe))
@@ -561,6 +581,13 @@
 ;; The original values of ediff-protected-variables for buffer Ancestor
 (ediff-defvar-local ediff-buffer-values-orig-Ancestor nil "")
 
+;; association between buff-type and ediff-buffer-values-orig-*
+(defconst ediff-buffer-values-orig-alist
+  '((A . ediff-buffer-values-orig-A)
+    (B . ediff-buffer-values-orig-B)
+    (C . ediff-buffer-values-orig-C)
+    (Ancestor . ediff-buffer-values-orig-Ancestor)))
+
 ;; Buffer-local variables to be saved then restored during Ediff sessions
 (defconst ediff-protected-variables '(
 				      ;;buffer-read-only 
@@ -585,6 +612,12 @@
 (ediff-defvar-local ediff-difference-vector-B nil "")
 (ediff-defvar-local ediff-difference-vector-C nil "")
 (ediff-defvar-local ediff-difference-vector-Ancestor nil "")
+;; A-list of diff vector types associated with buffer types
+(defconst ediff-difference-vector-alist
+  '((A . ediff-difference-vector-A)
+    (B . ediff-difference-vector-B)
+    (C . ediff-difference-vector-C)
+    (Ancestor . ediff-difference-vector-Ancestor)))
 
 ;; [ status status status ...]
 ;; Each status: [state-of-merge state-of-ancestor]
@@ -676,30 +709,6 @@
 	  ((memq op '(< <=)) t))))
   
   
-;;;; warn if it is a wrong version of emacs
-;;(if (or (ediff-check-version '< 19 35 'emacs)
-;;	(ediff-check-version '< 19 15 'xemacs))
-;;    (progn
-;;      (with-output-to-temp-buffer ediff-msg-buffer
-;;	(switch-to-buffer ediff-msg-buffer)
-;;	(insert
-;;	 (format "
-;;
-;;This version of Ediff requires 
-;;
-;;\t Emacs 19.35 and higher
-;;\t OR
-;;\t XEmacs 19.15 and higher
-;;
-;;It is unlikely to work under Emacs version %s
-;;that you are using... " emacs-version))
-;;	(if noninteractive
-;;	    ()
-;;	  (beep 1)
-;;	  (beep 1)
-;;	  (insert "\n\nType any key to continue...")
-;;	  (ediff-read-event)))
-;;      (kill-buffer ediff-msg-buffer)))
 
 ;; A fix for NeXT Step
 ;; Should probably be eliminated in later versions.
@@ -743,14 +752,30 @@
       (fset 'ediff-display-pixel-height
 	    (symbol-function 'x-display-pixel-height))))
       
+;; A-list of current-diff-overlay symbols asssociated with buf types
+(defconst ediff-current-diff-overlay-alist
+  '((A . ediff-current-diff-overlay-A)
+    (B . ediff-current-diff-overlay-B)
+    (C . ediff-current-diff-overlay-C)
+    (Ancestor . ediff-current-diff-overlay-Ancestor)))
+  
+;; A-list of current-diff-face-* symbols asssociated with buf types
+(defconst ediff-current-diff-face-alist
+  '((A . ediff-current-diff-face-A)
+    (B . ediff-current-diff-face-B)
+    (C . ediff-current-diff-face-C)
+    (Ancestor . ediff-current-diff-face-Ancestor)))
+  
 
 (defun ediff-make-current-diff-overlay (type)
   (if (ediff-has-face-support-p)
-      (let ((overlay (intern (format "ediff-current-diff-overlay-%S" type)))
+      (let ((overlay (ediff-get-symbol-from-alist
+		      type ediff-current-diff-overlay-alist))
 	    (buffer (ediff-get-buffer type))
 	    (face (face-name
 		   (symbol-value
-		    (intern (format "ediff-current-diff-face-%S" type))))))
+		    (ediff-get-symbol-from-alist
+		     type ediff-current-diff-face-alist)))))
 	(set overlay
 	     (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
 	(ediff-set-overlay-face (symbol-value overlay) face)
@@ -779,35 +804,35 @@
 	  (t ""))   ; none
     ))
 
-(defun ediff-set-face (ground face color)
-  "Set face foreground/background."
-  (if (ediff-has-face-support-p)
-      (if (ediff-valid-color-p color)
-	  (if (eq ground 'foreground)
-	      (set-face-foreground face color)
-	    (set-face-background face color))
-	(cond ((memq face
-		     '(ediff-current-diff-face-A
-		       ediff-current-diff-face-B
-		       ediff-current-diff-face-C
-		       ediff-current-diff-face-Ancestor))
-	       (copy-face 'highlight face))
-	      ((memq face
-		     '(ediff-fine-diff-face-A
-		       ediff-fine-diff-face-B
-		       ediff-fine-diff-face-C
-		       ediff-fine-diff-face-Ancestor))
-	       (copy-face 'secondary-selection face)
-	       (set-face-underline-p face t))
-	      ((memq face
-		     '(ediff-even-diff-face-A
-		       ediff-odd-diff-face-A 
-		       ediff-even-diff-face-B ediff-odd-diff-face-B
-		       ediff-even-diff-face-C ediff-odd-diff-face-C
-		       ediff-even-diff-face-Ancestor
-		       ediff-odd-diff-face-Ancestor))
-	       (copy-face 'secondary-selection face))))
-    ))
+;;(defun ediff-set-face (ground face color)
+;;  "Set face foreground/background."
+;;  (if (ediff-has-face-support-p)
+;;      (if (ediff-valid-color-p color)
+;;	  (if (eq ground 'foreground)
+;;	      (set-face-foreground face color)
+;;	    (set-face-background face color))
+;;	(cond ((memq face
+;;		     '(ediff-current-diff-face-A
+;;		       ediff-current-diff-face-B
+;;		       ediff-current-diff-face-C
+;;		       ediff-current-diff-face-Ancestor))
+;;	       (copy-face 'highlight face))
+;;	      ((memq face
+;;		     '(ediff-fine-diff-face-A
+;;		       ediff-fine-diff-face-B
+;;		       ediff-fine-diff-face-C
+;;		       ediff-fine-diff-face-Ancestor))
+;;	       (copy-face 'secondary-selection face)
+;;	       (set-face-underline-p face t))
+;;	      ((memq face
+;;		     '(ediff-even-diff-face-A
+;;		       ediff-odd-diff-face-A 
+;;		       ediff-even-diff-face-B ediff-odd-diff-face-B
+;;		       ediff-even-diff-face-C ediff-odd-diff-face-C
+;;		       ediff-even-diff-face-Ancestor
+;;		       ediff-odd-diff-face-Ancestor))
+;;	       (copy-face 'secondary-selection face))))
+;;    ))
 
 (defun ediff-set-face-pixmap (face pixmap)
   "Set face pixmap on a monochrome display."
@@ -822,280 +847,556 @@
   (if (and (ediff-has-face-support-p) ediff-emacs-p)
       (add-to-list 'facemenu-unlisted-faces face)))
       
-(defvar ediff-current-diff-face-A
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-current-diff-face-A)
-	(ediff-hide-face 'ediff-current-diff-face-A)
-	(or (face-differs-from-default-p 'ediff-current-diff-face-A)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-current-diff-face-A "firebrick")
-		   (ediff-set-face
-		    'background 'ediff-current-diff-face-A "pale green"))
-		  (t
-		   (if ediff-xemacs-p
-		       (copy-face 'modeline 'ediff-current-diff-face-A)
-		     (copy-face 'highlight 'ediff-current-diff-face-A))
-		   )))
-	'ediff-current-diff-face-A))
-  "Face for highlighting the selected difference in buffer A.")
+(defgroup ediff-highlighting nil
+  "Hilighting of difference regions in Ediff"
+  :prefix "ediff-"
+  :group 'ediff)
+
+;;(defvar ediff-current-diff-face-A
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-current-diff-face-A)
+;;	(or (face-differs-from-default-p 'ediff-current-diff-face-A)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-current-diff-face-A "firebrick")
+;;		   (ediff-set-face
+;;		    'background 'ediff-current-diff-face-A "pale green"))
+;;		  (t
+;;		   (if ediff-xemacs-p
+;;		       (copy-face 'modeline 'ediff-current-diff-face-A)
+;;		     (copy-face 'highlight 'ediff-current-diff-face-A))
+;;		   )))
+;;	'ediff-current-diff-face-A))
+;;  "Face for highlighting the selected difference in buffer A.")
+
+(defface ediff-current-diff-face-A
+  '((((class color)) (:foreground "firebrick" :background "pale green"))
+    (t (:inverse-video t)))
+  "Face for highlighting the selected difference in buffer A."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-current-diff-face-A 'ediff-current-diff-face-A)
+(ediff-hide-face 'ediff-current-diff-face-A)
+;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
+;; This means that some user customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (copy-face 'modeline 'ediff-current-diff-face-A))
+
+
 
-(defvar ediff-current-diff-face-B
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-current-diff-face-B)
-	(ediff-hide-face 'ediff-current-diff-face-B)
-	(or (face-differs-from-default-p 'ediff-current-diff-face-B)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-current-diff-face-B "DarkOrchid")
-		   (ediff-set-face
-		    'background 'ediff-current-diff-face-B "Yellow"))
-		  (t 
-		   (if ediff-xemacs-p
-		       (copy-face 'modeline 'ediff-current-diff-face-B)
-		     (copy-face 'highlight 'ediff-current-diff-face-B))
-		   )))
-	'ediff-current-diff-face-B))
-  "Face for highlighting the selected difference in buffer B.")
+;;(defvar ediff-current-diff-face-B
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-current-diff-face-B)
+;;	(or (face-differs-from-default-p 'ediff-current-diff-face-B)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-current-diff-face-B "DarkOrchid")
+;;		   (ediff-set-face
+;;		    'background 'ediff-current-diff-face-B "Yellow"))
+;;		  (t 
+;;		   (if ediff-xemacs-p
+;;		       (copy-face 'modeline 'ediff-current-diff-face-B)
+;;		     (copy-face 'highlight 'ediff-current-diff-face-B))
+;;		   )))
+;;	'ediff-current-diff-face-B))
+;;  "Face for highlighting the selected difference in buffer B.")
     
+(defface ediff-current-diff-face-B
+  '((((class color)) (:foreground "DarkOrchid" :background "Yellow"))
+    (t (:inverse-video t)))
+  "Face for highlighting the selected difference in buffer B."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-current-diff-face-B 'ediff-current-diff-face-B)
+(ediff-hide-face 'ediff-current-diff-face-B)
+;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
+;; This means that some user customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (copy-face 'modeline 'ediff-current-diff-face-B))
 
-(defvar ediff-current-diff-face-C
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-current-diff-face-C)
-	(ediff-hide-face 'ediff-current-diff-face-C)
-	(or (face-differs-from-default-p 'ediff-current-diff-face-C)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-current-diff-face-C "Navy")
-		   (ediff-set-face
-		    'background 'ediff-current-diff-face-C "Pink"))
-		  (t 
-		   (if ediff-xemacs-p
-		       (copy-face 'modeline 'ediff-current-diff-face-C)
-		     (copy-face 'highlight 'ediff-current-diff-face-C))
-		   )))
-	'ediff-current-diff-face-C))
-  "Face for highlighting the selected difference in buffer C.")
+;;(defvar ediff-current-diff-face-C
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-current-diff-face-C)
+;;	(or (face-differs-from-default-p 'ediff-current-diff-face-C)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-current-diff-face-C "Navy")
+;;		   (ediff-set-face
+;;		    'background 'ediff-current-diff-face-C "Pink"))
+;;		  (t 
+;;		   (if ediff-xemacs-p
+;;		       (copy-face 'modeline 'ediff-current-diff-face-C)
+;;		     (copy-face 'highlight 'ediff-current-diff-face-C))
+;;		   )))
+;;	'ediff-current-diff-face-C))
+;;  "Face for highlighting the selected difference in buffer C.")
+
+(defface ediff-current-diff-face-C
+  '((((class color)) (:foreground "Navy" :background "Pink"))
+    (t (:inverse-video t)))
+  "Face for highlighting the selected difference in buffer C."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-current-diff-face-C 'ediff-current-diff-face-C)
+(ediff-hide-face 'ediff-current-diff-face-C)
+;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
+;; This means that some user customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (copy-face 'modeline 'ediff-current-diff-face-C))
+
+;;(defvar ediff-current-diff-face-Ancestor
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-current-diff-face-Ancestor)
+;;	(or (face-differs-from-default-p 'ediff-current-diff-face-Ancestor)
+;;	    (copy-face 
+;;	     'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor))
+;;	'ediff-current-diff-face-Ancestor))
+;;  "Face for highlighting the selected difference in the ancestor buffer.")
 
-(defvar ediff-current-diff-face-Ancestor
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-current-diff-face-Ancestor)
-	(ediff-hide-face 'ediff-current-diff-face-Ancestor)
-	(or (face-differs-from-default-p 'ediff-current-diff-face-Ancestor)
-	    (copy-face 
-	     'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor))
-	'ediff-current-diff-face-Ancestor))
-  "Face for highlighting the selected difference in the ancestor buffer.")
+(defface ediff-current-diff-face-Ancestor
+  '((((class color)) (:foreground "Black" :background "VioletRed"))
+    (t (:inverse-video t)))
+  "Face for highlighting the selected difference in buffer Ancestor."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-face-Ancestor)
+(ediff-hide-face 'ediff-current-diff-face-Ancestor)
+;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
+;; This means that some user customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (copy-face 'modeline 'ediff-current-diff-face-Ancestor))
+
+;;(defvar ediff-fine-diff-pixmap "gray3"
+;;  "Pixmap to use for highlighting fine differences.")
+;;(defvar ediff-odd-diff-pixmap "gray1"
+;;  "Pixmap to use for highlighting odd differences.")
+;;(defvar ediff-even-diff-pixmap "Stipple"
+;;  "Pixmap to use for highlighting even differences.")
 
-(defvar ediff-fine-diff-pixmap "gray3"
-  "Pixmap to use for highlighting fine differences.")
-(defvar ediff-odd-diff-pixmap "gray1"
-  "Pixmap to use for highlighting odd differences.")
-(defvar ediff-even-diff-pixmap "Stipple"
-  "Pixmap to use for highlighting even differences.")
+;;(defvar ediff-fine-diff-face-A
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-fine-diff-face-A)
+;;	(or (face-differs-from-default-p 'ediff-fine-diff-face-A)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face 'foreground 'ediff-fine-diff-face-A
+;;				   "Navy")
+;;		   (ediff-set-face 'background 'ediff-fine-diff-face-A
+;;				   "sky blue"))
+;;		  (t
+;;		   (set-face-underline-p 'ediff-fine-diff-face-A t)
+;;		   (ediff-set-face-pixmap 'ediff-fine-diff-face-A
+;;					  ediff-fine-diff-pixmap)
+;;		   )))
+;;	'ediff-fine-diff-face-A))
+;;  "Face for highlighting the refinement of the selected diff in buffer A.")
+
+
+(defface ediff-fine-diff-face-A
+  '((((class color)) (:foreground "Navy" :background "sky blue"))
+    (t (:underline t :stipple "gray3")))
+  "Face for highlighting the refinement of the selected diff in buffer A."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-fine-diff-face-A 'ediff-fine-diff-face-A)
+(ediff-hide-face 'ediff-fine-diff-face-A)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-fine-diff-face-A "gray3"))
 
-(defvar ediff-fine-diff-face-A
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-fine-diff-face-A)
-	(ediff-hide-face 'ediff-fine-diff-face-A)
-	(or (face-differs-from-default-p 'ediff-fine-diff-face-A)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face 'foreground 'ediff-fine-diff-face-A
-				   "Navy")
-		   (ediff-set-face 'background 'ediff-fine-diff-face-A
-				   "sky blue"))
-		  (t
-		   (set-face-underline-p 'ediff-fine-diff-face-A t)
-		   (ediff-set-face-pixmap 'ediff-fine-diff-face-A
-					  ediff-fine-diff-pixmap)
-		   )))
-	'ediff-fine-diff-face-A))
-  "Face for highlighting the refinement of the selected diff in buffer A.")
+;;(defvar ediff-fine-diff-face-B
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-fine-diff-face-B)
+;;	(or (face-differs-from-default-p 'ediff-fine-diff-face-B)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black")
+;;		   (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan"))
+;;		  (t
+;;		   (set-face-underline-p 'ediff-fine-diff-face-B t)
+;;		   (ediff-set-face-pixmap 'ediff-fine-diff-face-B
+;;					  ediff-fine-diff-pixmap)
+;;		   )))
+;;	'ediff-fine-diff-face-B))
+;;  "Face for highlighting the refinement of the selected diff in buffer B.")
 
-(defvar ediff-fine-diff-face-B
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-fine-diff-face-B)
-	(ediff-hide-face 'ediff-fine-diff-face-B)
-	(or (face-differs-from-default-p 'ediff-fine-diff-face-B)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black")
-		   (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan"))
-		  (t
-		   (set-face-underline-p 'ediff-fine-diff-face-B t)
-		   (ediff-set-face-pixmap 'ediff-fine-diff-face-B
-					  ediff-fine-diff-pixmap)
-		   )))
-	'ediff-fine-diff-face-B))
-  "Face for highlighting the refinement of the selected diff in buffer B.")
+(defface ediff-fine-diff-face-B
+  '((((class color)) (:foreground "Black" :background "cyan"))
+    (t (:underline t :stipple "gray3")))
+  "Face for highlighting the refinement of the selected diff in buffer B."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-fine-diff-face-B 'ediff-fine-diff-face-B)
+(ediff-hide-face 'ediff-fine-diff-face-B)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-fine-diff-face-B "gray3"))
     
-(defvar ediff-fine-diff-face-C
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-fine-diff-face-C)
-	(ediff-hide-face 'ediff-fine-diff-face-C)
-	(or (face-differs-from-default-p 'ediff-fine-diff-face-C)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black")
-		   (ediff-set-face
-		    'background 'ediff-fine-diff-face-C "Turquoise"))
-		  (t
-		   (set-face-underline-p 'ediff-fine-diff-face-C t)
-		   (ediff-set-face-pixmap 'ediff-fine-diff-face-C
-					  ediff-fine-diff-pixmap)
-		   )))
-	'ediff-fine-diff-face-C))
-  "Face for highlighting the refinement of the selected diff in buffer C.")
+;;(defvar ediff-fine-diff-face-C
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-fine-diff-face-C)
+;;	(or (face-differs-from-default-p 'ediff-fine-diff-face-C)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black")
+;;		   (ediff-set-face
+;;		    'background 'ediff-fine-diff-face-C "Turquoise"))
+;;		  (t
+;;		   (set-face-underline-p 'ediff-fine-diff-face-C t)
+;;		   (ediff-set-face-pixmap 'ediff-fine-diff-face-C
+;;					  ediff-fine-diff-pixmap)
+;;		   )))
+;;	'ediff-fine-diff-face-C))
+;;  "Face for highlighting the refinement of the selected diff in buffer C.")
+
+(defface ediff-fine-diff-face-C
+  '((((class color)) (:foreground "Black" :background "Turquoise"))
+    (t (:underline t :stipple "gray3")))
+  "Face for highlighting the refinement of the selected diff in buffer C."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-fine-diff-face-C 'ediff-fine-diff-face-C)
+(ediff-hide-face 'ediff-fine-diff-face-C)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-fine-diff-face-C "gray3"))
+
+;;(defvar ediff-fine-diff-face-Ancestor
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-fine-diff-face-Ancestor)
+;;	(ediff-hide-face 'ediff-fine-diff-face-Ancestor)
+;;	(or (face-differs-from-default-p 'ediff-fine-diff-face-Ancestor)
+;;	    (progn
+;;	      (copy-face
+;;	       'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor)
+;;	      (ediff-set-face-pixmap 'ediff-fine-diff-face-Ancestor
+;;				     ediff-fine-diff-pixmap))
+;;	    )))
+;;  "Face highlighting refinements of the selected diff in ancestor buffer.
+;;Presently, this is not used, as difference regions are not refined in the
+;;ancestor buffer.")
 
-(defvar ediff-fine-diff-face-Ancestor
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-fine-diff-face-Ancestor)
-	(ediff-hide-face 'ediff-fine-diff-face-Ancestor)
-	(or (face-differs-from-default-p 'ediff-fine-diff-face-Ancestor)
-	    (progn
-	      (copy-face
-	       'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor)
-	      (ediff-set-face-pixmap 'ediff-fine-diff-face-Ancestor
-				     ediff-fine-diff-pixmap))
-	    )))
-  "Face highlighting refinements of the selected diff in ancestor buffer.
-Presently, this is not used, as difference regions are not refined in the
-ancestor buffer.")
+(defface ediff-fine-diff-face-Ancestor
+  '((((class color)) (:foreground "Black" :background "Green"))
+    (t (:underline t :stipple "gray3")))
+  "Face for highlighting the refinement of the selected diff in the ancestor buffer.
+At present, this face is not used and no fine differences are computed for the
+ancestor buffer."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-face-Ancestor)
+(ediff-hide-face 'ediff-fine-diff-face-Ancestor)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap
+     'ediff-fine-diff-face-Ancestor "gray3"))
     
-(defvar ediff-even-diff-face-A
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-even-diff-face-A)
-	(ediff-hide-face 'ediff-even-diff-face-A)
-	(or (face-differs-from-default-p 'ediff-even-diff-face-A)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-even-diff-face-A "black")
-		   (ediff-set-face
-		    'background 'ediff-even-diff-face-A "light grey"))
-		  (t 
-		   (copy-face 'italic 'ediff-even-diff-face-A)
-		   (ediff-set-face-pixmap 'ediff-even-diff-face-A
-					  ediff-even-diff-pixmap)
-		   )))
-	'ediff-even-diff-face-A))
-  "Face used to highlight even-numbered differences in buffer A.")
+;;(defvar ediff-even-diff-face-A
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-even-diff-face-A)
+;;	(or (face-differs-from-default-p 'ediff-even-diff-face-A)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-even-diff-face-A "black")
+;;		   (ediff-set-face
+;;		    'background 'ediff-even-diff-face-A "light grey"))
+;;		  (t 
+;;		   (copy-face 'italic 'ediff-even-diff-face-A)
+;;		   (ediff-set-face-pixmap 'ediff-even-diff-face-A
+;;					  ediff-even-diff-pixmap)
+;;		   )))
+;;	'ediff-even-diff-face-A))
+;;  "Face used for highlighting even-numbered differences in buffer A.")
+
+(defface ediff-even-diff-face-A
+  '((((class color)) (:foreground "Black" :background "light grey"))
+    (t (:italic t :stipple "Stipple")))
+  "Face for highlighting even-numbered non-current differences in buffer A."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-even-diff-face-A 'ediff-even-diff-face-A)
+(ediff-hide-face 'ediff-even-diff-face-A)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-even-diff-face-A "Stipple"))
       
-(defvar ediff-even-diff-face-B
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-even-diff-face-B)
-	(ediff-hide-face 'ediff-even-diff-face-B)
-	(or (face-differs-from-default-p 'ediff-even-diff-face-B)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-even-diff-face-B "White")
-		   (ediff-set-face
-		    'background 'ediff-even-diff-face-B "Gray"))
-		  (t 
-		   (copy-face 'italic 'ediff-even-diff-face-B)
-		   (ediff-set-face-pixmap 'ediff-even-diff-face-B
-					  ediff-even-diff-pixmap)
-		   )))
-	'ediff-even-diff-face-B))
-  "Face used to highlight even-numbered differences in buffer B.")
+;;(defvar ediff-even-diff-face-B
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-even-diff-face-B)
+;;	(or (face-differs-from-default-p 'ediff-even-diff-face-B)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-even-diff-face-B "White")
+;;		   (ediff-set-face
+;;		    'background 'ediff-even-diff-face-B "Gray"))
+;;		  (t 
+;;		   (copy-face 'italic 'ediff-even-diff-face-B)
+;;		   (ediff-set-face-pixmap 'ediff-even-diff-face-B
+;;					  ediff-even-diff-pixmap)
+;;		   )))
+;;	'ediff-even-diff-face-B))
+;;  "Face used for highlighting even-numbered differences in buffer B.")
+
+(defface ediff-even-diff-face-B
+  '((((class color)) (:foreground "White" :background "Grey"))
+    (t (:italic t :stipple "Stipple")))
+  "Face for highlighting even-numbered non-current differences in buffer B."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-even-diff-face-B 'ediff-even-diff-face-B)
+(ediff-hide-face 'ediff-even-diff-face-B)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-even-diff-face-B "Stipple"))
     
-(defvar ediff-even-diff-face-C
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-even-diff-face-C)
-	(ediff-hide-face 'ediff-even-diff-face-C)
-	(or (face-differs-from-default-p 'ediff-even-diff-face-C)
-	    (progn
-	      (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)
-	      (ediff-set-face-pixmap 'ediff-even-diff-face-C
-				     ediff-even-diff-pixmap)))
-	'ediff-even-diff-face-C))
-  "Face used to highlight even-numbered differences in buffer C.")
+;;(defvar ediff-even-diff-face-C
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-even-diff-face-C)
+;;	(ediff-hide-face 'ediff-even-diff-face-C)
+;;	(or (face-differs-from-default-p 'ediff-even-diff-face-C)
+;;	    (progn
+;;	      (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)
+;;	      (ediff-set-face-pixmap 'ediff-even-diff-face-C
+;;				     ediff-even-diff-pixmap)))
+;;	'ediff-even-diff-face-C))
+;;  "Face used for highlighting even-numbered differences in buffer C.")
+
+(defface ediff-even-diff-face-C
+  '((((class color)) (:foreground "Black" :background "light grey"))
+    (t (:italic t :stipple "Stipple")))
+  "Face for highlighting even-numbered non-current differences in buffer C."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-even-diff-face-C 'ediff-even-diff-face-C)
+(ediff-hide-face 'ediff-even-diff-face-C)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-even-diff-face-C "Stipple"))
+
+;;(defvar ediff-even-diff-face-Ancestor
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-even-diff-face-Ancestor)
+;;	(ediff-hide-face 'ediff-even-diff-face-Ancestor)
+;;	(or (face-differs-from-default-p 'ediff-even-diff-face-Ancestor)
+;;	    (progn
+;;	      (copy-face
+;;	       'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor)
+;;	      (ediff-set-face-pixmap 'ediff-even-diff-face-Ancestor
+;;				     ediff-even-diff-pixmap)))
+;;	'ediff-even-diff-face-Ancestor))
+;;  "Face highlighting even-numbered differences in the ancestor buffer.")
 
-(defvar ediff-even-diff-face-Ancestor
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-even-diff-face-Ancestor)
-	(ediff-hide-face 'ediff-even-diff-face-Ancestor)
-	(or (face-differs-from-default-p 'ediff-even-diff-face-Ancestor)
-	    (progn
-	      (copy-face
-	       'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor)
-	      (ediff-set-face-pixmap 'ediff-even-diff-face-Ancestor
-				     ediff-even-diff-pixmap)))
-	'ediff-even-diff-face-Ancestor))
-  "Face highlighting even-numbered differences in the ancestor buffer.")
-  
-(defvar ediff-odd-diff-face-A
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-odd-diff-face-A)
-	(ediff-hide-face 'ediff-odd-diff-face-A)
-	(or (face-differs-from-default-p 'ediff-odd-diff-face-A)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-odd-diff-face-A "White")
-		   (ediff-set-face
-		    'background 'ediff-odd-diff-face-A "Gray"))
-		  (t 
-		   (copy-face 'italic 'ediff-odd-diff-face-A)
-		   (ediff-set-face-pixmap 'ediff-odd-diff-face-A
-					  ediff-odd-diff-pixmap)
-		   )))
-	'ediff-odd-diff-face-A))
-  "Face used to highlight odd-numbered differences in buffer A.")
+(defface ediff-even-diff-face-Ancestor
+  '((((class color)) (:foreground "White" :background "Grey"))
+    (t (:italic t :stipple "Stipple")))
+  "Face for highlighting even-numbered non-current differences in the ancestor buffer."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-face-Ancestor)
+(ediff-hide-face 'ediff-even-diff-face-Ancestor)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap
+     'ediff-even-diff-face-Ancestor "Stipple"))
+
+;; Association between buffer types and even-diff-face symbols
+(defconst ediff-even-diff-face-alist
+  '((A . ediff-even-diff-face-A)
+    (B . ediff-even-diff-face-B)
+    (C . ediff-even-diff-face-C)
+    (Ancestor . ediff-even-diff-face-Ancestor)))
+
+;;(defvar ediff-odd-diff-face-A
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-odd-diff-face-A)
+;;	(or (face-differs-from-default-p 'ediff-odd-diff-face-A)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-odd-diff-face-A "White")
+;;		   (ediff-set-face
+;;		    'background 'ediff-odd-diff-face-A "Gray"))
+;;		  (t 
+;;		   (copy-face 'italic 'ediff-odd-diff-face-A)
+;;		   (ediff-set-face-pixmap 'ediff-odd-diff-face-A
+;;					  ediff-odd-diff-pixmap)
+;;		   )))
+;;	'ediff-odd-diff-face-A))
+;;  "Face used for highlighting odd-numbered differences in buffer A.")
+
+(defface ediff-odd-diff-face-A
+  '((((class color)) (:foreground "White" :background "Grey"))
+    (t (:italic t :stipple "gray1")))
+  "Face for highlighting odd-numbered non-current differences in buffer A."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-odd-diff-face-A 'ediff-odd-diff-face-A)
+(ediff-hide-face 'ediff-odd-diff-face-A)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-odd-diff-face-A "gray1"))
       
-(defvar ediff-odd-diff-face-B
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-odd-diff-face-B)
-	(ediff-hide-face 'ediff-odd-diff-face-B)
-	(or (face-differs-from-default-p 'ediff-odd-diff-face-B)
-	    (cond ((ediff-color-display-p)
-		   (ediff-set-face
-		    'foreground 'ediff-odd-diff-face-B "Black")
-		   (ediff-set-face
-		    'background 'ediff-odd-diff-face-B "light grey"))
-		  (t 
-		   (copy-face 'italic 'ediff-odd-diff-face-B)
-		   (ediff-set-face-pixmap 'ediff-odd-diff-face-B
-					  ediff-odd-diff-pixmap)
-		   )))
-	'ediff-odd-diff-face-B))
-  "Face used to highlight odd-numbered differences in buffer B.")
+;;(defvar ediff-odd-diff-face-B
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-odd-diff-face-B)
+;;	(ediff-hide-face 'ediff-odd-diff-face-B)
+;;	(or (face-differs-from-default-p 'ediff-odd-diff-face-B)
+;;	    (cond ((ediff-color-display-p)
+;;		   (ediff-set-face
+;;		    'foreground 'ediff-odd-diff-face-B "Black")
+;;		   (ediff-set-face
+;;		    'background 'ediff-odd-diff-face-B "light grey"))
+;;		  (t 
+;;		   (copy-face 'italic 'ediff-odd-diff-face-B)
+;;		   (ediff-set-face-pixmap 'ediff-odd-diff-face-B
+;;					  ediff-odd-diff-pixmap)
+;;		   )))
+;;	'ediff-odd-diff-face-B))
+;;  "Face used for highlighting odd-numbered differences in buffer B.")
+
+(defface ediff-odd-diff-face-B
+  '((((class color)) (:foreground "Black" :background "light grey"))
+    (t (:italic t :stipple "gray1")))
+  "Face for highlighting odd-numbered non-current differences in buffer B."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-odd-diff-face-B 'ediff-odd-diff-face-B)
+(ediff-hide-face 'ediff-odd-diff-face-B)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-odd-diff-face-B "gray1"))
     
-(defvar ediff-odd-diff-face-C
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-odd-diff-face-C)
-	(ediff-hide-face 'ediff-odd-diff-face-C)
-	(or (face-differs-from-default-p 'ediff-odd-diff-face-C)
-	    (progn
-	      (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)
-	      (ediff-set-face-pixmap 'ediff-odd-diff-face-C
-				     ediff-odd-diff-pixmap)))
-	'ediff-odd-diff-face-C))
-  "Face used to highlight odd-numbered differences in buffer C.")
+;;(defvar ediff-odd-diff-face-C
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-odd-diff-face-C)
+;;	(or (face-differs-from-default-p 'ediff-odd-diff-face-C)
+;;	    (progn
+;;	      (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)
+;;	      (ediff-set-face-pixmap 'ediff-odd-diff-face-C
+;;				     ediff-odd-diff-pixmap)))
+;;	'ediff-odd-diff-face-C))
+;;  "Face used for highlighting odd-numbered differences in buffer C.")
+
+(defface ediff-odd-diff-face-C
+  '((((class color)) (:foreground "White" :background "Grey"))
+    (t (:italic t :stipple "gray1")))
+  "Face for highlighting odd-numbered non-current differences in buffer C."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-odd-diff-face-C 'ediff-odd-diff-face-C)
+(ediff-hide-face 'ediff-odd-diff-face-C)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-odd-diff-face-C "gray1"))
 
-(defvar ediff-odd-diff-face-Ancestor 
-  (if (ediff-has-face-support-p)
-      (progn
-	(make-face 'ediff-odd-diff-face-Ancestor)
-	(ediff-hide-face 'ediff-odd-diff-face-Ancestor)
-	(or (face-differs-from-default-p 'ediff-odd-diff-face-Ancestor)
-	    (progn
-	      (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor)
-	      (ediff-set-face-pixmap 'ediff-odd-diff-face-Ancestor
-				     ediff-odd-diff-pixmap)))
-	'ediff-odd-diff-face-Ancestor))
-  "Face used to highlight even-numbered differences in the ancestor buffer.")
+;;(defvar ediff-odd-diff-face-Ancestor 
+;;  (if (ediff-has-face-support-p)
+;;      (progn
+;;	(make-face 'ediff-odd-diff-face-Ancestor)
+;;	(or (face-differs-from-default-p 'ediff-odd-diff-face-Ancestor)
+;;	    (progn
+;;	      (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor)
+;;	      (ediff-set-face-pixmap 'ediff-odd-diff-face-Ancestor
+;;				     ediff-odd-diff-pixmap)))
+;;	'ediff-odd-diff-face-Ancestor))
+;;  "Face used for highlighting even-numbered differences in the ancestor buffer.")
+
+(defface ediff-odd-diff-face-Ancestor
+  '((((class color)) (:foreground "Black" :background "light grey"))
+    (t (:italic t :stipple "gray1")))
+  "Face for highlighting odd-numbered non-current differences in the ancestor buffer."
+  :group 'ediff-highlighting)
+;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; this variable is set to nil, then again to the appropriate face.
+(defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-face-Ancestor)
+(ediff-hide-face 'ediff-odd-diff-face-Ancestor)
+;; Until custom.el for XEmacs starts supporting :stipple we do this.
+;; This means that some use customization may be trashed.
+(if (and ediff-xemacs-p
+	 (ediff-has-face-support-p)
+	 (not (ediff-color-display-p))) 
+    (ediff-set-face-pixmap 'ediff-odd-diff-face-Ancestor "gray1"))
+
+;; Association between buffer types and odd-diff-face symbols
+(defconst ediff-odd-diff-face-alist
+  '((A . ediff-odd-diff-face-A)
+    (B . ediff-odd-diff-face-B)
+    (C . ediff-odd-diff-face-C)
+    (Ancestor . ediff-odd-diff-face-Ancestor)))
+  
+;; A-list of fine-diff face symbols associated with buffer types
+(defconst ediff-fine-diff-face-alist
+  '((A . ediff-fine-diff-face-A)
+    (B . ediff-fine-diff-face-B)
+    (C . ediff-fine-diff-face-C)
+    (Ancestor . ediff-fine-diff-face-Ancestor)))
 
 ;; Help echo
 (put 'ediff-fine-diff-face-A 'ediff-help-echo
@@ -1118,14 +1419,14 @@
   "Overlay for the current difference region in buffer C.")
 (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
   "Overlay for the current difference region in the ancestor buffer.")
-  
+
 ;; Compute priority of ediff overlay.
 (defun ediff-highest-priority (start end buffer)
   (let ((pos (max 1 (1- start)))
 	ovr-list)
     (if ediff-xemacs-p
 	(1+ ediff-shadow-overlay-priority)
-      (ediff-eval-in-buffer buffer
+      (ediff-with-current-buffer buffer
 	(while (< pos (min (point-max) (1+ end)))
 	  (setq ovr-list (append (overlays-at pos) ovr-list))
 	  (setq pos (next-overlay-change pos)))
@@ -1240,16 +1541,18 @@
 (defsubst ediff-background-face (buf-type dif-num)
   ;; The value of dif-num is always 1- the one that user sees.
   ;; This is why even face is used when dif-num is odd.
-  (intern (format (if (ediff-odd-p dif-num)
-		      "ediff-even-diff-face-%S"
-		    "ediff-odd-diff-face-%S")
-		  buf-type)))
+  (ediff-get-symbol-from-alist
+   buf-type (if (ediff-odd-p dif-num)
+		ediff-even-diff-face-alist
+	      ediff-odd-diff-face-alist)
+   ))
 
 
 ;; activate faces on diff regions in buffer
 (defun ediff-paint-background-regions-in-one-buffer (buf-type unhighlight)
   (let ((diff-vector 
-	 (eval (intern (format "ediff-difference-vector-%S" buf-type))))
+	 (eval (ediff-get-symbol-from-alist
+		buf-type ediff-difference-vector-alist)))
 	overl diff-num)
     (mapcar (function
 	     (lambda (rec)
@@ -1279,14 +1582,15 @@
 (defun ediff-highlight-diff-in-one-buffer (n buf-type)
   (if (ediff-buffer-live-p (ediff-get-buffer buf-type))
       (let* ((buff (ediff-get-buffer buf-type))
-	     (last (ediff-eval-in-buffer buff (point-max)))
+	     (last (ediff-with-current-buffer buff (point-max)))
 	     (begin (ediff-get-diff-posn buf-type 'beg n))
 	     (end (ediff-get-diff-posn buf-type 'end n))
 	     (xtra (if (equal begin end) 1 0))
 	     (end-hilit (min last (+ end xtra)))
 	     (current-diff-overlay 
 	      (symbol-value
-	       (intern (format "ediff-current-diff-overlay-%S" buf-type)))))
+	       (ediff-get-symbol-from-alist
+		buf-type ediff-current-diff-overlay-alist))))
 	
 	(if ediff-xemacs-p
 	    (ediff-move-overlay current-diff-overlay begin end-hilit)
@@ -1305,7 +1609,8 @@
   (if (ediff-buffer-live-p (ediff-get-buffer buf-type))
       (let ((current-diff-overlay 
 	     (symbol-value
-	      (intern (format "ediff-current-diff-overlay-%S" buf-type))))
+	      (ediff-get-symbol-from-alist
+	       buf-type ediff-current-diff-overlay-alist)))
 	    (overlay
 	     (ediff-get-diff-overlay ediff-current-difference buf-type))
 	    )
@@ -1326,7 +1631,8 @@
   (if (and (ediff-has-face-support-p) ediff-use-faces)
       (let* ((inhibit-quit t)
 	     (current-diff-overlay-var
-	      (intern (format "ediff-current-diff-overlay-%S" buf-type)))
+	      (ediff-get-symbol-from-alist
+	       buf-type ediff-current-diff-overlay-alist))
 	     (current-diff-overlay (symbol-value current-diff-overlay-var)))
 	(ediff-paint-background-regions 'unhighlight)
 	(if (ediff-overlayp current-diff-overlay)
@@ -1557,7 +1863,7 @@
       (ediff-empty-diff-region-p n buf-type)
       (let ((beg (ediff-get-diff-posn buf-type 'beg n))
 	    (end (ediff-get-diff-posn buf-type 'end n)))
-	(ediff-eval-in-buffer (ediff-get-buffer buf-type)
+	(ediff-with-current-buffer (ediff-get-buffer buf-type)
 	  (save-excursion
 	    (goto-char beg)
 	    (skip-chars-forward ediff-whitespace)
@@ -1632,8 +1938,8 @@
 
     
 (defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end)
-  (ediff-eval-in-buffer 
-      (ediff-eval-in-buffer ctrl-buf (ediff-get-buffer buf-type))
+  (ediff-with-current-buffer 
+      (ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type))
     (buffer-substring
      (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf))
      (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf)))))
@@ -1678,8 +1984,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
      
 (provide 'ediff-init)
--- a/lisp/ediff/ediff-merg.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-merg.el	Mon Aug 13 09:53:19 2007 +0200
@@ -281,7 +281,7 @@
 	    reg-a-beg reg-a-end reg-b-beg reg-b-end reg-c-beg reg-c-end)
 	
 	(if combined
-	    (ediff-eval-in-buffer ediff-buffer-C
+	    (ediff-with-current-buffer ediff-buffer-C
 	      (goto-char reg-beg)
 	      (search-forward pat1 reg-end 'noerror)
 	      (setq reg-a-beg (match-beginning 0))
@@ -300,8 +300,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 ;; ediff-merg.el ends here
--- a/lisp/ediff/ediff-mult.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-mult.el	Mon Aug 13 09:53:19 2007 +0200
@@ -93,7 +93,7 @@
 (provide 'ediff-mult)
 
 (defgroup ediff-mult nil
-  "Multi-file and multi-buffer processing in ediff"
+  "Multi-file and multi-buffer processing in Ediff"
   :prefix "ediff-"
   :group 'ediff)
 
@@ -559,7 +559,7 @@
   (let* ((meta-buffer-name 
 	  (ediff-unique-buffer-name meta-buffer-name "*"))
 	 (meta-buffer (get-buffer-create meta-buffer-name)))
-    (ediff-eval-in-buffer meta-buffer
+    (ediff-with-current-buffer meta-buffer
 
       ;; comes first
       (ediff-meta-mode)
@@ -662,7 +662,7 @@
 	regexp elt session-buf f1 f2 f3 pt 
 	merge-autostore-dir
 	point tmp-list buffer-read-only)
-    (ediff-eval-in-buffer meta-buf
+    (ediff-with-current-buffer meta-buf
       (setq point (point))
       (erase-buffer)
       (insert (format ediff-meta-buffer-message
@@ -828,7 +828,7 @@
     ;; skip the directory part
     (setq diff-list (cdr diff-list))
     (setq ediff-dir-diffs-buffer (get-buffer-create buf-name))
-    (ediff-eval-in-buffer ediff-dir-diffs-buffer
+    (ediff-with-current-buffer ediff-dir-diffs-buffer
       (use-local-map ediff-dir-diffs-buffer-map)
       (erase-buffer)
       (setq ediff-meta-buffer meta-buf)
@@ -938,7 +938,7 @@
 
 ;; argument is ignored
 (defun ediff-redraw-registry-buffer (&optional ignore)
-  (ediff-eval-in-buffer ediff-registry-buffer
+  (ediff-with-current-buffer ediff-registry-buffer
     (let ((point (point))
 	  elt bufAname bufBname bufCname cur-diff total-diffs pt
 	  job-name meta-list registry-list buffer-read-only)
@@ -975,7 +975,7 @@
 	      registry-list (cdr registry-list))
 	
 	(if (ediff-buffer-live-p elt)
-	    (if (ediff-eval-in-buffer elt
+	    (if (ediff-with-current-buffer elt
 		  (setq job-name ediff-metajob-name
 			meta-list ediff-meta-list)
 		  (and ediff-metajob-name
@@ -1000,7 +1000,7 @@
 				       ""))))
 		  (ediff-set-meta-overlay pt (point) elt))
 	      (progn
-		(ediff-eval-in-buffer elt
+		(ediff-with-current-buffer elt
 		  (setq bufAname (if (ediff-buffer-live-p ediff-buffer-A)
 				     (buffer-name ediff-buffer-A)
 				   "!!!killed buffer!!!")
@@ -1143,7 +1143,7 @@
 	(metajob ediff-metajob-name)
 	tmp-buf custom-diff-buf)
     (if (ediff-buffer-live-p session-buf)
-	(ediff-eval-in-buffer session-buf
+	(ediff-with-current-buffer session-buf
 	  (if (eq ediff-control-buffer session-buf) ; individual session
 	      (progn
 		(ediff-compute-custom-diffs-maybe)
@@ -1191,7 +1191,7 @@
       (setq ediff-meta-diff-buffer
 	    (get-buffer-create
 	     (ediff-unique-buffer-name "*Ediff Multifile Diffs" "*"))))
-  (ediff-eval-in-buffer ediff-meta-diff-buffer
+  (ediff-with-current-buffer ediff-meta-diff-buffer
     (erase-buffer))
   (if (> (ediff-operate-on-marked-sessions 'ediff-append-custom-diff) 0)
       ;; did something
@@ -1207,7 +1207,7 @@
 	 (info (ediff-get-meta-info meta-buf pos 'noerror))
 	 (patchbuffer ediff-meta-patchbufer))
     (if (ediff-buffer-live-p patchbuffer)
-	(ediff-eval-in-buffer patchbuffer
+	(ediff-with-current-buffer patchbuffer
 	  (save-restriction
 	    (if (not info)
 		(widen)
@@ -1249,7 +1249,7 @@
 		(ediff-update-meta-buffer meta-buf))
 	    (error "Aborted"))))
 
-    (ediff-eval-in-buffer meta-buf
+    (ediff-with-current-buffer meta-buf
       (setq merge-autostore-dir
 	    (ediff-get-group-merge-autostore-dir ediff-meta-list))
       (goto-char pos) ; if the user clicked on session--move point there
@@ -1299,7 +1299,7 @@
 
 	    ;; handle an individual session with a live control buffer
 	    ((ediff-buffer-live-p session-buf)
-	     (ediff-eval-in-buffer session-buf
+	     (ediff-with-current-buffer session-buf
 	       (setq ediff-mouse-pixel-position (mouse-pixel-position))
 	       (ediff-recenter 'no-rehighlight)))
 
@@ -1387,18 +1387,18 @@
 
     (if (ediff-buffer-live-p ctl-buf)
 	;; check if this is ediff-control-buffer or ediff-meta-buffer
-	(if (ediff-eval-in-buffer ctl-buf
+	(if (ediff-with-current-buffer ctl-buf
 	      (eq (key-binding "q") 'ediff-quit-meta-buffer))
 	    ;; it's a meta-buffer -- last action should just display it
 	    (ediff-show-meta-buffer ctl-buf)
 	  ;; it's a session buffer -- invoke go back to session
-	  (ediff-eval-in-buffer ctl-buf
+	  (ediff-with-current-buffer ctl-buf
 	    (setq ediff-mouse-pixel-position (mouse-pixel-position))
 	    (ediff-recenter 'no-rehighlight)))
       (beep)
       (message "You've selected a stale session --- try again")
       (ediff-update-registry))
-    (ediff-eval-in-buffer buf
+    (ediff-with-current-buffer buf
       (goto-char pos))
     ))
 
@@ -1417,7 +1417,7 @@
 	    "Can't find this session's group panel -- session itself is ok")))
 
     (ediff-cleanup-meta-buffer meta-buf)
-    (ediff-eval-in-buffer meta-buf
+    (ediff-with-current-buffer meta-buf
       (save-excursion
 	(cond ((setq wind (ediff-get-visible-buffer-window meta-buf))
 	       (or silent
@@ -1461,7 +1461,7 @@
 	 (meta-buf (ediff-event-buffer last-command-event))
 	 (info (ediff-get-meta-info meta-buf pos))
 	 (meta-or-session-buf info))
-    (ediff-eval-in-buffer meta-or-session-buf
+    (ediff-with-current-buffer meta-or-session-buf
       (ediff-show-meta-buffer))))
 
 ;;;###autoload
@@ -1474,7 +1474,7 @@
   (let (wind frame)
     ;; for some reason, point moves in ediff-registry-buffer, so we preserve it
     ;; explicitly
-    (ediff-eval-in-buffer ediff-registry-buffer
+    (ediff-with-current-buffer ediff-registry-buffer
       (save-excursion
 	(cond  ((setq wind
 		      (ediff-get-visible-buffer-window ediff-registry-buffer))
@@ -1516,14 +1516,14 @@
 ;; parent meta-buf
 ;; Check if META-BUF exists before calling this function
 (defun ediff-update-meta-buffer (meta-buf)
-  (ediff-eval-in-buffer (current-buffer)
+  (ediff-with-current-buffer (current-buffer)
     (if (ediff-buffer-live-p meta-buf)
-	(ediff-eval-in-buffer meta-buf
+	(ediff-with-current-buffer meta-buf
 	  (funcall ediff-meta-redraw-function ediff-meta-list))
       )))
 
 (defun ediff-update-registry ()
-  (ediff-eval-in-buffer (current-buffer)
+  (ediff-with-current-buffer (current-buffer)
     (if (ediff-buffer-live-p ediff-registry-buffer)
 	(ediff-redraw-registry-buffer)
       (ediff-prepare-meta-buffer 
@@ -1538,7 +1538,7 @@
 ;; Otherwise, nothing happens.
 (defun ediff-cleanup-meta-buffer (meta-buffer)
   (if (ediff-buffer-live-p meta-buffer)
-      (ediff-eval-in-buffer meta-buffer
+      (ediff-with-current-buffer meta-buffer
 	(ediff-update-meta-buffer meta-buffer)
 	(if (ediff-buffer-live-p ediff-parent-meta-buffer)
 	    (ediff-update-meta-buffer ediff-parent-meta-buffer)))))
@@ -1550,7 +1550,7 @@
 	    (cont t)
 	    buffer-read-only)
 	(ediff-update-meta-buffer meta-buffer)
-	(ediff-eval-in-buffer meta-buffer
+	(ediff-with-current-buffer meta-buffer
 	  (setq lis (cdr lis)) ; discard the description part of meta-list
 	  (while (and cont lis)
 	    (if (ediff-buffer-live-p
@@ -1596,7 +1596,7 @@
 
 (defun ediff-dispose-of-meta-buffer (buf)
   (setq ediff-session-registry (delq buf ediff-session-registry))
-  (ediff-eval-in-buffer buf
+  (ediff-with-current-buffer buf
     (if (ediff-buffer-live-p ediff-dir-diffs-buffer)
 	(kill-buffer ediff-dir-diffs-buffer)))
   (kill-buffer buf))
@@ -1609,7 +1609,7 @@
 (defun ediff-get-meta-info (buf point &optional noerror)
   (let (result olist tmp)
     (if (and point (ediff-buffer-live-p buf))
-	(ediff-eval-in-buffer buf
+	(ediff-with-current-buffer buf
 	  (if ediff-xemacs-p
 	      (setq result
 		    (if (setq tmp (extent-at point buf 'ediff-meta-info))
@@ -1702,7 +1702,7 @@
 	(error
 	 "Patch has been already applied to this file--cannot be repeated!"))
 
-    (ediff-eval-in-buffer meta-patchbuf
+    (ediff-with-current-buffer meta-patchbuf
       (save-restriction
 	(widen)
 	(narrow-to-region beg-marker end-marker)
@@ -1747,8 +1747,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 ;;; ediff-mult.el ends here
--- a/lisp/ediff/ediff-ptch.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-ptch.el	Mon Aug 13 09:53:19 2007 +0200
@@ -155,7 +155,7 @@
 ;; no longer used
 ;; return the number of matches of regexp in buf starting from the beginning
 (defun ediff-count-matches (regexp buf)
-  (ediff-eval-in-buffer buf
+  (ediff-with-current-buffer buf
     (let ((count 0) opoint)
       (save-excursion
 	(goto-char (point-min))
@@ -174,7 +174,7 @@
 ;; it for the end. This list is then assigned to ediff-patch-map.
 ;; Returns the number of elements in the list ediff-patch-map
 (defun ediff-map-patch-buffer (buf)
-  (ediff-eval-in-buffer buf
+  (ediff-with-current-buffer buf
     (let ((count 0)
 	  (mark1 (move-marker (make-marker) (point-min)))
 	  (mark1-end (point-min))
@@ -403,7 +403,7 @@
 	     (read-file-name "Which file contains the patch? "
 			     dir nil 'must-match))))
     
-    (ediff-eval-in-buffer patch-buf
+    (ediff-with-current-buffer patch-buf
       (goto-char (point-min))
       (or (ediff-get-visible-buffer-window patch-buf)
 	  (progn
@@ -418,7 +418,7 @@
 ;; Should return either the ctl buffer or the meta-buffer
 (defun ediff-dispatch-file-patching-job (patch-buf filename
 						   &optional startup-hooks)
-  (ediff-eval-in-buffer patch-buf
+  (ediff-with-current-buffer patch-buf
     ;; relativize names in the patch with respect to source-file
     (ediff-fixup-patch-map filename)
     (if (< (length ediff-patch-map) 2)
@@ -438,7 +438,7 @@
   (let* ((buf-to-patch (get-buffer buf-to-patch-name))
 	 (file-name-ok (if buf-to-patch (buffer-file-name  buf-to-patch)))
 	 (buf-mod-status (buffer-modified-p buf-to-patch))
-	 (multifile-patch-p (> (length (ediff-eval-in-buffer patch-buf
+	 (multifile-patch-p (> (length (ediff-with-current-buffer patch-buf
 					 ediff-patch-map)) 1))
 	 default-dir file-name ctl-buf)
     (if file-name-ok
@@ -446,7 +446,7 @@
       (if multifile-patch-p
 	  (error
 	   "Can't apply multi-file patches to buffers that visit no files"))
-      (ediff-eval-in-buffer buf-to-patch
+      (ediff-with-current-buffer buf-to-patch
 	(setq default-dir default-directory)
 	(setq file-name (ediff-make-temp-file buf-to-patch))
 	(set-visited-file-name file-name)
@@ -466,15 +466,15 @@
 	()
       ;; buffer wasn't visiting any file,
       ;; so we will not run meta-level ediff here
-      (ediff-eval-in-buffer ctl-buf
+      (ediff-with-current-buffer ctl-buf
 	(delete-file (buffer-file-name ediff-buffer-A))
 	(delete-file (buffer-file-name ediff-buffer-B))
-	(ediff-eval-in-buffer ediff-buffer-A
+	(ediff-with-current-buffer ediff-buffer-A
 	  (if default-dir (setq default-directory default-dir))
 	  (set-visited-file-name nil)
 	  (rename-buffer buf-to-patch-name)
 	  (set-buffer-modified-p buf-mod-status))
-	(ediff-eval-in-buffer ediff-buffer-B
+	(ediff-with-current-buffer ediff-buffer-B
 	  (setq buffer-auto-save-file-name nil) ; don't create auto-save file
 	  (if default-dir (setq default-directory default-dir))
 	  (set-visited-file-name nil)
@@ -496,7 +496,7 @@
 	 (true-source-filename source-filename)
 	 (target-filename source-filename)
 	 target-buf buf-to-patch file-name-magic-p 
-	 patch-return-code ctl-buf backup-style)
+	 patch-return-code ctl-buf backup-style aux-wind)
 	  
     (if (string-match "-V" ediff-patch-options)
 	(error
@@ -520,7 +520,7 @@
     ;; could be checked back in.
     (ediff-maybe-checkout buf-to-patch)
 
-    (ediff-eval-in-buffer patch-diagnostics
+    (ediff-with-current-buffer patch-diagnostics
       (insert-buffer patch-buf)
       (message "Applying patch ... ")
       ;; fix environment for gnu patch, so it won't make numbered extensions
@@ -593,7 +593,7 @@
     ;; old-name_orig) and the result of patching will have the same name as
     ;; the original.
     (if (not file-name-magic-p)
-	(ediff-eval-in-buffer buf-to-patch
+	(ediff-with-current-buffer buf-to-patch
 	  (set-visited-file-name
 	   (concat source-filename ediff-backup-extension))
 	  (set-buffer-modified-p nil))
@@ -626,7 +626,7 @@
 	  (ediff-buffers-internal
 	   buf-to-patch target-buf nil
 	   startup-hooks 'epatch))
-    (ediff-eval-in-buffer ctl-buf
+    (ediff-with-current-buffer ctl-buf
       (setq ediff-patchbufer patch-buf
 	    ediff-patch-diagnostics patch-diagnostics))
   
@@ -648,7 +648,7 @@
 		startup-hooks))
     (setq meta-buf (ediff-prepare-meta-buffer 
 		    'ediff-filegroup-action
-		    (ediff-eval-in-buffer patch-buf
+		    (ediff-with-current-buffer patch-buf
 		      ;; nil replaces a regular expression
 		      (cons (list nil (format "%S" patch-buf))
 			    ediff-patch-map))
@@ -664,8 +664,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 ;;; ediff-ptch.el ends here
--- a/lisp/ediff/ediff-tbar.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-tbar.el	Mon Aug 13 09:53:19 2007 +0200
@@ -239,7 +239,7 @@
 	     (lambda (type)
 	       (let ((ebuf (ediff-get-buffer type)))
 		 (and (ediff-buffer-live-p ebuf)
-		      (ediff-eval-in-buffer ebuf
+		      (ediff-with-current-buffer ebuf
 			(and (buffer-modified-p)
 			     (save-buffer)))))))
 	    '(A B C))))
@@ -364,8 +364,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 ;;; ediff-tbar.el ends here
--- a/lisp/ediff/ediff-util.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-util.el	Mon Aug 13 09:53:19 2007 +0200
@@ -260,9 +260,9 @@
 	    (ediff-convert-standard-filename (expand-file-name file-C))))
   (let* ((control-buffer-name 
 	  (ediff-unique-buffer-name "*Ediff Control Panel" "*"))
-	 (control-buffer (ediff-eval-in-buffer buffer-A
+	 (control-buffer (ediff-with-current-buffer buffer-A
 			   (get-buffer-create control-buffer-name))))
-    (ediff-eval-in-buffer control-buffer
+    (ediff-with-current-buffer control-buffer
       (ediff-mode)                 
 	
       (make-local-variable 'ediff-use-long-help-message)
@@ -325,7 +325,7 @@
 	    (save-excursion
 	      (set-buffer buffer-C)
 	      (insert-buffer buf)
-	      (funcall (ediff-eval-in-buffer buf major-mode))
+	      (funcall (ediff-with-current-buffer buf major-mode))
 	      ;; after Stig@hackvan.com
 	      (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t)
 	      )))
@@ -354,12 +354,12 @@
       (setq ediff-error-buffer
 	    (get-buffer-create (ediff-unique-buffer-name "*ediff-errors" "*")))
       
-      (ediff-eval-in-buffer buffer-A (ediff-strip-mode-line-format))
-      (ediff-eval-in-buffer buffer-B (ediff-strip-mode-line-format))
+      (ediff-with-current-buffer buffer-A (ediff-strip-mode-line-format))
+      (ediff-with-current-buffer buffer-B (ediff-strip-mode-line-format))
       (if ediff-3way-job
-	  (ediff-eval-in-buffer buffer-C (ediff-strip-mode-line-format)))
+	  (ediff-with-current-buffer buffer-C (ediff-strip-mode-line-format)))
       (if (ediff-buffer-live-p ediff-ancestor-buffer)
-	  (ediff-eval-in-buffer ediff-ancestor-buffer
+	  (ediff-with-current-buffer ediff-ancestor-buffer
 	    (ediff-strip-mode-line-format)))
       
       (ediff-save-protected-variables) ; save variables to be restored on exit
@@ -392,13 +392,13 @@
       (or ediff-narrow-bounds
 	  (setq ediff-narrow-bounds ediff-wide-bounds))
       
-      ;; All these must be inside ediff-eval-in-buffer control-buffer,
+      ;; All these must be inside ediff-with-current-buffer control-buffer,
       ;; since these vars are local to control-buffer
       ;; These won't run if there are errors in diff
-      (ediff-eval-in-buffer ediff-buffer-A
+      (ediff-with-current-buffer ediff-buffer-A
 	(ediff-nuke-selective-display)
 	(run-hooks 'ediff-prepare-buffer-hook)
-	(if (ediff-eval-in-buffer control-buffer ediff-merge-job)
+	(if (ediff-with-current-buffer control-buffer ediff-merge-job)
 	    (setq buffer-read-only t))
 	;; add control-buffer to the list of sessions--no longer used, but may
 	;; be used again in the future
@@ -409,10 +409,10 @@
 	    (setq buffer-read-only t))
 	)
 
-      (ediff-eval-in-buffer ediff-buffer-B
+      (ediff-with-current-buffer ediff-buffer-B
 	(ediff-nuke-selective-display)
 	(run-hooks 'ediff-prepare-buffer-hook)
-	(if (ediff-eval-in-buffer control-buffer ediff-merge-job)
+	(if (ediff-with-current-buffer control-buffer ediff-merge-job)
 	    (setq buffer-read-only t))
 	;; add control-buffer to the list of sessions
 	(or (memq control-buffer ediff-this-buffer-ediff-sessions)
@@ -423,7 +423,7 @@
 	)
 
       (if ediff-3way-job
-	  (ediff-eval-in-buffer ediff-buffer-C
+	  (ediff-with-current-buffer ediff-buffer-C
 	    (ediff-nuke-selective-display)
 	    (run-hooks 'ediff-prepare-buffer-hook)
 	    ;; add control-buffer to the list of sessions
@@ -436,7 +436,7 @@
 	    ))
 
       (if (ediff-buffer-live-p ediff-ancestor-buffer)
-	  (ediff-eval-in-buffer ediff-ancestor-buffer
+	  (ediff-with-current-buffer ediff-ancestor-buffer
 	    (ediff-nuke-selective-display)
 	    (setq buffer-read-only t)
 	    (run-hooks 'ediff-prepare-buffer-hook)
@@ -548,27 +548,19 @@
   (interactive)
   (ediff-barf-if-not-control-buffer)
   (if (and (ediff-buffer-live-p ediff-ancestor-buffer)
-	   (not (y-or-n-p "Recompute differences during merge, really? ")))
-      (error "God forbid!"))
+	   (not
+	    (y-or-n-p
+	     "Ancestor buffer will not be used. Recompute diffs anyway? ")))
+      (error "Recomputation of differences canceled"))
       
-  (let ((point-A (ediff-eval-in-buffer ediff-buffer-A (point)))
-	;;(point-B (ediff-eval-in-buffer ediff-buffer-B (point)))
+  (let ((point-A (ediff-with-current-buffer ediff-buffer-A (point)))
+	;;(point-B (ediff-with-current-buffer ediff-buffer-B (point)))
 	(tmp-buffer (get-buffer-create ediff-tmp-buffer))
-	(buf-A-file-name
-	 (file-name-nondirectory (or (buffer-file-name ediff-buffer-A)
-				     (buffer-name ediff-buffer-A)
-				     )))
-	(buf-B-file-name
-	 (file-name-nondirectory (or (buffer-file-name ediff-buffer-B)
-				     (buffer-name ediff-buffer-B)
-				     )))
-	(buf-C-file-name
-	 (file-name-nondirectory (or (buffer-file-name ediff-buffer-C)
-				     ;; if (null ediff-buffer-C), there is
-				     ;; no danger, since we later check if
-				     ;; ediff-buffer-C is alive
-				     (buffer-name ediff-buffer-C)
-				     )))
+	(buf-A-file-name (buffer-file-name ediff-buffer-A))
+	(buf-B-file-name (buffer-file-name ediff-buffer-B))
+	;; (null ediff-buffer-C) is no problem, as we later check if
+	;; ediff-buffer-C is alive
+	(buf-C-file-name (buffer-file-name ediff-buffer-C))
 	(overl-A (ediff-get-value-according-to-buffer-type
 		  'A ediff-narrow-bounds))
 	(overl-B (ediff-get-value-according-to-buffer-type
@@ -577,6 +569,14 @@
 		  'C ediff-narrow-bounds))
 	beg-A end-A beg-B end-B beg-C end-C
 	file-A file-B file-C)
+
+    (if (stringp buf-A-file-name)
+	(setq buf-A-file-name (file-name-nondirectory buf-A-file-name)))
+    (if (stringp buf-B-file-name)
+	(setq buf-B-file-name (file-name-nondirectory buf-B-file-name)))
+    (if (stringp buf-C-file-name)
+	(setq buf-C-file-name (file-name-nondirectory buf-C-file-name)))
+
     (ediff-unselect-and-select-difference -1)
     
     (setq beg-A (ediff-overlay-start overl-A)
@@ -659,13 +659,13 @@
 	(ancestor-job ediff-merge-with-ancestor-job)
 	(merge ediff-merge-job)
 	(comparison ediff-3way-comparison-job))
-    (ediff-eval-in-buffer bufA
+    (ediff-with-current-buffer bufA
       (revert-buffer t noconfirm))
-    (ediff-eval-in-buffer bufB
+    (ediff-with-current-buffer bufB
       (revert-buffer t noconfirm))
     ;; this should only be executed in a 3way comparison, not in merge
     (if comparison
-	(ediff-eval-in-buffer bufC
+	(ediff-with-current-buffer bufC
 	  (revert-buffer t noconfirm)))
     (if merge
 	(progn
@@ -753,7 +753,7 @@
 	  (if ediff-3way-job
 	      (ediff-recenter-one-window 'C))
 	  
-	  (ediff-eval-in-buffer control-buf
+	  (ediff-with-current-buffer control-buf
 	    (ediff-recenter-ancestor) ; check if ancestor is alive
 	    
 	    (if (and (ediff-multiframe-setup-p)
@@ -766,7 +766,7 @@
 	  ))
 
     (ediff-restore-highlighting)
-    (ediff-eval-in-buffer control-buf (ediff-refresh-mode-lines))
+    (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))
     ))
   
 ;; this function returns to the window it was called from
@@ -780,7 +780,8 @@
 		      buf-type ediff-narrow-bounds)))
 	     (job-name ediff-job-name)
 	     (control-buf ediff-control-buffer)
-	     (window-name (intern (format "ediff-window-%S" buf-type)))
+	     (window-name (ediff-get-symbol-from-alist
+			   buf-type ediff-window-alist))
 	     (window (if (window-live-p (symbol-value window-name))
 			 (symbol-value window-name))))
 	
@@ -808,7 +809,7 @@
 	    (ctl-wind (selected-window))
 	    (job-name ediff-job-name)
 	    (ctl-buf ediff-control-buffer))
-	(ediff-eval-in-buffer ediff-ancestor-buffer
+	(ediff-with-current-buffer ediff-ancestor-buffer
 	  (goto-char (ediff-get-diff-posn 'Ancestor 'beg nil ctl-buf))
 	  (if window
 	      (progn
@@ -960,7 +961,7 @@
     (or buf
 	(setq buf (ediff-get-buffer buf-type)))
 	      
-    (ediff-eval-in-buffer buf     ; eval in buf A/B/C
+    (ediff-with-current-buffer buf     ; eval in buf A/B/C
       (let* ((file (buffer-file-name buf))
 	     (file-writable (and file
 				 (file-exists-p file)
@@ -990,7 +991,7 @@
 		   ;; do this, the mode line will show %%, since the file was
 		   ;; RO before ediff started, so the user will think the file
 		   ;; is checked in.
-		   (ediff-eval-in-buffer ctl-buf
+		   (ediff-with-current-buffer ctl-buf
 		     (ediff-change-saved-variable
 		      'buffer-read-only nil buf-type)))
 		  (t
@@ -1027,7 +1028,7 @@
 	      (format
 	       "File %s is under version control. Check it out? "
 	       (ediff-abbreviate-file-name file))))
-	(ediff-eval-in-buffer buf
+	(ediff-with-current-buffer buf
 	  (command-execute checkout-function)))))
 	   
 
@@ -1178,7 +1179,7 @@
   (let ((ctl-buf ediff-control-buffer))
     (setq ediff-wide-display-p (not ediff-wide-display-p))
     (if (not ediff-wide-display-p)
-	(ediff-eval-in-buffer ctl-buf
+	(ediff-with-current-buffer ctl-buf
 	  (modify-frame-parameters
 	   ediff-wide-display-frame ediff-wide-display-orig-parameters)
 	  ;;(sit-for (if ediff-xemacs-p 0.4 0))
@@ -1190,7 +1191,7 @@
 	  (ediff-recenter 'no-rehighlight))
       (funcall ediff-make-wide-display-function)
       ;;(sit-for (if ediff-xemacs-p 0.4 0))
-      (ediff-eval-in-buffer ctl-buf
+      (ediff-with-current-buffer ctl-buf
 	(setq ediff-window-B nil) ; force update of window config
 	(ediff-recenter 'no-rehighlight)))))
 	
@@ -1216,7 +1217,7 @@
   (setq-default ediff-window-setup-function window-setup-func)
   ;; change in all active ediff sessions
   (mapcar (function (lambda(buf)
-		      (ediff-eval-in-buffer buf
+		      (ediff-with-current-buffer buf
 			(setq ediff-window-setup-function window-setup-func
 			      ediff-window-B nil))))
 	  ediff-session-registry)
@@ -1241,7 +1242,7 @@
 	(setq ediff-use-toolbar-p (not ediff-use-toolbar-p))
 	
 	(mapcar (function (lambda(buf)
-			    (ediff-eval-in-buffer buf
+			    (ediff-with-current-buffer buf
 			      ;; force redisplay
 			      (setq ediff-window-config-saved "")
 			      )))
@@ -1331,15 +1332,15 @@
 	  (overl-C (ediff-get-value-according-to-buffer-type
 		    'C  ediff-visible-bounds))
 	  )
-      (ediff-eval-in-buffer ediff-buffer-A
+      (ediff-with-current-buffer ediff-buffer-A
 	(narrow-to-region
 	 (ediff-overlay-start overl-A) (ediff-overlay-end overl-A)))
-      (ediff-eval-in-buffer ediff-buffer-B
+      (ediff-with-current-buffer ediff-buffer-B
 	(narrow-to-region
 	 (ediff-overlay-start overl-B) (ediff-overlay-end overl-B)))
       
       (if ediff-3way-job
-	  (ediff-eval-in-buffer ediff-buffer-C
+	  (ediff-with-current-buffer ediff-buffer-C
 	    (narrow-to-region
 	     (ediff-overlay-start overl-C) (ediff-overlay-end overl-C))))
       )))
@@ -1522,13 +1523,14 @@
 (defun ediff-get-lines-to-region-end (buf-type &optional n ctl-buf)
   (or n (setq n ediff-current-difference))
   (or ctl-buf (setq ctl-buf ediff-control-buffer))
-  (ediff-eval-in-buffer ctl-buf
+  (ediff-with-current-buffer ctl-buf
     (let* ((buf (ediff-get-buffer buf-type))
-	   (wind (eval (intern (format "ediff-window-%S" buf-type))))
+	   (wind (eval (ediff-get-symbol-from-alist
+			buf-type ediff-window-alist)))
 	   (beg (window-start wind))
 	   (end (ediff-get-diff-posn buf-type 'end))
 	   lines)
-      (ediff-eval-in-buffer buf
+      (ediff-with-current-buffer buf
 	(if (< beg end)
 	    (setq lines (count-lines beg end))
 	  (setq lines 0))
@@ -1539,12 +1541,13 @@
 (defun ediff-get-lines-to-region-start (buf-type &optional n ctl-buf)
   (or n (setq n ediff-current-difference))
   (or ctl-buf (setq ctl-buf ediff-control-buffer))
-  (ediff-eval-in-buffer ctl-buf
+  (ediff-with-current-buffer ctl-buf
     (let* ((buf (ediff-get-buffer buf-type))
-	   (wind (eval (intern (format "ediff-window-%S" buf-type))))
+	   (wind (eval (ediff-get-symbol-from-alist
+			buf-type ediff-window-alist)))
 	   (end (window-end wind))
 	   (beg (ediff-get-diff-posn buf-type 'beg)))
-      (ediff-eval-in-buffer buf
+      (ediff-with-current-buffer buf
 	(if (< beg end) (count-lines beg end) 0))
       )))
 
@@ -1557,7 +1560,7 @@
 ;;
 ;; If the difference region is invalid, the coefficient is 1
 (defun ediff-get-region-size-coefficient (buf-type op &optional n ctl-buf)
-  (ediff-eval-in-buffer (or ctl-buf ediff-control-buffer)
+  (ediff-with-current-buffer (or ctl-buf ediff-control-buffer)
     (if (ediff-valid-difference-p n)
 	(let* ((func (cond ((eq op 'scroll-down)
 			    'ediff-get-lines-to-region-start)
@@ -1684,11 +1687,11 @@
   (ediff-barf-if-not-control-buffer)
   (let* ((buf-type (ediff-char-to-buftype last-command-char))
 	 (buffer (ediff-get-buffer buf-type))
-	 (pt (ediff-eval-in-buffer buffer (point)))
+	 (pt (ediff-with-current-buffer buffer (point)))
 	 (diff-no (ediff-diff-at-point buf-type nil (if arg 'after)))
 	 (past-last-diff (< ediff-number-of-differences diff-no))
 	 (beg (if past-last-diff
-		  (ediff-eval-in-buffer buffer (point-max))
+		  (ediff-with-current-buffer buffer (point-max))
 		(ediff-get-diff-posn buf-type 'beg (1- diff-no))))
 	 ctl-wind wind-A wind-B wind-C
 	 shift)
@@ -1701,7 +1704,7 @@
 	  wind-C ediff-window-C)
     (if arg
 	(progn
-	  (ediff-eval-in-buffer buffer
+	  (ediff-with-current-buffer buffer
 	    (setq shift (- beg pt)))
 	  (select-window wind-A)
 	  (if past-last-diff (goto-char (point-max)))
@@ -1745,7 +1748,7 @@
 	(beg 0)
 	(end 0))
 	
-    (ediff-eval-in-buffer buffer
+    (ediff-with-current-buffer buffer
       (setq pos (or pos (point)))
       (while (and (or (< pos prev-beg) (> pos beg))
 		  (< diff-no max-dif-num))
@@ -1873,7 +1876,7 @@
       (if (or batch-invocation (ediff-test-save-region n to-buf-type))
 	  (condition-case conds
 	      (progn
-		(ediff-eval-in-buffer to-buf
+		(ediff-with-current-buffer to-buf
 		  ;; to prevent flags from interfering if buffer is writable
 		  (let ((inhibit-read-only (null buffer-read-only)))
 		    
@@ -1977,7 +1980,7 @@
     (setq reg-end (ediff-get-diff-posn buf-type 'end n ediff-control-buffer))
     
     (condition-case conds
-	(ediff-eval-in-buffer buf
+	(ediff-with-current-buffer buf
 	  (let ((inhibit-read-only (null buffer-read-only)))
 	    
 	    (goto-char reg-end)
@@ -2159,21 +2162,21 @@
 	     (regex-A ediff-regexp-focus-A)
 	     (regex-B ediff-regexp-focus-B)
 	     (regex-C ediff-regexp-focus-C)
-	     (reg-A-match (ediff-eval-in-buffer ediff-buffer-A
+	     (reg-A-match (ediff-with-current-buffer ediff-buffer-A
 			    (save-restriction
 			      (narrow-to-region
 			       (ediff-get-diff-posn 'A 'beg n ctl-buf)
 			       (ediff-get-diff-posn 'A 'end n ctl-buf))
 			      (goto-char (point-min))
 			      (re-search-forward regex-A nil t))))
-	     (reg-B-match (ediff-eval-in-buffer ediff-buffer-B
+	     (reg-B-match (ediff-with-current-buffer ediff-buffer-B
 			    (save-restriction
 			      (narrow-to-region
 			       (ediff-get-diff-posn 'B 'beg n ctl-buf)
 			       (ediff-get-diff-posn 'B 'end n ctl-buf))
 			      (re-search-forward regex-B nil t))))
 	     (reg-C-match (if ediff-3way-comparison-job
-			      (ediff-eval-in-buffer ediff-buffer-C
+			      (ediff-with-current-buffer ediff-buffer-C
 				(save-restriction
 				  (narrow-to-region
 				   (ediff-get-diff-posn 'C 'beg n ctl-buf)
@@ -2200,14 +2203,14 @@
 	     (regex-A ediff-regexp-hide-A)
 	     (regex-B ediff-regexp-hide-B)
 	     (regex-C ediff-regexp-hide-C)
-	     (reg-A-match (ediff-eval-in-buffer ediff-buffer-A
+	     (reg-A-match (ediff-with-current-buffer ediff-buffer-A
 			    (save-restriction
 			      (narrow-to-region
 			       (ediff-get-diff-posn 'A 'beg n ctl-buf)
 			       (ediff-get-diff-posn 'A 'end n ctl-buf))
 			      (goto-char (point-min))
 			      (re-search-forward regex-A nil t))))
-	     (reg-B-match (ediff-eval-in-buffer ediff-buffer-B
+	     (reg-B-match (ediff-with-current-buffer ediff-buffer-B
 			    (save-restriction
 			      (narrow-to-region
 			       (ediff-get-diff-posn 'B 'beg n ctl-buf)
@@ -2215,7 +2218,7 @@
 			      (goto-char (point-min))
 			      (re-search-forward regex-B nil t))))
 	     (reg-C-match (if ediff-3way-comparison-job
-			      (ediff-eval-in-buffer ediff-buffer-C
+			      (ediff-with-current-buffer ediff-buffer-C
 				(save-restriction
 				  (narrow-to-region
 				   (ediff-get-diff-posn 'C 'beg n ctl-buf)
@@ -2295,7 +2298,7 @@
 			       (window-frame ediff-window-B))
 			      (t (next-frame))))))
     (condition-case nil
-	(ediff-eval-in-buffer ediff-buffer-A
+	(ediff-with-current-buffer ediff-buffer-A
 	  (setq ediff-this-buffer-ediff-sessions 
 		(delq control-buffer ediff-this-buffer-ediff-sessions))
 	  (kill-local-variable 'mode-line-buffer-identification)
@@ -2304,7 +2307,7 @@
       (error))
       
     (condition-case nil
-	(ediff-eval-in-buffer ediff-buffer-B
+	(ediff-with-current-buffer ediff-buffer-B
 	  (setq ediff-this-buffer-ediff-sessions 
 		(delq control-buffer ediff-this-buffer-ediff-sessions))
 	  (kill-local-variable 'mode-line-buffer-identification)
@@ -2313,7 +2316,7 @@
       (error))
     
     (condition-case nil
-	(ediff-eval-in-buffer ediff-buffer-C
+	(ediff-with-current-buffer ediff-buffer-C
 	  (setq ediff-this-buffer-ediff-sessions 
 		(delq control-buffer ediff-this-buffer-ediff-sessions))
 	  (kill-local-variable 'mode-line-buffer-identification)
@@ -2322,7 +2325,7 @@
       (error))
 
     (condition-case nil
-	(ediff-eval-in-buffer ediff-ancestor-buffer
+	(ediff-with-current-buffer ediff-ancestor-buffer
 	  (setq ediff-this-buffer-ediff-sessions 
 		(delq control-buffer ediff-this-buffer-ediff-sessions))
 	  (kill-local-variable 'mode-line-buffer-identification)
@@ -2494,7 +2497,7 @@
 	       (ediff-write-merge-buffer-and-maybe-kill
 		ediff-buffer-C merge-store-file nil save-and-continue))
 	      ((and (ediff-buffer-live-p ediff-meta-buffer)
-		    (ediff-eval-in-buffer ediff-meta-buffer
+		    (ediff-with-current-buffer ediff-meta-buffer
 		      (ediff-merge-metajob)))
 	       ;; This case shouldn't occur, as the parent metajob must pass on
 	       ;; a file name, ediff-merge-store-file, where to save the result
@@ -2511,7 +2514,7 @@
 (defun ediff-write-merge-buffer-and-maybe-kill (buf file
 					       &optional
 					       show-file save-and-continue)
-  (ediff-eval-in-buffer buf
+  (ediff-with-current-buffer buf
     (if (or (not (file-exists-p file))
 	    (y-or-n-p (format "File %s exists, overwrite? " file)))
 	(progn
@@ -2605,20 +2608,20 @@
     (raise-frame (selected-frame))
     (princ (ediff-version))
     (princ "\n\n")
-    (ediff-eval-in-buffer ediff-buffer-A
+    (ediff-with-current-buffer ediff-buffer-A
       (if buffer-file-name
 	  (princ
 	   (format "File A = %S\n" buffer-file-name))
 	(princ 
 	 (format "Buffer A = %S\n" (buffer-name)))))
-    (ediff-eval-in-buffer ediff-buffer-B
+    (ediff-with-current-buffer ediff-buffer-B
       (if buffer-file-name
 	  (princ
 	   (format "File B = %S\n" buffer-file-name))
 	(princ 
 	 (format "Buffer B = %S\n" (buffer-name)))))
     (if ediff-3way-job
-	(ediff-eval-in-buffer ediff-buffer-C
+	(ediff-with-current-buffer ediff-buffer-C
 	  (if buffer-file-name
 	      (princ
 	       (format "File C = %S\n" buffer-file-name))
@@ -2635,16 +2638,16 @@
 			       (buffer-name ediff-diff-buffer))
 		     " is not available")))
 			      
-    (let* ((A-line (ediff-eval-in-buffer ediff-buffer-A
+    (let* ((A-line (ediff-with-current-buffer ediff-buffer-A
 		     (1+ (count-lines (point-min) (point)))))
-	   (B-line (ediff-eval-in-buffer ediff-buffer-B
+	   (B-line (ediff-with-current-buffer ediff-buffer-B
 		     (1+ (count-lines (point-min) (point)))))
 	   C-line)
       (princ (format "\Buffer A's point is on line %d\n" A-line))
       (princ (format "Buffer B's point is on line %d\n" B-line))
       (if ediff-3way-job
 	  (progn
-	    (setq C-line (ediff-eval-in-buffer ediff-buffer-C
+	    (setq C-line (ediff-with-current-buffer ediff-buffer-C
 			   (1+ (count-lines (point-min) (point)))))
 	    (princ (format "Buffer C's point is on line %d\n" C-line)))))
       
@@ -2780,7 +2783,7 @@
 	  (setq ediff-current-difference n)
 	  ) ; end protected section
       
-      (ediff-eval-in-buffer control-buf (ediff-refresh-mode-lines))
+      (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))
       )))
 
 
@@ -2861,7 +2864,7 @@
 		  (t (make-temp-name f))))
     
     ;; create the file
-    (ediff-eval-in-buffer buff
+    (ediff-with-current-buffer buff
       (write-region (if start start (point-min))
 		    (if end end (point-max))
 		    f
@@ -2926,7 +2929,7 @@
   (interactive "P")
   (ediff-barf-if-not-control-buffer)
   (ediff-compute-custom-diffs-maybe)
-  (ediff-eval-in-buffer
+  (ediff-with-current-buffer
       (cond ((memq last-command-char '(?a ?b ?c))
 	     (ediff-get-buffer
 	      (ediff-char-to-buftype last-command-char)))
@@ -2983,7 +2986,7 @@
 		    nil))))
     (if buf
 	(progn
-	  (ediff-eval-in-buffer buf
+	  (ediff-with-current-buffer buf
 	    (goto-char (point-min)))
 	  (switch-to-buffer buf)
 	  (raise-frame (selected-frame)))))
@@ -3032,7 +3035,8 @@
 			 (setq possibilities (delq answer possibilities))
 			 (setq bufA
 			       (eval
-				(intern (format "ediff-buffer-%c" answer))))
+				(ediff-get-symbol-from-alist
+				 answer ediff-buffer-alist)))
 			 nil)
 			((equal answer ""))
 			(t (beep 1)
@@ -3050,7 +3054,8 @@
 			 (setq possibilities (delq answer possibilities))
 			 (setq bufB
 			       (eval
-				(intern (format "ediff-buffer-%c" answer))))
+				(ediff-get-symbol-from-alist
+				 answer ediff-buffer-alist)))
 			 nil)
 			((equal answer ""))
 			(t (beep 1)
@@ -3068,7 +3073,7 @@
 		 bufB ediff-buffer-B
 		 possibilities nil)))
 
-    (ediff-eval-in-buffer bufA
+    (ediff-with-current-buffer bufA
       (or (mark t)
 	  (error "You forgot to specify a region in buffer %s" (buffer-name)))
       (setq begA (region-beginning)
@@ -3080,7 +3085,7 @@
       (end-of-line)
       (or (eobp) (forward-char)) ; include the newline char
       (setq endA (point)))
-    (ediff-eval-in-buffer bufB
+    (ediff-with-current-buffer bufB
       (or (mark t)
 	  (error "You forgot to specify a region in buffer %s" (buffer-name)))
       (setq begB (region-beginning)
@@ -3097,14 +3102,14 @@
      ediff-current-difference 'unselect-only)
     (ediff-paint-background-regions 'unhighlight)
 
-    (ediff-eval-in-buffer bufA
+    (ediff-with-current-buffer bufA
       (goto-char begA)
       (set-mark endA)
       (narrow-to-region begA endA)
       ;; (ediff-activate-mark)
       )
     ;; (sit-for 0)
-    (ediff-eval-in-buffer bufB
+    (ediff-with-current-buffer bufB
       (goto-char begB)
       (set-mark endB)
       (narrow-to-region begB endB)
@@ -3116,11 +3121,11 @@
     ;; that was not selected, or it is nil. We delete the window that is not
     ;; selected.
     (if possibilities
-	(ediff-eval-in-buffer ctl-buf
+	(ediff-with-current-buffer ctl-buf
 	  (let* ((wind-to-delete (eval
-				  (intern
-				   (format
-				    "ediff-window-%c" (car possibilities)))))
+				  (ediff-get-symbol-from-alist
+				   (car possibilities)
+				    ediff-window-alist)))
 		 (frame (window-frame wind-to-delete)))
 	    (delete-window wind-to-delete)
 	    (select-frame frame)
@@ -3129,12 +3134,12 @@
 	 "Please check regions selected for comparison. Continue? ")
 	(setq quit-now t))
     
-    (ediff-eval-in-buffer bufA
+    (ediff-with-current-buffer bufA
       (widen))
-    (ediff-eval-in-buffer bufB
+    (ediff-with-current-buffer bufB
       (widen))
     (if quit-now
-	(ediff-eval-in-buffer ctl-buf
+	(ediff-with-current-buffer ctl-buf
 	  (ediff-recenter)
 	  (sit-for 0)
 	  (error "All right. Make up your mind and come back...")))
@@ -3151,7 +3156,7 @@
     
 
 (defun ediff-remove-flags-from-buffer (buffer overlay)
-  (ediff-eval-in-buffer buffer
+  (ediff-with-current-buffer buffer
     (let ((inhibit-read-only t))
       (if ediff-xemacs-p
 	  (ediff-overlay-put overlay 'begin-glyph nil)
@@ -3165,12 +3170,12 @@
 
 
 (defun ediff-place-flags-in-buffer (buf-type buffer ctl-buffer diff)
-  (ediff-eval-in-buffer buffer
+  (ediff-with-current-buffer buffer
     (ediff-place-flags-in-buffer1 buf-type ctl-buffer diff)))
 
 
 (defun ediff-place-flags-in-buffer1 (buf-type ctl-buffer diff-no)
-  (let* ((curr-overl (ediff-eval-in-buffer ctl-buffer
+  (let* ((curr-overl (ediff-with-current-buffer ctl-buffer
 		       (ediff-get-diff-overlay diff-no buf-type)))
 	 (before (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer))
 	 after beg-of-line flag)
@@ -3179,7 +3184,7 @@
     (goto-char before)
     (setq beg-of-line (bolp))
     
-    (setq flag (ediff-eval-in-buffer ctl-buffer
+    (setq flag (ediff-with-current-buffer ctl-buffer
 		 (if (eq ediff-highlighting-style 'ascii)
 		     (if beg-of-line
 			 ediff-before-flag-bol ediff-before-flag-mol))))
@@ -3195,7 +3200,7 @@
     (goto-char after)
     (setq beg-of-line (bolp))
     
-    (setq flag (ediff-eval-in-buffer ctl-buffer
+    (setq flag (ediff-with-current-buffer ctl-buffer
 		 (if (eq ediff-highlighting-style 'ascii)
 		     (if beg-of-line
 			 ediff-after-flag-eol ediff-after-flag-mol))))
@@ -3222,7 +3227,7 @@
     (or control-buf
 	(setq control-buf (current-buffer)))
 
-    (ediff-eval-in-buffer control-buf
+    (ediff-with-current-buffer control-buf
       (or n  (setq n ediff-current-difference))
       (if (or (< n 0) (>= n ediff-number-of-differences))
 	  (if (> ediff-number-of-differences 0)
@@ -3241,7 +3246,7 @@
 ;; Restore highlighting to what it should be according to ediff-use-faces,
 ;; ediff-highlighting-style, and ediff-highlight-all-diffs variables.
 (defun ediff-restore-highlighting (&optional ctl-buf)
-  (ediff-eval-in-buffer (or ctl-buf (current-buffer))
+  (ediff-with-current-buffer (or ctl-buf (current-buffer))
     (if (and (ediff-has-face-support-p) 
 	     ediff-use-faces
 	     ediff-highlight-all-diffs)
@@ -3281,7 +3286,7 @@
 (defun ediff-make-bullet-proof-overlay (beg end buff)
   (if (ediff-buffer-live-p buff)
       (let (overl)
-	(ediff-eval-in-buffer buff
+	(ediff-with-current-buffer buff
 	  (or (number-or-marker-p beg)
 	      (setq beg (eval beg)))
 	  (or (number-or-marker-p end)
@@ -3354,22 +3359,6 @@
       (format "%s<%d>%s" prefix n suffix))))
   
 
-;; splits at a white space, returns a list
-(defun ediff-split-string (string)
-  (let ((start 0)
-        (result '())
-	substr)
-    (while (string-match "[ \t]+" string start)
-      (let ((match (string-match "[ \t]+" string start)))
-	(setq substr (substring string start match))
-	(if (> (length substr) 0)
-	    (setq result (cons substr result)))
-        (setq start (match-end 0))))
-    (setq substr (substring string start nil))
-    (if (> (length substr) 0)
-	(setq result (cons substr result)))
-    (nreverse result)))
-
 (defun ediff-submit-report ()
   "Submit bug report on Ediff."
   (interactive)
@@ -3459,7 +3448,7 @@
       (bury-buffer)
       (beep 1)(message "Bug report aborted")
       (if (ediff-buffer-live-p ctl-buf)
-	  (ediff-eval-in-buffer ctl-buf
+	  (ediff-with-current-buffer ctl-buf
 	    (ediff-recenter 'no-rehighlight))))
     ))
 			     
@@ -3511,9 +3500,9 @@
 
 (defun ediff-change-saved-variable (var value buf-type)
   (let* ((assoc-list
-	  (symbol-value (intern
-			 (concat "ediff-buffer-values-orig-"
-				 (symbol-name buf-type)))))
+	  (symbol-value (ediff-get-symbol-from-alist
+			 buf-type
+			 ediff-buffer-values-orig-alist)))
 	 (assoc-elt (assoc var assoc-list)))
   (if assoc-elt
       (setcdr assoc-elt value))))
@@ -3522,18 +3511,18 @@
 ;; must execute in control buf
 (defun ediff-save-protected-variables ()
   (setq ediff-buffer-values-orig-A
-	(ediff-eval-in-buffer ediff-buffer-A
+	(ediff-with-current-buffer ediff-buffer-A
 	  (ediff-save-variables ediff-protected-variables)))
   (setq ediff-buffer-values-orig-B
-	(ediff-eval-in-buffer ediff-buffer-B
+	(ediff-with-current-buffer ediff-buffer-B
 	  (ediff-save-variables ediff-protected-variables)))
   (if ediff-3way-comparison-job
       (setq ediff-buffer-values-orig-C
-	    (ediff-eval-in-buffer ediff-buffer-C
+	    (ediff-with-current-buffer ediff-buffer-C
 	      (ediff-save-variables ediff-protected-variables))))
   (if (ediff-buffer-live-p ediff-ancestor-buffer)
       (setq ediff-buffer-values-orig-Ancestor
-	    (ediff-eval-in-buffer ediff-ancestor-buffer
+	    (ediff-with-current-buffer ediff-ancestor-buffer
 	      (ediff-save-variables ediff-protected-variables)))))
 
 ;; must execute in control buf
@@ -3542,21 +3531,21 @@
 	(values-B ediff-buffer-values-orig-B)
 	(values-C ediff-buffer-values-orig-C)
 	(values-Ancestor ediff-buffer-values-orig-Ancestor))
-    (ediff-eval-in-buffer ediff-buffer-A
+    (ediff-with-current-buffer ediff-buffer-A
       (ediff-restore-variables ediff-protected-variables values-A))
-    (ediff-eval-in-buffer ediff-buffer-B
+    (ediff-with-current-buffer ediff-buffer-B
       (ediff-restore-variables ediff-protected-variables values-B))
     (if ediff-3way-comparison-job
-	(ediff-eval-in-buffer ediff-buffer-C
+	(ediff-with-current-buffer ediff-buffer-C
 	  (ediff-restore-variables ediff-protected-variables values-C)))
     (if (ediff-buffer-live-p ediff-ancestor-buffer)
-	(ediff-eval-in-buffer ediff-ancestor-buffer
+	(ediff-with-current-buffer ediff-ancestor-buffer
 	  (ediff-restore-variables ediff-protected-variables values-Ancestor)))
     ))
 
 ;; save BUFFER in FILE. used in hooks.
 (defun ediff-save-buffer-in-file (buffer file)
-  (ediff-eval-in-buffer buffer
+  (ediff-with-current-buffer buffer
     (write-file file)))
 
 
@@ -3698,8 +3687,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 ;;; ediff-util.el ends here
--- a/lisp/ediff/ediff-vers.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-vers.el	Mon Aug 13 09:53:19 2007 +0200
@@ -359,8 +359,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 (provide 'ediff-vers)
--- a/lisp/ediff/ediff-wind.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff-wind.el	Mon Aug 13 09:53:19 2007 +0200
@@ -110,6 +110,15 @@
 ;; Used to minimize the need to rearrange windows.
 (ediff-defvar-local ediff-window-config-saved "" "")
 
+;; Association between buff-type and ediff-window-*
+(defconst ediff-window-alist
+  '((A . ediff-window-A)
+    (?A . ediff-window-A)
+    (B . ediff-window-B)
+    (?B . ediff-window-B)
+    (C . ediff-window-C)
+    (?C . ediff-window-C)))
+
 
 (defcustom ediff-split-window-function 'split-window-vertically
   "*The function used to split the main window between buffer-A and buffer-B.
@@ -304,7 +313,7 @@
   
   (or (ediff-keep-window-config control-buffer)
       (funcall 
-       (ediff-eval-in-buffer control-buffer ediff-window-setup-function)
+       (ediff-with-current-buffer control-buffer ediff-window-setup-function)
        buffer-A buffer-B buffer-C control-buffer))
   (run-hooks 'ediff-after-setup-windows-hook))
 
@@ -312,7 +321,7 @@
 ;; Usually used without windowing systems
 ;; With windowing, we want to use dedicated frames.
 (defun ediff-setup-windows-plain (buffer-A buffer-B buffer-C control-buffer)
-  (ediff-eval-in-buffer control-buffer
+  (ediff-with-current-buffer control-buffer
     (setq ediff-multiframe nil))
   (if ediff-merge-job
       (ediff-setup-windows-plain-merge
@@ -327,7 +336,7 @@
 	split-window-function 
 	merge-window-share merge-window-lines
 	wind-A wind-B wind-C)
-    (ediff-eval-in-buffer control-buffer
+    (ediff-with-current-buffer control-buffer
       (setq merge-window-share ediff-merge-window-share
 	    ;; this lets us have local versions of ediff-split-window-function
 	    split-window-function ediff-split-window-function))
@@ -362,7 +371,7 @@
     (switch-to-buffer buf-B)
     (setq wind-B (selected-window))
 	  
-    (ediff-eval-in-buffer control-buffer
+    (ediff-with-current-buffer control-buffer
       (setq ediff-window-A wind-A
 	    ediff-window-B wind-B
 	    ediff-window-C wind-C))
@@ -380,7 +389,7 @@
 	split-window-function wind-width-or-height
 	three-way-comparison
 	wind-A-start wind-B-start wind-A wind-B wind-C)
-    (ediff-eval-in-buffer control-buffer
+    (ediff-with-current-buffer control-buffer
       (setq wind-A-start (ediff-overlay-start
 			  (ediff-get-value-according-to-buffer-type
 			   'A ediff-narrow-bounds))
@@ -426,7 +435,7 @@
 	  (switch-to-buffer buf-C)
 	  (setq wind-C (selected-window))))
 	  
-    (ediff-eval-in-buffer control-buffer
+    (ediff-with-current-buffer control-buffer
       (setq ediff-window-A wind-A
 	    ediff-window-B wind-B
 	    ediff-window-C wind-C))
@@ -445,7 +454,7 @@
     
 ;; dispatch an appropriate window setup function
 (defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf)
-  (ediff-eval-in-buffer control-buf
+  (ediff-with-current-buffer control-buf
     (setq ediff-multiframe t))
   (if ediff-merge-job
       (ediff-setup-windows-multiframe-merge buf-A buf-B buf-C control-buf)
@@ -476,10 +485,10 @@
 	 (frame-C (if wind-C (window-frame wind-C)))
 	 ;; on wide display, do things in one frame
 	 (force-one-frame 
-	  (ediff-eval-in-buffer control-buf ediff-wide-display-p))
+	  (ediff-with-current-buffer control-buf ediff-wide-display-p))
 	 ;; this lets us have local versions of ediff-split-window-function
 	 (split-window-function 
-	  (ediff-eval-in-buffer control-buf ediff-split-window-function))
+	  (ediff-with-current-buffer control-buf ediff-split-window-function))
 	 (orig-wind (selected-window))
 	 (orig-frame (selected-frame))
 	 (use-same-frame (or force-one-frame
@@ -501,7 +510,7 @@
 	 ;; use-same-frame-for-AB implies wind A and B are ok for display
 	 (use-same-frame-for-AB (and (not use-same-frame)
 				     (eq frame-A frame-B)))
-	 (merge-window-share (ediff-eval-in-buffer control-buf
+	 (merge-window-share (ediff-with-current-buffer control-buf
 			       ediff-merge-window-share))
 	 merge-window-lines
 	 designated-minibuffer-frame
@@ -623,7 +632,7 @@
 	  (setq wind-C (selected-window))
 	  ))
     
-    (ediff-eval-in-buffer control-buf
+    (ediff-with-current-buffer control-buf
       (setq ediff-window-A wind-A
 	    ediff-window-B wind-B
 	    ediff-window-C wind-C)
@@ -660,16 +669,16 @@
 	 (frame-A (if wind-A (window-frame wind-A)))
 	 (frame-B (if wind-B (window-frame wind-B)))
 	 (frame-C (if wind-C (window-frame wind-C)))
-	 (ctl-frame-exists-p (ediff-eval-in-buffer control-buf
+	 (ctl-frame-exists-p (ediff-with-current-buffer control-buf
 			       (frame-live-p ediff-control-frame)))
 	 ;; on wide display, do things in one frame
 	 (force-one-frame 
-	  (ediff-eval-in-buffer control-buf ediff-wide-display-p))
+	  (ediff-with-current-buffer control-buf ediff-wide-display-p))
 	 ;; this lets us have local versions of ediff-split-window-function
 	 (split-window-function 
-	  (ediff-eval-in-buffer control-buf ediff-split-window-function))
+	  (ediff-with-current-buffer control-buf ediff-split-window-function))
 	 (three-way-comparison
-	  (ediff-eval-in-buffer control-buf ediff-3way-comparison-job))
+	  (ediff-with-current-buffer control-buf ediff-3way-comparison-job))
 	 (orig-wind (selected-window))
 	 (use-same-frame (or force-one-frame
 			     (eq frame-A frame-B)
@@ -692,7 +701,7 @@
 	 designated-minibuffer-frame
 	 done-A done-B done-C)
     
-    (ediff-eval-in-buffer control-buf
+    (ediff-with-current-buffer control-buf
       (setq wind-A-start (ediff-overlay-start
 			  (ediff-get-value-according-to-buffer-type
 			   'A ediff-narrow-bounds))
@@ -793,7 +802,7 @@
 	      (setq wind-C (selected-window))
 	      )))
     
-    (ediff-eval-in-buffer control-buf
+    (ediff-with-current-buffer control-buf
       (setq ediff-window-A wind-A
 	    ediff-window-B wind-B
 	    ediff-window-C wind-C)
@@ -870,13 +879,13 @@
 	;; user-grabbed-mouse
 	fheight fwidth adjusted-parameters) 
 	
-    (ediff-eval-in-buffer ctl-buffer
+    (ediff-with-current-buffer ctl-buffer
       (if ediff-xemacs-p (set-buffer-menubar nil))
       ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse))
       (run-hooks 'ediff-before-setup-control-frame-hook))
   
-    (setq old-ctl-frame (ediff-eval-in-buffer ctl-buffer ediff-control-frame))
-    (ediff-eval-in-buffer ctl-buffer
+    (setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame))
+    (ediff-with-current-buffer ctl-buffer
       (setq ctl-frame (if (frame-live-p old-ctl-frame)
 			  old-ctl-frame
 			(make-frame ediff-control-frame-parameters))
@@ -891,7 +900,7 @@
       
     ;; must be before ediff-setup-control-buffer
     ;; just a precaution--we should be in ctl-buffer already
-    (ediff-eval-in-buffer ctl-buffer
+    (ediff-with-current-buffer ctl-buffer
       (make-local-variable 'frame-title-format)
       (make-local-variable 'frame-icon-title-format)	; XEmacs
       (make-local-variable 'icon-title-format))  	; Emacs
@@ -986,18 +995,18 @@
 			       (not (eq ediff-grab-mouse t)))))
 	
     (if ediff-xemacs-p
-	(ediff-eval-in-buffer ctl-buffer
+	(ediff-with-current-buffer ctl-buffer
 	  (make-local-hook 'select-frame-hook)
 	  (add-hook 'select-frame-hook 'ediff-xemacs-select-frame-hook nil t)
 	  ))
 	
-    (ediff-eval-in-buffer ctl-buffer
+    (ediff-with-current-buffer ctl-buffer
       (run-hooks 'ediff-after-setup-control-frame-hook))
     ))
 
     
 (defun ediff-destroy-control-frame (ctl-buffer)
-  (ediff-eval-in-buffer ctl-buffer
+  (ediff-with-current-buffer ctl-buffer
     (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
 	(let ((ctl-frame ediff-control-frame))
 	  (if ediff-xemacs-p
@@ -1012,7 +1021,7 @@
 
 ;; finds a good place to clip control frame
 (defun ediff-make-frame-position (ctl-buffer ctl-frame-width ctl-frame-height)
-  (ediff-eval-in-buffer ctl-buffer
+  (ediff-with-current-buffer ctl-buffer
     (let* ((frame-A (window-frame ediff-window-A))
 	   (frame-A-parameters (frame-parameters frame-A))
 	   (frame-A-top (eval (cdr (assoc 'top frame-A-parameters))))
@@ -1135,27 +1144,27 @@
     (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
 	(ediff-refresh-control-frame))
     
-    (ediff-eval-in-buffer ediff-buffer-A
+    (ediff-with-current-buffer ediff-buffer-A
       (setq ediff-diff-status buf-A-state-diff)
       (ediff-strip-mode-line-format)
       (setq mode-line-format
 	    (list " A: " 'ediff-diff-status mode-line-format))
       (force-mode-line-update))
-    (ediff-eval-in-buffer ediff-buffer-B
+    (ediff-with-current-buffer ediff-buffer-B
       (setq ediff-diff-status buf-B-state-diff)
       (ediff-strip-mode-line-format)
       (setq mode-line-format
 	    (list " B: " 'ediff-diff-status mode-line-format))
       (force-mode-line-update))
     (if ediff-3way-job
-	(ediff-eval-in-buffer ediff-buffer-C
+	(ediff-with-current-buffer ediff-buffer-C
 	  (setq ediff-diff-status buf-C-state-diff)
 	  (ediff-strip-mode-line-format)
 	  (setq mode-line-format
 		(list " C: " 'ediff-diff-status mode-line-format))
 	  (force-mode-line-update)))
     (if (ediff-buffer-live-p ediff-ancestor-buffer)
-	(ediff-eval-in-buffer ediff-ancestor-buffer
+	(ediff-with-current-buffer ediff-ancestor-buffer
 	  (ediff-strip-mode-line-format)
 	  ;; we keep the second dummy string in the mode line format of the
 	  ;; ancestor, since for other buffers Ediff prepends 2 strings and
@@ -1234,7 +1243,7 @@
 (defun ediff-keep-window-config (control-buf)
   (and (eq control-buf (current-buffer))
        (/= (buffer-size) 0)
-       (ediff-eval-in-buffer control-buf
+       (ediff-with-current-buffer control-buf
 	 (let ((ctl-wind ediff-control-window)
 	       (A-wind ediff-window-A)
 	       (B-wind ediff-window-B)
@@ -1260,8 +1269,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 ;;; ediff-wind.el ends here
--- a/lisp/ediff/ediff.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/ediff/ediff.el	Mon Aug 13 09:53:19 2007 +0200
@@ -6,8 +6,8 @@
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, version control.
 
-(defconst ediff-version "2.66" "The current version of Ediff")
-(defconst ediff-date "July 9, 1997" "Date of last update")  
+(defconst ediff-version "2.67" "The current version of Ediff")
+(defconst ediff-date "August 7, 1997" "Date of last update")  
 
 
 ;; This file is part of GNU Emacs.
@@ -158,7 +158,7 @@
 
 ;; Used as a startup hook to set `_orig' patch file read-only.
 (defun ediff-set-read-only-in-buf-A ()
-  (ediff-eval-in-buffer ediff-buffer-A
+  (ediff-with-current-buffer ediff-buffer-A
     (toggle-read-only 1)))
 
 ;; Return a plausible default for ediff's first file:
@@ -291,7 +291,7 @@
     ;; Setup the buffer
     (set buffer-name (find-file-noselect file))
   
-    (ediff-eval-in-buffer (symbol-value buffer-name)
+    (ediff-with-current-buffer (symbol-value buffer-name)
       (widen) ; Make sure the entire file is seen
       (cond (file-magic  ;   file has a handler, such as jka-compr-handler or
 	     		 ;;; ange-ftp-hook-function--arrange for temp file
@@ -888,10 +888,10 @@
 	file-A file-B)
 	
     ;; in case beg/end-A/B aren't markers--make them into markers
-    (ediff-eval-in-buffer buffer-A
+    (ediff-with-current-buffer buffer-A
       (setq beg-A (move-marker (make-marker) beg-A)
 	    end-A (move-marker (make-marker) end-A)))
-    (ediff-eval-in-buffer buffer-B
+    (ediff-with-current-buffer buffer-B
       (setq beg-B (move-marker (make-marker) beg-B)
 	    end-B (move-marker (make-marker) end-B)))
 	
@@ -949,7 +949,7 @@
   
 (defsubst ediff-merge-on-startup ()
   (ediff-do-merge 0)
-  (ediff-eval-in-buffer ediff-buffer-C
+  (ediff-with-current-buffer ediff-buffer-C
     (set-buffer-modified-p nil)))
 
 ;;;###autoload
@@ -1293,8 +1293,8 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 (require 'ediff-util)
--- a/lisp/efs/dired.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/efs/dired.el	Mon Aug 13 09:53:19 2007 +0200
@@ -2953,11 +2953,9 @@
     (save-excursion
       (and
        (setq p1 (dired-move-to-filename (not no-error-if-not-filep) bol eol))
-       (setq p2 (dired-move-to-end-of-filename no-error-if-not-filep bol eol))
-       ;; We seem to be picking up the carriage-return at the end of the
-       ;; line, so here's a quick fix to get dired working.
-       (if (eq system-type 'windows-nt)
-         (setq p2 (1- p2)))
+       (setq p2 (if (eq system-type 'windows-nt) ; ignore carriage-return at eol
+		    (1- (dired-move-to-end-of-filename no-error-if-not-filep bol eol))
+		  (dired-move-to-end-of-filename no-error-if-not-filep bol eol)))
        (setq file (buffer-substring p1 p2))
        ;; Check if ls quoted the names, and unquote them.
        ;; Using read to unquote is much faster than substituting
--- a/lisp/egg/egg.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/egg/egg.el	Mon Aug 13 09:53:19 2007 +0200
@@ -862,8 +862,11 @@
   (interactive "r")
     (goto-char start)
     (while (re-search-forward kanji-katakana end end)
-      (let ((ch (preceding-char)))
-	(cond( (<= ch ?$B%s(B)
+      (let ((ch (char-before (point))))
+	(cond( (not (or (> ch ?$B%s(B)
+			(eq ch ?$B!<(B)
+			(eq ch ?$B!+(B)
+			(eq ch ?$B!,(B)))
 	       (delete-char -1)
 	       (insert (make-char (find-charset 'japanese-jisx0208) 36 (char-octet ch 1))))))))
 
@@ -893,9 +896,10 @@
   (interactive "r")
   (goto-char start)
   (while (re-search-forward kanji-hiragana end end)
-    (let ((ch (char-octet (preceding-char) 1)))
-      (delete-char -1)
-      (insert (make-char (find-charset 'japanese-jisx0208) 37 ch)))))
+    (let ((ch (char-before (point))))
+      (cond ((not (memq ch '(?$B!<(B ?$B!+(B ?$B!,(B)))
+	     (delete-char -1)
+	     (insert (make-char (find-charset 'japanese-jisx0208) 37 (char-octet ch 1))))))))
 
 (defun katakana-paragraph ()
   "katakana  paragraph at or after point."
@@ -924,18 +928,21 @@
   (save-restriction
     (narrow-to-region start end)
     (goto-char (point-min))
-    (while (re-search-forward "\\cS\\|\\cA" (point-max) (point-max))
+    (while (re-search-forward "\\cS\\|\\cA\\|\\cK" (point-max) (point-max))
       (let* ((ch (preceding-char))
 	     (ch1 (char-octet ch 0))
 	     (ch2 (char-octet ch 1)))
-	(cond ((= ?\241 ch1)
+	(cond ((= ch1 33) ;Symbols
 	       (let ((val (cdr (assq ch2 *hankaku-alist*))))
 		 (if val (progn
 			   (delete-char -1)
 			   (insert val)))))
-	      ((= ?\243 ch1)
+;	      ((= ch1 37) ;Katakana
+;	       (delete-char -1)
+;	       (insert (- ch2 ?\200 )))
+	      ((= ch1 35) ;Alphas
 	       (delete-char -1)
-	       (insert (- ch2 ?\200 ))))))))
+	       (insert ch2)))))))
 
 (defun hankaku-paragraph ()
   "hankaku  paragraph at or after point."
--- a/lisp/hm--html-menus/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/hm--html-menus/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,12 +1,12 @@
-(custom-put 'tmpl-minor 'custom-loads '("tmpl-minor-mode"))
-(custom-put 'idd-drag-and-drop 'custom-loads '("internal-drag-and-drop"))
-(custom-put 'hm--html-indentation 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-hooks 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-display 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-files 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-document-information 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-menus 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-links 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-templates 'custom-loads '("hm--html-configuration"))
 (custom-put 'hm--html-keys 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-templates 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-links 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-menus 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-document-information 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html-files 'custom-loads '("hm--html-configuration"))
-(custom-put 'hm--html 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-display 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-hooks 'custom-loads '("hm--html-configuration"))
+(custom-put 'hm--html-indentation 'custom-loads '("hm--html-configuration"))
+(custom-put 'idd-drag-and-drop 'custom-loads '("internal-drag-and-drop"))
+(custom-put 'tmpl-minor 'custom-loads '("tmpl-minor-mode"))
--- a/lisp/mh-e/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/mh-e/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,4 +1,4 @@
-(custom-put 'mh-buffer 'custom-loads '("mh-utils"))
+(custom-put 'mh-compose 'custom-loads '("mh-comp"))
+(custom-put 'mh 'custom-loads '("mh-comp" "mh-e" "mh-utils"))
 (custom-put 'mh-hook 'custom-loads '("mh-e"))
-(custom-put 'mh 'custom-loads '("mh-comp" "mh-e" "mh-utils"))
-(custom-put 'mh-compose 'custom-loads '("mh-comp"))
+(custom-put 'mh-buffer 'custom-loads '("mh-utils"))
--- a/lisp/modes/auto-autoloads.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/modes/auto-autoloads.el	Mon Aug 13 09:53:19 2007 +0200
@@ -570,7 +570,7 @@
 ;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el")
 
 (autoload 'ksh-mode "ksh-mode" "\
-ksh-mode $Revision: 1.6 $ - Major mode for editing (Bourne, Korn or Bourne again)
+ksh-mode $Revision: 1.7 $ - Major mode for editing (Bourne, Korn or Bourne again)
 shell scripts.
 Special key bindings and commands:
 \\{ksh-mode-map}
@@ -1939,11 +1939,11 @@
 
 (autoload 'vhdl-mode "vhdl-mode" "\
 Major mode for editing VHDL code.
-vhdl-mode $Revision: 1.6 $
+vhdl-mode $Revision: 1.7 $
 To submit a problem report, enter `\\[vhdl-submit-bug-report]' from a
 vhdl-mode buffer.  This automatically sets up a mail buffer with version
 information already added.  You just need to add a description of the
-problem, including a reproducible test case and send the message.
+problem, including a reproducable test case and send the message.
 
 Note that the details of configuring vhdl-mode will soon be moved to the
 accompanying texinfo manual.  Until then, please read the README file
--- a/lisp/modes/pascal.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/modes/pascal.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,6 +1,6 @@
 ;;; pascal.el --- major mode for editing pascal source in Emacs
 
-;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Espen Skoglund (espensk@stud.cs.uit.no)
 ;; Keywords: languages
@@ -18,8 +18,8 @@
 ;; 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,
+;; 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: FSF 19.34
@@ -46,10 +46,10 @@
 ;;       pascal-auto-lineup        '(all)
 ;;       pascal-toggle-completions nil
 ;;       pascal-type-keywords      '("array" "file" "packed" "char" 
-;; 				      "integer" "real" "string" "record")
+;; 				     "integer" "real" "string" "record")
 ;;       pascal-start-keywords     '("begin" "end" "function" "procedure"
-;; 				      "repeat" "until" "while" "read" "readln"
-;; 				      "reset" "rewrite" "write" "writeln")
+;; 				     "repeat" "until" "while" "read" "readln"
+;; 				     "reset" "rewrite" "write" "writeln")
 ;;       pascal-separator-keywords '("downto" "else" "mod" "div" "then"))
 
 ;; KNOWN BUGS / BUGREPORTS
@@ -69,7 +69,6 @@
   "Major mode for editing Pascal source in Emacs"
   :group 'languages)
 
-
 (defvar pascal-mode-abbrev-table nil
   "Abbrev table in use in Pascal-mode buffers.")
 (define-abbrev-table 'pascal-mode-abbrev-table ())
@@ -104,9 +103,9 @@
 ;  (define-key pascal-mode-map "\C-cc"    'pascal-capitalize-keywords)
   )
 
-;(defvar pascal-imenu-generic-expression
-;  '("^[ \t]*\\(function\\|procedure\\)[ \t\n]+\\([a-zA-Z0-9_.:]+\\)" . (2))
-;  "Imenu expression for Pascal-mode.  See `imenu-generic-expression'.")
+(defvar pascal-imenu-generic-expression
+  '("^[ \t]*\\(function\\|procedure\\)[ \t\n]+\\([a-zA-Z0-9_.:]+\\)" . (2))
+  "Imenu expression for Pascal-mode.  See `imenu-generic-expression'.")
 
 (defvar pascal-keywords
   '("and" "array" "begin" "case" "const" "div" "do" "downto" "else" "end" 
@@ -158,17 +157,19 @@
   (modify-syntax-entry ?_ "_"    pascal-mode-syntax-table)
   (modify-syntax-entry ?\' "\""  pascal-mode-syntax-table))
 
-(defvar pascal-font-lock-keywords
+(defvar pascal-font-lock-keywords (purecopy
   (list
-   '("^[ \t]*\\(function\\|pro\\(cedure\\|gram\\)\\)\\>[ \t]*\\(\\sw+\\)?"
-     (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
+   '("^[ \t]*\\(function\\|pro\\(cedure\\|gram\\)\\)\\>[ \t]*\\(\\[a-z]\\)?"
+     1 font-lock-keyword-face)
+   '("^[ \t]*\\(function\\|pro\\(cedure\\|gram\\)\\)\\>[ \t]*\\([a-z][a-z0-9_]*\\)"
+     3 font-lock-function-name-face t)
 ;   ("type" "const" "real" "integer" "char" "boolean" "var"
 ;    "record" "array" "file")
    (cons (concat "\\<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|"
 		 "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\>")
 	 'font-lock-type-face)
    '("\\<\\(label\\|external\\|forward\\)\\>" . font-lock-reference-face)
-   '("\\<\\([0-9]+\\)[ \t]*:" 1 font-lock-reference-face)
+   '("\\<\\([0-9]+\\)[ \t]*:" 1 font-lock-function-name-face)
 ;   ("of" "to" "for" "if" "then" "else" "case" "while"
 ;    "do" "until" "and" "or" "not" "in" "with" "repeat" "begin" "end")
    (concat "\\<\\("
@@ -176,8 +177,11 @@
 	   "not\\|o[fr]\\|repeat\\|t\\(hen\\|o\\)\\|until\\|w\\(hile\\|ith\\)"
 	   "\\)\\>")
    '("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?"
-     (1 font-lock-keyword-face) (2 font-lock-reference-face nil t)))
+     1 font-lock-keyword-face)
+   '("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?"
+     2 font-lock-keyword-face nil t)))
   "Additional expressions to highlight in Pascal mode.")
+(put 'pascal-mode 'font-lock-defaults '(pascal-font-lock-keywords nil t))
 
 (defcustom pascal-indent-level 3
   "*Indentation of Pascal statements with respect to containing block."
@@ -221,9 +225,10 @@
   :group 'pascal)
 
 (defcustom pascal-toggle-completions nil
-  "*Non-nil means that \\<pascal-mode-map>\\[pascal-complete-word] should try all pRepeated use of \\[pascal-complete-word] will show you all of them.
-Normally, when there is more than one possible completion,
-it displays a list of all possible completions."
+  "*Non-nil means that repeated use of \
+\\<pascal-mode-map>\\[pascal-complete-word] will toggle the possible
+completions in the minibuffer.  Normally, when there is more than one possible
+completion, a buffer will display all completions."
   :type 'boolean
   :group 'pascal)
 
@@ -360,11 +365,11 @@
   (make-local-variable 'comment-end)
   (setq comment-end "}")
   ;; Font lock support
-  ;;(make-local-variable 'font-lock-defaults)
-  ;;(setq font-lock-defaults '(pascal-font-lock-keywords nil t))
+  ;(make-local-variable 'font-lock-defaults)
+  ;(setq font-lock-defaults '(pascal-font-lock-keywords nil t))
   ;; Imenu support
-  ;;  (make-local-variable 'imenu-generic-expression)
-  ;;  (setq imenu-generic-expression pascal-imenu-generic-expression)
+  (make-local-variable 'imenu-generic-expression)
+  (setq imenu-generic-expression pascal-imenu-generic-expression)
   (run-hooks 'pascal-mode-hook))
 
 
@@ -919,12 +924,12 @@
   "Indent current line as comment.
 If optional arg is non-nil, just return the
 column number the line should be indented to."
-    (let* ((stcol (save-excursion
-		    (re-search-backward "(\\*\\|{" nil t)
-		    (1+ (current-column)))))
-      (if arg stcol
-	(delete-horizontal-space)
-	(indent-to stcol))))
+  (let* ((stcol (save-excursion
+		  (re-search-backward "(\\*\\|{" nil t)
+		  (1+ (current-column)))))
+    (if arg stcol
+      (delete-horizontal-space)
+      (indent-to stcol))))
 
 (defun pascal-indent-case ()
   "Indent within case statements."
@@ -1006,10 +1011,6 @@
 				      pos))))
 	    ind)
 
-	(if (= (point-max) edpos)
-	    (save-excursion
-	      (goto-char (point-max))
-	      (insert "\n")))
 	(goto-char stpos)
 	;; Indent lines in record block
 	(if arg
@@ -1024,7 +1025,7 @@
 	;; Do lineup
 	(setq ind (pascal-get-lineup-indent stpos edpos lineup))
 	(goto-char stpos)
-	(while (<= (point) edpos)
+	(while (and (<= (point) edpos) (not (eobp)))
 	  (if (search-forward lineup (pascal-get-end-of-line) 'move)
 	      (forward-char -1))
 	  (delete-horizontal-space)
@@ -1062,7 +1063,9 @@
 		  (skip-chars-backward " \t")
 		  (if (> (current-column) ind)
 		      (setq ind (current-column)))
-		  (goto-char (match-end 0)))))))
+		  (goto-char (match-end 0))
+		  (end-of-line)
+		  )))))
       ;; In case no lineup was found
       (if (> ind 0)
 	  (1+ ind)
@@ -1126,7 +1129,7 @@
 
 (defun pascal-get-completion-decl ()
   ;; Macro for searching through current declaration (var, type or const)
-  ;; for matches of `str' and adding the occurrence tp `all'
+  ;; for matches of `str' and adding the occurrence to `all'
   (let ((end (save-excursion (pascal-declaration-end)
 			     (point)))
 	match)
--- a/lisp/packages/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/packages/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,46 +1,46 @@
-(custom-put 'igrep 'custom-loads '("igrep"))
-(custom-put 'change-log 'custom-loads '("add-log"))
-(custom-put 'auto-save 'custom-loads '("auto-save"))
-(custom-put 'avoid 'custom-loads '("avoid"))
-(custom-put 'balloon-help 'custom-loads '("balloon-help"))
-(custom-put 'compilation 'custom-loads '("compile"))
-(custom-put 'completion 'custom-loads '("completion"))
-(custom-put 'dabbrev 'custom-loads '("dabbrev"))
-(custom-put 'desktop 'custom-loads '("desktop"))
-(custom-put 'diff 'custom-loads '("diff"))
-(custom-put 'etags 'custom-loads '("etags"))
-(custom-put 'fast-lock 'custom-loads '("fast-lock"))
-(custom-put 'feedmail 'custom-loads '("feedmail"))
-(custom-put 'filladapt 'custom-loads '("filladapt"))
-(custom-put 'fume 'custom-loads '("func-menu"))
-(custom-put 'generic-sc 'custom-loads '("generic-sc"))
-(custom-put 'gnuserv 'custom-loads '("gnuserv"))
-(custom-put 'gopher 'custom-loads '("gopher"))
-(custom-put 'hyper-apropos 'custom-loads '("hyper-apropos"))
-(custom-put 'hyper-apropos-faces 'custom-loads '("hyper-apropos"))
-(custom-put 'info 'custom-loads '("info"))
-(custom-put 'ispell 'custom-loads '("ispell"))
+(custom-put 'copyright 'custom-loads '("upd-copyr"))
+(custom-put 'time-stamp 'custom-loads '("time-stamp"))
+(custom-put 'texinfo-tex 'custom-loads '("texnfo-tex"))
+(custom-put 'supercite-hooks 'custom-loads '("supercite"))
+(custom-put 'supercite-cite 'custom-loads '("supercite"))
+(custom-put 'supercite-attr 'custom-loads '("supercite"))
+(custom-put 'supercite-frames 'custom-loads '("supercite"))
+(custom-put 'supercite 'custom-loads '("supercite"))
+(custom-put 'save-place 'custom-loads '("saveplace"))
+(custom-put 'recent-files-menu 'custom-loads '("recent-files"))
+(custom-put 'recent-files 'custom-loads '("recent-files"))
+(custom-put 'remote-compile 'custom-loads '("rcompile"))
+(custom-put 'ps-print-face 'custom-loads '("ps-print"))
+(custom-put 'ps-print-color 'custom-loads '("ps-print"))
+(custom-put 'ps-print-font 'custom-loads '("ps-print"))
+(custom-put 'ps-print-header 'custom-loads '("ps-print"))
+(custom-put 'ps-print-vertical 'custom-loads '("ps-print"))
+(custom-put 'ps-print-horizontal 'custom-loads '("ps-print"))
+(custom-put 'ps-print 'custom-loads '("ps-print"))
+(custom-put 'pages 'custom-loads '("page-ext"))
+(custom-put 'metamail 'custom-loads '("metamail"))
+(custom-put 'man 'custom-loads '("man"))
+(custom-put 'makeinfo 'custom-loads '("makeinfo"))
 (custom-put 'lpr 'custom-loads '("lpr"))
-(custom-put 'makeinfo 'custom-loads '("makeinfo"))
-(custom-put 'man 'custom-loads '("man"))
-(custom-put 'metamail 'custom-loads '("metamail"))
-(custom-put 'pages 'custom-loads '("page-ext"))
-(custom-put 'ps-print 'custom-loads '("ps-print"))
-(custom-put 'ps-print-horizontal 'custom-loads '("ps-print"))
-(custom-put 'ps-print-vertical 'custom-loads '("ps-print"))
-(custom-put 'ps-print-header 'custom-loads '("ps-print"))
-(custom-put 'ps-print-font 'custom-loads '("ps-print"))
-(custom-put 'ps-print-color 'custom-loads '("ps-print"))
-(custom-put 'ps-print-face 'custom-loads '("ps-print"))
-(custom-put 'remote-compile 'custom-loads '("rcompile"))
-(custom-put 'recent-files 'custom-loads '("recent-files"))
-(custom-put 'recent-files-menu 'custom-loads '("recent-files"))
-(custom-put 'save-place 'custom-loads '("saveplace"))
-(custom-put 'supercite 'custom-loads '("supercite"))
-(custom-put 'supercite-frames 'custom-loads '("supercite"))
-(custom-put 'supercite-attr 'custom-loads '("supercite"))
-(custom-put 'supercite-cite 'custom-loads '("supercite"))
-(custom-put 'supercite-hooks 'custom-loads '("supercite"))
-(custom-put 'texinfo-tex 'custom-loads '("texnfo-tex"))
-(custom-put 'time-stamp 'custom-loads '("time-stamp"))
-(custom-put 'copyright 'custom-loads '("upd-copyr"))
+(custom-put 'ispell 'custom-loads '("ispell"))
+(custom-put 'info 'custom-loads '("info"))
+(custom-put 'hyper-apropos-faces 'custom-loads '("hyper-apropos"))
+(custom-put 'hyper-apropos 'custom-loads '("hyper-apropos"))
+(custom-put 'gopher 'custom-loads '("gopher"))
+(custom-put 'gnuserv 'custom-loads '("gnuserv"))
+(custom-put 'generic-sc 'custom-loads '("generic-sc"))
+(custom-put 'fume 'custom-loads '("func-menu"))
+(custom-put 'filladapt 'custom-loads '("filladapt"))
+(custom-put 'feedmail 'custom-loads '("feedmail"))
+(custom-put 'fast-lock 'custom-loads '("fast-lock"))
+(custom-put 'etags 'custom-loads '("etags"))
+(custom-put 'diff 'custom-loads '("diff"))
+(custom-put 'desktop 'custom-loads '("desktop"))
+(custom-put 'dabbrev 'custom-loads '("dabbrev"))
+(custom-put 'completion 'custom-loads '("completion"))
+(custom-put 'compilation 'custom-loads '("compile"))
+(custom-put 'balloon-help 'custom-loads '("balloon-help"))
+(custom-put 'avoid 'custom-loads '("avoid"))
+(custom-put 'auto-save 'custom-loads '("auto-save"))
+(custom-put 'change-log 'custom-loads '("add-log"))
+(custom-put 'igrep 'custom-loads '("igrep"))
--- a/lisp/packages/func-menu.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/packages/func-menu.el	Mon Aug 13 09:53:19 2007 +0200
@@ -631,7 +631,7 @@
    ;; >= six spaces
    "^      \\s-*"
    ;; type specs
-   "+[a-zA-Z0-9*]*\\s-*"
+   "[a-zA-Z0-9*]*\\s-*"
    ;; continuation lines
    "\\(\n     [^ 0]\\s-*\\)*"
    ;; function or subroutine
@@ -645,7 +645,7 @@
 (defvar fume-function-name-regexp-fortran90
   (concat
    ;; type specs
-   "+[a-zA-Z0-9*]*\\s-*"
+   "[a-zA-Z0-9*]*\\s-*"
    ;; function or subroutine
    "\\(entry\\|ENTRY\\|function\\|FUNCTION\\|module\\|MODULE\\|subroutine\\|SUBROUTINE\\)\\s-*"
    )
--- a/lisp/packages/info.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/packages/info.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,7 +1,7 @@
 ;;; info.el --- info package for Emacs.
 ;; Keywords: help
 
-;; Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1993, 1997 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;;	   Richard Stallman <rms@gnu.ai.mit.edu>
@@ -301,6 +301,7 @@
 ;;
 ;; Added `Info-minibuffer-history'
 ;; (also added to defaults in "lisp/utils/savehist.el")
+;;  Other changes in main ChangeLog.
 
 ;; Code:
 
@@ -367,9 +368,17 @@
   :group 'info)
 
 (defcustom Info-default-directory-list nil
-  "*List of default directories to search for Info documentation files.
-This value is used as the default for `Info-directory-list'.  It is set
-in startup.el."
+  "*List of default directories to search for Info documentation
+files.  This value is used as the default for `Info-directory-list'.
+It is set in startup.el."
+  :type '(repeat directory)
+  :group 'info)
+
+(defcustom Info-additional-directory-list nil
+  "List of additional directories to search for Info documentation
+files.  These directories are not searched for merging the `dir'
+file. An example might be something like:
+\"/usr/local/lib/xemacs/packages/lisp/calc/\""
   :type '(repeat directory)
   :group 'info)
 
@@ -379,7 +388,7 @@
 	(let ((list nil)
  	      idx)
 	  (while (> (length path) 0)
-	    (setq idx (or (string-match ":" path) (length path))
+	    (setq idx (or (string-match path-separator path) (length path))
 		  list (cons (substring path 0 idx) list)
 		  path (substring path (min (1+ idx)
 					    (length path)))))
@@ -389,12 +398,15 @@
 Default is to use the environment variable INFOPATH if it exists,
 else to use Info-default-directory-list.")
 
-(defvar Info-suffix-list '( (".info" . nil)
+;; Is this right for NT?  .zip, with -c for to stdout, right?
+(defvar Info-suffix-list '( ("" . nil) 
+			    (".info" . nil)
 			    (".info.gz" . "gzip -dc %s")
 			    (".info-z" . "gzip -dc %s")
 			    (".info.Z" . "uncompress -c %s")
 			    (".gz" . "gzip -dc %s")
-			    (".Z" . "uncompress -c %s") )
+			    (".Z" . "uncompress -c %s")
+			    (".zip" . "unzip -c %s") )
   "List of file name suffixes and associated decoding commands.
 Each entry should be (SUFFIX . STRING); if STRING contains %s, that is
 changed to name of the file to decode, otherwise the file is given to
@@ -405,7 +417,9 @@
 All \"*Note\" references will be changed to use this word instead.")
 
 (defvar Info-current-file nil
-  "Info file that Info is now looking at, or nil.")
+  "Info file that Info is now looking at, or nil.
+This is the name that was specified in Info, not the actual file name.
+It doesn't contain directory names or file name extensions added by Info.")
 
 (defvar Info-current-subfile nil
   "Info subfile that is actually in the *info* buffer now,
@@ -428,7 +442,8 @@
   "List of possible matches for last Info-index command.")
 (defvar Info-index-first-alternative nil)
 
-(defcustom Info-annotations-path '("~/.infonotes" "/usr/lib/info.notes")
+(defcustom Info-annotations-path '("~/.xemacs/info.notes"
+				   "/usr/lib/info.notes")
   "*Names of files that contain annotations for different Info nodes.
 By convention, the first one should reside in your personal directory.
 The last should be a world-writable \"public\" annotations file."
@@ -467,7 +482,7 @@
 	   (setq file (nth 2 p))
 	   (setq command-line-args-left nil))
       (setq p (cdr p))))
-;  (Info-setup-x)
+;  (Info-setup-x) ??? What was this going to be?  Can anyone tell karlheg?
   (if file
       (unwind-protect
 	  (Info-goto-node (concat "(" file ")"))
@@ -492,18 +507,16 @@
 	  (bury-buffer (find-file-noselect (car f))))
       (setq f (cdr f)))))
 
-(defconst Info-emacs-info-file-name "xemacs")
-
-;; Go to an info node specified as separate filename and nodename.
-;; no-going-back is non-nil if recovering from an error in this function;
-;; it says do not attempt further (recursive) error recovery.
 (defun Info-find-node (filename &optional nodename no-going-back tryfile line)
-  ;; Look for a plausible filename, or if not found then look for URls
-  ;; &c, and dispatch to the appropriate fn.
+  "Go to an info node specified as separate FILENAME and NODENAME.
+Look for a plausible filename, or if not found then look for URL's and
+dispatch to the appropriate fn.  NO-GOING-BACK is non-nil if
+recovering from an error in this function; it says do not attempt
+further (recursive) error recovery.  TRYFILE is ??"
 
   (Info-setup-initial)
 
-  (cond 
+  (cond
    ;; empty filename is simple case
    ((null filename)
     (Info-find-file-node nil nodename no-going-back tryfile line))
@@ -511,18 +524,15 @@
    ;; Expand it, look harder...
    ((let (temp temp-downcase found 
 	       (fname (substitute-in-file-name filename)))
-      ;; horrible kludge so that I can call the emacs doc
-      ;; "XEmacs" without having to make .../info/dir be ugly.
-      ;; I'd like to do this only if the "emacs" node wasn't
-      ;; found, but this 200+ line function is too hairy for me
-      ;; to want to think about any longer than I have to.
-      (if (equal (downcase fname) "emacs")
-	  (setq fname Info-emacs-info-file-name))
-      (let ((dirs (if (string-match "^\\./" fname)
-		      ;; If specified name starts with `./'
-		      ;; then just try current directory.
-		      (list default-directory) ; '("./")
-		    Info-directory-list)))
+      (let ((dirs (cond
+		   ((string-match "^\\./" fname) ; If specified name starts with `./'
+		    (list default-directory)) ; then just try current directory.
+		   ((file-name-absolute-p fname)
+		    '(nil))		; No point in searching for an absolute file name
+		   (Info-additional-directory-list
+		    (append Info-directory-list
+			    Info-additional-directory-list))
+		   (t Info-directory-list))))
 	;; Search the directory list for file FNAME.
 	(while (and dirs (not found))
 	  (setq temp (expand-file-name fname (car dirs)))
@@ -539,29 +549,32 @@
     (Info-find-file-node filename nodename no-going-back tryfile line))
    ;; Look for a URL.  This pattern is stolen from w3.el to prevent
    ;; loading it if we won't need it.
-   ((string-match  "^\\(wais\\|solo\\|x-exec\\|newspost\\|www\\|mailto\\|news\\|tn3270\\|ftp\\|http\\|file\\|telnet\\|gopher\\):" filename)
-    (w3-fetch filename))
+   ((string-match  (concat "^\\(wais\\|solo\\|x-exec\\|newspost\\|www\\|"
+			   "mailto\\|news\\|tn3270\\|ftp\\|http\\|file\\|"
+			   "telnet\\|gopher\\):")
+		   filename)
+    (browse-url filename))
    (t
     (error "Info file %s does not exist" filename))))
 
-(defun Info-find-file-node (filename nodename 
+(defun Info-find-file-node (filename nodename
 				     &optional no-going-back tryfile line)
   ;; This is the guts of what was Info-find-node. Whoever wrote this
   ;; should be locked up where they can't do any more harm.
 
   ;; Go into info buffer.
   (switch-to-buffer "*info*")
-  (if (fboundp 'buffer-disable-undo)
-      (buffer-disable-undo (current-buffer)))
+  (buffer-disable-undo (current-buffer))
   (run-hooks 'Info-startup-hook)
   (or (eq major-mode 'Info-mode)
       (Info-mode))
   (or (null filename)
       (equal Info-current-file filename)
       (not Info-novice)
-      (string-match "^dir$" (file-name-nondirectory Info-current-file))
-      (if (y-or-n-p (format "Leave Info file `%s'? "
-			    (file-name-nondirectory Info-current-file)))
+      (string= "dir" (file-name-nondirectory Info-current-file))
+      (if (y-or-n-p-maybe-dialog-box
+	   (format "Leave Info file `%s'? "
+		   (file-name-nondirectory Info-current-file)))
 	  (message "")
 	(keyboard-quit)))
   ;; Record the node we are leaving.
@@ -578,55 +591,15 @@
 	    (let ((buffer-read-only nil))
 	      (setq Info-current-file nil
 		    Info-current-subfile nil
+		    Info-current-file-completions nil
 		    Info-index-alternatives nil
-		    Info-current-file-completions nil
 		    buffer-file-name nil)
 	      (erase-buffer)
-	      (Info-insert-file-contents filename t)
-	      ;; Add all "localdir" files in search path to "dir" file.
-	      (if (string-match "^dir$" (file-name-nondirectory filename))
-		  (let ((d Info-directory-list)
-			name (lim -1))
-		    (goto-char (point-max))
-		    (if (re-search-backward "^ *\\* *Locals *: *\n" nil t)
-			(delete-region (match-beginning 0) (match-end 0))
-		      (search-backward "\^L" nil t))
-		    (while d
-		      (setq name (expand-file-name "localdir" (car d)))
-		      (if (or (file-exists-p name)
-			      (file-exists-p
-			       (setq name (concat name ".info"))))
-			  ;; Insert menu part of the file
-			  (let* ((pt (point))
-				 (len (nth 1 (insert-file-contents name))))
-			    ;; be careful to put the local info entries
-			    ;; in the buffer in the order they were found
-			    ;; in the search path.
-			    (goto-char (+ pt len))
-			    (save-excursion
-			      (goto-char pt)
-			      (if (search-forward "* menu:" (+ pt len) t)
-				  (progn
-				    (forward-line 1)
-				    (delete-region pt (point)))))))
-		      (setq d (cdr d)))
-		    ;; Eliminate redundant menu entries.
-		    (goto-char (point-min))
-		    (while (re-search-forward "\n\\* \\([^:\n]*\\):" nil t)
-		      (let ((str (buffer-substring (match-beginning 1)
-						   (match-end 1))))
-			(if (> (point) lim)
-			    (save-excursion
-			      (setq lim (if (search-forward "\^_" nil t)
-					    (point)
-					  (point-max)))))
-			(save-excursion
-			  (if (search-forward (format "\n* %s:" str) lim t)
-			      (let ((pt (- (point) 3 (length str))))
-				(forward-line 1)
-				(delete-region pt (point)))))))))
+	      (if (string= "dir" (file-name-nondirectory filename))
+		  (Info-insert-dir)
+		(Info-insert-file-contents filename t)
+		(setq default-directory (file-name-directory filename)))
 	      (set-buffer-modified-p nil)
-	      (setq default-directory (file-name-directory filename))
 	      ;; See whether file has a tag table.  Record the location if yes.
 	      (set-marker Info-tag-table-marker nil)
 	      (goto-char (point-max))
@@ -647,8 +620,7 @@
 			  (let ((buf (current-buffer)))
 			    (set-buffer
 			     (get-buffer-create " *info tag table*"))
-			    (if (fboundp 'buffer-disable-undo)
-				(buffer-disable-undo (current-buffer)))
+			    (buffer-disable-undo (current-buffer))
 			    (setq case-fold-search t)
 			    (erase-buffer)
 			    (insert-buffer-substring buf)
@@ -736,6 +708,191 @@
 	  (Info-goto-node (car hist) t)
 	  (goto-char (+ (point-min) (nth 1 hist)))))))
 
+;; Cache the contents of the (virtual) dir file, once we have merged
+;; it for the first time, so we can save time subsequently.
+(defvar Info-dir-contents nil)
+
+;; Cache for the directory we decided to use for the default-directory
+;; of the merged dir text.
+(defvar Info-dir-contents-directory nil)
+
+;; Record the file attributes of all the files from which we
+;; constructed Info-dir-contents.
+(defvar Info-dir-file-attributes nil)
+
+(defun Info-insert-dir ()
+  "Construct the Info directory node by merging the files named
+\"dir\" or \"localdir\" from the directories in `Info-directory-list'
+The \"dir\" files will take precedence in cases where both exist.  It
+sets the *info* buffer's `default-directory' to the first directory we
+actually get any text from."
+  (if (and Info-dir-contents Info-dir-file-attributes
+	   ;; Verify that none of the files we used has changed
+	   ;; since we used it.
+	   (eval (cons 'and
+		       (mapcar '(lambda (elt)
+				  (let ((curr (file-attributes (car elt))))
+				    ;; Don't compare the access time.
+				    (if curr (setcar (nthcdr 4 curr) 0))
+				    (setcar (nthcdr 4 (cdr elt)) 0)
+				    (equal (cdr elt) curr)))
+			       Info-dir-file-attributes))))
+      (insert Info-dir-contents)
+    (let ((dirs Info-directory-list)
+	  buffers buffer others nodes dirs-done)
+
+      (setq Info-dir-file-attributes nil)
+
+      ;; Search the directory list for the directory file.
+      (while dirs
+	(let ((truename (file-truename (expand-file-name (car dirs)))))
+	  (or (member truename dirs-done)
+	      (member (directory-file-name truename) dirs-done)
+	      ;; Try several variants of specified name.
+	      ;; Try upcasing, appending `.info', or both.
+	      (let* (file
+		     (attrs
+		      (or
+		       (progn (setq file (expand-file-name "dir" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "DIR" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "dir.info" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "DIR.INFO" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "localdir" truename))
+			      (file-attributes file))
+		       )))
+		(setq dirs-done
+		      (cons truename
+			    (cons (directory-file-name truename)
+				  dirs-done)))
+		(if attrs
+		    (save-excursion
+		      (or buffers
+			  (message "Composing main Info directory..."))
+		      (set-buffer (generate-new-buffer "info dir"))
+		      (when (string-match "localdir" file)
+			(insert "localdir\n"))
+		      (insert-file-contents file)
+		      (setq buffers (cons (current-buffer) buffers)
+			    Info-dir-file-attributes
+			    (cons (cons file attrs)
+				  Info-dir-file-attributes))))))
+	  (or (cdr dirs) (setq Info-dir-contents-directory (car dirs)))
+	  (setq dirs (cdr dirs))))
+      
+      (or buffers
+	  (error "Can't find the Info directory node"))
+      ;; Distinguish the dir file that comes with Emacs from all the
+      ;; others.  Yes, that is really what this is supposed to do.
+      ;; If it doesn't work, fix it.
+      (setq buffer (car buffers)
+	    others (cdr buffers))
+
+      ;; Insert the entire original dir file as a start; note that we've
+      ;; already saved its default directory to use as the default
+      ;; directory for the whole concatenation.
+      (insert-buffer buffer)
+
+      ;; Look at each of the other buffers one by one.
+      (while others
+	(let ((other (car others))
+	      (info-buffer (current-buffer)))
+	  (if (with-current-buffer other
+		(goto-char (point-min))
+		(when (looking-at "localdir")
+		  (forward-line 1)
+		  (delete-region (point-min) (point))
+		  t))		
+	      (save-excursion
+		(set-buffer info-buffer)
+		(goto-char (point-max))
+		(cond
+		 ((re-search-backward "^ *\\* *Locals *: *\n" nil t)
+		  (delete-region (match-beginning 0) (match-end 0)))
+		 ((re-search-backward "^Local" nil t)
+		  (end-of-line))
+		 (t (search-backward "\^L" nil t)))
+		;; Insert menu part of the file
+		(let* ((pt (point))
+		       (len (length (buffer-string nil nil other))))
+		  (insert "\n" (buffer-string nil nil other))
+		  (goto-char (+ pt len))
+		  (save-excursion
+		    (goto-char pt)
+		    (if (search-forward "* menu:" (+ pt len) t)
+			(progn
+			  (forward-line 1)
+			  (delete-region pt (point)))))))
+	    ;; In each, find all the menus.
+	    (save-excursion
+	      (set-buffer other)
+	      (goto-char (point-min))
+	      ;; Find each menu, and add an elt to NODES for it.
+	      (while (re-search-forward "^\\* Menu:" nil t)
+		(let (beg nodename end)
+		  (forward-line 1)
+		  (setq beg (point))
+		  (search-backward "\n\^_")
+		  (search-forward "Node: ")
+		  (setq nodename (Info-following-node-name))
+		  (search-forward "\n\^_" nil 'move)
+		  (beginning-of-line)
+		  (setq end (point))
+		  (setq nodes (cons (list nodename other beg end) nodes))))))
+	  (setq others (cdr others))))
+      
+      ;; Add to the main menu a menu item for each other node.
+      (re-search-forward "^\\* Menu:")
+      (forward-line 1)
+      (let ((menu-items '("top"))
+	    (nodes nodes)
+	    (case-fold-search t)
+	    (end (save-excursion (search-forward "\^_" nil t) (point))))
+	(while nodes
+	  (let ((nodename (car (car nodes))))
+	    (save-excursion
+	      (or (member (downcase nodename) menu-items)
+		  (re-search-forward (concat "^\\* "
+					     (regexp-quote nodename)
+					     "::")
+				     end t)
+		  (progn
+		    (insert "* " nodename "::" "\n")
+		    (setq menu-items (cons nodename menu-items))))))
+	  (setq nodes (cdr nodes))))
+      ;; Now take each node of each of the other buffers
+      ;; and merge it into the main buffer.
+      (while nodes
+	(let ((nodename (car (car nodes))))
+	  (goto-char (point-min))
+	  ;; Find the like-named node in the main buffer.
+	  (if (re-search-forward (concat "\n\^_.*\n.*Node: "
+					 (regexp-quote nodename)
+					 "[,\n\t]")
+				 nil t)
+	      (progn
+		(search-forward "\n\^_" nil 'move)
+		(beginning-of-line)
+		(insert "\n"))
+	    ;; If none exists, add one.
+	    (goto-char (point-max))
+	    (insert "\^_\nFile: dir\tNode: " nodename "\n\n* Menu:\n\n"))
+	  ;; Merge the text from the other buffer's menu
+	  ;; into the menu in the like-named node in the main buffer.
+	  (apply 'insert-buffer-substring (cdr (car nodes))))
+	(setq nodes (cdr nodes)))
+      ;; Kill all the buffers we just made.
+      (while buffers
+	(kill-buffer (car buffers))
+	(setq buffers (cdr buffers)))
+      (message "Composing main Info directory...done"))
+    (setq Info-dir-contents (buffer-string)))
+  (setq default-directory Info-dir-contents-directory)
+  (setq buffer-file-name (caar Info-dir-file-attributes)))
+
 (defun Info-history-add (file node point)
   (if Info-keeping-history
       (let* ((name (format "(%s)%s" (Info-file-name-only file) node))
@@ -797,17 +954,27 @@
     (+ (- nodepos lastfilepos) (point))))
 
 (defun Info-suffixed-file (name &optional name2)
+  "Look for NAME with each of the `Info-suffix-list' extensions in
+turn. Optional NAME2 is the name of a fallback info file to check
+for; usually a downcased version of NAME."
   (let ((suff Info-suffix-list)
-	(found nil))
+	(found nil)
+	file file2)
     (while (and suff (not found))
-      (if (file-exists-p (concat name (car (car suff))))
-	  (setq found (concat name (car (car suff))))
-	(if (and name2 (file-exists-p (concat name2 (car (car suff)))))
-	    (setq found (concat name2 (car (car suff))))
-	  (setq suff (cdr suff)))))
+      (setq file (concat name (caar suff))
+	    file2 (and name2 (concat name2 (caar suff))))
+      (cond
+       ((file-exists-p file)
+	(setq found file))
+       ((and file2 (file-exists-p file2))
+	(setq found file2))
+       (t
+	(setq suff (cdr suff)))))
     (or found
-	(and (file-exists-p name) name)
-	(and name2 (file-exists-p name2) name2))))
+	(and name (when (file-exists-p name)
+		    name))
+	(and name2 (when (file-exists-p name2)
+		     name2)))))
 
 (defun Info-insert-file-contents (file &optional visit)
   (setq file (expand-file-name file default-directory))
@@ -892,7 +1059,7 @@
 		       "")
 		     ")"
 		     (or Info-current-node ""))))))
-	
+
 ;; Go to an info node specified with a filename-and-nodename string
 ;; of the sort that is found in pointers in nodes.
 
@@ -1017,6 +1184,7 @@
 (defvar Info-last-search nil
   "Default regexp for \\<Info-mode-map>\\[Info-search] command to search for.")
 
+
 ;;;###autoload
 (defun Info-search (regexp)
   "Search for REGEXP, starting from point, and select node it's found in."
@@ -1081,14 +1249,15 @@
       (or (and (equal onode Info-current-node)
                (equal ofile Info-current-file))
           (Info-history-add ofile onode opoint)))))
-
+
+
 ;; Extract the value of the node-pointer named NAME.
 ;; If there is none, use ERRORNAME in the error message; 
 ;; if ERRORNAME is nil, just return nil.
 (defun Info-extract-pointer (name &optional errorname)
   (save-excursion
    (goto-char (point-min))
-   (forward-line 1)
+   (forward-line 4)
    (let ((case-fold-search t))
      (if (re-search-backward (concat name ":") nil t)
 	 (progn
@@ -1169,7 +1338,7 @@
   "Go to the Info directory node."
   (interactive)
   (Info-find-node "dir" "top"))
-
+
 (defun Info-follow-reference (footnotename)
   "Follow cross reference named NAME to the node it refers to.
 NAME may be an abbreviation of the reference name."
@@ -1644,6 +1813,7 @@
     (Info-index (symbol-name command)))
   (pop-to-buffer "*info*"))
 
+
 ;;;###autoload
 (defun Info-goto-emacs-command-node (key)
   "Look up an Emacs command in the Emacs manual in the Info system.
@@ -1782,11 +1952,11 @@
 
 (defun Info-annotate (arg)
   "Add a personal annotation to the current Info node.
-Only you will be able to see this annotation.
-Annotations are stored in the file ~/.infonotes by default.
-If point is inside an existing annotation, edit that annotation.
-A prefix argument specifies which annotations file (from
-Info-annotations-path) is to be edited; default is 1."
+ Only you will be able to see this annotation.  Annotations are stored
+in the file \"~/.xemacs/info.notes\" by default.  If point is inside
+an existing annotation, edit that annotation.  A prefix argument
+specifies which annotations file (from `Info-annotations-path') is to
+be edited; default is 1."
   (interactive "p")
   (setq arg (1- arg))
   (if (or (< arg 0) (not (nth arg Info-annotations-path)))
@@ -1890,7 +2060,8 @@
       (or (equal tag "")
 	  (insert "<<" tag ">>"))))
   (Info-cease-annotate))
-
+
+
 (defun Info-exit ()
   "Exit Info by selecting some other buffer."
   (interactive)
@@ -2229,7 +2400,7 @@
   "Local keymap used within `e' command of Info.")
 (if Info-edit-map
     nil
-  ;; XEmcas: remove FSF stuff
+  ;; XEmacs: remove FSF stuff
   (setq Info-edit-map (make-sparse-keymap))
   (set-keymap-name Info-edit-map 'Info-edit-map)
   (set-keymap-parents Info-edit-map (list text-mode-map))
@@ -2266,7 +2437,7 @@
   (interactive)
   ;; Do this first, so nothing has changed if user C-g's at query.
   (and (buffer-modified-p)
-       (y-or-n-p "Save the file? ")
+       (y-or-n-p-maybe-dialog-box "Save the file? ")
        (save-buffer))
   (use-local-map Info-mode-map)
   (setq major-mode 'Info-mode)
@@ -2289,6 +2460,7 @@
     (save-excursion
       (Info-find-node "XEmacs" "Command Index")
       ;; Take the index node off the Info history.
+      ;; ??? says this isn't safe someplace else... hmmm.
       (setq Info-history (cdr Info-history))
       (goto-char (point-max))
       (while (re-search-backward cmd-desc nil t)
@@ -2304,52 +2476,81 @@
 ;;; fontification and mousability for info
 
 (defun Info-highlight-region (start end face)
-  (let ((extent (make-extent start end)))
+  (let ((extent nil)
+	(splitp (string-match "\n[ \t]+" (buffer-substring start end))))
+    (if splitp
+	(save-excursion
+	  (setq extent (make-extent start (progn (goto-char start)
+						 (end-of-line)
+						 (point))))
+	  (set-extent-face extent face)
+	  (set-extent-property extent 'info t)
+	  (set-extent-property extent 'highlight t)
+	  (skip-chars-forward "\n\t ")
+	  (setq extent (make-extent (point) end)))
+      (setq extent (make-extent start end)))
     (set-extent-face extent face)
     (set-extent-property extent 'info t)
     (set-extent-property extent 'highlight t)))
 
 (defun Info-fontify-node ()
   (save-excursion
-    (let (;(lucid (string-match "Lucid" emacs-version))
-	  (case-fold-search t)
-	  (xref-regexp (concat "\\*" 
+    (let ((case-fold-search t)
+	  (xref-regexp (concat "\\*"
 			       (regexp-quote Info-footnote-tag)
 			       "[ \n\t]*\\([^:]*\\):")))
-;      (if lucid
-	  (map-extents (function (lambda (x y) (delete-extent x)))
-		       (current-buffer) (point-min) (point-max) nil)
-;	)
+      ;; Clear the old extents
+      (map-extents #'(lambda (x y) (delete-extent x))
+		   (current-buffer) (point-min) (point-max) nil)
+      ;; Break the top line iff it is > 79 characters.  Some info nodes
+      ;; have top lines that span 3 lines because of long node titles.
+      ;; eg: (Info-find-node "lispref.info" "Window-Level Event Position Info")
+      (toggle-read-only -1)
+      (let ((extent nil)
+	    (len 0)
+	    (done nil)
+	    (p (point-min)))
+	(goto-char (point-min))
+	(re-search-forward "Node: *[^,]+,  " nil t)
+	(setq len (- (point) (point-min))
+	      extent (make-extent (point-min) (point)))
+	(set-extent-property extent 'invisible t)
+	(while (not done)
+	  (goto-char p)
+	  (end-of-line)
+	  (if (< (current-column) (+ 78 len))
+	      (setq done t)
+	    (goto-char p)
+	    (forward-char (+ 79 len))
+	    (re-search-backward "," nil t)
+	    (forward-char 1)
+	    (insert "\n")
+	    (just-one-space)
+	    (backward-delete-char 1)
+	    (setq p (point)
+		  len 0))))
+      (toggle-read-only 1)
+      ;; Highlight xrefs in the top few lines of the node
       (goto-char (point-min))
       (if (looking-at "^File: [^,: \t]+,?[ \t]+")
 	  (progn
 	    (goto-char (match-end 0))
 	    (while
-		(looking-at "[ \t]*[^:, \t\n]+:[ \t]+\\([^:,\t\n]+\\),?")
+		(looking-at "[ \t]*[^:, \t\n]+:[ \t]+\\([^:,\t\n]+\\),?\n?")
 	      (goto-char (match-end 0))
-	      (Info-highlight-region (match-beginning 1) (match-end 1)
-				     'info-xref ;lucid
-				     ))))
+	      (Info-highlight-region (match-beginning 1) (match-end 1) 'info-xref))))
+      ;; Now get the xrefs in the body
       (goto-char (point-min))
       (while (re-search-forward xref-regexp nil t)
 	(if (= (char-after (1- (match-beginning 0))) ?\") ; hack
 	    nil
-	  (Info-highlight-region (match-beginning 1) (match-end 1)
-				 'info-xref ;lucid
-				 )))
+	  (Info-highlight-region (match-beginning 1) (match-end 1) 'info-xref)))
+      ;; then highlight the nodes in the menu.
       (goto-char (point-min))
-      (if (and (search-forward "\n* menu:" nil t)
-;; principle of least astonishment, dude...
-;; (Also, in xemacs this is fast even on indexes, and without it, nodes don't
-;; highlight when you move over them.)
-;;	       (not (string-match "\\<Index\\>" Info-current-node))
-;;	       (< (- (point-max) (point)) 10000)
-	       )
+      (if (and (search-forward "\n* menu:" nil t))
 	  (while (re-search-forward
-		  "^\\* \\([^\t\n]*\\):?:[ \t\n]" nil t)
-	    (Info-highlight-region (match-beginning 1) (match-end 1)
-				   'info-node ;lucid
-				   )))
+		  "^\\* \\([^:\t\n]*\\):?:[ \t\n]" nil t)
+	    (Info-highlight-region (match-beginning 1) (match-end 1) 'info-node)))
       (set-buffer-modified-p nil))))
 
 (defun Info-construct-menu (&optional event)
@@ -2361,56 +2562,68 @@
 	(xref-regexp (concat "\\*" 
 			     (regexp-quote Info-footnote-tag)
 			     "[ \n\t]*\\([^:]*\\):"))
-	up-p prev-p next-p menu
-	i text xrefs subnodes in)
+	up-p prev-p next-p menu xrefs subnodes in)
     (save-excursion
-      (goto-char (point-min))
-      (if (looking-at ".*\\bNext:") (setq next-p t))
-      (if (looking-at ".*\\bPrev:") (setq prev-p t))
-      (if (looking-at ".*Up:") (setq up-p t))
-      (setq menu (nconc 
-			(if (setq in (Info-indicated-node event))
-			    (list (vector (car (cdr in)) in t)))
-			(list
-			 ["Goto Info Top-level" Info-directory t]
-			 (vector "Next Node" 'Info-next next-p)
-			 (vector "Previous Node" 'Info-prev prev-p)
-			 (vector "Parent Node (Up)" 'Info-up up-p)
-			 ["Goto Node..." Info-goto-node t]
-			 ["Goto Last Visited Node" Info-last t])))
-      (while (re-search-forward xref-regexp nil t)
-	(setq text (buffer-substring (match-beginning 1) (match-end 1)))
-	(while (setq i (string-match "[ \n\t]+" text i))
-	  (setq text (concat (substring text 0 i) " "
-			     (substring text (match-end 0))))
-	  (setq i (1+ i)))
-	(setq xrefs (cons text xrefs)))
+      ;; `one-space' fixes "Notes:" xrefs that are split across lines.
+      (flet
+	  ((one-space (text)
+		      (let (i)
+			(while (setq i (string-match "[ \n\t]+" text i))
+			  (setq text (concat (substring text 0 i) " "
+					     (substring text (match-end 0))))
+			  (setq i (1+ i)))
+			text)))
+	(goto-char (point-min))
+	(if (looking-at ".*\\bNext:") (setq next-p t))
+	(if (looking-at ".*\\bPrev:") (setq prev-p t))
+	(if (looking-at ".*Up:") (setq up-p t))
+	(setq menu (nconc
+		    (if (setq in (Info-indicated-node event))
+			(list (vector (one-space (cadr in)) in t)
+			      "--:shadowEtchedIn"))
+		    (list
+		     ["Goto Info Top-level" Info-directory t]
+		     (vector "Next Node" 'Info-next next-p)
+		     (vector "Previous Node" 'Info-prev prev-p)
+		     (vector "Parent Node (Up)" 'Info-up up-p)
+		     ["Goto Node..." Info-goto-node t]
+		     ["Goto Last Visited Node " Info-last t])))
+	;; Find the xrefs and make a list
+	(while (re-search-forward xref-regexp nil t)
+	  (setq xrefs (cons (one-space (buffer-substring (match-beginning 1)
+							 (match-end 1)))
+			    xrefs))))
       (setq xrefs (nreverse xrefs))
       (if (> (length xrefs) 21) (setcdr (nthcdr 20 xrefs) '(more)))
+      ;; Find the subnodes and make a list
       (goto-char (point-min))
       (if (search-forward "\n* menu:" nil t)
-	  (while (re-search-forward "^\\* \\([^:\t\n]*\\):" nil t)
-	    (setq text (buffer-substring (match-beginning 1) (match-end 1)))
-	    (setq subnodes (cons text subnodes))))
+      (while (re-search-forward "^\\* \\([^:\t\n]*\\):" nil t)
+	(setq subnodes (cons (buffer-substring (match-beginning 1)
+					       (match-end 1))
+			     subnodes))))
       (setq subnodes (nreverse subnodes))
-      (if (> (length subnodes) 21) (setcdr (nthcdr 20 subnodes) '(more)))
-      )
+      (if (> (length subnodes) 21) (setcdr (nthcdr 20 subnodes) '(more))))
     (if xrefs
-	(nconc menu (list "----" "Cross-References:" "----")
-	       (mapcar (function (lambda (xref)
-				   (if (eq xref 'more)
-				       "...more..."
-				     (vector xref
-					     (list 'Info-follow-reference xref)
-					     t))))
+	(nconc menu (list "--:shadowDoubleEtchedIn"
+			  "    Cross-References"
+			  "--:singleLine")
+	       (mapcar #'(lambda (xref)
+			   (if (eq xref 'more)
+			       "...more..."
+			     (vector xref
+				     (list 'Info-follow-reference xref)
+				     t)))
 		       xrefs)))
     (if subnodes
-	(nconc menu (list "----" "Sub-Nodes:" "----")
-	       (mapcar (function (lambda (node)
-				   (if (eq node 'more)
-				       "...more..."
-				     (vector node (list 'Info-menu node)
-					     t))))
+	(nconc menu (list "--:shadowDoubleEtchedIn"
+			  "      Sub-Nodes"
+			  "--:singleLine")
+	       (mapcar #'(lambda (node)
+			   (if (eq node 'more)
+			       "...more..."
+			     (vector node (list 'Info-menu node)
+				     t)))
 		       subnodes)))
     menu))
 
@@ -2423,8 +2636,9 @@
   (interactive "e")
   (select-window (event-window event))
   (let ((menu (Info-construct-menu event)))
-    (setq menu (nconc (list "Info" ; title: not shown
-			    "Info Commands:" "----")
+    (setq menu (nconc (list "Info" ; title: not displayed
+			    "     Info Commands"
+			    "--:shadowDoubleEtchedOut")
 		      menu))
     (let ((popup-menu-titles nil))
       (popup-menu menu))))
@@ -2469,14 +2683,14 @@
 		 Info-exit
 		 t
 		 "Exit info"]
+		[info::toolbar-next-icon
+		 Info-next
+		 t
+		 "Next entry in same section"]
 		[info::toolbar-prev-icon
 		 Info-prev
 		 t
 		 "Prev entry in same section"]
-		[info::toolbar-next-icon
-		 Info-next
-		 t
-		 "Next entry in same section"]
 		[info::toolbar-up-icon
 		 Info-up
 		 t
--- a/lisp/packages/man.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/packages/man.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,7 +1,7 @@
 ;;; man.el --- browse UNIX manual pages
 ;; Keywords: help
 
-;; Copyright (C) 1985, 1993, 1994, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
 ;;
 ;; This file is part of XEmacs.
 
@@ -180,34 +180,37 @@
 			nil 'Manual-page-minibuffer-history)))
 	   (if (equal thing "") default thing))
 	 (prefix-numeric-value current-prefix-arg)))
-  ;;(interactive "sManual entry (topic): \np")
   (or arg (setq arg 1))
   (let (section apropos-mode)
     (let ((case-fold-search nil))
       (if (and (null section)
 	       (string-match "\\`[ \t]*\\([^( \t]+\\)[ \t]*(\\(.+\\))[ \t]*\\'"
 			     topic))
-	  (setq section (substring topic (match-beginning 2)
-				   (match-end 2))
-		topic (substring topic (match-beginning 1)
-				 (match-end 1)))
+	  (setq section (match-string 2 topic)
+		topic (match-string 1 topic))
 	(if (string-match "\\`[ \t]*-k[ \t]+\\([^ \t]+\\)\\'" topic)
 	    (setq section "-k"
-		  topic (substring topic (match-beginning 1))))))
+		  topic (match-string 1 topic)))))
 
     (when Manual-snip-subchapter
       ;; jwz: turn section "3x11" and "3n" into "3".
       (if (and section (string-match "\\`\\([0-9]+\\)[^0-9]" section))
-	  (setq section (substring section 0 (match-end 1)))))
+	  (setq section (match-string 1 section))))
+
     (if (equal section "-k")
 	(setq apropos-mode t))
 
-    (let ((bufname (cond (apropos-mode
-			  (concat "*man apropos " topic "*"))
-			 (t
-			  (concat "*man " topic
-				  (if section (concat "." section) "")
-				  "*"))))
+    (let ((bufname (flet
+		       ((maybe-star ()
+				    (if buffers-menu-submenus-for-groups-p
+					""
+				      "*")))
+		     (if apropos-mode
+			 (concat (maybe-star) "man apropos " topic (maybe-star))
+		       (concat (maybe-star)
+			       topic
+			       (if section (concat "(" section ")") "")
+			       (maybe-star)))))
 	  (temp-buffer-show-function 
 	   (cond ((eq 't Manual-buffer-view-mode)
 		  'view-buffer)
@@ -255,15 +258,24 @@
 
 		   (message "%s (cleaning...)" args-string)
 		   (Manual-nuke-nroff-bs apropos-mode)
-		   (message "%s (done.)" args-string)
-		   )
-
+		   (message "%s (done.)" args-string))
 		 (set-buffer-modified-p nil)
-		 (Manual-mode)
-		 ))))
-      (setq Manual-page-history
-	    (cons (buffer-name)
-		  (delete (buffer-name) Manual-page-history)))))
+		 (Manual-mode)))))
+
+      (let ((page (flet
+		      ((maybe-star ()
+				   (if buffers-menu-submenus-for-groups-p
+				       ""
+				     "*")))
+		    (if section
+			(concat (maybe-star) topic "(" section ")" (maybe-star))
+		      topic))))
+	(setq Manual-page-history
+	      (cons (buffer-name)
+		    (delete (buffer-name) Manual-page-history))
+	      Manual-page-minibuffer-history
+	      (cons page (delete page Manual-page-minibuffer-history))))))
+
   (message nil)
   t)
 
@@ -280,15 +292,24 @@
   ;; turn off horizontal scrollbars in this buffer
   (when (featurep 'scrollbar)
     (set-specifier scrollbar-height (cons (current-buffer) 0)))
+  (make-local-hook 'kill-buffer-hook)
+  (add-hook 'kill-buffer-hook #'(lambda ()
+				  (setq Manual-page-history
+					(delete (buffer-name)
+						Manual-page-history)))
+	    nil t)
   (run-hooks 'Manual-mode-hook))
 
 (defun Manual-last-page ()
   (interactive)
-  (while (or (not (get-buffer (car (or Manual-page-history
-				       (error "No more history.")))))
-	     (eq (get-buffer (car Manual-page-history)) (current-buffer)))
-    (setq Manual-page-history (cdr Manual-page-history)))
-  (switch-to-buffer (car Manual-page-history)))
+  (if Manual-page-history
+      (let ((page (pop Manual-page-history)))
+	(if page
+	    (progn
+	      (get-buffer page)
+	      (cons Manual-page-history page)
+	      (switch-to-buffer page))))
+    (error "No manual page buffers found. Use `M-x manual-entry'")))
 
 
 (defmacro Manual-delete-char (n)
@@ -394,6 +415,7 @@
 
 
 (defun Manual-nuke-nroff-bs-footers ()
+  "For info see comments in packages/man.el"
   ;; Nuke headers and footers.
   ;;
   ;; nroff assumes pages are 66 lines high.  We assume that, and that the
@@ -492,7 +514,7 @@
 (defun Manual-mouseify-xrefs ()
   (goto-char (point-min))
   (let ((case-fold-search nil)
-	s e name extent)
+	s e name splitp extent)
     ;; possibly it would be faster to rewrite this expression to search for
     ;; a less common sequence first (like "([0-9]") and then back up to see
     ;; if it's really a match.  This function is 15% of the total time, 13%
@@ -501,29 +523,49 @@
 			      nil t)
       (setq s (match-beginning 0)
 	    e (match-end 0)
-	    name (buffer-substring s e))
+	    name (buffer-substring s e)
+	    splitp nil)
+
       (goto-char s)
-      (skip-chars-backward " \t")
-      (if (and (bolp) (not (bobp))
-	       (progn (backward-char 1) (equal (char-before) ?-)))
-	  (progn
-	    (setq s (point))
-	    (skip-chars-backward "-a-zA-Z0-9_.:")
-	    (setq name (concat (buffer-substring (point)
-						 (if (>= s 0)
-						     (1- s)
-						   0))
-			       name))
-	    (setq s (point))))
+      ;; if this is a hyphenated xref, we're on the second line, 1st char now.
+
+      (when (progn
+	      (beginning-of-line)
+	      (and (looking-at (concat "^[ \t]+" (regexp-quote name)))
+		   (progn
+		     (backward-char 1)
+		     (or (equal (char-before) ?-)
+			 (equal (char-before) ?\255)))
+		   (setq s (progn
+			     (skip-chars-backward "-\255_a-zA-Z0-9")
+			     (point))
+			 name (buffer-substring s e))))
+	(setq splitp t)
+	;; delete the spaces and dash from `name'
+	(let (i)
+	  (while (setq i (string-match "[-\255 \n\t]+" name i))
+	    (setq name (concat (substring name 0 i)
+			       (substring name (match-end 0)))
+		  i (1+ i)))))
+
       ;; if there are upper case letters in the section, downcase them.
       (if (string-match "(.*[A-Z]+.*)$" name)
 	  (setq name (concat (substring name 0 (match-beginning 0))
 			     (downcase (substring name (match-beginning 0))))))
-      ;; (setq already-fontified (extent-at s))
-      (setq extent (make-extent s e))
+
+      ;; if the xref was hyphenated, don't highlight the indention spaces.
+      (if splitp
+	  (progn
+	    (setq extent (make-extent s (progn (goto-char s) (end-of-line) (point))))
+	    (set-extent-property extent 'man (list 'Manual-follow-xref name))
+	    (set-extent-property extent 'highlight t)
+	    (set-extent-face extent 'man-xref)
+	    (goto-char e)
+	    (skip-chars-backward "-_a-zA-Z0-9()")
+	    (setq extent (make-extent (point) e)))
+	(setq extent (make-extent s e)))
       (set-extent-property extent 'man (list 'Manual-follow-xref name))
       (set-extent-property extent 'highlight t)
-      ;; (if (not already-fontified)...
       (set-extent-face extent 'man-xref)
       (goto-char e))))
 
@@ -561,7 +603,6 @@
   (interactive "e")
   (let ((buffer (current-buffer))
 	(sep "---")
-	(prefix "Show Manual Page for ")
 	xref items)
     (cond (event
 	   (setq buffer (event-buffer event))
@@ -579,13 +620,14 @@
 		    nil))
 		 buffer)
     (if (eq sep (car items)) (setq items (cdr items)))
-    (let ((popup-menu-titles nil))
+    (let ((popup-menu-titles t))
+      (and (null items) (setq popup-menu-titles nil))
       (popup-menu
        (cons "Manual Entry"
 	     (mapcar #'(lambda (item)
 			 (if (eq item sep)
 			     item
-                           (vector (concat prefix item)
+                           (vector item
                                    (list 'Manual-follow-xref item) t)))
 		     (nreverse items)))))))
 
@@ -606,9 +648,16 @@
 		  (setq manpage (buffer-substring (match-beginning 1)
 						  (match-end 1)))
 		(setq manpage "???"))
-	      (setq buffer
-		    (rename-buffer
-		     (generate-new-buffer-name (concat "*man " manpage "*"))))
+	      (flet
+		  ((maybe-star ()
+			       (if buffers-menu-submenus-for-groups-p
+				   "*"
+				 "")))
+		(setq buffer
+		      (rename-buffer
+		       (generate-new-buffer-name (concat (maybe-star)
+							 manpage
+							 (maybe-star))))))
 	      (setq buffer-file-name nil)
 	      (goto-char (point-min))
 	      (insert (format "%s\n" buf-name))
--- a/lisp/prim/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/prim/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,12 +1,12 @@
-(custom-put 'backup 'custom-loads '("files"))
-(custom-put 'find-file 'custom-loads '("files"))
-(custom-put 'frames 'custom-loads '("frame" "window-xemacs" "gui"))
-(custom-put 'help-appearance 'custom-loads '("help"))
-(custom-put 'isearch 'custom-loads '("isearch-mode"))
+(custom-put 'sound 'custom-loads '("sound"))
+(custom-put 'paren-matching 'custom-loads '())
+(custom-put 'fill-comments 'custom-loads '("simple"))
+(custom-put 'killing 'custom-loads '("simple"))
+(custom-put 'editing-basics 'custom-loads '("simple" "files" "lisp" "cmdloop"))
+(custom-put 'modeline 'custom-loads '("modeline"))
 (custom-put 'minibuffer 'custom-loads '("minibuf"))
-(custom-put 'modeline 'custom-loads '("modeline"))
-(custom-put 'editing-basics 'custom-loads '("simple" "files" "lisp" "cmdloop"))
-(custom-put 'killing 'custom-loads '("simple"))
-(custom-put 'fill-comments 'custom-loads '("simple"))
-(custom-put 'paren-matching 'custom-loads '())
-(custom-put 'sound 'custom-loads '("sound"))
+(custom-put 'isearch 'custom-loads '("isearch-mode"))
+(custom-put 'help-appearance 'custom-loads '("help"))
+(custom-put 'frames 'custom-loads '("frame" "window-xemacs" "gui"))
+(custom-put 'find-file 'custom-loads '("files"))
+(custom-put 'backup 'custom-loads '("files"))
--- a/lisp/prim/files.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/prim/files.el	Mon Aug 13 09:53:19 2007 +0200
@@ -3024,8 +3024,14 @@
 		      val)
 		    (setq active t))
 	       (setq processes (cdr processes)))
-	     (or (not active)
-		 (yes-or-no-p "Active processes exist; kill them and exit anyway? "))))
+	     (or
+	      (not active)
+	      (save-excursion
+		(save-window-excursion
+		  (delete-other-windows)
+		  (list-processes)
+		  (yes-or-no-p
+		   "Active processes exist; kill them and exit anyway? "))))))
        ;; Query the user for other things, perhaps.
        (run-hook-with-args-until-failure 'kill-emacs-query-functions)
        (kill-emacs)))
--- a/lisp/prim/obsolete.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/prim/obsolete.el	Mon Aug 13 09:53:19 2007 +0200
@@ -48,9 +48,15 @@
 (defsubst define-obsolete-variable-alias (oldvar newvar)
   "Define OLDVAR as an obsolete alias for variable NEWVAR.
 This makes referencing or setting OLDVAR equivalent to referencing or
-setting NEWVAR and marks OLDVAR as obsolete."
-  (defvaralias oldvar newvar)
-  (make-obsolete-variable oldvar newvar))
+setting NEWVAR and marks OLDVAR as obsolete. 
+If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR.
+
+Note: Use this before any other references (defvar/defcustom) to NEWVAR"
+  (let ((needs-setting (and (boundp oldvar) (not (boundp newvar))))
+        (value (and (boundp oldvar) (symbol-value oldvar))))
+     (defvaralias oldvar newvar)
+     (make-obsolete-variable oldvar newvar)
+     (and needs-setting (set newvar value))))
 
 (defsubst define-compatible-variable-alias (oldvar newvar)
   "Define OLDVAR as a compatible alias for variable NEWVAR.
--- a/lisp/prim/simple.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/prim/simple.el	Mon Aug 13 09:53:19 2007 +0200
@@ -2334,6 +2334,13 @@
 		 regexp)
   :group 'fill)
 
+(defvar comment-line-break-function 'indent-new-comment-line
+  "*Mode-specific function which line breaks and continues a comment.
+
+This function is only called during auto-filling of a comment section.
+The function should take a single optional argument which is a flag
+indicating whether soft newlines should be inserted.")
+
 ;; This function is the auto-fill-function of a buffer
 ;; when Auto-Fill mode is enabled.
 ;; It returns t if it really did any work.
@@ -2515,10 +2522,10 @@
 		(if (save-excursion
 		      (skip-chars-backward " \t")
 		      (= (point) fill-point))
-		    (indent-new-comment-line t)
+		    (funcall comment-line-break-function t)
 		  (save-excursion
 		    (goto-char fill-point)
-		    (indent-new-comment-line t)))
+		    (funcall comment-line-break-function t)))
 		;; Now do justification, if required
 		(if (not (eq justify 'left))
 		    (save-excursion 
--- a/lisp/psgml/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/psgml/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,7 +1,7 @@
-(custom-put 'tempo 'custom-loads '("tempo"))
-(custom-put 'psgml-dtd 'custom-loads '("psgml"))
-(custom-put 'psgml-insert 'custom-loads '("psgml"))
+(custom-put 'html 'custom-loads '("psgml-html"))
+(custom-put 'psgml-html 'custom-loads '("psgml-html"))
+(custom-put 'sgml 'custom-loads '("psgml-html" "psgml"))
 (custom-put 'psgml 'custom-loads '("psgml-html" "psgml"))
-(custom-put 'sgml 'custom-loads '("psgml-html" "psgml"))
-(custom-put 'psgml-html 'custom-loads '("psgml-html"))
-(custom-put 'html 'custom-loads '("psgml-html"))
+(custom-put 'psgml-insert 'custom-loads '("psgml"))
+(custom-put 'psgml-dtd 'custom-loads '("psgml"))
+(custom-put 'tempo 'custom-loads '("tempo"))
--- a/lisp/utils/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/utils/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,14 +1,14 @@
-(custom-put 'uniquify 'custom-loads '("uniquify"))
-(custom-put 'smtpmail 'custom-loads '("smtpmail"))
-(custom-put 'savehist 'custom-loads '("savehist"))
-(custom-put 'ph 'custom-loads '("ph"))
-(custom-put 'passwd 'custom-loads '("passwd"))
-(custom-put 'message-headers 'custom-loads '())
+(custom-put 'highlight-headers-faces 'custom-loads '("highlight-headers"))
+(custom-put 'crontab 'custom-loads '("crontab"))
+(custom-put 'browse-url 'custom-loads '("browse-url"))
+(custom-put 'detached-minibuf 'custom-loads '("detached-minibuf"))
+(custom-put 'edmacro 'custom-loads '("edmacro"))
+(custom-put 'eldoc 'custom-loads '("eldoc"))
+(custom-put 'elp 'custom-loads '("elp"))
 (custom-put 'highlight-headers 'custom-loads '("highlight-headers"))
-(custom-put 'elp 'custom-loads '("elp"))
-(custom-put 'eldoc 'custom-loads '("eldoc"))
-(custom-put 'edmacro 'custom-loads '("edmacro"))
-(custom-put 'detached-minibuf 'custom-loads '("detached-minibuf"))
-(custom-put 'browse-url 'custom-loads '("browse-url"))
-(custom-put 'crontab 'custom-loads '("crontab"))
-(custom-put 'highlight-headers-faces 'custom-loads '("highlight-headers"))
+(custom-put 'message-headers 'custom-loads '())
+(custom-put 'passwd 'custom-loads '("passwd"))
+(custom-put 'ph 'custom-loads '("ph"))
+(custom-put 'savehist 'custom-loads '("savehist"))
+(custom-put 'smtpmail 'custom-loads '("smtpmail"))
+(custom-put 'uniquify 'custom-loads '("uniquify"))
--- a/lisp/viper/Makefile	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/Makefile	Mon Aug 13 09:53:19 2007 +0200
@@ -7,9 +7,9 @@
 # variables VERSION, EMACS, DATADIR and comment out the Emacs-specific
 # versions.
 
-VERSION = 19.34
+VERSION = 20.0
 EMACS = emacs-$(VERSION)
-#VERSION = 19.14
+#VERSION = 20.3
 #EMACS = xemacs-$(VERSION)
 PREFIX = /usr/local
 DATADIR = $(PREFIX)/share
@@ -17,6 +17,7 @@
 LISPDIR = $(DATADIR)/emacs/site-lisp
 INFODIR = $(PREFIX)/info
 ETCDIR = $(DATADIR)/emacs/$(VERSION)/etc
+COMPDIR =
 
 # --------- YOU PROBABLY DON'T WANT TO CHANGE THESE ----------------
 TeX = tex
@@ -27,8 +28,16 @@
 # --------- ONLY AUTHORIZED PERSONNEL BEYOND THIS POINT!!! ------------
 VIPER = viper.el viper-cmd.el viper-util.el viper-mous.el viper-ex.el \
         viper-macs.el viper-keym.el viper-init.el
-VIPERelc = viper-util.elc viper-mous.elc viper-ex.elc viper-macs.elc \
-	   viper-keym.elc viper.elc viper-cmd.elc viper-init.elc
+VIPERelc = $(COMPDIR)viper-util.elc \
+	   $(COMPDIR)viper-mous.elc \
+	   $(COMPDIR)viper-ex.elc \
+	   $(COMPDIR)viper-macs.elc \
+	   $(COMPDIR)viper-keym.elc \
+	   $(COMPDIR)viper.elc \
+	   $(COMPDIR)viper-cmd.elc \
+	   $(COMPDIR)viper-init.elc
+
+COMPILE_ARGS = -batch -f batch-byte-compile
 
 all: dvi info hello elc goodbye
 
@@ -48,7 +57,7 @@
 hello:
 	@echo ""
 	@echo ""
-	@echo "Byte compiling using Emacs 19"
+	@echo "Byte compiling using Emacs"
 	@echo "Use  make EMACS=xemacs  to compile under XEmacs"
 	@echo ""
 	@echo ""
@@ -89,37 +98,37 @@
 	@echo ""
 	$(TeX) viperCard.tex
 
-viper-init.elc: viper-init.el
+${COMPDIR}viper-init.elc: viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-init.el
+	$(EMACS) $(COMPILE_ARGS) viper-init.el
 
-viper-util.elc: viper-util.el viper-init.el
+$(COMPDIR)viper-util.elc: viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-util.el
+	$(EMACS) $(COMPILE_ARGS) viper-util.el
 
-viper-ex.elc: viper-ex.el viper-util.el viper-init.el
+$(COMPDIR)viper-ex.elc: viper-ex.el viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-ex.el
+	$(EMACS) $(COMPILE_ARGS) viper-ex.el
 
-viper-mous.elc: viper-mous.el viper-util.el viper-init.el
+$(COMPDIR)viper-mous.elc: viper-mous.el viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-mous.el
+	$(EMACS) $(COMPILE_ARGS) viper-mous.el
 
-viper-macs.elc: viper-macs.el viper-util.el viper-init.el
+$(COMPDIR)viper-macs.elc: viper-macs.el viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-macs.el
+	$(EMACS) $(COMPILE_ARGS) viper-macs.el
 
-viper-keym.elc: viper-keym.el viper-util.el viper-init.el
+$(COMPDIR)viper-keym.elc: viper-keym.el viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-keym.el
+	$(EMACS) $(COMPILE_ARGS) viper-keym.el
 
-viper.elc: viper.el viper-util.el viper-init.el
+$(COMPDIR)viper.elc: viper.el viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper.el
+	$(EMACS) $(COMPILE_ARGS) viper.el
 
-viper-cmd.elc: viper-cmd.el viper.el viper-util.el viper-init.el
+$(COMPDIR)viper-cmd.elc: viper-cmd.el viper.el viper-util.el viper-init.el
 	@echo ""
-	$(EMACS) -batch -f batch-byte-compile viper-cmd.el
+	$(EMACS) $(COMPILE_ARGS) viper-cmd.el
 
 
 dvi: viper.dvi viperCard.dvi
--- a/lisp/viper/auto-autoloads.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/auto-autoloads.el	Mon Aug 13 09:53:19 2007 +0200
@@ -5,9 +5,9 @@
 (provide 'viper-autoloads)
 ))
 
-;;;### (autoloads (viper-mode) "viper" "viper/viper.el")
+;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "viper/viper.el")
 
-(defalias 'vip-mode 'viper-mode)
+(autoload 'toggle-viper-mode "viper" nil t nil)
 
 (autoload 'viper-mode "viper" "\
 Turn on Viper emulation of Vi." t nil)
--- a/lisp/viper/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,3 +1,3 @@
-(custom-put 'viper 'custom-loads '("viper-cmd" "viper-ex" "viper-init" "viper-keym" "viper-macs" "viper-mous" "viper-util"))
+(custom-put 'viper 'custom-loads '("viper-cmd" "viper-ex" "viper-init" "viper-keym" "viper-macs" "viper-mous" "viper-util" "viper"))
 (custom-put 'viper-mouse 'custom-loads '("viper-mous"))
 (custom-put 'viper-ex 'custom-loads '("viper-ex"))
--- a/lisp/viper/viper-cmd.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-cmd.el	Mon Aug 13 09:53:19 2007 +0200
@@ -8,13 +8,13 @@
 (require 'advice)
 
 ;; Compiler pacifier
-(defvar vip-minibuffer-current-face)
-(defvar vip-minibuffer-insert-face)
-(defvar vip-minibuffer-vi-face)
-(defvar vip-minibuffer-emacs-face)
+(defvar viper-minibuffer-current-face)
+(defvar viper-minibuffer-insert-face)
+(defvar viper-minibuffer-vi-face)
+(defvar viper-minibuffer-emacs-face)
 (defvar viper-always)
-(defvar vip-mode-string)
-(defvar vip-custom-file-name)
+(defvar viper-mode-string)
+(defvar viper-custom-file-name)
 (defvar iso-accents-mode)
 (defvar zmacs-region-stays)
 (defvar mark-even-if-inactive)
@@ -53,151 +53,154 @@
 ;; generate test functions
 ;; given symbol foo, foo-p is the test function, foos is the set of
 ;; Viper command keys
-;; (macroexpand '(vip-test-com-defun foo))
+;; (macroexpand '(viper-test-com-defun foo))
 ;; (defun foo-p (com) (consp (memq (if (< com 0) (- com) com) foos)))
 
-(defmacro vip-test-com-defun (name)
+(defmacro viper-test-com-defun (name)
   (let* ((snm (symbol-name name))
 	 (nm-p (intern (concat snm "-p")))
 	 (nms (intern (concat snm "s"))))
     (` (defun (, nm-p) (com) 
-	 (consp (memq (if (< com 0) (- com) com) (, nms)))))))
+	 (consp (memq (if (and (viper-characterp com) (< com 0))
+			  (- com) com) (, nms)))))))
   
 ;; Variables for defining VI commands
 
 ;; Modifying commands that can be prefixes to movement commands
-(defconst vip-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\"))
-;; define vip-prefix-command-p
-(vip-test-com-defun vip-prefix-command)
+(defconst viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\"))
+;; define viper-prefix-command-p
+(viper-test-com-defun viper-prefix-command)
   
 ;; Commands that are pairs eg. dd. r and R here are a hack
-(defconst vip-charpair-commands '(?c ?d ?y ?! ?= ?< ?> ?r ?R))
-;; define vip-charpair-command-p
-(vip-test-com-defun vip-charpair-command)
-
-(defconst vip-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?H ?j ?k ?l
+(defconst viper-charpair-commands '(?c ?d ?y ?! ?= ?< ?> ?r ?R))
+;; define viper-charpair-command-p
+(viper-test-com-defun viper-charpair-command)
+
+(defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?H ?j ?k ?l
 				     ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?%
 				     ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?`
 				     ?; ?, ?0 ?? ?/ ?\C-m ?\ 
+				     space return
+				     delete backspace
 				     )
 				     "Movement commands")
-;; define vip-movement-command-p
-(vip-test-com-defun vip-movement-command)
+;; define viper-movement-command-p
+(viper-test-com-defun viper-movement-command)
 
 ;; Vi digit commands
-(defconst vip-digit-commands '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))
-
-;; define vip-digit-command-p
-(vip-test-com-defun vip-digit-command)
+(defconst viper-digit-commands '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))
+
+;; define viper-digit-command-p
+(viper-test-com-defun viper-digit-command)
 
 ;; Commands that can be repeated by . (dotted)
-(defconst vip-dotable-commands '(?c ?d ?C ?s ?S ?D ?> ?<))
-;; define vip-dotable-command-p
-(vip-test-com-defun vip-dotable-command)
+(defconst viper-dotable-commands '(?c ?d ?C ?s ?S ?D ?> ?<))
+;; define viper-dotable-command-p
+(viper-test-com-defun viper-dotable-command)
 
 ;; Commands that can follow a #
-(defconst vip-hash-commands '(?c ?C ?g ?q ?s))
-;; define vip-hash-command-p
-(vip-test-com-defun vip-hash-command)
+(defconst viper-hash-commands '(?c ?C ?g ?q ?s))
+;; define viper-hash-command-p
+(viper-test-com-defun viper-hash-command)
 
 ;; Commands that may have registers as prefix
-(defconst vip-regsuffix-commands '(?d ?y ?Y ?D ?p ?P ?x ?X))
-;; define vip-regsuffix-command-p
-(vip-test-com-defun vip-regsuffix-command)
-
-(defconst vip-vi-commands (append vip-movement-commands
-				  vip-digit-commands
-				  vip-dotable-commands
-				  vip-charpair-commands
-				  vip-hash-commands
-				  vip-prefix-commands
-				  vip-regsuffix-commands)
+(defconst viper-regsuffix-commands '(?d ?y ?Y ?D ?p ?P ?x ?X))
+;; define viper-regsuffix-command-p
+(viper-test-com-defun viper-regsuffix-command)
+
+(defconst viper-vi-commands (append viper-movement-commands
+				  viper-digit-commands
+				  viper-dotable-commands
+				  viper-charpair-commands
+				  viper-hash-commands
+				  viper-prefix-commands
+				  viper-regsuffix-commands)
   "The list of all commands in Vi-state.")
-;; define vip-vi-command-p
-(vip-test-com-defun vip-vi-command)
+;; define viper-vi-command-p
+(viper-test-com-defun viper-vi-command)
 
 
 ;;; CODE
 
 ;; sentinels
 
-;; Runs vip-after-change-functions inside after-change-functions
-(defun vip-after-change-sentinel (beg end len)
-  (let ((list vip-after-change-functions))
+;; Runs viper-after-change-functions inside after-change-functions
+(defun viper-after-change-sentinel (beg end len)
+  (let ((list viper-after-change-functions))
     (while list
       (funcall (car list) beg end len)
       (setq list (cdr list)))))
       
-;; Runs vip-before-change-functions inside before-change-functions
-(defun vip-before-change-sentinel (beg end)
-  (let ((list vip-before-change-functions))
+;; Runs viper-before-change-functions inside before-change-functions
+(defun viper-before-change-sentinel (beg end)
+  (let ((list viper-before-change-functions))
     (while list
       (funcall (car list) beg end)
       (setq list (cdr list)))))
 
-(defsubst vip-post-command-sentinel ()
-  (run-hooks 'vip-post-command-hooks))
+(defsubst viper-post-command-sentinel ()
+  (run-hooks 'viper-post-command-hooks))
   
-(defsubst vip-pre-command-sentinel ()
-  (run-hooks 'vip-pre-command-hooks))
+(defsubst viper-pre-command-sentinel ()
+  (run-hooks 'viper-pre-command-hooks))
   
 ;; Needed so that Viper will be able to figure the last inserted
 ;; chunk of text with reasonable accuracy.
-(defsubst vip-insert-state-post-command-sentinel ()
-  (if (and (memq vip-current-state '(insert-state replace-state))
-	   vip-insert-point
-	   (>= (point) vip-insert-point))
-      (setq vip-last-posn-while-in-insert-state (point-marker)))
-  (if (eq vip-current-state 'insert-state)
+(defsubst viper-insert-state-post-command-sentinel ()
+  (if (and (memq viper-current-state '(insert-state replace-state))
+	   viper-insert-point
+	   (>= (point) viper-insert-point))
+      (setq viper-last-posn-while-in-insert-state (point-marker)))
+  (if (eq viper-current-state 'insert-state)
       (progn
-	(or (stringp vip-saved-cursor-color)
-	    (string= (vip-get-cursor-color) vip-insert-state-cursor-color)
-	    (setq vip-saved-cursor-color (vip-get-cursor-color)))
-	(if (stringp vip-saved-cursor-color)
-	    (vip-change-cursor-color vip-insert-state-cursor-color))
+	(or (stringp viper-saved-cursor-color)
+	    (string= (viper-get-cursor-color) viper-insert-state-cursor-color)
+	    (setq viper-saved-cursor-color (viper-get-cursor-color)))
+	(if (stringp viper-saved-cursor-color)
+	    (viper-change-cursor-color viper-insert-state-cursor-color))
 	))
   (if (and (eq this-command 'dabbrev-expand)
-	   (integerp vip-pre-command-point)
-	   (> vip-insert-point vip-pre-command-point))
-      (move-marker vip-insert-point vip-pre-command-point))
+	   (integerp viper-pre-command-point)
+	   (> viper-insert-point viper-pre-command-point))
+      (move-marker viper-insert-point viper-pre-command-point))
   )
   
-(defsubst vip-insert-state-pre-command-sentinel ()
+(defsubst viper-insert-state-pre-command-sentinel ()
   (or (memq this-command '(self-insert-command))
-      (memq (vip-event-key last-command-event)
+      (memq (viper-event-key last-command-event)
 	    '(up down left right (meta f) (meta b)
 		 (control n) (control p) (control f) (control b)))
-      (vip-restore-cursor-color-after-insert))
+      (viper-restore-cursor-color-after-insert))
   (if (and (eq this-command 'dabbrev-expand)
-	   (markerp vip-insert-point)
-	   (marker-position vip-insert-point))
-      (setq vip-pre-command-point (marker-position vip-insert-point))))
+	   (markerp viper-insert-point)
+	   (marker-position viper-insert-point))
+      (setq viper-pre-command-point (marker-position viper-insert-point))))
 	
-(defsubst vip-R-state-post-command-sentinel ()
+(defsubst viper-R-state-post-command-sentinel ()
   ;; Restoring cursor color is needed despite
-  ;; vip-replace-state-pre-command-sentinel: When you jump to another buffer in
-  ;; another frame, the pre-command hook won't change cursor color to default
-  ;; in that other frame.  So, if the second frame cursor was red and we set
-  ;; the point outside the replacement region, then the cursor color will
-  ;; remain red. Restoring the default, below, prevents this.
-  (if (and (<= (vip-replace-start) (point))
-	   (<=  (point) (vip-replace-end)))
-      (vip-change-cursor-color vip-replace-overlay-cursor-color)
-    (vip-restore-cursor-color-after-replace)
+  ;; viper-replace-state-pre-command-sentinel: When you jump to another buffer
+  ;; in another frame, the pre-command hook won't change cursor color to
+  ;; default in that other frame.  So, if the second frame cursor was red and
+  ;; we set the point outside the replacement region, then the cursor color
+  ;; will remain red. Restoring the default, below, prevents this.
+  (if (and (<= (viper-replace-start) (point))
+	   (<=  (point) (viper-replace-end)))
+      (viper-change-cursor-color viper-replace-overlay-cursor-color)
+    (viper-restore-cursor-color-after-replace)
     ))
 
 ;; to speed up, don't change cursor color before self-insert
 ;; and common move commands
-(defsubst vip-replace-state-pre-command-sentinel ()
+(defsubst viper-replace-state-pre-command-sentinel ()
   (or (memq this-command '(self-insert-command))
-      (memq (vip-event-key last-command-event)
+      (memq (viper-event-key last-command-event)
 	    '(up down left right (meta f) (meta b)
 		 (control n) (control p) (control f) (control b)))
-      (vip-restore-cursor-color-after-replace)))
+      (viper-restore-cursor-color-after-replace)))
   
-(defun vip-replace-state-post-command-sentinel ()
+(defun viper-replace-state-post-command-sentinel ()
   ;; Restoring cursor color is needed despite
-  ;; vip-replace-state-pre-command-sentinel: When one jumps to another buffer
+  ;; viper-replace-state-pre-command-sentinel: When one jumps to another buffer
   ;; in another frame, the pre-command hook won't change cursor color to
   ;; default in that other frame.  So, if the second frame cursor was red and
   ;; we set the point outside the replacement region, then the cursor color
@@ -205,57 +208,58 @@
   ;;
   ;; We optimize for self-insert-command's here, since they either don't change
   ;; cursor color or, if they terminate replace mode, the color will be changed
-  ;; in vip-finish-change
+  ;; in viper-finish-change
   (or (memq this-command '(self-insert-command))
-      (vip-restore-cursor-color-after-replace))
+      (viper-restore-cursor-color-after-replace))
   (cond 
-   ((eq vip-current-state 'replace-state)
+   ((eq viper-current-state 'replace-state)
     ;; delete characters to compensate for inserted chars.
-    (let ((replace-boundary (vip-replace-end)))
+    (let ((replace-boundary (viper-replace-end)))
       (save-excursion
-	(goto-char vip-last-posn-in-replace-region)
-	(delete-char vip-replace-chars-to-delete)
-	(setq vip-replace-chars-to-delete 0
-	      vip-replace-chars-deleted 0)
+	(goto-char viper-last-posn-in-replace-region)
+	(delete-char viper-replace-chars-to-delete)
+	(setq viper-replace-chars-to-delete 0
+	      viper-replace-chars-deleted 0)
 	;; terminate replace mode if reached replace limit
-	(if (= vip-last-posn-in-replace-region 
-	       (vip-replace-end))
-	    (vip-finish-change vip-last-posn-in-replace-region)))
+	(if (= viper-last-posn-in-replace-region 
+	       (viper-replace-end))
+	    (viper-finish-change viper-last-posn-in-replace-region)))
       
-      (if (and (<= (vip-replace-start) (point))
+      (if (and (<= (viper-replace-start) (point))
 	       (<=  (point) replace-boundary))
 	  (progn
-	    ;; the state may have changed in vip-finish-change above
-	    (if (eq vip-current-state 'replace-state)
-		(vip-change-cursor-color vip-replace-overlay-cursor-color))
-	    (setq vip-last-posn-in-replace-region (point-marker))))
+	    ;; the state may have changed in viper-finish-change above
+	    (if (eq viper-current-state 'replace-state)
+		(viper-change-cursor-color viper-replace-overlay-cursor-color))
+	    (setq viper-last-posn-in-replace-region (point-marker))))
       ))
    
    (t ;; terminate replace mode if changed Viper states.
-    (vip-finish-change vip-last-posn-in-replace-region))))
+    (viper-finish-change viper-last-posn-in-replace-region))))
 
 
 ;; changing mode
 
 ;; Change state to NEW-STATE---either emacs-state, vi-state, or insert-state.
-(defun vip-change-state (new-state)
-  ;; Keep vip-post/pre-command-hooks fresh.
-  ;; We remove then add vip-post/pre-command-sentinel since it is very
-  ;; desirable that vip-pre-command-sentinel is the last hook and
-  ;; vip-post-command-sentinel is the first hook.
-  (remove-hook 'post-command-hook 'vip-post-command-sentinel)
-  (add-hook 'post-command-hook 'vip-post-command-sentinel)
-  (remove-hook 'pre-command-hook 'vip-pre-command-sentinel)
-  (add-hook 'pre-command-hook 'vip-pre-command-sentinel t)
+(defun viper-change-state (new-state)
+  ;; Keep viper-post/pre-command-hooks fresh.
+  ;; We remove then add viper-post/pre-command-sentinel since it is very
+  ;; desirable that viper-pre-command-sentinel is the last hook and
+  ;; viper-post-command-sentinel is the first hook.
+  (remove-hook 'post-command-hook 'viper-post-command-sentinel)
+  (add-hook 'post-command-hook 'viper-post-command-sentinel)
+  (remove-hook 'pre-command-hook 'viper-pre-command-sentinel)
+  (add-hook 'pre-command-hook 'viper-pre-command-sentinel t)
   ;; These hooks will be added back if switching to insert/replace mode
-  (vip-remove-hook 'vip-post-command-hooks
-		   'vip-insert-state-post-command-sentinel)
-  (vip-remove-hook 'vip-pre-command-hooks
-		   'vip-insert-state-pre-command-sentinel)
+  (viper-remove-hook 'viper-post-command-hooks
+		     'viper-insert-state-post-command-sentinel)
+  (viper-remove-hook 'viper-pre-command-hooks
+		     'viper-insert-state-pre-command-sentinel)
+  (setq viper-intermediate-command nil)
   (cond ((eq new-state 'vi-state)
-	 (cond ((member vip-current-state '(insert-state replace-state))
+	 (cond ((member viper-current-state '(insert-state replace-state))
 		    
-		;; move vip-last-posn-while-in-insert-state
+		;; move viper-last-posn-while-in-insert-state
 		;; This is a normal hook that is executed in insert/replace
 		;; states after each command. In Vi/Emacs state, it does
 		;; nothing. We need to execute it here to make sure that
@@ -263,139 +267,142 @@
 		;; It may be left unrecorded if the last thing done in
 		;; insert/repl state was dabbrev-expansion or abbrev
 		;; expansion caused by hitting ESC
-		(vip-insert-state-post-command-sentinel)
+		(viper-insert-state-post-command-sentinel)
 		
 		(condition-case conds
 		    (progn
-		      (vip-save-last-insertion
-		       vip-insert-point 
-		       vip-last-posn-while-in-insert-state)
-		      (if vip-began-as-replace
-			  (setq vip-began-as-replace nil)
+		      (viper-save-last-insertion
+		       viper-insert-point 
+		       viper-last-posn-while-in-insert-state)
+		      (if viper-began-as-replace
+			  (setq viper-began-as-replace nil)
 			;; repeat insert commands if numerical arg > 1
 			(save-excursion
-			  (vip-repeat-insert-command))))
+			  (viper-repeat-insert-command))))
 		  (error
-		   (vip-message-conditions conds)))
+		   (viper-message-conditions conds)))
 		     
-		(if (> (length vip-last-insertion) 0)
-		    (vip-push-onto-ring vip-last-insertion
-					'vip-insertion-ring))
+		(if (> (length viper-last-insertion) 0)
+		    (viper-push-onto-ring viper-last-insertion
+					  'viper-insertion-ring))
 		
-		(if vip-ex-style-editing-in-insert
+		(if viper-ex-style-editing-in-insert
 		    (or (bolp) (backward-char 1))))
 	       ))
 	 
 	;; insert or replace
 	((memq new-state '(insert-state replace-state))
-	 (if (memq vip-current-state '(emacs-state vi-state))
-	     (vip-move-marker-locally 'vip-insert-point (point)))
-	 (vip-move-marker-locally 'vip-last-posn-while-in-insert-state (point))
-	 (vip-add-hook 'vip-post-command-hooks
-		       'vip-insert-state-post-command-sentinel t)
-	 (vip-add-hook 'vip-pre-command-hooks
-		       'vip-insert-state-pre-command-sentinel t))
+	 (if (memq viper-current-state '(emacs-state vi-state))
+	     (viper-move-marker-locally 'viper-insert-point (point)))
+	 (viper-move-marker-locally
+	  'viper-last-posn-while-in-insert-state (point))
+	 (viper-add-hook 'viper-post-command-hooks
+			 'viper-insert-state-post-command-sentinel t)
+	 (viper-add-hook 'viper-pre-command-hooks
+			 'viper-insert-state-pre-command-sentinel t))
 	) ; outermost cond
   
   ;; Nothing needs to be done to switch to emacs mode! Just set some
-  ;; variables, which is already done in vip-change-state-to-emacs!
-
-  (setq vip-current-state new-state)
-  (vip-normalize-minor-mode-map-alist)
-  (vip-adjust-keys-for new-state)
-  (vip-set-mode-vars-for new-state)
-  (vip-refresh-mode-line)
+  ;; variables, which is already done in viper-change-state-to-emacs!
+
+  (setq viper-current-state new-state)
+  (viper-normalize-minor-mode-map-alist)
+  (viper-adjust-keys-for new-state)
+  (viper-set-mode-vars-for new-state)
+  (viper-refresh-mode-line)
   )
 
 
     
-(defun vip-adjust-keys-for (state)
+(defun viper-adjust-keys-for (state)
   "Make necessary adjustments to keymaps before entering STATE."
   (cond ((memq state '(insert-state replace-state))
-	 (if vip-auto-indent
+	 (if viper-auto-indent
 	     (progn
-	       (define-key vip-insert-basic-map "\C-m" 'vip-autoindent)
-	       (if vip-want-emacs-keys-in-insert
+	       (define-key viper-insert-basic-map "\C-m" 'viper-autoindent)
+	       (if viper-want-emacs-keys-in-insert
 		   ;; expert
-		   (define-key vip-insert-basic-map "\C-j" nil)
+		   (define-key viper-insert-basic-map "\C-j" nil)
 		 ;; novice
-		 (define-key vip-insert-basic-map "\C-j" 'vip-autoindent)))
-	   (define-key vip-insert-basic-map "\C-m" nil)
-	   (define-key vip-insert-basic-map "\C-j" nil))
+		 (define-key viper-insert-basic-map "\C-j" 'viper-autoindent)))
+	   (define-key viper-insert-basic-map "\C-m" nil)
+	   (define-key viper-insert-basic-map "\C-j" nil))
 		    
-	 (setq vip-insert-diehard-minor-mode
-	       (not vip-want-emacs-keys-in-insert))
+	 (setq viper-insert-diehard-minor-mode
+	       (not viper-want-emacs-keys-in-insert))
 		   
-	 (if vip-want-ctl-h-help
+	 (if viper-want-ctl-h-help
 	     (progn 
-	       (define-key vip-insert-basic-map [(control h)] 'help-command)
-	       (define-key vip-replace-map [(control h)] 'help-command))
-	   (define-key vip-insert-basic-map 
-	     [(control h)] 'vip-del-backward-char-in-insert)
-	   (define-key vip-replace-map
-	     [(control h)] 'vip-del-backward-char-in-replace)))
+	       (define-key viper-insert-basic-map [(control h)] 'help-command)
+	       (define-key viper-replace-map [(control h)] 'help-command))
+	   (define-key viper-insert-basic-map 
+	     [(control h)] 'viper-del-backward-char-in-insert)
+	   (define-key viper-replace-map
+	     [(control h)] 'viper-del-backward-char-in-replace)))
 		     
 	(t ; Vi state
-	 (setq vip-vi-diehard-minor-mode (not vip-want-emacs-keys-in-vi))
-	 (if vip-want-ctl-h-help
-	     (define-key vip-vi-basic-map [(control h)] 'help-command)
-	   (define-key vip-vi-basic-map [(control h)] 'vip-backward-char)))
+	 (setq viper-vi-diehard-minor-mode (not viper-want-emacs-keys-in-vi))
+	 (if viper-want-ctl-h-help
+	     (define-key viper-vi-basic-map [(control h)] 'help-command)
+	   (define-key viper-vi-basic-map [(control h)] 'viper-backward-char)))
 	))
 	     
     
 ;; Normalizes minor-mode-map-alist by putting Viper keymaps first.
 ;; This ensures that Viper bindings are in effect, regardless of which minor
 ;; modes were turned on by the user or by other packages.
-(defun vip-normalize-minor-mode-map-alist ()
+(defun viper-normalize-minor-mode-map-alist ()
   (setq minor-mode-map-alist 
-	(vip-append-filter-alist
+	(viper-append-filter-alist
 	 (list
-	       (cons 'vip-vi-intercept-minor-mode vip-vi-intercept-map)
-	       (cons 'vip-vi-minibuffer-minor-mode vip-minibuffer-map) 
-	       (cons 'vip-vi-local-user-minor-mode vip-vi-local-user-map)
-	       (cons 'vip-vi-kbd-minor-mode vip-vi-kbd-map)
-	       (cons 'vip-vi-global-user-minor-mode vip-vi-global-user-map)
-	       (cons 'vip-vi-state-modifier-minor-mode
+	       (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map)
+	       (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map) 
+	       (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map)
+	       (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map)
+	       (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map)
+	       (cons 'viper-vi-state-modifier-minor-mode
 		     (if (keymapp
-			  (cdr (assoc major-mode vip-vi-state-modifier-alist)))
-			 (cdr (assoc major-mode vip-vi-state-modifier-alist))
-		       vip-empty-keymap))
-	       (cons 'vip-vi-diehard-minor-mode  vip-vi-diehard-map)
-	       (cons 'vip-vi-basic-minor-mode     vip-vi-basic-map)
-	       (cons 'vip-insert-intercept-minor-mode vip-insert-intercept-map)
-	       (cons 'vip-replace-minor-mode  vip-replace-map)
-	       ;; vip-insert-minibuffer-minor-mode must come after
-	       ;; vip-replace-minor-mode 
-	       (cons 'vip-insert-minibuffer-minor-mode
-		     vip-minibuffer-map) 
-	       (cons 'vip-insert-local-user-minor-mode
-		     vip-insert-local-user-map)
-	       (cons 'vip-insert-kbd-minor-mode vip-insert-kbd-map)
-	       (cons 'vip-insert-global-user-minor-mode
-		     vip-insert-global-user-map)
-	       (cons 'vip-insert-state-modifier-minor-mode
+			  (cdr (assoc major-mode
+				      viper-vi-state-modifier-alist))) 
+			 (cdr (assoc major-mode viper-vi-state-modifier-alist))
+		       viper-empty-keymap))
+	       (cons 'viper-vi-diehard-minor-mode  viper-vi-diehard-map)
+	       (cons 'viper-vi-basic-minor-mode     viper-vi-basic-map)
+	       (cons 'viper-insert-intercept-minor-mode
+		     viper-insert-intercept-map) 
+	       (cons 'viper-replace-minor-mode  viper-replace-map)
+	       ;; viper-insert-minibuffer-minor-mode must come after
+	       ;; viper-replace-minor-mode 
+	       (cons 'viper-insert-minibuffer-minor-mode
+		     viper-minibuffer-map) 
+	       (cons 'viper-insert-local-user-minor-mode
+		     viper-insert-local-user-map)
+	       (cons 'viper-insert-kbd-minor-mode viper-insert-kbd-map)
+	       (cons 'viper-insert-global-user-minor-mode
+		     viper-insert-global-user-map)
+	       (cons 'viper-insert-state-modifier-minor-mode
+		     (if (keymapp
+			  (cdr (assoc major-mode
+				      viper-insert-state-modifier-alist))) 
+			 (cdr (assoc major-mode
+				     viper-insert-state-modifier-alist))
+		       viper-empty-keymap))
+	       (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map)
+	       (cons 'viper-insert-basic-minor-mode viper-insert-basic-map)
+	       (cons 'viper-emacs-intercept-minor-mode
+		     viper-emacs-intercept-map)
+	       (cons 'viper-emacs-local-user-minor-mode
+		     viper-emacs-local-user-map)
+	       (cons 'viper-emacs-kbd-minor-mode viper-emacs-kbd-map)
+	       (cons 'viper-emacs-global-user-minor-mode
+		     viper-emacs-global-user-map)
+	       (cons 'viper-emacs-state-modifier-minor-mode
 		     (if (keymapp
 			  (cdr
-			   (assoc major-mode vip-insert-state-modifier-alist)))
+			   (assoc major-mode viper-emacs-state-modifier-alist)))
 			 (cdr
-			  (assoc major-mode vip-insert-state-modifier-alist))
-		       vip-empty-keymap))
-	       (cons 'vip-insert-diehard-minor-mode vip-insert-diehard-map)
-	       (cons 'vip-insert-basic-minor-mode vip-insert-basic-map)
-	       (cons 'vip-emacs-intercept-minor-mode
-		     vip-emacs-intercept-map)
-	       (cons 'vip-emacs-local-user-minor-mode
-		     vip-emacs-local-user-map)
-	       (cons 'vip-emacs-kbd-minor-mode vip-emacs-kbd-map)
-	       (cons 'vip-emacs-global-user-minor-mode
-		     vip-emacs-global-user-map)
-	       (cons 'vip-emacs-state-modifier-minor-mode
-		     (if (keymapp
-			  (cdr
-			   (assoc major-mode vip-emacs-state-modifier-alist)))
-			 (cdr
-			  (assoc major-mode vip-emacs-state-modifier-alist))
-		       vip-empty-keymap))
+			  (assoc major-mode viper-emacs-state-modifier-alist))
+		       viper-empty-keymap))
 	       )
 	 minor-mode-map-alist)))
 	 
@@ -406,116 +413,117 @@
 ;; Viper mode-changing commands and utilities
 
 ;; Modifies mode-line-buffer-identification.
-(defun vip-refresh-mode-line ()
-  (setq vip-mode-string	
-	(cond ((eq vip-current-state 'emacs-state) vip-emacs-state-id)
-	      ((eq vip-current-state 'vi-state) vip-vi-state-id)
-	      ((eq vip-current-state 'replace-state) vip-replace-state-id)
-	      ((eq vip-current-state 'insert-state) vip-insert-state-id)))
+(defun viper-refresh-mode-line ()
+  (setq viper-mode-string	
+	(cond ((eq viper-current-state 'emacs-state) viper-emacs-state-id)
+	      ((eq viper-current-state 'vi-state) viper-vi-state-id)
+	      ((eq viper-current-state 'replace-state) viper-replace-state-id)
+	      ((eq viper-current-state 'insert-state) viper-insert-state-id)))
     
   ;; Sets Viper mode string in global-mode-string
   (force-mode-line-update))
 	
 
 ;; Switch from Insert state to Vi state.
-(defun vip-exit-insert-state ()
+(defun viper-exit-insert-state ()
   (interactive)
-  (vip-change-state-to-vi))
-
-(defun vip-set-mode-vars-for (state)
+  (viper-change-state-to-vi))
+
+(defun viper-set-mode-vars-for (state)
   "Sets Viper minor mode variables to put Viper's state STATE in effect."
   
   ;; Emacs state
-  (setq vip-vi-minibuffer-minor-mode	   nil
-        vip-insert-minibuffer-minor-mode   nil
-	vip-vi-intercept-minor-mode	   nil
-	vip-insert-intercept-minor-mode	   nil
+  (setq viper-vi-minibuffer-minor-mode	     nil
+        viper-insert-minibuffer-minor-mode   nil
+	viper-vi-intercept-minor-mode	     nil
+	viper-insert-intercept-minor-mode    nil
 	
-	vip-vi-local-user-minor-mode       nil
-	vip-vi-kbd-minor-mode        	   nil
-	vip-vi-global-user-minor-mode      nil
-	vip-vi-state-modifier-minor-mode   nil
-	vip-vi-diehard-minor-mode     	   nil
-        vip-vi-basic-minor-mode       	   nil
+	viper-vi-local-user-minor-mode       nil
+	viper-vi-kbd-minor-mode        	     nil
+	viper-vi-global-user-minor-mode      nil
+	viper-vi-state-modifier-minor-mode   nil
+	viper-vi-diehard-minor-mode          nil
+        viper-vi-basic-minor-mode            nil
 	
-	vip-replace-minor-mode 	      	   nil
+	viper-replace-minor-mode 	       nil
 	
-	vip-insert-local-user-minor-mode     nil
-	vip-insert-kbd-minor-mode     	     nil
-	vip-insert-global-user-minor-mode    nil
-	vip-insert-state-modifier-minor-mode nil
-	vip-insert-diehard-minor-mode 	     nil
-	vip-insert-basic-minor-mode   	     nil
-	vip-emacs-intercept-minor-mode       t
-	vip-emacs-local-user-minor-mode      t
-	vip-emacs-kbd-minor-mode             (not (vip-is-in-minibuffer))
-	vip-emacs-global-user-minor-mode     t
-	vip-emacs-state-modifier-minor-mode  t
+	viper-insert-local-user-minor-mode     nil
+	viper-insert-kbd-minor-mode            nil
+	viper-insert-global-user-minor-mode    nil
+	viper-insert-state-modifier-minor-mode nil
+	viper-insert-diehard-minor-mode        nil
+	viper-insert-basic-minor-mode          nil
+	viper-emacs-intercept-minor-mode       t
+	viper-emacs-local-user-minor-mode      t
+	viper-emacs-kbd-minor-mode             (not (viper-is-in-minibuffer))
+	viper-emacs-global-user-minor-mode     t
+	viper-emacs-state-modifier-minor-mode  t
 	)
   
   ;; Vi state
   (if (eq state 'vi-state) ; adjust for vi-state
       (setq 
-       vip-vi-intercept-minor-mode	   t 
-       vip-vi-minibuffer-minor-mode	   (vip-is-in-minibuffer)
-       vip-vi-local-user-minor-mode	   t
-       vip-vi-kbd-minor-mode        	   (not (vip-is-in-minibuffer))
-       vip-vi-global-user-minor-mode	   t
-       vip-vi-state-modifier-minor-mode    t
+       viper-vi-intercept-minor-mode	   t 
+       viper-vi-minibuffer-minor-mode	   (viper-is-in-minibuffer)
+       viper-vi-local-user-minor-mode	   t
+       viper-vi-kbd-minor-mode        	   (not (viper-is-in-minibuffer))
+       viper-vi-global-user-minor-mode	   t
+       viper-vi-state-modifier-minor-mode    t
        ;; don't let the diehard keymap block command completion 
        ;; and other things in the minibuffer
-       vip-vi-diehard-minor-mode    	   (not
-					    (or vip-want-emacs-keys-in-vi
-						(vip-is-in-minibuffer)))
-       vip-vi-basic-minor-mode      	    t 
-       vip-emacs-intercept-minor-mode       nil
-       vip-emacs-local-user-minor-mode      nil
-       vip-emacs-kbd-minor-mode     	    nil
-       vip-emacs-global-user-minor-mode     nil
-       vip-emacs-state-modifier-minor-mode  nil
+       viper-vi-diehard-minor-mode    	   (not
+					    (or viper-want-emacs-keys-in-vi
+						(viper-is-in-minibuffer)))
+       viper-vi-basic-minor-mode      	      t 
+       viper-emacs-intercept-minor-mode       nil
+       viper-emacs-local-user-minor-mode      nil
+       viper-emacs-kbd-minor-mode     	      nil
+       viper-emacs-global-user-minor-mode     nil
+       viper-emacs-state-modifier-minor-mode  nil
        ))
   
   ;; Insert and Replace states
   (if (member state '(insert-state replace-state))
       (setq 
-       vip-insert-intercept-minor-mode	    t 
-       vip-replace-minor-mode	     	    (eq state 'replace-state)
-       vip-insert-minibuffer-minor-mode	    (vip-is-in-minibuffer)
-       vip-insert-local-user-minor-mode     t
-       vip-insert-kbd-minor-mode     	    (not (vip-is-in-minibuffer))
-       vip-insert-global-user-minor-mode    t
-       vip-insert-state-modifier-minor-mode  t
+       viper-insert-intercept-minor-mode      t 
+       viper-replace-minor-mode	     	      (eq state 'replace-state)
+       viper-insert-minibuffer-minor-mode     (viper-is-in-minibuffer)
+       viper-insert-local-user-minor-mode     t
+       viper-insert-kbd-minor-mode     	      (not (viper-is-in-minibuffer))
+       viper-insert-global-user-minor-mode     t
+       viper-insert-state-modifier-minor-mode  t
        ;; don't let the diehard keymap block command completion 
        ;; and other things in the minibuffer
-       vip-insert-diehard-minor-mode 	    (not
-					     (or vip-want-emacs-keys-in-insert
-						 (vip-is-in-minibuffer)))
-       vip-insert-basic-minor-mode   	    t
-       vip-emacs-intercept-minor-mode       nil
-       vip-emacs-local-user-minor-mode      nil
-       vip-emacs-kbd-minor-mode     	    nil
-       vip-emacs-global-user-minor-mode     nil
-       vip-emacs-state-modifier-minor-mode  nil
+       viper-insert-diehard-minor-mode 	      (not
+					       (or
+					        viper-want-emacs-keys-in-insert
+					        (viper-is-in-minibuffer)))
+       viper-insert-basic-minor-mode   	      t
+       viper-emacs-intercept-minor-mode       nil
+       viper-emacs-local-user-minor-mode      nil
+       viper-emacs-kbd-minor-mode     	      nil
+       viper-emacs-global-user-minor-mode     nil
+       viper-emacs-state-modifier-minor-mode  nil
        ))
        
   ;; minibuffer faces
-  (if (vip-has-face-support-p)
-      (setq vip-minibuffer-current-face
-	    (cond ((eq state 'emacs-state) vip-minibuffer-emacs-face)
-		  ((eq state 'vi-state) vip-minibuffer-vi-face)
+  (if (viper-has-face-support-p)
+      (setq viper-minibuffer-current-face
+	    (cond ((eq state 'emacs-state) viper-minibuffer-emacs-face)
+		  ((eq state 'vi-state) viper-minibuffer-vi-face)
 		  ((memq state '(insert-state replace-state))
-		   vip-minibuffer-insert-face))))
+		   viper-minibuffer-insert-face))))
   
-  (if (vip-is-in-minibuffer)
-      (vip-set-minibuffer-overlay))
+  (if (viper-is-in-minibuffer)
+      (viper-set-minibuffer-overlay))
   )
 
 ;; This also takes care of the annoying incomplete lines in files.
 ;; Also, this fixes `undo' to work vi-style for complex commands.
-(defun vip-change-state-to-vi ()
+(defun viper-change-state-to-vi ()
   "Change Viper state to Vi."
   (interactive)
-  (if (and vip-first-time (not (vip-is-in-minibuffer)))
+  (if (and viper-first-time (not (viper-is-in-minibuffer)))
       (viper-mode)
     (if overwrite-mode (overwrite-mode nil))
     (if abbrev-mode (expand-abbrev))
@@ -523,126 +531,125 @@
 	(funcall auto-fill-function))
     ;; don't leave whitespace lines around
     (if (and (memq last-command
-		   '(vip-autoindent
-		     vip-open-line vip-Open-line
-		     vip-replace-state-exit-cmd))
-	     (vip-over-whitespace-line))
+		   '(viper-autoindent
+		     viper-open-line viper-Open-line
+		     viper-replace-state-exit-cmd))
+	     (viper-over-whitespace-line))
 	(indent-to-left-margin))
-    (vip-add-newline-at-eob-if-necessary)
-    (if vip-undo-needs-adjustment  (vip-adjust-undo))
-    (vip-change-state 'vi-state)
+    (viper-add-newline-at-eob-if-necessary)
+    (if viper-undo-needs-adjustment  (viper-adjust-undo))
+    (viper-change-state 'vi-state)
 
     ;; always turn off iso-accents-mode, or else we won't be able to use the
     ;; keys `,',^ in Vi state, as they will do accents instead of Vi actions.
     (if (and (boundp 'iso-accents-mode) iso-accents-mode)
 	(iso-accents-mode -1))
 
-    (vip-restore-cursor-color-after-insert)
+    (viper-restore-cursor-color-after-insert)
     
     ;; Protection against user errors in hooks
     (condition-case conds
-	(run-hooks 'vip-vi-state-hook)
+	(run-hooks 'viper-vi-state-hook)
       (error
-       (vip-message-conditions conds)))))
-
-(defun vip-change-state-to-insert ()
+       (viper-message-conditions conds)))))
+
+(defun viper-change-state-to-insert ()
   "Change Viper state to Insert."
   (interactive)
-  (vip-change-state 'insert-state)
-  (if (and vip-automatic-iso-accents (fboundp 'iso-accents-mode))
+  (viper-change-state 'insert-state)
+  (if (and viper-automatic-iso-accents (fboundp 'iso-accents-mode))
       (iso-accents-mode 1)) ; turn iso accents on
   
-  (or (stringp vip-saved-cursor-color)
-      (string= (vip-get-cursor-color) vip-insert-state-cursor-color)
-      (setq vip-saved-cursor-color (vip-get-cursor-color)))
-  ;; Commented out, because if vip-change-state-to-insert is executed
+  (or (stringp viper-saved-cursor-color)
+      (string= (viper-get-cursor-color) viper-insert-state-cursor-color)
+      (setq viper-saved-cursor-color (viper-get-cursor-color)))
+  ;; Commented out, because if viper-change-state-to-insert is executed
   ;; non-interactively then the old cursor color may get lost. Same old Emacs
   ;; bug related to local variables?
-;;;(if (stringp vip-saved-cursor-color)
-;;;      (vip-change-cursor-color vip-insert-state-cursor-color))
+;;;(if (stringp viper-saved-cursor-color)
+;;;      (viper-change-cursor-color viper-insert-state-cursor-color))
   ;; Protection against user errors in hooks
   (condition-case conds
-      (run-hooks 'vip-insert-state-hook)
+      (run-hooks 'viper-insert-state-hook)
     (error
-     (vip-message-conditions conds))))
+     (viper-message-conditions conds))))
      
-(defsubst vip-downgrade-to-insert ()
- (setq vip-current-state 'insert-state
-       vip-replace-minor-mode nil)
- )
+(defsubst viper-downgrade-to-insert ()
+ (setq viper-current-state 'insert-state
+       viper-replace-minor-mode nil))
 
     
   
 ;; Change to replace state. When the end of replacement region is reached,
 ;; replace state changes to insert state.
-(defun vip-change-state-to-replace (&optional non-R-cmd)
-  (vip-change-state 'replace-state)
-  (if (and vip-automatic-iso-accents (fboundp 'iso-accents-mode))
+(defun viper-change-state-to-replace (&optional non-R-cmd)
+  (viper-change-state 'replace-state)
+  (if (and viper-automatic-iso-accents (fboundp 'iso-accents-mode))
       (iso-accents-mode 1)) ; turn iso accents on
   ;; Run insert-state-hook
   (condition-case conds
-      (run-hooks 'vip-insert-state-hook 'vip-replace-state-hook)
+      (run-hooks 'viper-insert-state-hook 'viper-replace-state-hook)
     (error
-     (vip-message-conditions conds)))
+     (viper-message-conditions conds)))
   
   (if non-R-cmd
-      (vip-start-replace)
+      (viper-start-replace)
     ;; 'R' is implemented using Emacs's overwrite-mode
-    (vip-start-R-mode))
+    (viper-start-R-mode))
   )
 
     
-(defun vip-change-state-to-emacs ()
+(defun viper-change-state-to-emacs ()
   "Change Viper state to Emacs."
   (interactive)
-  (vip-change-state 'emacs-state)
-  (if (and vip-automatic-iso-accents (fboundp 'iso-accents-mode))
+  (viper-change-state 'emacs-state)
+  (if (and viper-automatic-iso-accents (fboundp 'iso-accents-mode))
       (iso-accents-mode 1)) ; turn iso accents on
   
   ;; Protection agains user errors in hooks
   (condition-case conds
-      (run-hooks 'vip-emacs-state-hook)
+      (run-hooks 'viper-emacs-state-hook)
     (error
-     (vip-message-conditions conds))))
+     (viper-message-conditions conds))))
   
 ;; escape to emacs mode termporarily
-(defun vip-escape-to-emacs (arg &optional events)
+(defun viper-escape-to-emacs (arg &optional events)
   "Escape to Emacs state from Vi state for one Emacs command.
 ARG is used as the prefix value for the executed command.  If
 EVENTS is a list of events, which become the beginning of the command."
   (interactive "P")
   (if (= last-command-char ?\\)
       (message "Switched to EMACS state for the next command..."))
-  (vip-escape-to-state arg events 'emacs-state))
+  (viper-escape-to-state arg events 'emacs-state))
   
 ;; escape to Vi mode termporarily
-(defun vip-escape-to-vi (arg)
+(defun viper-escape-to-vi (arg)
   "Escape from Emacs state to Vi state for one Vi 1-character command.
 If the Vi command that the user types has a prefix argument, e.g., `d2w', then
 Vi's prefix argument will be used. Otherwise, the prefix argument passed to
-`vip-escape-to-vi' is used."
+`viper-escape-to-vi' is used."
   (interactive "P")
   (message "Switched to VI state for the next command...")
-  (vip-escape-to-state arg nil 'vi-state))
+  (viper-escape-to-state arg nil 'vi-state))
   
 ;; Escape to STATE mode for one Emacs command.
-(defun vip-escape-to-state (arg events state)
+(defun viper-escape-to-state (arg events state)
   ;;(let (com key prefix-arg)
   (let (com key)
     ;; this temporarily turns off Viper's minor mode keymaps
-    (vip-set-mode-vars-for state)
-    (vip-normalize-minor-mode-map-alist)
-    (if events (vip-set-unread-command-events events))
+    (viper-set-mode-vars-for state)
+    (viper-normalize-minor-mode-map-alist)
+    (if events (viper-set-unread-command-events events))
     
     ;; protect against keyboard quit and other errors
     (condition-case nil
-	(let (vip-vi-kbd-minor-mode 
-	      vip-insert-kbd-minor-mode
-	      vip-emacs-kbd-minor-mode)
+	(let (viper-vi-kbd-minor-mode 
+	      viper-insert-kbd-minor-mode
+	      viper-emacs-kbd-minor-mode)
 	  (unwind-protect
 	      (progn
 		(setq com (key-binding (setq key 
-					     (if vip-xemacs-p
+					     (if viper-xemacs-p
 						 (read-key-sequence nil)
 					       (read-key-sequence nil t)))))
 		;; In case of binding indirection--chase definitions.
@@ -656,15 +663,17 @@
 	  ;; escaped to command, Viper's mode vars will remain those of
 	  ;; `state'. When we return to the orig buffer, the bindings will be
 	  ;; screwed up.
-	  (vip-set-mode-vars-for vip-current-state)
+	  (viper-set-mode-vars-for viper-current-state)
 	  
 	  ;; this-command, last-command-char, last-command-event
 	  (setq this-command com)
-	  (if vip-xemacs-p ; XEmacs represents key sequences as vectors
-	      (setq last-command-event (vip-copy-event (vip-seq-last-elt key))
+	  (if viper-xemacs-p ; XEmacs represents key sequences as vectors
+	      (setq last-command-event
+		    (viper-copy-event (viper-seq-last-elt key))
 		    last-command-char (event-to-character last-command-event))
 	    ;; Emacs represents them as sequences (str or vec)
-	    (setq last-command-event (vip-copy-event (vip-seq-last-elt key))
+	    (setq last-command-event
+		  (viper-copy-event (viper-seq-last-elt key))
 		  last-command-char last-command-event))
 	    
 	  (if (commandp com)
@@ -675,103 +684,105 @@
       (quit (ding))
       (error (beep 1))))
   ;; set state in the new buffer
-  (vip-set-mode-vars-for vip-current-state))
+  (viper-set-mode-vars-for viper-current-state))
       
-(defun vip-exec-form-in-vi  (form)
+(defun viper-exec-form-in-vi  (form)
   "Execute FORM in Vi state, regardless of the Ccurrent Vi state."
   (let ((buff (current-buffer))
 	result)
-    (vip-set-mode-vars-for 'vi-state)
+    (viper-set-mode-vars-for 'vi-state)
 
     (condition-case nil
-	(setq result (eval form))
+	(let (viper-vi-kbd-minor-mode) ; execute without kbd macros
+	  (setq result (eval form))
+	  )
       (error
        (signal 'quit nil)))
 
     (if (not (equal buff (current-buffer))) ; cmd switched buffer
 	(save-excursion
 	  (set-buffer buff)
-	  (vip-set-mode-vars-for vip-current-state)))
-    (vip-set-mode-vars-for vip-current-state)
+	  (viper-set-mode-vars-for viper-current-state)))
+    (viper-set-mode-vars-for viper-current-state)
     result))
 
-(defun vip-exec-form-in-emacs  (form)
+(defun viper-exec-form-in-emacs  (form)
   "Execute FORM in Emacs, temporarily disabling Viper's minor modes.
-Similar to vip-escape-to-emacs, but accepts forms rather than keystrokes."
+Similar to viper-escape-to-emacs, but accepts forms rather than keystrokes."
   (let ((buff (current-buffer))
 	result)
-    (vip-set-mode-vars-for 'emacs-state)
+    (viper-set-mode-vars-for 'emacs-state)
     (setq result (eval form))
     (if (not (equal buff (current-buffer))) ; cmd switched buffer
 	(save-excursion
 	  (set-buffer buff)
-	  (vip-set-mode-vars-for vip-current-state)))
-    (vip-set-mode-vars-for vip-current-state)
+	  (viper-set-mode-vars-for viper-current-state)))
+    (viper-set-mode-vars-for viper-current-state)
     result))
 
   
 ;; This is needed because minor modes sometimes override essential Viper
 ;; bindings. By letting Viper know which files these modes are in, it will
 ;; arrange to reorganize minor-mode-map-alist so that things will work right.
-(defun vip-harness-minor-mode (load-file)
+(defun viper-harness-minor-mode (load-file)
   "Familiarize Viper with a minor mode defined in LOAD_FILE.
 Minor modes that have their own keymaps may overshadow Viper keymaps.
 This function is designed to make Viper aware of the packages that define
 such minor modes.
 Usage:
-    (vip-harness-minor-mode load-file)
+    (viper-harness-minor-mode load-file)
 
 LOAD-FILE is a name of the file where the specific minor mode is defined.
 Suffixes such as .el or .elc should be stripped."
 
   (interactive "sEnter name of the load file: ")
   
-  (vip-eval-after-load load-file '(vip-normalize-minor-mode-map-alist))
+  (eval-after-load load-file '(viper-normalize-minor-mode-map-alist))
   
   ;; Change the default for minor-mode-map-alist each time a harnessed minor
   ;; mode adds its own keymap to the a-list.
-  (vip-eval-after-load
+  (eval-after-load
    load-file '(setq-default minor-mode-map-alist minor-mode-map-alist))
   )
 
 
-(defun vip-ESC (arg)
+(defun viper-ESC (arg)
   "Emulate ESC key in Emacs.
-Prevents multiple escape keystrokes if vip-no-multiple-ESC is true.
-If vip-no-multiple-ESC is 'twice double ESC would ding in vi-state.
+Prevents multiple escape keystrokes if viper-no-multiple-ESC is true.
+If viper-no-multiple-ESC is 'twice double ESC would ding in vi-state.
 Other ESC sequences are emulated via the current Emacs's major mode
 keymap. This is more convenient on TTYs, since this won't block
 function keys such as up,down, etc. ESC will also will also work as
-a Meta key in this case. When vip-no-multiple-ESC is nil, ESC functions
+a Meta key in this case. When viper-no-multiple-ESC is nil, ESC functions
 as a Meta key and any number of multiple escapes is allowed."
   (interactive "P")
   (let (char)
-    (cond ((and (not vip-no-multiple-ESC) (eq vip-current-state 'vi-state))
-	   (setq char (vip-read-char-exclusive))
-	   (vip-escape-to-emacs arg (list ?\e char) ))
-	  ((and (eq vip-no-multiple-ESC 'twice) 
-		(eq vip-current-state 'vi-state))
-	   (setq char (vip-read-char-exclusive))
-	   (if (= char (string-to-char vip-ESC-key))
+    (cond ((and (not viper-no-multiple-ESC) (eq viper-current-state 'vi-state))
+	   (setq char (viper-read-char-exclusive))
+	   (viper-escape-to-emacs arg (list ?\e char) ))
+	  ((and (eq viper-no-multiple-ESC 'twice) 
+		(eq viper-current-state 'vi-state))
+	   (setq char (viper-read-char-exclusive))
+	   (if (= char (string-to-char viper-ESC-key))
 	       (ding)
-	     (vip-escape-to-emacs arg (list ?\e char) )))
+	     (viper-escape-to-emacs arg (list ?\e char) )))
 	  (t (ding)))
     ))
 
-(defun vip-alternate-Meta-key (arg)
+(defun viper-alternate-Meta-key (arg)
   "Simulate Emacs Meta key."
   (interactive "P")
   (sit-for 1) (message "ESC-")
-  (vip-escape-to-emacs arg '(?\e)))
-
-(defun vip-toggle-key-action ()
-  "Action bound to `vip-toggle-key'."
+  (viper-escape-to-emacs arg '(?\e)))
+
+(defun viper-toggle-key-action ()
+  "Action bound to `viper-toggle-key'."
   (interactive)
-  (if (and (< viper-expert-level 2) (equal vip-toggle-key "\C-z"))
-      (if (vip-window-display-p)
-	  (vip-iconify)
+  (if (and (< viper-expert-level 2) (equal viper-toggle-key "\C-z"))
+      (if (viper-window-display-p)
+	  (viper-iconify)
 	(suspend-emacs))
-    (vip-change-state-to-emacs)))
+    (viper-change-state-to-emacs)))
 
 
 ;; Intercept ESC sequences on dumb terminals.
@@ -780,16 +791,16 @@
 ;; Check if last key was ESC and if so try to reread it as a function key.
 ;; But only if there are characters to read during a very short time.
 ;; Returns the last event, if any.
-(defun vip-envelop-ESC-key ()
+(defun viper-envelop-ESC-key ()
   (let ((event last-input-event)
 	(keyseq [nil])
 	inhibit-quit)
-    (if (vip-ESC-event-p event)
+    (if (viper-ESC-event-p event)
 	(progn 
-	  (if (vip-fast-keysequence-p)
+	  (if (viper-fast-keysequence-p)
 	      (progn
 		(let (minor-mode-map-alist)
-		  (vip-set-unread-command-events event)
+		  (viper-set-unread-command-events event)
 		  (setq keyseq
 			(funcall
 			 (ad-get-orig-definition 'read-key-sequence) nil))
@@ -812,37 +823,38 @@
 		;; If `first-key' is not an ESC event, we make it into the
 		;; last-command-event in order to pretend that this key was
 		;; pressed. This is needed to allow arrow keys to be bound to
-		;; macros. Otherwise, vip-exec-mapped-kbd-macro will think that
-		;; the last event was ESC and so it'll execute whatever is
+		;; macros. Otherwise, viper-exec-mapped-kbd-macro will think
+		;; that the last event was ESC and so it'll execute whatever is
 		;; bound to ESC. (Viper macros can't be bound to
 		;; ESC-sequences).
 		(let* ((first-key (elt keyseq 0))
 		       (key-mod (event-modifiers first-key)))
-		  (cond ((vip-ESC-event-p first-key)
+		  (cond ((viper-ESC-event-p first-key)
 			 ;; put keys following ESC on the unread list
 			 ;; and return ESC as the key-sequence
-			 (vip-set-unread-command-events (subseq keyseq 1))
+			 (viper-set-unread-command-events (subseq keyseq 1))
 			 (setq last-input-event event
-			       keyseq (if vip-emacs-p
+			       keyseq (if viper-emacs-p
 					  "\e"
 					(vector (character-to-event ?\e)))))
-			((and vip-xemacs-p
+			((and viper-xemacs-p
 			      (key-press-event-p first-key)
 			      (equal '(meta) key-mod))
-			 (vip-set-unread-command-events 
+			 (viper-set-unread-command-events 
 			  (vconcat (vector
 				    (character-to-event (event-key first-key)))
 				   (subseq keyseq 1)))
 			 (setq last-input-event event
 			       keyseq (vector (character-to-event ?\e))))
 			((eventp first-key)
-			 (setq last-command-event (vip-copy-event first-key)))
+			 (setq last-command-event
+			       (viper-copy-event first-key)))
 			))
 		) ; end progn
 		
 	    ;; this is escape event with nothing after it
 	    ;; put in unread-command-event and then re-read
-	    (vip-set-unread-command-events event)
+	    (viper-set-unread-command-events event)
 	    (setq keyseq
 		  (funcall (ad-get-orig-definition 'read-key-sequence) nil))
 	    ))
@@ -855,24 +867,24 @@
 ;; Listen to ESC key.
 ;; If a sequence of keys starting with ESC is issued with very short delays,
 ;; interpret these keys in Emacs mode, so ESC won't be interpreted as a Vi key.
-(defun vip-intercept-ESC-key ()
+(defun viper-intercept-ESC-key ()
   "Function that implements ESC key in Viper emulation of Vi."
   (interactive)
-  (let ((cmd (or (key-binding (vip-envelop-ESC-key)) 
+  (let ((cmd (or (key-binding (viper-envelop-ESC-key)) 
 		 '(lambda () (interactive) (error "")))))
     
     ;; call the actual function to execute ESC (if no other symbols followed)
     ;; or the key bound to the ESC sequence (if the sequence was issued
     ;; with very short delay between characters.
-    (if (eq cmd 'vip-intercept-ESC-key)
+    (if (eq cmd 'viper-intercept-ESC-key)
 	(setq cmd
-	      (cond ((eq vip-current-state 'vi-state)
-		     'vip-ESC)
-		    ((eq vip-current-state 'insert-state)
-		     'vip-exit-insert-state) 
-		    ((eq vip-current-state 'replace-state)
-		     'vip-replace-state-exit-cmd)
-		    (t 'vip-change-state-to-vi)
+	      (cond ((eq viper-current-state 'vi-state)
+		     'viper-ESC)
+		    ((eq viper-current-state 'insert-state)
+		     'viper-exit-insert-state) 
+		    ((eq viper-current-state 'replace-state)
+		     'viper-replace-state-exit-cmd)
+		    (t 'viper-change-state-to-vi)
 		    )))
     (call-interactively cmd)))
 
@@ -886,7 +898,7 @@
 ;; command prefix such as "c", "d", "m" and "y".
 
 ;; Get value part of prefix-argument ARG.
-(defsubst vip-p-val (arg)
+(defsubst viper-p-val (arg)
   (cond ((null arg) 1)
 	((consp arg)
 	 (if (or (null (car arg)) (equal (car arg) '(nil)))
@@ -894,20 +906,23 @@
 	(t arg)))
 
 ;; Get raw value part of prefix-argument ARG.
-(defsubst vip-P-val (arg)
+(defsubst viper-P-val (arg)
   (cond ((consp arg) (car arg))
 	(t arg)))
 
 ;; Get com part of prefix-argument ARG.
-(defsubst vip-getcom (arg)
+(defsubst viper-getcom (arg)
   (cond ((null arg) nil)
 	((consp arg) (cdr arg))
 	(t nil)))
 
 ;; Get com part of prefix-argument ARG and modify it.
-(defun vip-getCom (arg)
-  (let ((com (vip-getcom arg)))
-    (cond ((equal com ?c) ?C)
+(defun viper-getCom (arg)
+  (let ((com (viper-getcom arg)))
+    (cond ((equal com ?c) ?c)
+	  ;; Previously, ?c was being converted to ?C, but this prevented
+	  ;; multiline replace regions.
+	  ;;((equal com ?c) ?C)
 	  ((equal com ?d) ?D)
 	  ((equal com ?y) ?Y)
 	  (t com))))
@@ -915,55 +930,61 @@
 
 ;; Compute numeric prefix arg value. 
 ;; Invoked by EVENT. COM is the command part obtained so far.
-(defun vip-prefix-arg-value (event com)
-  (let (value func)
+(defun viper-prefix-arg-value (event com)
+  (let ((viper-intermediate-command 'viper-digit-argument)
+	value func)
     ;; read while number
-    (while (and (vip-characterp event) (>= event ?0) (<= event ?9))
+    (while (and (viper-characterp event) (>= event ?0) (<= event ?9))
       (setq value (+ (* (if (integerp value) value 0) 10) (- event ?0)))
-      (setq event (vip-read-event-convert-to-char)))
+      (setq event (viper-read-event-convert-to-char)))
     
     (setq prefix-arg value)
     (if com (setq prefix-arg (cons prefix-arg com)))
     (while (eq event ?U)
-      (vip-describe-arg prefix-arg)
-      (setq event (vip-read-event-convert-to-char)))
+      (viper-describe-arg prefix-arg)
+      (setq event (viper-read-event-convert-to-char)))
     
-    (if (or com (and (not (eq vip-current-state 'vi-state))
+    (if (or com (and (not (eq viper-current-state 'vi-state))
 		     ;; make sure it is a Vi command
-		     (vip-characterp event) (vip-vi-command-p event)
+		     (viper-characterp event) (viper-vi-command-p event)
 		     ))
 	;; If appears to be one of the vi commands,
 	;; then execute it with funcall and clear prefix-arg in order to not
 	;; confuse subsequent commands
 	(progn
 	  ;; last-command-char is the char we want emacs to think was typed
-	  ;; last. If com is not nil, the vip-digit-argument command was called
-	  ;; from within vip-prefix-arg command, such as `d', `w', etc., i.e., 
-	  ;; the user typed, say, d2. In this case, `com' would be `d', `w',
-	  ;; etc.
-	  ;; If vip-digit-argument was invoked by vip-escape-to-vi (which is
-	  ;; indicated by the fact that the current state is not vi-state),
-	  ;; then `event' represents the vi command to be executed (e.g., `d',
-	  ;; `w', etc). Again, last-command-char must make emacs believe that
-	  ;; this is the command we typed.
+	  ;; last. If com is not nil, the viper-digit-argument command was
+	  ;; called from within viper-prefix-arg command, such as `d', `w',
+	  ;; etc., i.e., the user typed, say, d2. In this case, `com' would be
+	  ;; `d', `w', etc.  If viper-digit-argument was invoked by
+	  ;; viper-escape-to-vi (which is indicated by the fact that the
+	  ;; current state is not vi-state), then `event' represents the vi
+	  ;; command to be executed (e.g., `d', `w', etc). Again,
+	  ;; last-command-char must make emacs believe that this is the command
+	  ;; we typed.
+	  (cond ((eq event 'return) (setq event ?\C-m))
+		((eq event 'delete) (setq event ?\C-?))
+		((eq event 'backspace) (setq event ?\C-h))
+		((eq event 'space) (setq event ?\ )))
 	  (setq last-command-char (or com event))
-	  (setq func (vip-exec-form-in-vi 
+	  (setq func (viper-exec-form-in-vi 
 		      (` (key-binding (char-to-string (, event))))))
 	  (funcall func prefix-arg)
 	  (setq prefix-arg nil))
       ;; some other command -- let emacs do it in its own way
-      (vip-set-unread-command-events event))
+      (viper-set-unread-command-events event))
     ))
 		     
 
 ;; Vi operator as prefix argument."
-(defun vip-prefix-arg-com (char value com)
+(defun viper-prefix-arg-com (char value com)
   (let ((cont t)
-	cmd-info mv-or-digit-cmd)
+	cmd-info 
+	cmd-to-exec-at-end)
     (while (and cont
 		(memq char
 		      (list ?c ?d ?y ?! ?< ?> ?= ?# ?r ?R ?\"
-			    vip-buffer-search-char)))
+			    viper-buffer-search-char)))
       (if com
 	  ;; this means that we already have a command character, so we
 	  ;; construct a com list and exit while.  however, if char is "
@@ -973,10 +994,10 @@
 	    (if (memq char '(?# ?\")) (error ""))
 	    (setq com (cons char com))
 	    (setq cont nil))
-	;; If com is nil we set com as char, and read more.  Again, if char
-	;; is ", we read the name of register and store it in vip-use-register.
-	;; if char is !, =, or #, a complete com is formed so we exit the
-	;; while loop.
+	;; If com is nil we set com as char, and read more.  Again, if char is
+	;; ", we read the name of register and store it in viper-use-register.
+	;; if char is !, =, or #, a complete com is formed so we exit the while
+	;; loop.
 	(cond ((memq char '(?! ?=))
 	       (setq com char)
 	       (setq char (read-char))
@@ -987,8 +1008,8 @@
 	       (setq char (read-char)))
 	      ((= char ?\")
 	       (let ((reg (read-char)))
-		 (if (vip-valid-register reg)
-		     (setq vip-use-register reg)
+		 (if (viper-valid-register reg)
+		     (setq viper-use-register reg)
 		   (error ""))
 		 (setq char (read-char))))
 	      (t
@@ -1002,16 +1023,17 @@
       (progn
 	(setq cmd-info (cons value com))
 	(while (= char ?U)
-	  (vip-describe-arg cmd-info)
+	  (viper-describe-arg cmd-info)
 	  (setq char (read-char)))
 	;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so we
 	;; execute it at the very end 
-	(or (vip-movement-command-p char)
-	    (vip-digit-command-p char)
-	    (vip-regsuffix-command-p char)
+	(or (viper-movement-command-p char)
+	    (viper-digit-command-p char)
+	    (viper-regsuffix-command-p char)
+	    (= char ?!) ; bang command
 	    (error ""))
-	(setq mv-or-digit-cmd
-	      (vip-exec-form-in-vi 
+	(setq cmd-to-exec-at-end
+	      (viper-exec-form-in-vi 
 	       (` (key-binding (char-to-string (, char)))))))
     
     ;; as com is non-nil, this means that we have a command to execute
@@ -1019,39 +1041,44 @@
 	;; execute apropriate region command.
 	(let ((char (car com)) (com (cdr com)))
 	  (setq prefix-arg (cons value com))
-	  (if (= char ?r) (vip-region prefix-arg)
-	    (vip-Region prefix-arg))
+	  (if (= char ?r) (viper-region prefix-arg)
+	    (viper-Region prefix-arg))
 	  ;; reset prefix-arg
 	  (setq prefix-arg nil))
       ;; otherwise, reset prefix arg and call appropriate command
       (setq value (if (null value) 1 value))
       (setq prefix-arg nil)
-      (cond ((equal com '(?c . ?c)) (vip-line (cons value ?C)))
-	    ((equal com '(?d . ?d)) (vip-line (cons value ?D)))
-	    ((equal com '(?d . ?y)) (vip-yank-defun))
-	    ((equal com '(?y . ?y)) (vip-line (cons value ?Y)))
-	    ((equal com '(?< . ?<)) (vip-line (cons value ?<)))
-	    ((equal com '(?> . ?>)) (vip-line (cons value ?>)))
-	    ((equal com '(?! . ?!)) (vip-line (cons value ?!)))
-	    ((equal com '(?= . ?=)) (vip-line (cons value ?=)))
-	    (t (error "")))))
+      (cond 
+       ;; If we change ?C to ?c here, then cc will enter replacement mode
+       ;; rather than deleting lines. However, it will affect 1 less line than
+       ;; normal. We decided to not use replacement mode here and follow Vi,
+       ;; since replacement mode on n full lines can be achieved with nC.
+       ((equal com '(?c . ?c)) (viper-line (cons value ?C)))
+       ((equal com '(?d . ?d)) (viper-line (cons value ?D)))
+       ((equal com '(?d . ?y)) (viper-yank-defun))
+       ((equal com '(?y . ?y)) (viper-line (cons value ?Y)))
+       ((equal com '(?< . ?<)) (viper-line (cons value ?<)))
+       ((equal com '(?> . ?>)) (viper-line (cons value ?>)))
+       ((equal com '(?! . ?!)) (viper-line (cons value ?!)))
+       ((equal com '(?= . ?=)) (viper-line (cons value ?=)))
+       (t (error "")))))
   
-  (if mv-or-digit-cmd
+  (if cmd-to-exec-at-end
       (progn
 	(setq last-command-char char)
 	(setq last-command-event 
-	      (vip-copy-event
-	       (if vip-xemacs-p (character-to-event char) char)))
+	      (viper-copy-event
+	       (if viper-xemacs-p (character-to-event char) char)))
 	(condition-case nil
-	    (funcall mv-or-digit-cmd cmd-info)
+	    (funcall cmd-to-exec-at-end cmd-info)
 	  (error
 	   (error "")))))
   ))
 
-(defun vip-describe-arg (arg)
+(defun viper-describe-arg (arg)
   (let (val com)
-    (setq val (vip-P-val arg)
-	  com (vip-getcom arg))
+    (setq val (viper-P-val arg)
+	  com (viper-getcom arg))
     (if (null val)
 	(if (null com)
 	    (message "Value is nil, and command is nil")
@@ -1060,279 +1087,285 @@
 	  (message "Value is `%d', and command is nil" val)
 	(message "Value is `%d', and command is `%c'" val com)))))
 
-(defun vip-digit-argument (arg)
+(defun viper-digit-argument (arg)
   "Begin numeric argument for the next command."
   (interactive "P")
-  (vip-leave-region-active)
-  (vip-prefix-arg-value
+  (viper-leave-region-active)
+  (viper-prefix-arg-value
    last-command-char (if (consp arg) (cdr arg) nil)))
 
-(defun vip-command-argument (arg)
+(defun viper-command-argument (arg)
   "Accept a motion command as an argument."
   (interactive "P")
-  (let ((vip-inside-command-argument-action t))
+  (let ((viper-intermediate-command 'viper-command-argument))
     (condition-case nil
-	(vip-prefix-arg-com
+	(viper-prefix-arg-com
 	 last-command-char   
 	 (cond ((null arg) nil)
 	       ((consp arg) (car arg))
 	       ((integerp arg) arg)
-	       (t (error vip-InvalidCommandArgument)))
+	       (t (error viper-InvalidCommandArgument)))
 	 (cond ((null arg) nil)
 	       ((consp arg) (cdr arg))
 	       ((integerp arg) nil)
-	       (t (error vip-InvalidCommandArgument))))
-      (quit (setq vip-use-register nil)
+	       (t (error viper-InvalidCommandArgument))))
+      (quit (setq viper-use-register nil)
 	    (signal 'quit nil)))
-    (vip-deactivate-mark)))
+    (viper-deactivate-mark)))
 
 
 ;; repeat last destructive command
 
 ;; Append region to text in register REG.
 ;; START and END are buffer positions indicating what to append.
-(defsubst vip-append-to-register (reg start end)
+(defsubst viper-append-to-register (reg start end)
   (set-register reg (concat (if (stringp (get-register reg))
 				(get-register reg) "")
 			    (buffer-substring start end))))
 
-;; Saves last inserted text for possible use by vip-repeat command.
-(defun vip-save-last-insertion (beg end)
-  (setq vip-last-insertion (buffer-substring beg end))
-  (or (< (length vip-d-com) 5)
-      (setcar (nthcdr 4 vip-d-com) vip-last-insertion))
-  (or (null vip-command-ring)
-      (ring-empty-p vip-command-ring)
+;; Saves last inserted text for possible use by viper-repeat command.
+(defun viper-save-last-insertion (beg end)
+  (setq viper-last-insertion (buffer-substring beg end))
+  (or (< (length viper-d-com) 5)
+      (setcar (nthcdr 4 viper-d-com) viper-last-insertion))
+  (or (null viper-command-ring)
+      (ring-empty-p viper-command-ring)
       (progn
-	(setcar (nthcdr 4 (vip-current-ring-item vip-command-ring))
-		vip-last-insertion)
+	(setcar (nthcdr 4 (viper-current-ring-item viper-command-ring))
+		viper-last-insertion)
 	;; del most recent elt, if identical to the second most-recent
-	(vip-cleanup-ring vip-command-ring)))
+	(viper-cleanup-ring viper-command-ring)))
   )
     
-(defsubst vip-yank-last-insertion ()
-  "Inserts the text saved by the previous vip-save-last-insertion command."
+(defsubst viper-yank-last-insertion ()
+  "Inserts the text saved by the previous viper-save-last-insertion command."
   (condition-case nil
-      (insert vip-last-insertion)
+      (insert viper-last-insertion)
     (error nil)))
   
 			    
 ;; define functions to be executed
 
 ;; invoked by the `C' command
-(defun vip-exec-change (m-com com) 
-  (or (and (markerp vip-com-point) (marker-position vip-com-point))
-      (set-marker vip-com-point (point) (current-buffer)))
+(defun viper-exec-change (m-com com) 
+  (or (and (markerp viper-com-point) (marker-position viper-com-point))
+      (set-marker viper-com-point (point) (current-buffer)))
   ;; handle C cmd at the eol and at eob.
-  (if (or (and (eolp) (= vip-com-point (point)))
-	  (= vip-com-point (point-max)))
+  (if (or (and (eolp) (= viper-com-point (point)))
+	  (= viper-com-point (point-max)))
       (progn
 	(insert " ")(backward-char 1)))
-  (if (= vip-com-point (point))
-      (vip-forward-char-carefully))
+  (if (= viper-com-point (point))
+      (viper-forward-char-carefully))
+  (set-mark viper-com-point)
+  (if (eq m-com 'viper-next-line-at-bol)
+      (viper-enlarge-region (mark t) (point)))
+  (if (< (point) (mark t))
+      (exchange-point-and-mark))
+  (if (eq (preceding-char) ?\n)
+      (viper-backward-char-carefully)) ; give back the newline
   (if (= com ?c)
-      (vip-change vip-com-point (point))
-    (vip-change-subr vip-com-point (point))))
-
-;; this is invoked by vip-substitute-line
-(defun vip-exec-Change (m-com com)
+      (viper-change (mark t) (point))
+    (viper-change-subr (mark t) (point))))
+
+;; this is invoked by viper-substitute-line
+(defun viper-exec-Change (m-com com)
   (save-excursion
-    (set-mark vip-com-point)
-    (vip-enlarge-region (mark t) (point))
-    (if vip-use-register
+    (set-mark viper-com-point)
+    (viper-enlarge-region (mark t) (point))
+    (if viper-use-register
 	(progn
-	  (cond ((vip-valid-register vip-use-register '(letter digit))
-		 ;;(vip-valid-register vip-use-register '(letter)
+	  (cond ((viper-valid-register viper-use-register '(letter digit))
 		 (copy-to-register
-		  vip-use-register (mark t) (point) nil))
-		((vip-valid-register vip-use-register '(Letter))
-		 (vip-append-to-register
-		  (downcase vip-use-register) (mark t) (point)))
-		(t (setq vip-use-register nil)
-		   (error vip-InvalidRegister vip-use-register)))
-	  (setq vip-use-register nil)))
+		  viper-use-register (mark t) (point) nil))
+		((viper-valid-register viper-use-register '(Letter))
+		 (viper-append-to-register
+		  (downcase viper-use-register) (mark t) (point)))
+		(t (setq viper-use-register nil)
+		   (error viper-InvalidRegister viper-use-register)))
+	  (setq viper-use-register nil)))
     (delete-region (mark t) (point)))
   (open-line 1)
-  (if (= com ?C) (vip-change-mode-to-insert) (vip-yank-last-insertion)))
-
-(defun vip-exec-delete (m-com com)
-  (or (and (markerp vip-com-point) (marker-position vip-com-point))
-      (set-marker vip-com-point (point) (current-buffer)))
-  (if vip-use-register
+  (if (= com ?C)
+      (viper-change-state-to-insert)
+    (viper-yank-last-insertion)))
+
+(defun viper-exec-delete (m-com com)
+  (or (and (markerp viper-com-point) (marker-position viper-com-point))
+      (set-marker viper-com-point (point) (current-buffer)))
+  (if viper-use-register
       (progn
-	(cond ((vip-valid-register vip-use-register '(letter digit))
-	       ;;(vip-valid-register vip-use-register '(letter))
+	(cond ((viper-valid-register viper-use-register '(letter digit))
 	       (copy-to-register
-		vip-use-register vip-com-point (point) nil))
-	      ((vip-valid-register vip-use-register '(Letter))
-	       (vip-append-to-register
-		(downcase vip-use-register) vip-com-point (point)))
-	      (t (setq vip-use-register nil)
-		 (error vip-InvalidRegister vip-use-register)))
-	(setq vip-use-register nil)))
+		viper-use-register viper-com-point (point) nil))
+	      ((viper-valid-register viper-use-register '(Letter))
+	       (viper-append-to-register
+		(downcase viper-use-register) viper-com-point (point)))
+	      (t (setq viper-use-register nil)
+		 (error viper-InvalidRegister viper-use-register)))
+	(setq viper-use-register nil)))
   (setq last-command
 	(if (eq last-command 'd-command) 'kill-region nil))
-  (kill-region vip-com-point (point))
+  (kill-region viper-com-point (point))
   (setq this-command 'd-command)
-  (if vip-ex-style-motion
+  (if viper-ex-style-motion
       (if (and (eolp) (not (bolp))) (backward-char 1))))
 
-(defun vip-exec-Delete (m-com com)
+(defun viper-exec-Delete (m-com com)
   (save-excursion
-    (set-mark vip-com-point)
-    (vip-enlarge-region (mark t) (point))
-    (if vip-use-register
+    (set-mark viper-com-point)
+    (viper-enlarge-region (mark t) (point))
+    (if viper-use-register
 	(progn
-	  (cond ((vip-valid-register vip-use-register '(letter digit))
-		 ;;(vip-valid-register vip-use-register '(letter))
+	  (cond ((viper-valid-register viper-use-register '(letter digit))
 		 (copy-to-register
-		  vip-use-register (mark t) (point) nil))
-		((vip-valid-register vip-use-register '(Letter))
-		 (vip-append-to-register
-		  (downcase vip-use-register) (mark t) (point)))
-		(t (setq vip-use-register nil)
-		   (error vip-InvalidRegister vip-use-register)))
-	  (setq vip-use-register nil)))
+		  viper-use-register (mark t) (point) nil))
+		((viper-valid-register viper-use-register '(Letter))
+		 (viper-append-to-register
+		  (downcase viper-use-register) (mark t) (point)))
+		(t (setq viper-use-register nil)
+		   (error viper-InvalidRegister viper-use-register)))
+	  (setq viper-use-register nil)))
     (setq last-command
 	  (if (eq last-command 'D-command) 'kill-region nil))
     (kill-region (mark t) (point))
-    (if (eq m-com 'vip-line) (setq this-command 'D-command)))
+    (if (eq m-com 'viper-line) (setq this-command 'D-command)))
   (back-to-indentation))
 
-(defun vip-exec-yank (m-com com)
-  (or (and (markerp vip-com-point) (marker-position vip-com-point))
-      (set-marker vip-com-point (point) (current-buffer)))
-  (if vip-use-register
+(defun viper-exec-yank (m-com com)
+  (or (and (markerp viper-com-point) (marker-position viper-com-point))
+      (set-marker viper-com-point (point) (current-buffer)))
+  (if viper-use-register
       (progn
-	(cond ((vip-valid-register vip-use-register '(letter digit))
-	       ;; (vip-valid-register vip-use-register '(letter))
+	(cond ((viper-valid-register viper-use-register '(letter digit))
 	       (copy-to-register
-		vip-use-register vip-com-point (point) nil))
-	      ((vip-valid-register vip-use-register '(Letter))
-	       (vip-append-to-register
-		(downcase vip-use-register) vip-com-point (point)))
-	      (t (setq vip-use-register nil)
-		 (error vip-InvalidRegister vip-use-register)))
-	(setq vip-use-register nil)))
+		viper-use-register viper-com-point (point) nil))
+	      ((viper-valid-register viper-use-register '(Letter))
+	       (viper-append-to-register
+		(downcase viper-use-register) viper-com-point (point)))
+	      (t (setq viper-use-register nil)
+		 (error viper-InvalidRegister viper-use-register)))
+	(setq viper-use-register nil)))
   (setq last-command nil)
-  (copy-region-as-kill vip-com-point (point))
-  (goto-char vip-com-point))
-
-(defun vip-exec-Yank (m-com com)
+  (copy-region-as-kill viper-com-point (point))
+  (goto-char viper-com-point))
+
+(defun viper-exec-Yank (m-com com)
   (save-excursion
-    (set-mark vip-com-point)
-    (vip-enlarge-region (mark t) (point))
-    (if vip-use-register
+    (set-mark viper-com-point)
+    (viper-enlarge-region (mark t) (point))
+    (if viper-use-register
 	(progn
-	  (cond ((vip-valid-register vip-use-register '(letter digit))
+	  (cond ((viper-valid-register viper-use-register '(letter digit))
 		 (copy-to-register
-		  vip-use-register (mark t) (point) nil))
-		((vip-valid-register vip-use-register '(Letter))
-		 (vip-append-to-register
-		  (downcase vip-use-register) (mark t) (point)))
-		(t (setq vip-use-register nil)
-		   (error vip-InvalidRegister  vip-use-register)))
-	  (setq vip-use-register nil)))
+		  viper-use-register (mark t) (point) nil))
+		((viper-valid-register viper-use-register '(Letter))
+		 (viper-append-to-register
+		  (downcase viper-use-register) (mark t) (point)))
+		(t (setq viper-use-register nil)
+		   (error viper-InvalidRegister  viper-use-register)))
+	  (setq viper-use-register nil)))
     (setq last-command nil)
     (copy-region-as-kill (mark t) (point)))
-  (vip-deactivate-mark)
-  (goto-char vip-com-point))
-
-(defun vip-exec-bang (m-com com)
+  (viper-deactivate-mark)
+  (goto-char viper-com-point))
+
+(defun viper-exec-bang (m-com com)
   (save-excursion
-    (set-mark vip-com-point)
-    (vip-enlarge-region (mark t) (point))
+    (set-mark viper-com-point)
+    (viper-enlarge-region (mark t) (point))
+    (exchange-point-and-mark)
     (shell-command-on-region
      (mark t) (point)
      (if (= com ?!)
-	 (setq vip-last-shell-com
-	       (vip-read-string-with-history 
+	 (setq viper-last-shell-com
+	       (viper-read-string-with-history 
 		"!"
 		nil
-		'vip-shell-history
-		(car vip-shell-history)
+		'viper-shell-history
+		(car viper-shell-history)
 		))
-       vip-last-shell-com)
+       viper-last-shell-com)
      t)))
 
-(defun vip-exec-equals (m-com com)
+(defun viper-exec-equals (m-com com)
   (save-excursion
-    (set-mark vip-com-point)
-    (vip-enlarge-region (mark t) (point))
+    (set-mark viper-com-point)
+    (viper-enlarge-region (mark t) (point))
     (if (> (mark t) (point)) (exchange-point-and-mark))
     (indent-region (mark t) (point) nil)))
 
-(defun vip-exec-shift (m-com com)
+(defun viper-exec-shift (m-com com)
   (save-excursion
-    (set-mark vip-com-point)
-    (vip-enlarge-region (mark t) (point))
+    (set-mark viper-com-point)
+    (viper-enlarge-region (mark t) (point))
     (if (> (mark t) (point)) (exchange-point-and-mark))
     (indent-rigidly (mark t) (point) 
 		    (if (= com ?>)
-			vip-shift-width
-		      (- vip-shift-width))))
+			viper-shift-width
+		      (- viper-shift-width))))
   ;; return point to where it was before shift
-  (goto-char vip-com-point))
+  (goto-char viper-com-point))
 
 ;; this is needed because some commands fake com by setting it to ?r, which
 ;; denotes repeated insert command.
-(defsubst vip-exec-dummy (m-com com)
+(defsubst viper-exec-dummy (m-com com)
   nil)
 
-(defun vip-exec-buffer-search (m-com com)
-  (setq vip-s-string (buffer-substring (point) vip-com-point))
-  (setq vip-s-forward t)
-  (setq vip-search-history (cons vip-s-string vip-search-history))
-  (vip-search vip-s-string vip-s-forward 1))
-
-(defvar vip-exec-array (make-vector 128 nil))
+(defun viper-exec-buffer-search (m-com com)
+  (setq viper-s-string (buffer-substring (point) viper-com-point))
+  (setq viper-s-forward t)
+  (setq viper-search-history (cons viper-s-string viper-search-history))
+  (viper-search viper-s-string viper-s-forward 1))
+
+(defvar viper-exec-array (make-vector 128 nil))
 
 ;; Using a dispatch array allows adding functions like buffer search
 ;; without affecting other functions. Buffer search can now be bound
 ;; to any character.
 
-(aset vip-exec-array ?c 'vip-exec-change)
-(aset vip-exec-array ?C 'vip-exec-Change)
-(aset vip-exec-array ?d 'vip-exec-delete)
-(aset vip-exec-array ?D 'vip-exec-Delete)
-(aset vip-exec-array ?y 'vip-exec-yank)
-(aset vip-exec-array ?Y 'vip-exec-Yank)
-(aset vip-exec-array ?r 'vip-exec-dummy)
-(aset vip-exec-array ?! 'vip-exec-bang)
-(aset vip-exec-array ?< 'vip-exec-shift)
-(aset vip-exec-array ?> 'vip-exec-shift)
-(aset vip-exec-array ?= 'vip-exec-equals)
+(aset viper-exec-array ?c 'viper-exec-change)
+(aset viper-exec-array ?C 'viper-exec-Change)
+(aset viper-exec-array ?d 'viper-exec-delete)
+(aset viper-exec-array ?D 'viper-exec-Delete)
+(aset viper-exec-array ?y 'viper-exec-yank)
+(aset viper-exec-array ?Y 'viper-exec-Yank)
+(aset viper-exec-array ?r 'viper-exec-dummy)
+(aset viper-exec-array ?! 'viper-exec-bang)
+(aset viper-exec-array ?< 'viper-exec-shift)
+(aset viper-exec-array ?> 'viper-exec-shift)
+(aset viper-exec-array ?= 'viper-exec-equals)
 
 
 
 ;; This function is called by various movement commands to execute a
 ;; destructive command on the region specified by the movement command. For
-;; instance, if the user types cw, then the command vip-forward-word will
-;; call vip-execute-com to execute vip-exec-change, which eventually will
-;; call vip-change to invoke the replace mode on the region.
+;; instance, if the user types cw, then the command viper-forward-word will
+;; call viper-execute-com to execute viper-exec-change, which eventually will
+;; call viper-change to invoke the replace mode on the region.
 ;;
-;; The list (M-COM VAL COM REG INSETED-TEXT COMMAND-KEYS) is set to
-;; vip-d-com for later use by vip-repeat.
-(defun vip-execute-com (m-com val com)
-  (let ((reg vip-use-register))
+;; The var viper-d-com is set to (M-COM VAL COM REG INSETED-TEXT COMMAND-KEYS)
+;; via a call to viper-set-destructive-command, for later use by viper-repeat.
+(defun viper-execute-com (m-com val com)
+  (let ((reg viper-use-register))
     ;; this is the special command `#'
     (if (> com 128)
-	(vip-special-prefix-com (- com 128))
-      (let ((fn (aref vip-exec-array (if (< com 0) (- com) com))))
+	(viper-special-prefix-com (- com 128))
+      (let ((fn (aref viper-exec-array (if (< com 0) (- com) com))))
 	(if (null fn)
-	    (error "%c: %s" com vip-InvalidViCommand)
+	    (error "%c: %s" com viper-InvalidViCommand)
 	  (funcall fn m-com com))))
-    (if (vip-dotable-command-p com)
-	(vip-set-destructive-command
+    (if (viper-dotable-command-p com)
+	(viper-set-destructive-command
 	 (list m-com val
 	       (if (memq com (list ?c ?C ?!)) (- com) com)
 	       reg nil nil)))
     ))
 
 
-(defun vip-repeat (arg)
+(defun viper-repeat (arg)
   "Re-execute last destructive command.
-Use the info in vip-d-com, which has the form
+Use the info in viper-d-com, which has the form
 \(com val ch reg inserted-text command-keys\),
 where `com' is the command to be re-executed, `val' is the
 argument to `com', `ch' is a flag for repeat, and `reg' is optional;
@@ -1341,99 +1374,99 @@
   (interactive "P")
   (let ((save-point (point)) ; save point before repeating prev cmd
 	;; Pass along that we are repeating a destructive command
-	;; This tells vip-set-destructive-command not to update
-	;; vip-command-ring
-	(vip-intermediate-command 'vip-repeat))
-    (if (eq last-command 'vip-undo)
-	;; if the last command was vip-undo, then undo-more
-	(vip-undo-more)
-      ;; otherwise execute the command stored in vip-d-com.  if arg is non-nil
-      ;; its prefix value is used as new prefix value for the command.
-      (let ((m-com (car vip-d-com))
-	    (val (vip-P-val arg))
-	    (com (nth 2 vip-d-com))
-	    (reg (nth 3 vip-d-com)))
-        (if (null val) (setq val (nth 1 vip-d-com)))
+	;; This tells viper-set-destructive-command not to update
+	;; viper-command-ring
+	(viper-intermediate-command 'viper-repeat))
+    (if (eq last-command 'viper-undo)
+	;; if the last command was viper-undo, then undo-more
+	(viper-undo-more)
+      ;; otherwise execute the command stored in viper-d-com.  if arg is
+      ;; non-nil its prefix value is used as new prefix value for the command.
+      (let ((m-com (car viper-d-com))
+	    (val (viper-P-val arg))
+	    (com (nth 2 viper-d-com))
+	    (reg (nth 3 viper-d-com)))
+        (if (null val) (setq val (nth 1 viper-d-com)))
         (if (null m-com) (error "No previous command to repeat."))
-        (setq vip-use-register reg)
-	(if (nth 4 vip-d-com) ; text inserted by command
-	    (setq vip-last-insertion (nth 4 vip-d-com)
-		  vip-d-char (nth 4 vip-d-com)))
+        (setq viper-use-register reg)
+	(if (nth 4 viper-d-com) ; text inserted by command
+	    (setq viper-last-insertion (nth 4 viper-d-com)
+		  viper-d-char (nth 4 viper-d-com)))
         (funcall m-com (cons val com))
-        (cond ((and (< save-point (point)) vip-keep-point-on-repeat)
+        (cond ((and (< save-point (point)) viper-keep-point-on-repeat)
 	       (goto-char save-point)) ; go back to before repeat.
-	      ((and (< save-point (point)) vip-ex-style-editing-in-insert)
+	      ((and (< save-point (point)) viper-ex-style-editing-in-insert)
 	       (or (bolp) (backward-char 1))))
 	(if (and (eolp) (not (bolp)))
 	    (backward-char 1))
      ))
-  (if vip-undo-needs-adjustment (vip-adjust-undo)) ; take care of undo
+  (if viper-undo-needs-adjustment (viper-adjust-undo)) ; take care of undo
   ;; If the prev cmd was rotating the command ring, this means that `.' has
   ;; just executed a command from that ring. So, push it on the ring again.
-  ;; If we are just executing previous command , then don't push vip-d-com
-  ;; because vip-d-com is not fully constructed in this case (its keys and
+  ;; If we are just executing previous command , then don't push viper-d-com
+  ;; because viper-d-com is not fully constructed in this case (its keys and
   ;; the inserted text may be nil). Besides, in this case, the command
   ;; executed by `.' is already on the ring.
-  (if (eq last-command 'vip-display-current-destructive-command)
-      (vip-push-onto-ring vip-d-com 'vip-command-ring))
-  (vip-deactivate-mark)
+  (if (eq last-command 'viper-display-current-destructive-command)
+      (viper-push-onto-ring viper-d-com 'viper-command-ring))
+  (viper-deactivate-mark)
   ))
   
-(defun vip-repeat-from-history ()
+(defun viper-repeat-from-history ()
   "Repeat a destructive command from history.
-Doesn't change vip-command-ring in any way, so `.' will work as before
+Doesn't change viper-command-ring in any way, so `.' will work as before
 executing this command.
 This command is supposed to be bound to a two-character Vi macro where
 the second character is a digit 0 to 9. The digit indicates which
 history command to execute. `<char>0' is equivalent to `.', `<char>1'
 invokes the command before that, etc."
   (interactive)
-  (let* ((vip-intermediate-command 'repeating-display-destructive-command)
-	 (idx (cond (vip-this-kbd-macro
+  (let* ((viper-intermediate-command 'repeating-display-destructive-command)
+	 (idx (cond (viper-this-kbd-macro
 		      (string-to-number
-		       (symbol-name (elt vip-this-kbd-macro 1))))
+		       (symbol-name (elt viper-this-kbd-macro 1))))
 		    (t 0)))
 	 (num idx)
-	 (vip-d-com vip-d-com))
+	 (viper-d-com viper-d-com))
 
     (or (and (numberp num) (<= 0 num) (<= num 9))
 	(progn
 	  (setq idx 0
 		num 0)
 	  (message
-	   "`vip-repeat-from-history' must be invoked as a Vi macro bound to `<key><digit>'")))
+	   "`viper-repeat-from-history' must be invoked as a Vi macro bound to `<key><digit>'")))
     (while (< 0 num)
-      (setq vip-d-com (vip-special-ring-rotate1 vip-command-ring -1))
+      (setq viper-d-com (viper-special-ring-rotate1 viper-command-ring -1))
       (setq num (1- num)))
-    (vip-repeat nil)
+    (viper-repeat nil)
     (while (> idx num)
-      (vip-special-ring-rotate1 vip-command-ring 1)
+      (viper-special-ring-rotate1 viper-command-ring 1)
       (setq num (1+ num)))
     ))
       
 
 ;; The hash-command. It is invoked interactively by the key sequence #<char>.
-;; The chars that can follow `#' are determined by vip-hash-command-p
-(defun vip-special-prefix-com (char)
+;; The chars that can follow `#' are determined by viper-hash-command-p
+(defun viper-special-prefix-com (char)
   (cond ((= char ?c)
-	 (downcase-region (min vip-com-point (point))
-			  (max vip-com-point (point))))
+	 (downcase-region (min viper-com-point (point))
+			  (max viper-com-point (point))))
 	((= char ?C)
-	 (upcase-region (min vip-com-point (point))
-			(max vip-com-point (point))))
+	 (upcase-region (min viper-com-point (point))
+			(max viper-com-point (point))))
 	((= char ?g)
-	 (push-mark vip-com-point t)
-	 (vip-global-execute))
+	 (push-mark viper-com-point t)
+	 (viper-global-execute))
 	((= char ?q)
-	 (push-mark vip-com-point t)
-	 (vip-quote-region))
-	((= char ?s) (funcall vip-spell-function vip-com-point (point)))
-	(t (error "#%c: %s" char vip-InvalidViCommand))))
+	 (push-mark viper-com-point t)
+	 (viper-quote-region))
+	((= char ?s) (funcall viper-spell-function viper-com-point (point)))
+	(t (error "#%c: %s" char viper-InvalidViCommand))))
 
 
 ;; undoing
 
-(defun vip-undo ()
+(defun viper-undo ()
   "Undo previous change."
   (interactive)
   (message "undo!")
@@ -1455,13 +1488,13 @@
     
     (goto-char undo-beg-posn)
     (sit-for 0)
-    (if (and vip-keep-point-on-undo
+    (if (and viper-keep-point-on-undo
 	     (pos-visible-in-window-p before-undo-pt))
 	(progn
 	  (push-mark (point-marker) t) 
-	  (vip-sit-for-short 300)
+	  (viper-sit-for-short 300)
 	  (goto-char undo-end-posn)
-	  (vip-sit-for-short 300)
+	  (viper-sit-for-short 300)
 	  (if (and (> (abs (- undo-beg-posn before-undo-pt)) 1)
 		  (> (abs (- undo-end-posn before-undo-pt)) 1))
 	      (goto-char before-undo-pt)
@@ -1469,27 +1502,27 @@
       (push-mark before-undo-pt t))
     (if (and (eolp) (not (bolp))) (backward-char 1))
     (if (not modified) (set-buffer-modified-p t)))
-  (setq this-command 'vip-undo))
+  (setq this-command 'viper-undo))
 
 ;; Continue undoing previous changes.
-(defun vip-undo-more ()
+(defun viper-undo-more ()
   (message "undo more!")
   (condition-case nil
       (undo-more 1)
     (error (beep)
 	   (message "No further undo information in this buffer")))
   (if (and (eolp) (not (bolp))) (backward-char 1))
-  (setq this-command 'vip-undo))
+  (setq this-command 'viper-undo))
 
 ;; The following two functions are used to set up undo properly.
 ;; In VI, unlike Emacs, if you open a line, say, and add a bunch of lines,
 ;; they are undone all at once.  
-(defun vip-adjust-undo ()
+(defun viper-adjust-undo ()
   (let ((inhibit-quit t)
 	tmp tmp2)
-    (setq vip-undo-needs-adjustment nil)
+    (setq viper-undo-needs-adjustment nil)
     (if (listp buffer-undo-list)
-	(if (setq tmp (memq vip-buffer-undo-list-mark buffer-undo-list))
+	(if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list))
 	    (progn
 	      (setq tmp2 (cdr tmp)) ; the part after mark
 	      
@@ -1499,114 +1532,122 @@
 	      
 	      (setq buffer-undo-list (delq nil buffer-undo-list))
 	      (setq buffer-undo-list
-		    (delq vip-buffer-undo-list-mark buffer-undo-list))
+		    (delq viper-buffer-undo-list-mark buffer-undo-list))
 	      ;; restore tail of buffer-undo-list
 	      (setq buffer-undo-list (nconc buffer-undo-list tmp2)))
 	  (setq buffer-undo-list (delq nil buffer-undo-list))))))
   
 
-(defun vip-set-complex-command-for-undo ()  
+(defun viper-set-complex-command-for-undo ()  
   (if (listp buffer-undo-list)
-      (if (not vip-undo-needs-adjustment)
+      (if (not viper-undo-needs-adjustment)
 	  (let ((inhibit-quit t))
 	    (setq buffer-undo-list 
-		  (cons vip-buffer-undo-list-mark buffer-undo-list))
-	    (setq vip-undo-needs-adjustment t)))))
+		  (cons viper-buffer-undo-list-mark buffer-undo-list))
+	    (setq viper-undo-needs-adjustment t)))))
 
 
 
       
-(defun vip-display-current-destructive-command ()
-  (let ((text (nth 4 vip-d-com))
-	(keys (nth 5 vip-d-com))
+(defun viper-display-current-destructive-command ()
+  (let ((text (nth 4 viper-d-com))
+	(keys (nth 5 viper-d-com))
 	(max-text-len 30))
     
-    (setq this-command 'vip-display-current-destructive-command)
+    (setq this-command 'viper-display-current-destructive-command)
 	
     (message " `.' runs  %s%s"
-	     (concat "`" (vip-array-to-string keys) "'")
-	     (vip-abbreviate-string text max-text-len
-				    "  inserting  `" "'" "    ......."))
+	     (concat "`" (viper-array-to-string keys) "'")
+	     (viper-abbreviate-string 
+	      (if viper-xemacs-p
+		  (replace-in-string text "\n" "^J")
+		text)
+	      max-text-len
+	      "  inserting  `" "'" "    ......."))
     ))
     
     
-;; don't change vip-d-com if it was vip-repeat command invoked with `.'
+;; don't change viper-d-com if it was viper-repeat command invoked with `.'
 ;; or in some other way (non-interactively).
-(defun vip-set-destructive-command (list)
-  (or (eq vip-intermediate-command 'vip-repeat)
+(defun viper-set-destructive-command (list)
+  (or (eq viper-intermediate-command 'viper-repeat)
       (progn
-	(setq vip-d-com list)
-	(setcar (nthcdr 5 vip-d-com)
-		(vip-array-to-string (this-command-keys)))
-	(vip-push-onto-ring vip-d-com 'vip-command-ring))))
+	(setq viper-d-com list)
+	(setcar (nthcdr 5 viper-d-com)
+		(viper-array-to-string (if (arrayp viper-this-command-keys)
+					   viper-this-command-keys
+					 (this-command-keys))))
+	(viper-push-onto-ring viper-d-com 'viper-command-ring)))
+  (setq viper-this-command-keys nil))
     
-(defun vip-prev-destructive-command (next)
+(defun viper-prev-destructive-command (next)
   "Find previous destructive command in the history of destructive commands.
 With prefix argument, find next destructive command."
   (interactive "P")
-  (let (cmd vip-intermediate-command)
-    (if (eq last-command 'vip-display-current-destructive-command)
+  (let (cmd viper-intermediate-command)
+    (if (eq last-command 'viper-display-current-destructive-command)
 	;; repeated search through command history
-	(setq vip-intermediate-command 'repeating-display-destructive-command)
+	(setq viper-intermediate-command
+	      'repeating-display-destructive-command)
       ;; first search through command history--set temp ring
-      (setq vip-temp-command-ring (copy-list vip-command-ring))) 
+      (setq viper-temp-command-ring (copy-list viper-command-ring))) 
     (setq cmd (if next
-		  (vip-special-ring-rotate1 vip-temp-command-ring 1)
-		(vip-special-ring-rotate1 vip-temp-command-ring -1)))
+		  (viper-special-ring-rotate1 viper-temp-command-ring 1)
+		(viper-special-ring-rotate1 viper-temp-command-ring -1)))
     (if (null cmd)
 	()
-      (setq vip-d-com cmd))
-    (vip-display-current-destructive-command)))
+      (setq viper-d-com cmd))
+    (viper-display-current-destructive-command)))
       
-(defun vip-next-destructive-command ()
+(defun viper-next-destructive-command ()
   "Find next destructive command in the history of destructive commands."
   (interactive)
-  (vip-prev-destructive-command 'next))
+  (viper-prev-destructive-command 'next))
   
-(defun vip-insert-prev-from-insertion-ring (arg)
+(defun viper-insert-prev-from-insertion-ring (arg)
   "Cycle through insertion ring in the direction of older insertions.
 Undoes previous insertion and inserts new.
 With prefix argument, cycles in the direction of newer elements.
 In minibuffer, this command executes whatever the invocation key is bound
 to in the global map, instead of cycling through the insertion ring."
   (interactive "P")
-  (let (vip-intermediate-command)
-    (if (eq last-command 'vip-insert-from-insertion-ring)
+  (let (viper-intermediate-command)
+    (if (eq last-command 'viper-insert-from-insertion-ring)
 	(progn  ; repeated search through insertion history
-	  (setq vip-intermediate-command 'repeating-insertion-from-ring)
-	  (if (eq vip-current-state 'replace-state)
+	  (setq viper-intermediate-command 'repeating-insertion-from-ring)
+	  (if (eq viper-current-state 'replace-state)
 	      (undo 1)
-	    (if vip-last-inserted-string-from-insertion-ring
+	    (if viper-last-inserted-string-from-insertion-ring
 		(backward-delete-char
-		 (length vip-last-inserted-string-from-insertion-ring))))
+		 (length viper-last-inserted-string-from-insertion-ring))))
 	  )
       ;;first search through insertion history
-      (setq vip-temp-insertion-ring (copy-list vip-insertion-ring)))
-    (setq this-command 'vip-insert-from-insertion-ring)
+      (setq viper-temp-insertion-ring (copy-list viper-insertion-ring)))
+    (setq this-command 'viper-insert-from-insertion-ring)
     ;; so that things will be undone properly
     (setq buffer-undo-list (cons nil buffer-undo-list))
-    (setq vip-last-inserted-string-from-insertion-ring
-	  (vip-special-ring-rotate1 vip-temp-insertion-ring (if arg 1 -1)))
+    (setq viper-last-inserted-string-from-insertion-ring
+	  (viper-special-ring-rotate1 viper-temp-insertion-ring (if arg 1 -1)))
     
-    ;; this change of vip-intermediate-command must come after
-    ;; vip-special-ring-rotate1, so that the ring will rotate, but before the
+    ;; this change of viper-intermediate-command must come after
+    ;; viper-special-ring-rotate1, so that the ring will rotate, but before the
     ;; insertion.
-    (setq vip-intermediate-command nil)
-    (if vip-last-inserted-string-from-insertion-ring
-	(insert vip-last-inserted-string-from-insertion-ring))
+    (setq viper-intermediate-command nil)
+    (if viper-last-inserted-string-from-insertion-ring
+	(insert viper-last-inserted-string-from-insertion-ring))
     ))
 
-(defun vip-insert-next-from-insertion-ring ()
+(defun viper-insert-next-from-insertion-ring ()
   "Cycle through insertion ring in the direction of older insertions.
 Undo previous insertion and inserts new."
   (interactive)
-  (vip-insert-prev-from-insertion-ring 'next))
+  (viper-insert-prev-from-insertion-ring 'next))
     
 
 ;; some region utilities
 
 ;; If at the last line of buffer, add \\n before eob, if newline is missing.
-(defun vip-add-newline-at-eob-if-necessary ()
+(defun viper-add-newline-at-eob-if-necessary ()
   (save-excursion
       (end-of-line)
       ;; make sure all lines end with newline, unless in the minibuffer or
@@ -1614,16 +1655,16 @@
       (if (and (eobp)
 	       (not (bolp))
 	       require-final-newline
-	       (not (vip-is-in-minibuffer))
+	       (not (viper-is-in-minibuffer))
 	       (not buffer-read-only))
 	  (insert "\n"))))
 
-(defun vip-yank-defun ()
+(defun viper-yank-defun ()
   (mark-defun)
   (copy-region-as-kill (point) (mark t)))
 
 ;; Enlarge region between BEG and END.
-(defun vip-enlarge-region (beg end)
+(defun viper-enlarge-region (beg end)
   (or beg (setq beg end)) ; if beg is nil, set to end
   (or end (setq end beg)) ; if end is nil, set to beg
   
@@ -1639,26 +1680,26 @@
 
 
 ;; Quote region by each line with a user supplied string.
-(defun vip-quote-region ()
-  (setq vip-quote-string
-	(vip-read-string-with-history
+(defun viper-quote-region ()
+  (setq viper-quote-string
+	(viper-read-string-with-history
 	 "Quote string: "
 	 nil
-	 'vip-quote-region-history
-	 vip-quote-string))
-  (vip-enlarge-region (point) (mark t))
+	 'viper-quote-region-history
+	 viper-quote-string))
+  (viper-enlarge-region (point) (mark t))
   (if (> (point) (mark t)) (exchange-point-and-mark))
-  (insert vip-quote-string)
+  (insert viper-quote-string)
   (beginning-of-line)
   (forward-line 1)
   (while (and (< (point) (mark t)) (bolp))
-    (insert vip-quote-string)
+    (insert viper-quote-string)
     (beginning-of-line)
     (forward-line 1)))
 
 ;;  Tells whether BEG is on the same line as END.
 ;;  If one of the args is nil, it'll return nil.
-(defun vip-same-line (beg end)
+(defun viper-same-line (beg end)
    (let ((selective-display nil)
 	 (incr 0)
 	 temp)
@@ -1672,18 +1713,18 @@
 	       (t
 		;; This 'if' is needed because Emacs treats the next empty line
 		;; as part of the previous line.
-		(if (= (vip-line-pos 'start) end)
+		(if (= (viper-line-pos 'start) end)
 		    (setq incr 1))
 		(<= (+ incr (count-lines beg end)) 1))))
      ))
 	 
 	 
 ;; Check if the string ends with a newline.
-(defun vip-end-with-a-newline-p (string)
+(defun viper-end-with-a-newline-p (string)
   (or (string= string "")
-      (= (vip-seq-last-elt string) ?\n)))
-
-(defun vip-tmp-insert-at-eob (msg)
+      (= (viper-seq-last-elt string) ?\n)))
+
+(defun viper-tmp-insert-at-eob (msg)
   (let ((savemax (point-max)))
       (goto-char savemax)
       (insert msg)
@@ -1695,19 +1736,19 @@
 
 ;;; Minibuffer business
 	    
-(defsubst vip-set-minibuffer-style ()
-  (add-hook 'minibuffer-setup-hook 'vip-minibuffer-setup-sentinel))
+(defsubst viper-set-minibuffer-style ()
+  (add-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel))
   
   
-(defun vip-minibuffer-setup-sentinel ()
-  (let ((hook (if vip-vi-style-in-minibuffer
-		  'vip-change-state-to-insert
-		'vip-change-state-to-emacs)))
+(defun viper-minibuffer-setup-sentinel ()
+  (let ((hook (if viper-vi-style-in-minibuffer
+		  'viper-change-state-to-insert
+		'viper-change-state-to-emacs)))
     (funcall hook)
     ))
   
 ;; Interpret last event in the local map
-(defun vip-exit-minibuffer ()
+(defun viper-exit-minibuffer ()
   (interactive)
   (let (command)
     (setq command (local-key-binding (char-to-string last-command-char)))
@@ -1718,7 +1759,7 @@
 
 ;;; Reading string with history  
     
-(defun vip-read-string-with-history (prompt &optional initial 
+(defun viper-read-string-with-history (prompt &optional initial 
 					    history-var default keymap)
   ;; Read string, prompting with PROMPT and inserting the INITIAL
   ;; value. Uses HISTORY-VAR. DEFAULT is the default value to accept if the
@@ -1736,7 +1777,7 @@
 		      (sit-for 840))
 		  (erase-buffer)
 		  (insert initial)))
-	    (vip-minibuffer-setup-sentinel)))
+	    (viper-minibuffer-setup-sentinel)))
 	(val "")
 	(padding "")
 	temp-msg)
@@ -1747,12 +1788,12 @@
 		       (format "(default: %s) " default)
 		     ""))
 		   
-    (setq vip-incomplete-ex-cmd nil)
+    (setq viper-incomplete-ex-cmd nil)
     (setq val (read-from-minibuffer prompt 
 				    (concat temp-msg initial val padding)
 				    keymap nil history-var))
     (setq minibuffer-setup-hook nil
-	  padding (vip-array-to-string (this-command-keys))
+	  padding (viper-array-to-string (this-command-keys))
 	  temp-msg "")
     ;; the following tries to be smart about what to put in history
     (if (not (string= val (car (eval history-var))))
@@ -1760,15 +1801,15 @@
     (if (or (string= (nth 0 (eval history-var)) (nth 1 (eval history-var)))
 	    (string= (nth 0 (eval history-var)) ""))
 	(set history-var (cdr (eval history-var))))
-    ;; If the user enters nothing but the prev cmd wasn't vip-ex,
-    ;; vip-command-argument, or `! shell-command', this probably means 
+    ;; If the user enters nothing but the prev cmd wasn't viper-ex,
+    ;; viper-command-argument, or `! shell-command', this probably means 
     ;; that the user typed something then erased. Return "" in this case, not
     ;; the default---the default is too confusing in this case.
     (cond ((and (string= val "")
 		(not (string= prompt "!")) ; was a `! shell-command'
 		(not (memq last-command
-			   '(vip-ex
-			     vip-command-argument
+			   '(viper-ex
+			     viper-command-argument
 			     t)
 			   )))
 	   "")
@@ -1783,204 +1824,207 @@
 ;; Called when state changes from Insert Vi command mode.
 ;; Repeats the insertion command if Insert state was entered with prefix
 ;; argument > 1.
-(defun vip-repeat-insert-command ()
-  (let ((i-com (car vip-d-com))
-	(val   (nth 1 vip-d-com))
-	(char  (nth 2 vip-d-com)))
+(defun viper-repeat-insert-command ()
+  (let ((i-com (car viper-d-com))
+	(val   (nth 1 viper-d-com))
+	(char  (nth 2 viper-d-com)))
     (if (and val (> val 1)) ; first check that val is non-nil
 	(progn        
-	  (setq vip-d-com (list i-com (1- val) ?r nil nil nil))
-	  (vip-repeat nil)
-	  (setq vip-d-com (list i-com val char nil nil nil))
+	  (setq viper-d-com (list i-com (1- val) ?r nil nil nil))
+	  (viper-repeat nil)
+	  (setq viper-d-com (list i-com val char nil nil nil))
 	  ))))
 
-(defun vip-insert (arg)
+(defun viper-insert (arg)
   "Insert before point."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command (list 'vip-insert val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command (list 'viper-insert val ?r nil nil nil))
     (if com
-	(vip-loop val (vip-yank-last-insertion))
-      (vip-change-state-to-insert))))
-
-(defun vip-append (arg)
+	(viper-loop val (viper-yank-last-insertion))
+      (viper-change-state-to-insert))))
+
+(defun viper-append (arg)
   "Append after point."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command (list 'vip-append val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command (list 'viper-append val ?r nil nil nil))
     (if (not (eolp)) (forward-char))
     (if (equal com ?r)
-	(vip-loop val (vip-yank-last-insertion))
-      (vip-change-state-to-insert))))
-
-(defun vip-Append (arg)
+	(viper-loop val (viper-yank-last-insertion))
+      (viper-change-state-to-insert))))
+
+(defun viper-Append (arg)
   "Append at end of line."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command (list 'vip-Append val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command (list 'viper-Append val ?r nil nil nil))
     (end-of-line)
     (if (equal com ?r)
-	(vip-loop val (vip-yank-last-insertion))
-      (vip-change-state-to-insert))))
-
-(defun vip-Insert (arg)
+	(viper-loop val (viper-yank-last-insertion))
+      (viper-change-state-to-insert))))
+
+(defun viper-Insert (arg)
   "Insert before first non-white."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command (list 'vip-Insert val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command (list 'viper-Insert val ?r nil nil nil))
     (back-to-indentation)
     (if (equal com ?r)
-	(vip-loop val (vip-yank-last-insertion))
-      (vip-change-state-to-insert))))
-
-(defun vip-open-line (arg)
+	(viper-loop val (viper-yank-last-insertion))
+      (viper-change-state-to-insert))))
+
+(defun viper-open-line (arg)
   "Open line below."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command (list 'vip-open-line val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command (list 'viper-open-line val ?r nil nil nil))
     (let ((col (current-indentation)))
       (if (equal com ?r)
-	  (vip-loop val
+	  (viper-loop val
 		    (progn
 		      (end-of-line)
 		      (newline 1)
-		      (if vip-auto-indent 
+		      (if viper-auto-indent 
 			  (progn
-			    (setq vip-cted t)
-			    (if vip-electric-mode
+			    (setq viper-cted t)
+			    (if viper-electric-mode
 				(indent-according-to-mode)
 			      (indent-to col))
 			    ))
-		      (vip-yank-last-insertion)))
+		      (viper-yank-last-insertion)))
 	(end-of-line)
 	(newline 1)
-	(if vip-auto-indent
+	(if viper-auto-indent
 	    (progn
-	      (setq vip-cted t)
-	      (if vip-electric-mode
+	      (setq viper-cted t)
+	      (if viper-electric-mode
 		  (indent-according-to-mode)
 		(indent-to col))))
-	(vip-change-state-to-insert)))))
-
-(defun vip-Open-line (arg)
+	(viper-change-state-to-insert)))))
+
+(defun viper-Open-line (arg)
   "Open line above."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command (list 'vip-Open-line val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command (list 'viper-Open-line val ?r nil nil nil))
     (let ((col (current-indentation)))
       (if (equal com ?r)
-	  (vip-loop val
+	  (viper-loop val
 		    (progn
 		      (beginning-of-line)
 		      (open-line 1)
-		      (if vip-auto-indent 
+		      (if viper-auto-indent 
 			  (progn
-			    (setq vip-cted t)
-			    (if vip-electric-mode
+			    (setq viper-cted t)
+			    (if viper-electric-mode
 				(indent-according-to-mode)
 			      (indent-to col))
 			    ))
-		      (vip-yank-last-insertion)))
+		      (viper-yank-last-insertion)))
 	(beginning-of-line)
 	(open-line 1)
-	(if vip-auto-indent
+	(if viper-auto-indent
 	    (progn
-	      (setq vip-cted t)
-	      (if vip-electric-mode
+	      (setq viper-cted t)
+	      (if viper-electric-mode
 		  (indent-according-to-mode)
 		(indent-to col))
 	      ))
-	(vip-change-state-to-insert)))))
-
-(defun vip-open-line-at-point (arg)
+	(viper-change-state-to-insert)))))
+
+(defun viper-open-line-at-point (arg)
   "Open line at point."
   (interactive "P")
-  (vip-set-complex-command-for-undo)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-set-destructive-command
-     (list 'vip-open-line-at-point val ?r nil nil nil))
+  (viper-set-complex-command-for-undo)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-set-destructive-command
+     (list 'viper-open-line-at-point val ?r nil nil nil))
     (if (equal com ?r)
-	(vip-loop val
+	(viper-loop val
 		  (progn
 		    (open-line 1)
-		    (vip-yank-last-insertion)))
+		    (viper-yank-last-insertion)))
       (open-line 1)
-      (vip-change-state-to-insert))))
-
-(defun vip-substitute (arg)
+      (viper-change-state-to-insert))))
+
+(defun viper-substitute (arg)
   "Substitute characters."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
     (push-mark nil t)
     (forward-char val)
     (if (equal com ?r)
-	(vip-change-subr (mark t) (point))
-      (vip-change (mark t) (point)))
-    (vip-set-destructive-command (list 'vip-substitute val ?r nil nil nil))
+	(viper-change-subr (mark t) (point))
+      (viper-change (mark t) (point)))
+    (viper-set-destructive-command (list 'viper-substitute val ?r nil nil nil))
     ))
 
-(defun vip-substitute-line (arg)
+;; Command bound to S
+(defun viper-substitute-line (arg)
   "Substitute lines."
   (interactive "p")
-  (vip-set-complex-command-for-undo)
-  (vip-line (cons arg ?C)))
+  (viper-set-complex-command-for-undo)
+  (viper-line (cons arg ?C)))
 
 ;; Prepare for replace
-(defun vip-start-replace ()
-  (setq vip-began-as-replace t
-	vip-sitting-in-replace t
-	vip-replace-chars-to-delete 0
-	vip-replace-chars-deleted 0)
-  (vip-add-hook 'vip-after-change-functions 'vip-replace-mode-spy-after t)
-  (vip-add-hook 'vip-before-change-functions 'vip-replace-mode-spy-before t)
+(defun viper-start-replace ()
+  (setq viper-began-as-replace t
+	viper-sitting-in-replace t
+	viper-replace-chars-to-delete 0
+	viper-replace-chars-deleted 0)
+  (viper-add-hook
+   'viper-after-change-functions 'viper-replace-mode-spy-after t)
+  (viper-add-hook
+   'viper-before-change-functions 'viper-replace-mode-spy-before t)
   ;; this will get added repeatedly, but no harm
-  (add-hook 'after-change-functions 'vip-after-change-sentinel t)
-  (add-hook 'before-change-functions 'vip-before-change-sentinel t)
-  (vip-move-marker-locally 'vip-last-posn-in-replace-region
-			   (vip-replace-start))
-  (vip-add-hook
-   'vip-post-command-hooks 'vip-replace-state-post-command-sentinel t)
-  (vip-add-hook
-   'vip-pre-command-hooks 'vip-replace-state-pre-command-sentinel t)
+  (add-hook 'after-change-functions 'viper-after-change-sentinel t)
+  (add-hook 'before-change-functions 'viper-before-change-sentinel t)
+  (viper-move-marker-locally 'viper-last-posn-in-replace-region
+			     (viper-replace-start))
+  (viper-add-hook
+   'viper-post-command-hooks 'viper-replace-state-post-command-sentinel t)
+  (viper-add-hook
+   'viper-pre-command-hooks 'viper-replace-state-pre-command-sentinel t)
   ;; guard against a smartie who switched from R-replace to normal replace
-  (vip-remove-hook
-   'vip-post-command-hooks 'vip-R-state-post-command-sentinel)
+  (viper-remove-hook
+   'viper-post-command-hooks 'viper-R-state-post-command-sentinel)
   (if overwrite-mode (overwrite-mode nil))
   )
   
 
 ;; checks how many chars were deleted by the last change
-(defun vip-replace-mode-spy-before (beg end)
-  (setq vip-replace-chars-deleted
+(defun viper-replace-mode-spy-before (beg end)
+  (setq viper-replace-chars-deleted
 	(- end beg
-	   (max 0 (- end (vip-replace-end)))
-	   (max 0 (- (vip-replace-start) beg))
+	   (max 0 (- end (viper-replace-end)))
+	   (max 0 (- (viper-replace-start) beg))
 	   )))
 
 ;; Invoked as an after-change-function to set up parameters of the last change
-(defun vip-replace-mode-spy-after (beg end length)
-  (if (memq vip-intermediate-command '(repeating-insertion-from-ring))
+(defun viper-replace-mode-spy-after (beg end length)
+  (if (memq viper-intermediate-command '(repeating-insertion-from-ring))
       (progn
-	(setq vip-replace-chars-to-delete 0)
-	(vip-move-marker-locally 
-	 'vip-last-posn-in-replace-region (point)))
+	(setq viper-replace-chars-to-delete 0)
+	(viper-move-marker-locally 
+	 'viper-last-posn-in-replace-region (point)))
     
     (let (beg-col end-col real-end chars-to-delete)
-      (setq real-end (min end (vip-replace-end)))
+      (setq real-end (min end (viper-replace-end)))
       (save-excursion
 	(goto-char beg)
 	(setq beg-col (current-column))
@@ -2010,8 +2054,8 @@
       ;; regions as well, since this will let us capture the situation when
       ;; dabbrev-expand goes back past the insertion point to find the
       ;; beginning of the word to be expanded.
-      (if (or (and (<= (vip-replace-start) beg)
-		   (<= beg (vip-replace-end)))
+      (if (or (and (<= (viper-replace-start) beg)
+		   (<= beg (viper-replace-end)))
 	      (and (= length 0) (eq this-command 'dabbrev-expand)))
 	  (setq chars-to-delete
 		(max (- end-col beg-col) (- real-end beg) 0))
@@ -2021,277 +2065,289 @@
       ;; same command that does multiple changes. Moreover, it means
       ;; that we have two subsequent changes (insert/delete) that
       ;; complement each other.
-      (if (= beg (marker-position vip-last-posn-in-replace-region))
-	  (setq vip-replace-chars-to-delete 
-		(- (+ chars-to-delete vip-replace-chars-to-delete)
-		   vip-replace-chars-deleted)) 
-	(setq vip-replace-chars-to-delete chars-to-delete))
+      (if (= beg (marker-position viper-last-posn-in-replace-region))
+	  (setq viper-replace-chars-to-delete 
+		(- (+ chars-to-delete viper-replace-chars-to-delete)
+		   viper-replace-chars-deleted)) 
+	(setq viper-replace-chars-to-delete chars-to-delete))
       
-      (vip-move-marker-locally 
-       'vip-last-posn-in-replace-region
-       (max (if (> end (vip-replace-end)) (vip-replace-start) end)
-	    (or (marker-position vip-last-posn-in-replace-region)
-		(vip-replace-start)) 
+      (viper-move-marker-locally 
+       'viper-last-posn-in-replace-region
+       (max (if (> end (viper-replace-end)) (viper-replace-start) end)
+	    (or (marker-position viper-last-posn-in-replace-region)
+		(viper-replace-start)) 
 	    ))
       
-      (setq vip-replace-chars-to-delete
+      (setq viper-replace-chars-to-delete
 	    (max 0
-		 (min vip-replace-chars-to-delete
-		      (- (vip-replace-end) vip-last-posn-in-replace-region)
-		      (- (vip-line-pos 'end) vip-last-posn-in-replace-region)
+		 (min viper-replace-chars-to-delete
+		      (- (viper-replace-end) viper-last-posn-in-replace-region)
+		      (- (viper-line-pos 'end)
+			 viper-last-posn-in-replace-region)
 		      )))
       )))
 
 
-;; Delete stuff between posn and the end of vip-replace-overlay-marker, if
+;; Delete stuff between posn and the end of viper-replace-overlay-marker, if
 ;; posn is within the overlay.
-(defun vip-finish-change (posn)
-  (vip-remove-hook 'vip-after-change-functions 'vip-replace-mode-spy-after)
-  (vip-remove-hook 'vip-before-change-functions 'vip-replace-mode-spy-before)
-  (vip-remove-hook 'vip-post-command-hooks
-		   'vip-replace-state-post-command-sentinel) 
-  (vip-remove-hook
-   'vip-pre-command-hooks 'vip-replace-state-pre-command-sentinel) 
-  (vip-restore-cursor-color-after-replace)
-  (setq vip-sitting-in-replace nil) ; just in case we'll need to know it
+(defun viper-finish-change (posn)
+  (viper-remove-hook
+   'viper-after-change-functions 'viper-replace-mode-spy-after)
+  (viper-remove-hook
+   'viper-before-change-functions 'viper-replace-mode-spy-before)
+  (viper-remove-hook
+   'viper-post-command-hooks 'viper-replace-state-post-command-sentinel) 
+  (viper-remove-hook
+   'viper-pre-command-hooks 'viper-replace-state-pre-command-sentinel) 
+  (viper-restore-cursor-color-after-replace)
+  (setq viper-sitting-in-replace nil) ; just in case we'll need to know it
   (save-excursion
     (if (and 
-	 vip-replace-overlay
-	 (>= posn (vip-replace-start))
-	 (<  posn (vip-replace-end)))
-	   (delete-region posn (vip-replace-end)))
+	 viper-replace-overlay
+	 (>= posn (viper-replace-start))
+	 (<  posn (viper-replace-end)))
+	   (delete-region posn (viper-replace-end)))
     )
   
-  (if (eq vip-current-state 'replace-state)
-      (vip-downgrade-to-insert))
-  ;; replace mode ended => nullify vip-last-posn-in-replace-region
-  (vip-move-marker-locally 'vip-last-posn-in-replace-region nil)
-  (vip-hide-replace-overlay)
-  (vip-refresh-mode-line)
-  (vip-put-string-on-kill-ring vip-last-replace-region)
+  (if (eq viper-current-state 'replace-state)
+      (viper-downgrade-to-insert))
+  ;; replace mode ended => nullify viper-last-posn-in-replace-region
+  (viper-move-marker-locally 'viper-last-posn-in-replace-region nil)
+  (viper-hide-replace-overlay)
+  (viper-refresh-mode-line)
+  (viper-put-string-on-kill-ring viper-last-replace-region)
   )
 
 ;; Make STRING be the first element of the kill ring.
-(defun vip-put-string-on-kill-ring (string)
+(defun viper-put-string-on-kill-ring (string)
   (setq kill-ring (cons string kill-ring))
   (if (> (length kill-ring) kill-ring-max)
       (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))
   (setq kill-ring-yank-pointer kill-ring))
 
-(defun vip-finish-R-mode ()
-  (vip-remove-hook 'vip-post-command-hooks 'vip-R-state-post-command-sentinel)
-  (vip-remove-hook
-   'vip-pre-command-hooks 'vip-replace-state-pre-command-sentinel)
-  (vip-downgrade-to-insert))
+(defun viper-finish-R-mode ()
+  (viper-remove-hook
+   'viper-post-command-hooks 'viper-R-state-post-command-sentinel)
+  (viper-remove-hook
+   'viper-pre-command-hooks 'viper-replace-state-pre-command-sentinel)
+  (viper-downgrade-to-insert))
   
-(defun vip-start-R-mode ()
+(defun viper-start-R-mode ()
   ;; Leave arg as 1, not t: XEmacs insists that it must be a pos number
   (overwrite-mode 1)
-  (vip-add-hook
-   'vip-post-command-hooks 'vip-R-state-post-command-sentinel t)
-  (vip-add-hook
-   'vip-pre-command-hooks 'vip-replace-state-pre-command-sentinel t)
+  (viper-add-hook
+   'viper-post-command-hooks 'viper-R-state-post-command-sentinel t)
+  (viper-add-hook
+   'viper-pre-command-hooks 'viper-replace-state-pre-command-sentinel t)
   ;; guard against a smartie who switched from R-replace to normal replace
-  (vip-remove-hook
-   'vip-post-command-hooks 'vip-replace-state-post-command-sentinel)
+  (viper-remove-hook
+   'viper-post-command-hooks 'viper-replace-state-post-command-sentinel)
   )
 
 
   
-(defun vip-replace-state-exit-cmd ()
+(defun viper-replace-state-exit-cmd ()
   "Binding for keys that cause Replace state to switch to Vi or to Insert.
 These keys are ESC, RET, and LineFeed"
   (interactive)
   (if overwrite-mode  ;; If you are in replace mode invoked via 'R'
-      (vip-finish-R-mode)
-    (vip-finish-change vip-last-posn-in-replace-region))
+      (viper-finish-R-mode)
+    (viper-finish-change viper-last-posn-in-replace-region))
   (let (com)
-    (if (eq this-command 'vip-intercept-ESC-key)
-	(setq com 'vip-exit-insert-state)
-      (vip-set-unread-command-events last-input-char)
+    (if (eq this-command 'viper-intercept-ESC-key)
+	(setq com 'viper-exit-insert-state)
+      (viper-set-unread-command-events last-input-char)
       (setq com (key-binding (read-key-sequence nil))))
       
     (condition-case conds
 	(command-execute com)
       (error
-       (vip-message-conditions conds)))
+       (viper-message-conditions conds)))
     )
-  (vip-hide-replace-overlay))
-
-(defun vip-replace-state-carriage-return ()
-  "Implements carriage return in Viper replace state."
+  (viper-hide-replace-overlay))
+
+
+(defun viper-replace-state-carriage-return ()
+  "Carriage return in Viper replace state."
   (interactive)
   ;; If Emacs start supporting overlay maps, as it currently supports
-  ;; text-property maps, we could do away with vip-replace-minor-mode and
+  ;; text-property maps, we could do away with viper-replace-minor-mode and
   ;; just have keymap attached to replace overlay. Then the "if part" of this
   ;; statement can be deleted.
-  (if (or (< (point) (vip-replace-start))
-	  (> (point) (vip-replace-end)))
-      (let (vip-replace-minor-mode com)
-	(vip-set-unread-command-events last-input-char)
+  (if (or (< (point) (viper-replace-start))
+	  (> (point) (viper-replace-end)))
+      (let (viper-replace-minor-mode com)
+	(viper-set-unread-command-events last-input-char)
 	(setq com (key-binding (read-key-sequence nil)))
 	(condition-case conds
 	    (command-execute com)
 	  (error
-	   (vip-message-conditions conds))))
-    (if (not vip-allow-multiline-replace-regions)
-	(vip-replace-state-exit-cmd)
-      (if (vip-same-line (point) (vip-replace-end))
-	  (vip-replace-state-exit-cmd)
-	(vip-kill-line nil)
-	(vip-next-line-at-bol nil)))))
+	   (viper-message-conditions conds))))
+    (if (not viper-allow-multiline-replace-regions)
+	(viper-replace-state-exit-cmd)
+      (if (viper-same-line (point) (viper-replace-end))
+	  (viper-replace-state-exit-cmd)
+	;; delete the rest of line
+	(delete-region (point) (viper-line-pos 'end))
+	(save-excursion
+	  (end-of-line)
+	  (if (eobp) (error "Last line in buffer")))
+	;; skip to the next line
+	(forward-line 1)
+	(back-to-indentation)
+	))))
 
   
 ;; This is the function bound to 'R'---unlimited replace.
 ;; Similar to Emacs's own overwrite-mode.
-(defun vip-overwrite (arg) 
+(defun viper-overwrite (arg) 
   "Begin overwrite mode."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)) (len))
-    (vip-set-destructive-command (list 'vip-overwrite val ?r nil nil nil))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)) (len))
+    (viper-set-destructive-command (list 'viper-overwrite val ?r nil nil nil))
     (if com
 	(progn 
-	  ;; Viper saves inserted text in vip-last-insertion
-	  (setq len (length vip-last-insertion))
+	  ;; Viper saves inserted text in viper-last-insertion
+	  (setq len (length viper-last-insertion))
 	  (delete-char len)	
-	  (vip-loop val (vip-yank-last-insertion)))
-      (setq last-command 'vip-overwrite)
-      (vip-set-complex-command-for-undo)
-      (vip-set-replace-overlay (point) (vip-line-pos 'end))
-      (vip-change-state-to-replace)
+	  (viper-loop val (viper-yank-last-insertion)))
+      (setq last-command 'viper-overwrite)
+      (viper-set-complex-command-for-undo)
+      (viper-set-replace-overlay (point) (viper-line-pos 'end))
+      (viper-change-state-to-replace)
       )))
 
 
 ;; line commands
 
-(defun vip-line (arg)
+(defun viper-line (arg)
   (let ((val (car arg))
 	(com (cdr arg)))
-    (vip-move-marker-locally 'vip-com-point (point))
+    (viper-move-marker-locally 'viper-com-point (point))
     (if (not (eobp))
-	(vip-next-line-carefully (1- val)))
+	(viper-next-line-carefully (1- val)))
     ;; this ensures that dd, cc, D, yy will do the right thing on the last
     ;; line of buffer when this line has no \n.
-    (vip-add-newline-at-eob-if-necessary)
-    (vip-execute-com 'vip-line val com))
+    (viper-add-newline-at-eob-if-necessary)
+    (viper-execute-com 'viper-line val com))
   (if (and (eobp) (not (bobp))) (forward-line -1))
   )
 
-(defun vip-yank-line (arg)
+(defun viper-yank-line (arg)
   "Yank ARG lines (in Vi's sense)."
   (interactive "P")
-  (let ((val (vip-p-val arg)))
-    (vip-line (cons val ?Y))))
+  (let ((val (viper-p-val arg)))
+    (viper-line (cons val ?Y))))
 
 
 ;; region commands
 
-(defun vip-region (arg)
+(defun viper-region (arg)
   "Execute command on a region."
   (interactive "P")
-  (let ((val (vip-P-val arg))
-	(com (vip-getcom arg)))
-    (vip-move-marker-locally 'vip-com-point (point))
+  (let ((val (viper-P-val arg))
+	(com (viper-getcom arg)))
+    (viper-move-marker-locally 'viper-com-point (point))
     (exchange-point-and-mark)
-    (vip-execute-com 'vip-region val com)))
-
-(defun vip-Region (arg)
+    (viper-execute-com 'viper-region val com)))
+
+(defun viper-Region (arg)
   "Execute command on a Region."
   (interactive "P")
-  (let ((val (vip-P-val arg))
-	(com (vip-getCom arg)))
-    (vip-move-marker-locally 'vip-com-point (point))
+  (let ((val (viper-P-val arg))
+	(com (viper-getCom arg)))
+    (viper-move-marker-locally 'viper-com-point (point))
     (exchange-point-and-mark)
-    (vip-execute-com 'vip-Region val com)))
-
-(defun vip-replace-char (arg)
+    (viper-execute-com 'viper-Region val com)))
+
+(defun viper-replace-char (arg)
   "Replace the following ARG chars by the character read."
   (interactive "P")
   (if (and (eolp) (bolp)) (error "No character to replace here"))
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-replace-char-subr com val)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-replace-char-subr com val)
     (if (and (eolp) (not (bolp))) (forward-char 1))
-    (vip-set-destructive-command
-     (list 'vip-replace-char val ?r nil vip-d-char nil))
+    (viper-set-destructive-command
+     (list 'viper-replace-char val ?r nil viper-d-char nil))
   ))
 
-(defun vip-replace-char-subr (com arg)
+(defun viper-replace-char-subr (com arg)
   (let ((take-care-of-iso-accents
-	 (and (boundp 'iso-accents-mode) vip-automatic-iso-accents))
+	 (and (boundp 'iso-accents-mode) viper-automatic-iso-accents))
 	char)
     (setq char (if (equal com ?r)
-		   vip-d-char
+		   viper-d-char
 		 (read-char)))
     (if (and  take-care-of-iso-accents (memq char '(?' ?\" ?^ ?~)))
 	;; get European characters
 	(progn
 	  (iso-accents-mode 1)
-	  (vip-set-unread-command-events char)
+	  (viper-set-unread-command-events char)
 	  (setq char (aref (read-key-sequence nil) 0))
 	  (iso-accents-mode -1)))
     (delete-char arg t)
-    (setq vip-d-char char)
-    (vip-loop (if (> arg 0) arg (- arg)) 
+    (setq viper-d-char char)
+    (viper-loop (if (> arg 0) arg (- arg)) 
 	    (if (eq char ?\C-m) (insert "\n") (insert char)))
     (backward-char arg)))
 
 
 ;; basic cursor movement.  j, k, l, h commands.
 
-(defun vip-forward-char (arg)
+(defun viper-forward-char (arg)
   "Move point right ARG characters (left if ARG negative).
 On reaching end of line, stop and signal error."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (if vip-ex-style-motion
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (if viper-ex-style-motion
 	(progn
 	  ;; the boundary condition check gets weird here because
 	  ;; forward-char may be the parameter of a delete, and 'dl' works
 	  ;; just like 'x' for the last char on a line, so we have to allow
-	  ;; the forward motion before the 'vip-execute-com', but, of
+	  ;; the forward motion before the 'viper-execute-com', but, of
 	  ;; course, 'dl' doesn't work on an empty line, so we have to
-	  ;; catch that condition before 'vip-execute-com'
+	  ;; catch that condition before 'viper-execute-com'
 	  (if (and (eolp) (bolp)) (error "") (forward-char val))
-	  (if com (vip-execute-com 'vip-forward-char val com))
+	  (if com (viper-execute-com 'viper-forward-char val com))
 	  (if (eolp) (progn (backward-char 1) (error ""))))
       (forward-char val)
-      (if com (vip-execute-com 'vip-forward-char val com)))))
-
-(defun vip-backward-char (arg)
+      (if com (viper-execute-com 'viper-forward-char val com)))))
+
+(defun viper-backward-char (arg)
   "Move point left ARG characters (right if ARG negative). 
 On reaching beginning of line, stop and signal error."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (if vip-ex-style-motion
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (if viper-ex-style-motion
 	(progn
 	  (if (bolp) (error "") (backward-char val))
-	  (if com (vip-execute-com 'vip-backward-char val com)))
+	  (if com (viper-execute-com 'viper-backward-char val com)))
       (backward-char val)
-      (if com (vip-execute-com 'vip-backward-char val com)))))
+      (if com (viper-execute-com 'viper-backward-char val com)))))
       
 ;; Like forward-char, but doesn't move at end of buffer.
-(defun vip-forward-char-carefully (&optional arg)      
+(defun viper-forward-char-carefully (&optional arg)      
   (setq arg (or arg 1))
   (if (>= (point-max) (+ (point) arg))
       (forward-char arg)
     (goto-char (point-max))))
       
 ;; Like backward-char, but doesn't move at end of buffer.
-(defun vip-backward-char-carefully (&optional arg)      
+(defun viper-backward-char-carefully (&optional arg)      
   (setq arg (or arg 1))
   (if (<= (point-min) (- (point) arg))
       (backward-char arg)
     (goto-char (point-min))))
 
-(defun vip-next-line-carefully (arg)
+(defun viper-next-line-carefully (arg)
   (condition-case nil
       (next-line arg)
     (error nil)))
@@ -2300,337 +2356,336 @@
 
 ;;; Word command
 
-;; Words are formed from alpha's and nonalphas - <sp>,\t\n are separators
-;; for word movement. When executed with a destructive command, \n is
-;; usually left untouched for the last word.
-;; Viper uses syntax table to determine what is a word and what is a
-;; separator. However, \n is always a separator. Also, if vip-syntax-preference
-;; is 'vi, then `_' is part of the word.
+;; Words are formed from alpha's and nonalphas - <sp>,\t\n are separators for
+;; word movement. When executed with a destructive command, \n is usually left
+;; untouched for the last word.  Viper uses syntax table to determine what is a
+;; word and what is a separator. However, \n is always a separator. Also, if
+;; viper-syntax-preference is 'vi, then `_' is part of the word.
 
 ;; skip only one \n
-(defun vip-skip-separators (forward)
+(defun viper-skip-separators (forward)
   (if forward
       (progn
-	(vip-skip-all-separators-forward 'within-line)
+	(viper-skip-all-separators-forward 'within-line)
 	(if (looking-at "\n")
 	    (progn
 	      (forward-char)
-	      (vip-skip-all-separators-forward  'within-line))))
-    (vip-skip-all-separators-backward 'within-line)
+	      (viper-skip-all-separators-forward  'within-line))))
+    (viper-skip-all-separators-backward 'within-line)
     (backward-char)
     (if (looking-at "\n")
-	(vip-skip-all-separators-backward 'within-line)
+	(viper-skip-all-separators-backward 'within-line)
       (forward-char))))
       
-(defun vip-forward-word-kernel (val)
+(defun viper-forward-word-kernel (val)
   (while (> val 0)
-    (cond ((vip-looking-at-alpha)
-	   (vip-skip-alpha-forward "_")
-	   (vip-skip-separators t))
-	  ((vip-looking-at-separator)
-	   (vip-skip-separators t))
-	  ((not (vip-looking-at-alphasep))
-	   (vip-skip-nonalphasep-forward)
-	   (vip-skip-separators t)))
+    (cond ((viper-looking-at-alpha)
+	   (viper-skip-alpha-forward "_")
+	   (viper-skip-separators t))
+	  ((viper-looking-at-separator)
+	   (viper-skip-separators t))
+	  ((not (viper-looking-at-alphasep))
+	   (viper-skip-nonalphasep-forward)
+	   (viper-skip-separators t)))
     (setq val (1- val))))
 
 ;; first search backward for pat. Then skip chars backwards using aux-pat
-(defun vip-fwd-skip (pat aux-pat lim)
+(defun viper-fwd-skip (pat aux-pat lim)
   (if (and (save-excursion 
 	     (re-search-backward pat lim t))
 	   (= (point) (match-end 0)))
       (goto-char (match-beginning 0)))
   (skip-chars-backward aux-pat lim)
   (if (= (point) lim)
-      (vip-forward-char-carefully))
+      (viper-forward-char-carefully))
   )
 
 	  
-(defun vip-forward-word (arg)
+(defun viper-forward-word (arg)
   "Forward word."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-forward-word-kernel val)
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-forward-word-kernel val)
     (if com (progn
 	      (cond ((memq com (list ?c (- ?c)))
-		     (vip-fwd-skip "\n[ \t]*" " \t" vip-com-point))
+		     (viper-fwd-skip "\n[ \t]*" " \t" viper-com-point))
 		    ;; Yank words including the whitespace, but not newline
 		    ((memq com (list ?y (- ?y)))
-		     (vip-fwd-skip "\n[ \t]*" "" vip-com-point))
-		    ((vip-dotable-command-p com)
-		     (vip-fwd-skip "\n[ \t]*" "" vip-com-point)))
-	      (vip-execute-com 'vip-forward-word val com)))))
+		     (viper-fwd-skip "\n[ \t]*" "" viper-com-point))
+		    ((viper-dotable-command-p com)
+		     (viper-fwd-skip "\n[ \t]*" "" viper-com-point)))
+	      (viper-execute-com 'viper-forward-word val com)))))
 	  
 
-(defun vip-forward-Word (arg)
+(defun viper-forward-Word (arg)
   "Forward word delimited by white characters."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-loop val
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-loop val
 	      (progn
-		(vip-skip-nonseparators 'forward)
-		(vip-skip-separators t)))
+		(viper-skip-nonseparators 'forward)
+		(viper-skip-separators t)))
     (if com (progn
 	      (cond ((memq com (list ?c (- ?c)))
-		     (vip-fwd-skip "\n[ \t]*" " \t" vip-com-point))
+		     (viper-fwd-skip "\n[ \t]*" " \t" viper-com-point))
 		    ;; Yank words including the whitespace, but not newline
 		    ((memq com (list ?y (- ?y)))
-		     (vip-fwd-skip "\n[ \t]*" "" vip-com-point))
-		    ((vip-dotable-command-p com)
-		     (vip-fwd-skip "\n[ \t]*" "" vip-com-point)))
-	      (vip-execute-com 'vip-forward-Word val com)))))
+		     (viper-fwd-skip "\n[ \t]*" "" viper-com-point))
+		    ((viper-dotable-command-p com)
+		     (viper-fwd-skip "\n[ \t]*" "" viper-com-point)))
+	      (viper-execute-com 'viper-forward-Word val com)))))
 
 
 ;; this is a bit different from Vi, but Vi's end of word 
 ;; makes no sense whatsoever
-(defun vip-end-of-word-kernel ()
-  (if (vip-end-of-word-p) (forward-char))
-  (if (vip-looking-at-separator)
-      (vip-skip-all-separators-forward))
+(defun viper-end-of-word-kernel ()
+  (if (viper-end-of-word-p) (forward-char))
+  (if (viper-looking-at-separator)
+      (viper-skip-all-separators-forward))
   
-  (cond ((vip-looking-at-alpha) (vip-skip-alpha-forward "_"))
-	((not (vip-looking-at-alphasep)) (vip-skip-nonalphasep-forward)))
-  (vip-backward-char-carefully))
-
-(defun vip-end-of-word-p ()
+  (cond ((viper-looking-at-alpha) (viper-skip-alpha-forward "_"))
+	((not (viper-looking-at-alphasep)) (viper-skip-nonalphasep-forward)))
+  (viper-backward-char-carefully))
+
+(defun viper-end-of-word-p ()
   (or (eobp) 
       (save-excursion
-	(cond ((vip-looking-at-alpha)
+	(cond ((viper-looking-at-alpha)
 	       (forward-char)
-	       (not (vip-looking-at-alpha)))
-	      ((not (vip-looking-at-alphasep))
+	       (not (viper-looking-at-alpha)))
+	      ((not (viper-looking-at-alphasep))
 	       (forward-char)
-	       (vip-looking-at-alphasep))))))
-
-
-(defun vip-end-of-word (arg &optional careful)
+	       (viper-looking-at-alphasep))))))
+
+
+(defun viper-end-of-word (arg &optional careful)
   "Move point to end of current word."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-loop val (vip-end-of-word-kernel))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-loop val (viper-end-of-word-kernel))
     (if com 
 	(progn
 	  (forward-char)
-	  (vip-execute-com 'vip-end-of-word val com)))))
-
-(defun vip-end-of-Word (arg)
+	  (viper-execute-com 'viper-end-of-word val com)))))
+
+(defun viper-end-of-Word (arg)
   "Forward to end of word delimited by white character."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-loop val
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-loop val
 	      (progn
-		(vip-end-of-word-kernel)
-		(vip-skip-nonseparators 'forward)
+		(viper-end-of-word-kernel)
+		(viper-skip-nonseparators 'forward)
 		(backward-char)))
     (if com 
 	(progn
 	  (forward-char)
-	  (vip-execute-com 'vip-end-of-Word val com)))))
-
-(defun vip-backward-word-kernel (val)
+	  (viper-execute-com 'viper-end-of-Word val com)))))
+
+(defun viper-backward-word-kernel (val)
   (while (> val 0)
     (backward-char)
-    (cond ((vip-looking-at-alpha)
-	   (vip-skip-alpha-backward "_"))
-	  ((vip-looking-at-separator)
+    (cond ((viper-looking-at-alpha)
+	   (viper-skip-alpha-backward "_"))
+	  ((viper-looking-at-separator)
 	   (forward-char)
-	   (vip-skip-separators nil)
+	   (viper-skip-separators nil)
 	   (backward-char)
-	   (cond ((vip-looking-at-alpha)
-		  (vip-skip-alpha-backward "_"))
-		 ((not (vip-looking-at-alphasep))
-		  (vip-skip-nonalphasep-backward))
+	   (cond ((viper-looking-at-alpha)
+		  (viper-skip-alpha-backward "_"))
+		 ((not (viper-looking-at-alphasep))
+		  (viper-skip-nonalphasep-backward))
 		 (t (forward-char))))
-	  ((not (vip-looking-at-alphasep))
-	   (vip-skip-nonalphasep-backward)))
+	  ((not (viper-looking-at-alphasep))
+	   (viper-skip-nonalphasep-backward)))
     (setq val (1- val))))
 
-(defun vip-backward-word (arg)
+(defun viper-backward-word (arg)
   "Backward word."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
     (if com
 	(let (i)
 	  (if (setq i (save-excursion (backward-char) (looking-at "\n")))
 	      (backward-char))
-	  (vip-move-marker-locally 'vip-com-point (point))
+	  (viper-move-marker-locally 'viper-com-point (point))
 	  (if i (forward-char))))
-    (vip-backward-word-kernel val)
-    (if com (vip-execute-com 'vip-backward-word val com))))
-
-(defun vip-backward-Word (arg)
+    (viper-backward-word-kernel val)
+    (if com (viper-execute-com 'viper-backward-word val com))))
+
+(defun viper-backward-Word (arg)
   "Backward word delimited by white character."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
     (if com
 	(let (i)
 	  (if (setq i (save-excursion (backward-char) (looking-at "\n")))
 	      (backward-char))
-	  (vip-move-marker-locally 'vip-com-point (point))
+	  (viper-move-marker-locally 'viper-com-point (point))
 	  (if i (forward-char))))
-    (vip-loop val
+    (viper-loop val
 	      (progn 
-		(vip-skip-separators nil)
-		(vip-skip-nonseparators 'backward)))
-    (if com (vip-execute-com 'vip-backward-Word val com))))
+		(viper-skip-separators nil)
+		(viper-skip-nonseparators 'backward)))
+    (if com (viper-execute-com 'viper-backward-Word val com))))
 
 
 
 ;; line commands
 
-(defun vip-beginning-of-line (arg)
+(defun viper-beginning-of-line (arg)
   "Go to beginning of line."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (beginning-of-line val)
-    (if com (vip-execute-com 'vip-beginning-of-line val com))))
-
-(defun vip-bol-and-skip-white (arg)
+    (if com (viper-execute-com 'viper-beginning-of-line val com))))
+
+(defun viper-bol-and-skip-white (arg)
   "Beginning of line at first non-white character."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (forward-to-indentation (1- val))
-    (if com (vip-execute-com 'vip-bol-and-skip-white val com))))
-
-(defun vip-goto-eol (arg)
+    (if com (viper-execute-com 'viper-bol-and-skip-white val com))))
+
+(defun viper-goto-eol (arg)
   "Go to end of line."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (end-of-line val)
-    (if com (vip-execute-com 'vip-goto-eol val com))
-    (if vip-ex-style-motion
+    (if com (viper-execute-com 'viper-goto-eol val com))
+    (if viper-ex-style-motion
 	(if (and (eolp) (not (bolp)) 
-		 ;; a fix for vip-change-to-eol
-		 (not (equal vip-current-state 'insert-state)))
+		 ;; a fix for viper-change-to-eol
+		 (not (equal viper-current-state 'insert-state)))
 	    (backward-char 1)
     ))))
 
 
-(defun vip-goto-col (arg)
+(defun viper-goto-col (arg)
   "Go to ARG's column."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg))
 	line-len)
-    (setq line-len (- (vip-line-pos 'end) (vip-line-pos 'start)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+    (setq line-len (- (viper-line-pos 'end) (viper-line-pos 'start)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (beginning-of-line)
     (forward-char (1- (min line-len val)))
     (while (> (current-column) (1- val))
       (backward-char 1))
-    (if com (vip-execute-com 'vip-goto-col val com))
+    (if com (viper-execute-com 'viper-goto-col val com))
     (save-excursion
       (end-of-line)
       (if (> val (current-column)) (error "")))
     ))
     
 
-(defun vip-next-line (arg)
+(defun viper-next-line (arg)
   "Go to next line."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (next-line val)
-    (if vip-ex-style-motion
+    (if viper-ex-style-motion
 	(if (and (eolp) (not (bolp))) (backward-char 1)))
     (setq this-command 'next-line)
-    (if com (vip-execute-com 'vip-next-line val com))))
-
-(defun vip-next-line-at-bol (arg)
+    (if com (viper-execute-com 'viper-next-line val com))))
+
+(defun viper-next-line-at-bol (arg)
   "Next line at beginning of line."
   (interactive "P")
-  (vip-leave-region-active)
+  (viper-leave-region-active)
   (save-excursion
     (end-of-line)
     (if (eobp) (error "Last line in buffer")))
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (forward-line val)
     (back-to-indentation)
-    (if com (vip-execute-com 'vip-next-line-at-bol val com))))
-
-(defun vip-previous-line (arg)	 
+    (if com (viper-execute-com 'viper-next-line-at-bol val com))))
+
+(defun viper-previous-line (arg)	 
   "Go to previous line."    	
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (viper-leave-region-active)
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (previous-line val)
-    (if vip-ex-style-motion
+    (if viper-ex-style-motion
 	(if (and (eolp) (not (bolp))) (backward-char 1)))
     (setq this-command 'previous-line)
-    (if com (vip-execute-com 'vip-previous-line val com))))
-
-
-(defun vip-previous-line-at-bol (arg)
+    (if com (viper-execute-com 'viper-previous-line val com))))
+
+
+(defun viper-previous-line-at-bol (arg)
   "Previous line at beginning of line."
   (interactive "P")
-  (vip-leave-region-active)
+  (viper-leave-region-active)
   (save-excursion
     (beginning-of-line)
     (if (bobp) (error "First line in buffer")))
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (forward-line (- val))
     (back-to-indentation)
-    (if com (vip-execute-com 'vip-previous-line val com))))
-
-(defun vip-change-to-eol (arg)
+    (if com (viper-execute-com 'viper-previous-line val com))))
+
+(defun viper-change-to-eol (arg)
   "Change to end of line."
   (interactive "P")
-  (vip-goto-eol (cons arg ?c)))
-
-(defun vip-kill-line (arg)
+  (viper-goto-eol (cons arg ?c)))
+
+(defun viper-kill-line (arg)
   "Delete line."
   (interactive "P")
-  (vip-goto-eol (cons arg ?d)))
-
-(defun vip-erase-line (arg)
+  (viper-goto-eol (cons arg ?d)))
+
+(defun viper-erase-line (arg)
   "Erase line."
   (interactive "P")
-  (vip-beginning-of-line (cons arg ?d)))
+  (viper-beginning-of-line (cons arg ?d)))
 
 
 ;;; Moving around
 
-(defun vip-goto-line (arg)
+(defun viper-goto-line (arg)
   "Go to ARG's line.  Without ARG go to end of buffer."
   (interactive "P")
-  (let ((val (vip-P-val arg))
-	(com (vip-getCom arg)))
-    (vip-move-marker-locally 'vip-com-point (point))
-    (vip-deactivate-mark)
+  (let ((val (viper-P-val arg))
+	(com (viper-getCom arg)))
+    (viper-move-marker-locally 'viper-com-point (point))
+    (viper-deactivate-mark)
     (push-mark nil t)
     (if (null val)
 	(goto-char (point-max))
@@ -2641,7 +2696,7 @@
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
     
-    (if com (vip-execute-com 'vip-goto-line val com))
+    (if com (viper-execute-com 'viper-goto-line val com))
     
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
@@ -2650,12 +2705,12 @@
 ;; Find ARG's occurrence of CHAR on the current line. 
 ;; If FORWARD then search is forward, otherwise backward.  OFFSET is used to
 ;; adjust point after search.
-(defun vip-find-char (arg char forward offset)
+(defun viper-find-char (arg char forward offset)
   (or (char-or-string-p char) (error ""))
   (let ((arg (if forward arg (- arg)))
-	(cmd (if (eq vip-intermediate-command 'vip-repeat)
-		 (nth 5 vip-d-com)
-	       (vip-array-to-string (this-command-keys))))
+	(cmd (if (eq viper-intermediate-command 'viper-repeat)
+		 (nth 5 viper-d-com)
+	       (viper-array-to-string (this-command-keys))))
 	point)
     (save-excursion
       (save-restriction
@@ -2680,155 +2735,150 @@
 	  (error "Command `%s':  `%c' not found" cmd char))))
     (goto-char (+ point (if (> arg 0) (if offset -2 -1) (if offset 1 0))))))
 
-(defun vip-find-char-forward (arg)
+(defun viper-find-char-forward (arg)
   "Find char on the line. 
 If called interactively read the char to find from the terminal, and if
-called from vip-repeat, the char last used is used.  This behaviour is
+called from viper-repeat, the char last used is used.  This behaviour is
 controlled by the sign of prefix numeric value."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg))
-	(cmd-representation (nth 5 vip-d-com)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg))
+	(cmd-representation (nth 5 viper-d-com)))
     (if (> val 0)
 	;; this means that the function was called interactively
-	(setq vip-f-char (read-char)
-	      vip-f-forward t
-	      vip-f-offset nil)
-      ;; vip-repeat --- set vip-F-char from command-keys
-      (setq vip-F-char (if (stringp cmd-representation)
-			   (vip-seq-last-elt cmd-representation)
-			 vip-F-char)
-	    vip-f-char vip-F-char)
+	(setq viper-f-char (read-char)
+	      viper-f-forward t
+	      viper-f-offset nil)
+      ;; viper-repeat --- set viper-F-char from command-keys
+      (setq viper-F-char (if (stringp cmd-representation)
+			   (viper-seq-last-elt cmd-representation)
+			 viper-F-char)
+	    viper-f-char viper-F-char)
       (setq val (- val)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-find-char val (if (> (vip-p-val arg) 0) vip-f-char vip-F-char) t nil)
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-find-char
+     val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) t nil)
     (setq val (- val))
     (if com
 	(progn
-	  (setq vip-F-char vip-f-char) ; set new vip-F-char
+	  (setq viper-F-char viper-f-char) ; set new viper-F-char
 	  (forward-char)
-	  (vip-execute-com 'vip-find-char-forward val com)))))
-
-(defun vip-goto-char-forward (arg)
+	  (viper-execute-com 'viper-find-char-forward val com)))))
+
+(defun viper-goto-char-forward (arg)
   "Go up to char ARG forward on line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg))
-	(cmd-representation (nth 5 vip-d-com)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg))
+	(cmd-representation (nth 5 viper-d-com)))
     (if (> val 0)
 	;; this means that the function was called interactively
-	(setq vip-f-char (read-char)
-	      vip-f-forward t
-	      vip-f-offset t)
-      ;; vip-repeat --- set vip-F-char from command-keys
-      (setq vip-F-char (if (stringp cmd-representation)
-			   (vip-seq-last-elt cmd-representation)
-			 vip-F-char)
-	    vip-f-char vip-F-char)
+	(setq viper-f-char (read-char)
+	      viper-f-forward t
+	      viper-f-offset t)
+      ;; viper-repeat --- set viper-F-char from command-keys
+      (setq viper-F-char (if (stringp cmd-representation)
+			     (viper-seq-last-elt cmd-representation)
+			   viper-F-char)
+	    viper-f-char viper-F-char)
       (setq val (- val)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-find-char val (if (> (vip-p-val arg) 0) vip-f-char vip-F-char) t t)
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-find-char
+     val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) t t)
     (setq val (- val))
     (if com
 	(progn
-	  (setq vip-F-char vip-f-char) ; set new vip-F-char
+	  (setq viper-F-char viper-f-char) ; set new viper-F-char
 	  (forward-char)
-	  (vip-execute-com 'vip-goto-char-forward val com)))))
-
-(defun vip-find-char-backward (arg)
+	  (viper-execute-com 'viper-goto-char-forward val com)))))
+
+(defun viper-find-char-backward (arg)
   "Find char ARG on line backward."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg))
-	(cmd-representation (nth 5 vip-d-com)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg))
+	(cmd-representation (nth 5 viper-d-com)))
     (if (> val 0)
 	;; this means that the function was called interactively
-	(setq vip-f-char (read-char)
-	      vip-f-forward nil
-	      vip-f-offset nil)
-      ;; vip-repeat --- set vip-F-char from command-keys
-      (setq vip-F-char (if (stringp cmd-representation)
-			   (vip-seq-last-elt cmd-representation)
-			 vip-F-char)
-	    vip-f-char vip-F-char)
+	(setq viper-f-char (read-char)
+	      viper-f-forward nil
+	      viper-f-offset nil)
+      ;; viper-repeat --- set viper-F-char from command-keys
+      (setq viper-F-char (if (stringp cmd-representation)
+			   (viper-seq-last-elt cmd-representation)
+			 viper-F-char)
+	    viper-f-char viper-F-char)
       (setq val (- val)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-find-char
-     val (if (> (vip-p-val arg) 0) vip-f-char vip-F-char) nil nil)
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-find-char
+     val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) nil nil)
     (setq val (- val))
     (if com
 	(progn
-	  (setq vip-F-char vip-f-char) ; set new vip-F-char
-	  (vip-execute-com 'vip-find-char-backward val com)))))
-
-(defun vip-goto-char-backward (arg)
+	  (setq viper-F-char viper-f-char) ; set new viper-F-char
+	  (viper-execute-com 'viper-find-char-backward val com)))))
+
+(defun viper-goto-char-backward (arg)
   "Go up to char ARG backward on line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg))
-	(cmd-representation (nth 5 vip-d-com)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg))
+	(cmd-representation (nth 5 viper-d-com)))
     (if (> val 0)
 	;; this means that the function was called interactively
-	(setq vip-f-char (read-char)
-	      vip-f-forward nil
-	      vip-f-offset t)
-      ;; vip-repeat --- set vip-F-char from command-keys
-      (setq vip-F-char (if (stringp cmd-representation)
-			   (vip-seq-last-elt cmd-representation)
-			 vip-F-char)
-	    vip-f-char vip-F-char)
+	(setq viper-f-char (read-char)
+	      viper-f-forward nil
+	      viper-f-offset t)
+      ;; viper-repeat --- set viper-F-char from command-keys
+      (setq viper-F-char (if (stringp cmd-representation)
+			   (viper-seq-last-elt cmd-representation)
+			 viper-F-char)
+	    viper-f-char viper-F-char)
       (setq val (- val)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-find-char val (if (> (vip-p-val arg) 0) vip-f-char vip-F-char) nil t)
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-find-char
+     val (if (> (viper-p-val arg) 0) viper-f-char viper-F-char) nil t)
     (setq val (- val))
     (if com
 	(progn
-	  (setq vip-F-char vip-f-char) ; set new vip-F-char
-	  (vip-execute-com 'vip-goto-char-backward val com)))))
-
-(defun vip-repeat-find (arg)
+	  (setq viper-F-char viper-f-char) ; set new viper-F-char
+	  (viper-execute-com 'viper-goto-char-backward val com)))))
+
+(defun viper-repeat-find (arg)
   "Repeat previous find command."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-deactivate-mark)
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-find-char val vip-f-char vip-f-forward vip-f-offset)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-deactivate-mark)
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-find-char val viper-f-char viper-f-forward viper-f-offset)
     (if com
 	(progn
-	  (if vip-f-forward (forward-char))
-	  (vip-execute-com 'vip-repeat-find val com)))))
-
-(defun vip-repeat-find-opposite (arg)
+	  (if viper-f-forward (forward-char))
+	  (viper-execute-com 'viper-repeat-find val com)))))
+
+(defun viper-repeat-find-opposite (arg)
   "Repeat previous find command in the opposite direction."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (vip-deactivate-mark)
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (vip-find-char val vip-f-char (not vip-f-forward) vip-f-offset)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (viper-deactivate-mark)
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (viper-find-char val viper-f-char (not viper-f-forward) viper-f-offset)
     (if com
 	(progn
-	  (if vip-f-forward (forward-char))
-	  (vip-execute-com 'vip-repeat-find-opposite val com)))))
+	  (if viper-f-forward (forward-char))
+	  (viper-execute-com 'viper-repeat-find-opposite val com)))))
 
 
 ;; window scrolling etc.
 
-(defun vip-other-window (arg)
-  "Switch to other window."
-  (interactive "p")
-  (other-window arg)
-  (or (not (eq vip-current-state 'emacs-state))
-      (string= (buffer-name (current-buffer)) " *Minibuf-1*")
-      (vip-change-state-to-vi)))
-
-(defun vip-window-top (arg)
+(defun viper-window-top (arg)
   "Go to home window line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (push-mark nil t) 
     (move-to-window-line (1- val))
 
@@ -2836,19 +2886,19 @@
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
     
-    (if com (vip-execute-com 'vip-window-top val com))
+    (if com (viper-execute-com 'viper-window-top val com))
     
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
     ))
 
-(defun vip-window-middle (arg)
+(defun viper-window-middle (arg)
   "Go to middle window line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg))
 	lines)
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (push-mark nil t) 
     (if (not (pos-visible-in-window-p (point-max)))
 	(move-to-window-line (+ (/ (1- (window-height)) 2) (1- val)))
@@ -2859,18 +2909,18 @@
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
 
-    (if com (vip-execute-com 'vip-window-middle val com))
+    (if com (viper-execute-com 'viper-window-middle val com))
     
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
     ))
 
-(defun vip-window-bottom (arg)
+(defun viper-window-bottom (arg)
   "Go to last window line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (push-mark nil t) 
     (move-to-window-line (- val))
     
@@ -2878,34 +2928,34 @@
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
 
-    (if com (vip-execute-com 'vip-window-bottom val com))
+    (if com (viper-execute-com 'viper-window-bottom val com))
     
     (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
     (back-to-indentation)
     ))
 
-(defun vip-line-to-top (arg)
+(defun viper-line-to-top (arg)
   "Put current line on the home line."
   (interactive "p")
   (recenter (1- arg)))
 
-(defun vip-line-to-middle (arg)
+(defun viper-line-to-middle (arg)
   "Put current line on the middle line."
   (interactive "p")
   (recenter (+ (1- arg) (/ (1- (window-height)) 2))))
 
-(defun vip-line-to-bottom (arg)
+(defun viper-line-to-bottom (arg)
   "Put current line on the last line."
   (interactive "p")
   (recenter (- (window-height) (1+ arg))))
 
-;; If point is within vip-search-scroll-threshold of window top or bottom,
+;; If point is within viper-search-scroll-threshold of window top or bottom,
 ;; scroll up or down 1/7 of window height, depending on whether we are at the
-;; bottom or at the top of the  window. This function is called by vip-search
-;; (which is called from vip-search-forward/backward/next). If the value of
-;; vip-search-scroll-threshold is negative - don't scroll.
-(defun vip-adjust-window ()
-  (let ((win-height (if vip-emacs-p
+;; bottom or at the top of the  window. This function is called by viper-search
+;; (which is called from viper-search-forward/backward/next). If the value of
+;; viper-search-scroll-threshold is negative - don't scroll.
+(defun viper-adjust-window ()
+  (let ((win-height (if viper-emacs-p
 			(1- (window-height)) ; adjust for modeline
 		      (window-displayed-height)))
 	(pt (point))
@@ -2915,14 +2965,14 @@
       (move-to-window-line 0) ; top
       (setq at-top-p
 	    (<= (count-lines pt (point))
-		vip-search-scroll-threshold))
+		viper-search-scroll-threshold))
       (move-to-window-line -1) ; bottom
       (setq at-bottom-p
-	    (<= (count-lines pt (point)) vip-search-scroll-threshold))
+	    (<= (count-lines pt (point)) viper-search-scroll-threshold))
       )
-    (cond (at-top-p (setq min-scroll (1- vip-search-scroll-threshold)
+    (cond (at-top-p (setq min-scroll (1- viper-search-scroll-threshold)
 			  direction  1))
-	  (at-bottom-p (setq min-scroll (1+ vip-search-scroll-threshold)
+	  (at-bottom-p (setq min-scroll (1+ viper-search-scroll-threshold)
 			     direction -1)))
     (if min-scroll
 	(recenter
@@ -2935,12 +2985,12 @@
 ;; it is good that paren match gets confused, because that way you
 ;; catch _all_ imbalances. 
 
-(defun vip-paren-match (arg)
+(defun viper-paren-match (arg)
   "Go to the matching parenthesis."
   (interactive "P")
-  (vip-leave-region-active)
-  (let ((com (vip-getcom arg))
-	(parse-sexp-ignore-comments vip-parse-sexp-ignore-comments)
+  (viper-leave-region-active)
+  (let ((com (viper-getcom arg))
+	(parse-sexp-ignore-comments viper-parse-sexp-ignore-comments)
 	anchor-point)
     (if (integerp arg)
 	(if (or (> arg 99) (< arg 1))
@@ -2965,116 +3015,117 @@
 	      (t
 	       (error "No matching character on line"))))
       (cond ((looking-at "[\(\[{]")
-	     (if com (vip-move-marker-locally 'vip-com-point (point)))
+	     (if com (viper-move-marker-locally 'viper-com-point (point)))
 	     (forward-sexp 1)
 	     (if com
-		 (vip-execute-com 'vip-paren-match nil com)
+		 (viper-execute-com 'viper-paren-match nil com)
 	       (backward-char)))
 	    (anchor-point
 	     (if com
 		 (progn
-		   (vip-move-marker-locally 'vip-com-point anchor-point)
+		   (viper-move-marker-locally 'viper-com-point anchor-point)
 		   (forward-char 1)
-		   (vip-execute-com 'vip-paren-match nil com)
+		   (viper-execute-com 'viper-paren-match nil com)
 		   )))
 	    ((looking-at "[])}]")
 	     (forward-char)
-	     (if com (vip-move-marker-locally 'vip-com-point (point)))
+	     (if com (viper-move-marker-locally 'viper-com-point (point)))
 	     (backward-sexp 1)
-	     (if com (vip-execute-com 'vip-paren-match nil com)))
+	     (if com (viper-execute-com 'viper-paren-match nil com)))
 	    (t (error ""))))))
 
-(defun vip-toggle-parse-sexp-ignore-comments ()
+(defun viper-toggle-parse-sexp-ignore-comments ()
   (interactive)
-  (setq vip-parse-sexp-ignore-comments (not vip-parse-sexp-ignore-comments))
+  (setq viper-parse-sexp-ignore-comments
+	(not viper-parse-sexp-ignore-comments))
   (princ (format
 	  "From now on, `%%' will %signore parentheses inside comment fields"
-	  (if vip-parse-sexp-ignore-comments "" "NOT "))))
+	  (if viper-parse-sexp-ignore-comments "" "NOT "))))
 
 
 ;; sentence ,paragraph and heading
 
-(defun vip-forward-sentence (arg)
+(defun viper-forward-sentence (arg)
   "Forward sentence."
   (interactive "P")
   (push-mark nil t) 
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (forward-sentence val)
-    (if com (vip-execute-com 'vip-forward-sentence nil com))))
-
-(defun vip-backward-sentence (arg)
+    (if com (viper-execute-com 'viper-forward-sentence nil com))))
+
+(defun viper-backward-sentence (arg)
   "Backward sentence."
   (interactive "P")
   (push-mark nil t) 
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (backward-sentence val)
-    (if com (vip-execute-com 'vip-backward-sentence nil com))))
-
-(defun vip-forward-paragraph (arg)
+    (if com (viper-execute-com 'viper-backward-sentence nil com))))
+
+(defun viper-forward-paragraph (arg)
   "Forward paragraph."
   (interactive "P")
   (push-mark nil t) 
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (forward-paragraph val)
     (if com
 	(progn
 	  (backward-char 1)
-	  (vip-execute-com 'vip-forward-paragraph nil com)))))
-
-(defun vip-backward-paragraph (arg)
+	  (viper-execute-com 'viper-forward-paragraph nil com)))))
+
+(defun viper-backward-paragraph (arg)
   "Backward paragraph."
   (interactive "P")
   (push-mark nil t) 
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (backward-paragraph val)
     (if com
 	(progn
 	  (forward-char 1)
-	  (vip-execute-com 'vip-backward-paragraph nil com)
+	  (viper-execute-com 'viper-backward-paragraph nil com)
 	  (backward-char 1)))))
 
 ;; should be mode-specific etc.
 
-(defun vip-prev-heading (arg)
+(defun viper-prev-heading (arg)
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (re-search-backward vip-heading-start nil t val)
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (re-search-backward viper-heading-start nil t val)
     (goto-char (match-beginning 0))
-    (if com (vip-execute-com 'vip-prev-heading nil com))))
-
-(defun vip-heading-end (arg)
+    (if com (viper-execute-com 'viper-prev-heading nil com))))
+
+(defun viper-heading-end (arg)
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
-    (re-search-forward vip-heading-end nil t val)
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
+    (re-search-forward viper-heading-end nil t val)
     (goto-char (match-beginning 0))
-    (if com (vip-execute-com 'vip-heading-end nil com))))
-
-(defun vip-next-heading (arg)
+    (if com (viper-execute-com 'viper-heading-end nil com))))
+
+(defun viper-next-heading (arg)
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getCom arg)))
-    (if com (vip-move-marker-locally 'vip-com-point (point)))
+  (let ((val (viper-p-val arg))
+	(com (viper-getCom arg)))
+    (if com (viper-move-marker-locally 'viper-com-point (point)))
     (end-of-line)
-    (re-search-forward vip-heading-start nil t val)
+    (re-search-forward viper-heading-start nil t val)
     (goto-char (match-beginning 0))
-    (if com (vip-execute-com 'vip-next-heading nil com))))
+    (if com (viper-execute-com 'viper-next-heading nil com))))
 
 
 ;; scrolling
 
-(defun vip-scroll-screen (arg)
+(defun viper-scroll-screen (arg)
   "Scroll to next screen."
   (interactive "p")
   (condition-case nil
@@ -3094,12 +3145,12 @@
 	     (goto-char (point-min))))
     ))
 
-(defun vip-scroll-screen-back (arg)
+(defun viper-scroll-screen-back (arg)
   "Scroll to previous screen."
   (interactive "p")
-  (vip-scroll-screen (- arg)))
-
-(defun vip-scroll-down (arg)
+  (viper-scroll-screen (- arg)))
+
+(defun viper-scroll-down (arg)
   "Pull down half screen."
   (interactive "P")
   (condition-case nil
@@ -3110,12 +3161,12 @@
 	   (message "Beginning of buffer")
 	   (goto-char (point-min)))))
 
-(defun vip-scroll-down-one (arg)
+(defun viper-scroll-down-one (arg)
   "Scroll up one line."
   (interactive "p")
   (scroll-down arg))
 
-(defun vip-scroll-up (arg)
+(defun viper-scroll-up (arg)
   "Pull up half screen."
   (interactive "P")
   (condition-case nil
@@ -3126,7 +3177,7 @@
 	   (message "End of buffer")
 	   (goto-char (point-max)))))
 
-(defun vip-scroll-up-one (arg)
+(defun viper-scroll-up-one (arg)
   "Scroll down one line."
   (interactive "p")
   (scroll-up arg))
@@ -3134,25 +3185,28 @@
 
 ;; searching
 
-(defun vip-if-string (prompt)
-  (let ((s (vip-read-string-with-history
+(defun viper-if-string (prompt)
+  (if (memq viper-intermediate-command
+	    '(viper-command-argument viper-digit-argument viper-repeat))
+      (setq viper-this-command-keys (this-command-keys)))
+  (let ((s (viper-read-string-with-history
 	    prompt
 	    nil ; no initial
-	    'vip-search-history
-	    (car vip-search-history))))
+	    'viper-search-history
+	    (car viper-search-history))))
     (if (not (string= s ""))
-	(setq vip-s-string s))))  
+	(setq viper-s-string s))))  
 	
     
-(defun vip-toggle-search-style (arg) 
-  "Toggle the value of vip-case-fold-search/vip-re-search.
+(defun viper-toggle-search-style (arg) 
+  "Toggle the value of viper-case-fold-search/viper-re-search.
 Without prefix argument, will ask which search style to toggle. With prefix
-arg 1,toggles vip-case-fold-search; with arg 2 toggles vip-re-search.
-
-Although this function is bound to \\[vip-toggle-search-style], the most
+arg 1,toggles viper-case-fold-search; with arg 2 toggles viper-re-search.
+
+Although this function is bound to \\[viper-toggle-search-style], the most
 convenient way to use it is to bind `//' to the macro
-`1 M-x vip-toggle-search-style' and `///' to
-`2 M-x vip-toggle-search-style'. In this way, hitting `//' quickly will
+`1 M-x viper-toggle-search-style' and `///' to
+`2 M-x viper-toggle-search-style'. In this way, hitting `//' quickly will
 toggle case-fold-search and hitting `/' three times witth toggle regexp
 search. Macros are more convenient in this case because they don't affect
 the Emacs binding of `/'."
@@ -3161,32 +3215,32 @@
     (cond ((or (eq arg 1)
 	       (and (null arg)
 		    (y-or-n-p (format "Search style: '%s'. Want '%s'? "
-				      (if vip-case-fold-search
+				      (if viper-case-fold-search
 					  "case-insensitive" "case-sensitive")
-				      (if vip-case-fold-search
+				      (if viper-case-fold-search
 					  "case-sensitive"
 					"case-insensitive")))))
-	   (setq vip-case-fold-search (null vip-case-fold-search))
-	   (if vip-case-fold-search
+	   (setq viper-case-fold-search (null viper-case-fold-search))
+	   (if viper-case-fold-search
 	       (setq msg "Search becomes case-insensitive")
 	     (setq msg "Search becomes case-sensitive")))
 	  ((or (eq arg 2)
 	       (and (null arg)
 		    (y-or-n-p (format "Search style: '%s'. Want '%s'? "
-				      (if vip-re-search
+				      (if viper-re-search
 					  "regexp-search" "vanilla-search")
-				      (if vip-re-search
+				      (if viper-re-search
 					  "vanilla-search"
 					"regexp-search")))))
-	   (setq vip-re-search (null vip-re-search))
-	   (if vip-re-search
+	   (setq viper-re-search (null viper-re-search))
+	   (if viper-re-search
 	       (setq msg "Search becomes regexp-style")
 	     (setq msg "Search becomes vanilla-style")))
 	  (t
 	   (setq msg "Search style remains unchanged")))
     (princ msg t)))
 
-(defun vip-set-searchstyle-toggling-macros (unset)
+(defun viper-set-searchstyle-toggling-macros (unset)
   "Set the macros for toggling the search style in Viper's vi-state.
 The macro that toggles case sensitivity is bound to `//', and the one that
 toggles regexp search is bound to `///'.
@@ -3196,24 +3250,24 @@
       (if (not unset)
 	  (progn
 	    ;; toggle case sensitivity in search
-	    (vip-record-kbd-macro
+	    (viper-record-kbd-macro
 	     "//" 'vi-state
-	     [1 (meta x) v i p - t o g g l e - s e a r c h - s t y l e return]
+	     [1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
 	     't)
 	    ;; toggle regexp/vanila search
-	    (vip-record-kbd-macro
+	    (viper-record-kbd-macro
 	     "///" 'vi-state
-	     [2 (meta x) v i p - t o g g l e - s e a r c h - s t y l e return]
+	     [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
 	     't)
 	    (if (interactive-p)
 		(message
 		 "// and /// now toggle case-sensitivity and regexp search")))
-	(vip-unrecord-kbd-macro "//" 'vi-state)
+	(viper-unrecord-kbd-macro "//" 'vi-state)
 	(sit-for 2)
-	(vip-unrecord-kbd-macro "///" 'vi-state))))
-
-
-(defun vip-set-parsing-style-toggling-macro (unset)
+	(viper-unrecord-kbd-macro "///" 'vi-state))))
+
+
+(defun viper-set-parsing-style-toggling-macro (unset)
   "Set `%%%' to be a macro that toggles whether comment fields should be parsed for matching parentheses.
 This is used in conjunction with the `%' command.
 
@@ -3223,17 +3277,17 @@
       (if (not unset)
 	  (progn
 	    ;; Make %%% toggle parsing comments for matching parentheses
-	    (vip-record-kbd-macro
+	    (viper-record-kbd-macro
 	     "%%%" 'vi-state
-	     [(meta x) v i p - t o g g l e - p a r s e - s e x p - i g n o r e - c o m m e n t s return]
+	     [(meta x) v i p e r - t o g g l e - p a r s e - s e x p - i g n o r e - c o m m e n t s return]
 	     't)
 	    (if (interactive-p)
 		(message
 		 "%%%%%% now toggles whether comments should be parsed for matching parentheses")))
-	(vip-unrecord-kbd-macro "%%%" 'vi-state))))
-
-
-(defun vip-set-emacs-state-searchstyle-macros (unset &optional arg-majormode)
+	(viper-unrecord-kbd-macro "%%%" 'vi-state))))
+
+
+(defun viper-set-emacs-state-searchstyle-macros (unset &optional arg-majormode)
   "Set the macros for toggling the search style in Viper's emacs-state.
 The macro that toggles case sensitivity is bound to `//', and the one that
 toggles regexp search is bound to `///'.
@@ -3247,64 +3301,64 @@
       (if (not unset)
 	  (progn
 	    ;; toggle case sensitivity in search
-	    (vip-record-kbd-macro
+	    (viper-record-kbd-macro
 	     "//" 'emacs-state
-	     [1 (meta x) v i p - t o g g l e - s e a r c h - s t y l e return] 
+	     [1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return] 
 	     (or arg-majormode major-mode))
 	    ;; toggle regexp/vanila search
-	    (vip-record-kbd-macro
+	    (viper-record-kbd-macro
 	     "///" 'emacs-state
-	     [2 (meta x) v i p - t o g g l e - s e a r c h - s t y l e return]
+	     [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
 	     (or arg-majormode major-mode))
 	    (if (interactive-p)
 		(message
 		 "// and /// now toggle case-sensitivity and regexp search.")))
-	(vip-unrecord-kbd-macro "//" 'emacs-state)
+	(viper-unrecord-kbd-macro "//" 'emacs-state)
 	(sit-for 2)
-	(vip-unrecord-kbd-macro "///" 'emacs-state))))
-
-
-(defun vip-search-forward (arg)
+	(viper-unrecord-kbd-macro "///" 'emacs-state))))
+
+
+(defun viper-search-forward (arg)
   "Search a string forward. 
 ARG is used to find the ARG's occurrence of the string.
 Null string will repeat previous search."
   (interactive "P")
-  (let ((val (vip-P-val arg))
-	(com (vip-getcom arg))
-	(old-str vip-s-string))
-    (setq vip-s-forward t)
-    (vip-if-string "/")
+  (let ((val (viper-P-val arg))
+	(com (viper-getcom arg))
+	(old-str viper-s-string))
+    (setq viper-s-forward t)
+    (viper-if-string "/")
     ;; this is not used at present, but may be used later
-    (if (or (not (equal old-str vip-s-string))
-	    (not (markerp vip-local-search-start-marker))
-	    (not (marker-buffer vip-local-search-start-marker)))
-	(setq vip-local-search-start-marker (point-marker)))
-    (vip-search vip-s-string t val)
+    (if (or (not (equal old-str viper-s-string))
+	    (not (markerp viper-local-search-start-marker))
+	    (not (marker-buffer viper-local-search-start-marker)))
+	(setq viper-local-search-start-marker (point-marker)))
+    (viper-search viper-s-string t val)
     (if com
 	(progn
-	  (vip-move-marker-locally 'vip-com-point (mark t))
-	  (vip-execute-com 'vip-search-next val com)))))
-
-(defun vip-search-backward (arg)
+	  (viper-move-marker-locally 'viper-com-point (mark t))
+	  (viper-execute-com 'viper-search-next val com)))))
+
+(defun viper-search-backward (arg)
   "Search a string backward. 
 ARG is used to find the ARG's occurrence of the string.
 Null string will repeat previous search."
   (interactive "P")
-  (let ((val (vip-P-val arg))
-	(com (vip-getcom arg))
-	(old-str vip-s-string))
-    (setq vip-s-forward nil)
-    (vip-if-string "?")
+  (let ((val (viper-P-val arg))
+	(com (viper-getcom arg))
+	(old-str viper-s-string))
+    (setq viper-s-forward nil)
+    (viper-if-string "?")
     ;; this is not used at present, but may be used later
-    (if (or (not (equal old-str vip-s-string))
-	    (not (markerp vip-local-search-start-marker))
-	    (not (marker-buffer vip-local-search-start-marker)))
-	(setq vip-local-search-start-marker (point-marker)))
-    (vip-search vip-s-string nil val)
+    (if (or (not (equal old-str viper-s-string))
+	    (not (markerp viper-local-search-start-marker))
+	    (not (marker-buffer viper-local-search-start-marker)))
+	(setq viper-local-search-start-marker (point-marker)))
+    (viper-search viper-s-string nil val)
     (if com
 	(progn
-	  (vip-move-marker-locally 'vip-com-point (mark t))
-	  (vip-execute-com 'vip-search-next val com)))))
+	  (viper-move-marker-locally 'viper-com-point (mark t))
+	  (viper-execute-com 'viper-search-next val com)))))
 	  
 
 ;; Search for COUNT's occurrence of STRING.
@@ -3312,20 +3366,20 @@
 ;; INIT-POINT is the position where search is to start.
 ;; Arguments:
 ;;   (STRING FORW COUNT &optional NO-OFFSET INIT-POINT LIMIT FAIL-IF-NOT-FOUND)
-(defun vip-search (string forward arg
-			  &optional no-offset init-point fail-if-not-found)
+(defun viper-search (string forward arg
+			    &optional no-offset init-point fail-if-not-found)
   (if (not (equal string ""))
-    (let ((val (vip-p-val arg))
-	  (com (vip-getcom arg))
+    (let ((val (viper-p-val arg))
+	  (com (viper-getcom arg))
 	  (offset (not no-offset))
-	  (case-fold-search vip-case-fold-search)
+	  (case-fold-search viper-case-fold-search)
 	  (start-point (or init-point (point))))
-      (vip-deactivate-mark)
+      (viper-deactivate-mark)
       (if forward
 	  (condition-case nil
 	      (progn
-	        (if offset (vip-forward-char-carefully))
-	        (if vip-re-search
+	        (if offset (viper-forward-char-carefully))
+	        (if viper-re-search
 		    (progn
 		      (re-search-forward string nil nil val)
 		      (re-search-backward string))
@@ -3334,110 +3388,122 @@
 		(if (not (equal start-point (point)))
 		    (push-mark start-point t))) 
 	    (search-failed
-	     (if (and (not fail-if-not-found) vip-search-wrap-around-t)
+	     (if (and (not fail-if-not-found) viper-search-wrap-around-t)
 	         (progn
 		   (message "Search wrapped around BOTTOM of buffer")
 		   (goto-char (point-min))
-		   (vip-search string forward (cons 1 com) t start-point 'fail)
+		   (viper-search string forward (cons 1 com) t start-point 'fail)
 		   ;; don't wait in macros
-		   (or executing-kbd-macro (sit-for 2))
+		   (or executing-kbd-macro
+		       (memq viper-intermediate-command 
+			     '(viper-repeat
+			       viper-digit-argument
+			       viper-command-argument))
+		       (sit-for 2))
 		   ;; delete the wrap-around message
 		   (message "")
 		   )
 	       (goto-char start-point)
 	       (error "`%s': %s not found"
 		      string
-		      (if vip-re-search "Pattern" "String"))
+		      (if viper-re-search "Pattern" "String"))
 	       )))
 	;; backward
         (condition-case nil
 	    (progn
-	      (if vip-re-search
+	      (if viper-re-search
 		  (re-search-backward string nil nil val)
 	        (search-backward string nil nil val))
 	      (if (not (equal start-point (point)))
 		  (push-mark start-point t))) 
 	  (search-failed
-	   (if (and (not fail-if-not-found) vip-search-wrap-around-t)
+	   (if (and (not fail-if-not-found) viper-search-wrap-around-t)
 	       (progn
 		 (message "Search wrapped around TOP of buffer")
 	         (goto-char (point-max))
-	         (vip-search string forward (cons 1 com) t start-point 'fail)
+	         (viper-search string forward (cons 1 com) t start-point 'fail)
 		 ;; don't wait in macros
-		 (or executing-kbd-macro (sit-for 2))
+		 (or executing-kbd-macro
+		     (memq viper-intermediate-command 
+			   '(viper-repeat
+			     viper-digit-argument
+			     viper-command-argument))
+		     (sit-for 2))
 		 ;; delete the wrap-around message
 		 (message "")
 		 )
 	     (goto-char start-point)
 	     (error "`%s': %s not found"
 		    string
-		    (if vip-re-search "Pattern" "String"))
+		    (if viper-re-search "Pattern" "String"))
 	     ))))
       ;; pull up or down if at top/bottom of window
-      (vip-adjust-window)
+      (viper-adjust-window)
       ;; highlight the result of search
       ;; don't wait and don't highlight in macros
       (or executing-kbd-macro
-	  vip-inside-command-argument-action
-	  (vip-flash-search-pattern))
+	  (memq viper-intermediate-command 
+		'(viper-repeat viper-digit-argument viper-command-argument))
+	  (viper-flash-search-pattern))
       )))
 
-(defun vip-search-next (arg)
+(defun viper-search-next (arg)
   "Repeat previous search."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if (null vip-s-string) (error vip-NoPrevSearch))
-    (vip-search vip-s-string vip-s-forward arg)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if (null viper-s-string) (error viper-NoPrevSearch))
+    (viper-search viper-s-string viper-s-forward arg)
     (if com
 	(progn
-	  (vip-move-marker-locally 'vip-com-point (mark t))
-	  (vip-execute-com 'vip-search-next val com)))))
-
-(defun vip-search-Next (arg)
+	  (viper-move-marker-locally 'viper-com-point (mark t))
+	  (viper-execute-com 'viper-search-next val com)))))
+
+(defun viper-search-Next (arg)
   "Repeat previous search in the reverse direction."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(com (vip-getcom arg)))
-    (if (null vip-s-string) (error vip-NoPrevSearch))
-    (vip-search vip-s-string (not vip-s-forward) arg)
+  (let ((val (viper-p-val arg))
+	(com (viper-getcom arg)))
+    (if (null viper-s-string) (error viper-NoPrevSearch))
+    (viper-search viper-s-string (not viper-s-forward) arg)
     (if com
 	(progn
-	  (vip-move-marker-locally 'vip-com-point (mark t))
-	  (vip-execute-com 'vip-search-Next val com)))))
+	  (viper-move-marker-locally 'viper-com-point (mark t))
+	  (viper-execute-com 'viper-search-Next val com)))))
 
 
 ;; Search contents of buffer defined by one of Viper's motion commands.
 ;; Repeatable via `n' and `N'.
-(defun vip-buffer-search-enable (&optional c)
-  (cond (c (setq vip-buffer-search-char c))
-	((null vip-buffer-search-char)
-	 (setq vip-buffer-search-char ?g)))
-  (define-key vip-vi-basic-map
-    (char-to-string vip-buffer-search-char) 'vip-command-argument)
-  (aset vip-exec-array vip-buffer-search-char 'vip-exec-buffer-search)
-  (setq vip-prefix-commands (cons vip-buffer-search-char vip-prefix-commands)))
+(defun viper-buffer-search-enable (&optional c)
+  (cond (c (setq viper-buffer-search-char c))
+	((null viper-buffer-search-char)
+	 (setq viper-buffer-search-char ?g)))
+  (define-key viper-vi-basic-map
+    (char-to-string viper-buffer-search-char) 'viper-command-argument)
+  (aset viper-exec-array viper-buffer-search-char 'viper-exec-buffer-search)
+  (setq viper-prefix-commands
+	(cons viper-buffer-search-char viper-prefix-commands)))
 
 ;; This is a Viper wraper for isearch-forward.
-(defun vip-isearch-forward (arg)
+(defun viper-isearch-forward (arg)
   "Do incremental search forward."
   (interactive "P")
   ;; emacs bug workaround
   (if (listp arg) (setq arg (car arg)))
-  (vip-exec-form-in-emacs (list 'isearch-forward arg)))
+  (viper-exec-form-in-emacs (list 'isearch-forward arg)))
 
 ;; This is a Viper wraper for isearch-backward."
-(defun vip-isearch-backward (arg)
+(defun viper-isearch-backward (arg)
   "Do incremental search backward."
   (interactive "P")
   ;; emacs bug workaround
   (if (listp arg) (setq arg (car arg)))
-  (vip-exec-form-in-emacs (list 'isearch-backward arg)))
+  (viper-exec-form-in-emacs (list 'isearch-backward arg)))
 
 
 ;; visiting and killing files, buffers
 
-(defun vip-switch-to-buffer ()
+(defun viper-switch-to-buffer ()
   "Switch to buffer in the current window."
   (interactive)
   (let (buffer)
@@ -3448,7 +3514,7 @@
     (switch-to-buffer buffer)
     ))
 
-(defun vip-switch-to-buffer-other-window ()
+(defun viper-switch-to-buffer-other-window ()
   "Switch to buffer in another window."
   (interactive)
   (let (buffer)
@@ -3459,7 +3525,7 @@
     (switch-to-buffer-other-window buffer)
     ))
 
-(defun vip-kill-buffer ()
+(defun viper-kill-buffer ()
   "Kill a buffer."
   (interactive)
   (let (buffer buffer-name)
@@ -3481,7 +3547,7 @@
       (error "Buffer not killed"))))
 
 
-(defcustom vip-smart-suffix-list
+(defcustom viper-smart-suffix-list
   '("" "tex" "c" "cc" "C" "el" "java" "html" "htm" "pl" "P" "p")
   "*List of suffixes that Viper automatically tries to append to filenames ending with a `.'.
 This is useful when you the current directory contains files with the same
@@ -3500,157 +3566,161 @@
     
 ;; Try to add suffix to files ending with a `.'
 ;; Useful when the user hits RET on a non-completed file name.
-(defun vip-file-add-suffix ()
+(defun viper-file-add-suffix ()
   (let ((count 0)
-	(len (length vip-smart-suffix-list))
+	(len (length viper-smart-suffix-list))
 	(file (buffer-string))
 	found key cmd suff)
     (goto-char (point-max))
-    (if (and vip-smart-suffix-list (string-match "\\.$" file))
+    (if (and viper-smart-suffix-list (string-match "\\.$" file))
 	(progn
 	  (while (and (not found) (< count len))
-	    (setq suff (nth count vip-smart-suffix-list)
+	    (setq suff (nth count viper-smart-suffix-list)
 		  count (1+ count))
-	    (if (file-exists-p (format "%s%s" file suff))
+	    (if (file-exists-p
+		 (format "%s%s" (substitute-in-file-name file) suff))
 		(progn
 		  (setq found t)
 		  (insert suff))))
-      
+	  
 	  (if found
 	      ()
-	    (vip-tmp-insert-at-eob " [Please complete file name]")
+	    (viper-tmp-insert-at-eob " [Please complete file name]")
 	    (unwind-protect 
-		(while (not (memq cmd '(exit-minibuffer vip-exit-minibuffer)))
+		(while (not (memq cmd
+				  '(exit-minibuffer viper-exit-minibuffer)))
 		  (setq cmd
 			(key-binding (setq key (read-key-sequence nil))))
 		  (cond ((eq cmd 'self-insert-command)
-			 (if vip-xemacs-p
+			 (if viper-xemacs-p
 			     (insert (events-to-keys key))
 			   (insert key)))
-			((memq cmd '(exit-minibuffer vip-exit-minibuffer))
+			((memq cmd '(exit-minibuffer viper-exit-minibuffer))
 			 nil)
 			(t (command-execute cmd)))
 		  )))
-	      ))
-    ))
+	  ))))
 
 
      
 
 ;; yank and pop
 
-(defsubst vip-yank (text)
+(defsubst viper-yank (text)
   "Yank TEXT silently. This works correctly with Emacs's yank-pop command."
     (insert text)
     (setq this-command 'yank))
 
-(defun vip-put-back (arg)
+(defun viper-put-back (arg)
   "Put back after point/below line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(text (if vip-use-register
-		  (cond ((vip-valid-register vip-use-register '(digit))
-			 (current-kill (- vip-use-register ?1) 'do-not-rotate))
-			((vip-valid-register vip-use-register)
-			 (get-register (downcase vip-use-register)))
-			(t (error vip-InvalidRegister vip-use-register)))
+  (let ((val (viper-p-val arg))
+	(text (if viper-use-register
+		  (cond ((viper-valid-register viper-use-register '(digit))
+			 (current-kill
+			  (- viper-use-register ?1) 'do-not-rotate))
+			((viper-valid-register viper-use-register)
+			 (get-register (downcase viper-use-register)))
+			(t (error viper-InvalidRegister viper-use-register)))
 		(current-kill 0))))
     (if (null text)
-	(if vip-use-register
-	    (let ((reg vip-use-register))
-	      (setq vip-use-register nil)
-	      (error vip-EmptyRegister reg))
+	(if viper-use-register
+	    (let ((reg viper-use-register))
+	      (setq viper-use-register nil)
+	      (error viper-EmptyRegister reg))
 	  (error "")))
-    (setq vip-use-register nil)
-    (if (vip-end-with-a-newline-p text)
+    (setq viper-use-register nil)
+    (if (viper-end-with-a-newline-p text)
 	(progn
 	  (end-of-line)
 	  (if (eobp)
 	      (insert "\n")
 	    (forward-line 1))
 	  (beginning-of-line))
-      (if (not (eolp)) (vip-forward-char-carefully)))
-    (set-marker (vip-mark-marker) (point) (current-buffer))
-    (vip-set-destructive-command
-     (list 'vip-put-back val nil vip-use-register nil nil))
-    (vip-loop val (vip-yank text)))
+      (if (not (eolp)) (viper-forward-char-carefully)))
+    (set-marker (viper-mark-marker) (point) (current-buffer))
+    (viper-set-destructive-command
+     (list 'viper-put-back val nil viper-use-register nil nil))
+    (viper-loop val (viper-yank text)))
   ;; Vi puts cursor on the last char when the yanked text doesn't contain a
   ;; newline; it leaves the cursor at the beginning when the text contains 
   ;; a newline
-  (if (vip-same-line (point) (mark))
-      (or (= (point) (mark)) (vip-backward-char-carefully))
+  (if (viper-same-line (point) (mark))
+      (or (= (point) (mark)) (viper-backward-char-carefully))
     (exchange-point-and-mark)
     (if (bolp)
 	(back-to-indentation)))
-  (vip-deactivate-mark))
-
-(defun vip-Put-back (arg)
+  (viper-deactivate-mark))
+
+(defun viper-Put-back (arg)
   "Put back at point/above line."
   (interactive "P")
-  (let ((val (vip-p-val arg))
-	(text (if vip-use-register
-		  (cond ((vip-valid-register vip-use-register '(digit))
-			 (current-kill (- vip-use-register ?1) 'do-not-rotate))
-			((vip-valid-register vip-use-register)
-			 (get-register (downcase vip-use-register)))
-			(t (error vip-InvalidRegister vip-use-register)))
+  (let ((val (viper-p-val arg))
+	(text (if viper-use-register
+		  (cond ((viper-valid-register viper-use-register '(digit))
+			 (current-kill
+			  (- viper-use-register ?1) 'do-not-rotate))
+			((viper-valid-register viper-use-register)
+			 (get-register (downcase viper-use-register)))
+			(t (error viper-InvalidRegister viper-use-register)))
 		(current-kill 0))))
     (if (null text)
-	(if vip-use-register
-	    (let ((reg vip-use-register))
-	      (setq vip-use-register nil)
-	      (error vip-EmptyRegister reg))
+	(if viper-use-register
+	    (let ((reg viper-use-register))
+	      (setq viper-use-register nil)
+	      (error viper-EmptyRegister reg))
 	  (error "")))
-    (setq vip-use-register nil)
-    (if (vip-end-with-a-newline-p text) (beginning-of-line))
-    (vip-set-destructive-command
-     (list 'vip-Put-back val nil vip-use-register nil nil))
-    (set-marker (vip-mark-marker) (point) (current-buffer))
-    (vip-loop val (vip-yank text)))
+    (setq viper-use-register nil)
+    (if (viper-end-with-a-newline-p text) (beginning-of-line))
+    (viper-set-destructive-command
+     (list 'viper-Put-back val nil viper-use-register nil nil))
+    (set-marker (viper-mark-marker) (point) (current-buffer))
+    (viper-loop val (viper-yank text)))
   ;; Vi puts cursor on the last char when the yanked text doesn't contain a
   ;; newline; it leaves the cursor at the beginning when the text contains 
   ;; a newline
-  (if (vip-same-line (point) (mark))
-      (or (= (point) (mark)) (vip-backward-char-carefully))
+  (if (viper-same-line (point) (mark))
+      (or (= (point) (mark)) (viper-backward-char-carefully))
     (exchange-point-and-mark)
     (if (bolp)
 	(back-to-indentation)))
-  (vip-deactivate-mark))
+  (viper-deactivate-mark))
     
 
 ;; Copy region to kill-ring.
 ;; If BEG and END do not belong to the same buffer, copy empty region.
-(defun vip-copy-region-as-kill (beg end)
+(defun viper-copy-region-as-kill (beg end)
   (condition-case nil
       (copy-region-as-kill beg end)
     (error (copy-region-as-kill beg beg))))
     
 
-(defun vip-delete-char (arg)
+(defun viper-delete-char (arg)
   "Delete character."
   (interactive "P")
-  (let ((val (vip-p-val arg)))
-    (vip-set-destructive-command (list 'vip-delete-char val nil nil nil nil))
+  (let ((val (viper-p-val arg)))
+    (viper-set-destructive-command
+     (list 'viper-delete-char val nil nil nil nil))
     (if (> val 1)
 	(save-excursion
 	  (let ((here (point)))
 	    (end-of-line)
 	    (if (> val (- (point) here))
 		(setq val (- (point) here))))))
-    (if (and (eq val 0) (not vip-ex-style-motion)) (setq val 1))
-    (if (and vip-ex-style-motion (eolp))
+    (if (and (eq val 0) (not viper-ex-style-motion)) (setq val 1))
+    (if (and viper-ex-style-motion (eolp))
 	(if (bolp) (error "") (setq val 0))) ; not bol---simply back 1 ch
-    (if vip-use-register
+    (if viper-use-register
 	(progn
-	  (cond ((vip-valid-register vip-use-register '((Letter)))
-		 (vip-append-to-register
-		  (downcase vip-use-register) (point) (- (point) val)))
-		((vip-valid-register vip-use-register)
+	  (cond ((viper-valid-register viper-use-register '((Letter)))
+		 (viper-append-to-register
+		  (downcase viper-use-register) (point) (- (point) val)))
+		((viper-valid-register viper-use-register)
 		 (copy-to-register
-		  vip-use-register (point) (- (point) val) nil))
-		(t (error vip-InvalidRegister vip-use-register)))
-	  (setq vip-use-register nil)))
-    (if vip-ex-style-motion
+		  viper-use-register (point) (- (point) val) nil))
+		(t (error viper-InvalidRegister viper-use-register)))
+	  (setq viper-use-register nil)))
+    (if viper-ex-style-motion
 	(progn
 	  (delete-char val t)
 	  (if (and (eolp) (not (bolp))) (backward-char 1)))
@@ -3658,55 +3728,55 @@
           (delete-backward-char val t)
         (delete-char val t)))))
 
-(defun vip-delete-backward-char (arg)
+(defun viper-delete-backward-char (arg)
   "Delete previous character. On reaching beginning of line, stop and beep."
   (interactive "P")
-  (let ((val (vip-p-val arg)))
-    (vip-set-destructive-command
-     (list 'vip-delete-backward-char val nil nil nil nil))
+  (let ((val (viper-p-val arg)))
+    (viper-set-destructive-command
+     (list 'viper-delete-backward-char val nil nil nil nil))
     (if (> val 1)
 	(save-excursion
 	  (let ((here (point)))
 	    (beginning-of-line)
 	    (if (> val (- here (point)))
 		(setq val (- here (point)))))))
-    (if vip-use-register
+    (if viper-use-register
 	(progn
-	  (cond ((vip-valid-register vip-use-register '(Letter))
-		 (vip-append-to-register
-		  (downcase vip-use-register) (point) (+ (point) val)))
-		((vip-valid-register vip-use-register)
+	  (cond ((viper-valid-register viper-use-register '(Letter))
+		 (viper-append-to-register
+		  (downcase viper-use-register) (point) (+ (point) val)))
+		((viper-valid-register viper-use-register)
 		 (copy-to-register
-		  vip-use-register (point) (+ (point) val) nil))
-		(t (error vip-InvalidRegister vip-use-register)))
-	  (setq vip-use-register nil)))
+		  viper-use-register (point) (+ (point) val) nil))
+		(t (error viper-InvalidRegister viper-use-register)))
+	  (setq viper-use-register nil)))
     (if (bolp) (ding)
       (delete-backward-char val t))))
       
-(defun vip-del-backward-char-in-insert ()
+(defun viper-del-backward-char-in-insert ()
   "Delete 1 char backwards while in insert mode."
   (interactive)      
-  (if (and vip-ex-style-editing-in-insert (bolp))
+  (if (and viper-ex-style-editing-in-insert (bolp))
       (beep 1)
     (delete-backward-char 1 t)))
       
-(defun vip-del-backward-char-in-replace ()
+(defun viper-del-backward-char-in-replace ()
   "Delete one character in replace mode.
-If `vip-delete-backwards-in-replace' is t, then DEL key actually deletes
+If `viper-delete-backwards-in-replace' is t, then DEL key actually deletes
 charecters. If it is nil, then the cursor just moves backwards, similarly
-to Vi. The variable `vip-ex-style-editing-in-insert', if t, doesn't let the
+to Vi. The variable `viper-ex-style-editing-in-insert', if t, doesn't let the
 cursor move past the beginning of line."
   (interactive)
-  (cond (vip-delete-backwards-in-replace
+  (cond (viper-delete-backwards-in-replace
 	 (cond ((not (bolp))
 		(delete-backward-char 1 t))
-	       (vip-ex-style-editing-in-insert
+	       (viper-ex-style-editing-in-insert
 		(beep 1))
 	       ((bobp)
 		(beep 1))
 	       (t
 		(delete-backward-char 1 t))))
-	(vip-ex-style-editing-in-insert
+	(viper-ex-style-editing-in-insert
 	 (if (bolp)
 	     (beep 1)
 	   (backward-char 1)))
@@ -3717,12 +3787,13 @@
 
 ;; join lines.
 
-(defun vip-join-lines (arg)
+(defun viper-join-lines (arg)
   "Join this line to next, if ARG is nil.  Otherwise, join ARG lines."
   (interactive "*P")
-  (let ((val (vip-P-val arg)))
-    (vip-set-destructive-command (list 'vip-join-lines val nil nil nil nil))
-    (vip-loop (if (null val) 1 (1- val))
+  (let ((val (viper-P-val arg)))
+    (viper-set-destructive-command
+     (list 'viper-join-lines val nil nil nil nil))
+    (viper-loop (if (null val) 1 (1- val))
 	      (progn
 		(end-of-line)
 		(if (not (eobp))
@@ -3740,80 +3811,80 @@
 
 ;; Replace state
 
-(defun vip-change (beg end)
+(defun viper-change (beg end)
   (if (markerp beg) (setq beg (marker-position beg)))
   (if (markerp end) (setq end (marker-position end)))
   ;; beg is sometimes (mark t), which may be nil
   (or beg (setq beg end))
   
-  (vip-set-complex-command-for-undo)
-  (if vip-use-register
+  (viper-set-complex-command-for-undo)
+  (if viper-use-register
       (progn
-	(copy-to-register vip-use-register beg end nil)
-	(setq vip-use-register nil)))
-  (vip-set-replace-overlay beg end)
+	(copy-to-register viper-use-register beg end nil)
+	(setq viper-use-register nil)))
+  (viper-set-replace-overlay beg end)
   (setq last-command nil) ; separate repl text from prev kills
   
-  (if (= (vip-replace-start) (point-max))
+  (if (= (viper-replace-start) (point-max))
       (error "End of buffer"))
       
-  (setq vip-last-replace-region
-	(buffer-substring (vip-replace-start)
-			  (vip-replace-end)))
+  (setq viper-last-replace-region
+	(buffer-substring (viper-replace-start)
+			  (viper-replace-end)))
   
   ;; protect against error while inserting "@" and other disasters
   ;; (e.g., read-only buff)
   (condition-case conds
-      (if (or vip-allow-multiline-replace-regions
-	      (vip-same-line (vip-replace-start)
-			     (vip-replace-end)))
+      (if (or viper-allow-multiline-replace-regions
+	      (viper-same-line (viper-replace-start)
+			       (viper-replace-end)))
 	  (progn
 	    ;; tabs cause problems in replace, so untabify
-	    (goto-char (vip-replace-end))
+	    (goto-char (viper-replace-end))
 	    (insert-before-markers "@") ; put placeholder after the TAB
-	    (untabify (vip-replace-start) (point))
+	    (untabify (viper-replace-start) (point))
 	    ;; del @, don't put on kill ring 
 	    (delete-backward-char 1)
 	    
-	    (vip-set-replace-overlay-glyphs
-	     vip-replace-region-start-delimiter
-	     vip-replace-region-end-delimiter)
+	    (viper-set-replace-overlay-glyphs
+	     viper-replace-region-start-delimiter
+	     viper-replace-region-end-delimiter)
 	    ;; this move takes care of the last posn in the overlay, which
 	    ;; has to be shifted because of insert. We can't simply insert
 	    ;; "$" before-markers because then overlay-start will shift the
 	    ;; beginning of the overlay in case we are replacing a single
 	    ;; character. This fixes the bug with `s' and `cl' commands.
-	    (vip-move-replace-overlay (vip-replace-start) (point))
-	    (goto-char (vip-replace-start))
-	    (vip-change-state-to-replace t))
-	(kill-region (vip-replace-start)
-		     (vip-replace-end))
-	(vip-hide-replace-overlay)
-	(vip-change-state-to-insert))
+	    (viper-move-replace-overlay (viper-replace-start) (point))
+	    (goto-char (viper-replace-start))
+	    (viper-change-state-to-replace t))
+	(kill-region (viper-replace-start)
+		     (viper-replace-end))
+	(viper-hide-replace-overlay)
+	(viper-change-state-to-insert))
     (error ;; make sure that the overlay doesn't stay.
            ;; go back to the original point
-     (goto-char (vip-replace-start))
-     (vip-hide-replace-overlay)
-     (vip-message-conditions conds))))
-
-
-(defun vip-change-subr (beg end)
+     (goto-char (viper-replace-start))
+     (viper-hide-replace-overlay)
+     (viper-message-conditions conds))))
+
+
+(defun viper-change-subr (beg end)
   ;; beg is sometimes (mark t), which may be nil
   (or beg (setq beg end))
-  
-  (if vip-use-register
+  (if viper-use-register
       (progn
-	(copy-to-register vip-use-register beg end nil)
-	(setq vip-use-register nil)))
+	(copy-to-register viper-use-register beg end nil)
+	(setq viper-use-register nil)))
   (kill-region beg end)
-  (setq this-command 'vip-change)
-  (vip-yank-last-insertion))
-
-(defun vip-toggle-case (arg)
+  (setq this-command 'viper-change)
+  (viper-yank-last-insertion))
+
+(defun viper-toggle-case (arg)
   "Toggle character case."
   (interactive "P")
-  (let ((val (vip-p-val arg)) (c))
-    (vip-set-destructive-command (list 'vip-toggle-case val nil nil nil nil))
+  (let ((val (viper-p-val arg)) (c))
+    (viper-set-destructive-command
+     (list 'viper-toggle-case val nil nil nil nil))
     (while (> val 0)
       (setq c (following-char))
       (delete-char 1 nil)
@@ -3826,48 +3897,48 @@
 
 ;; query replace
 
-(defun vip-query-replace ()
+(defun viper-query-replace ()
   "Query replace. 
 If a null string is suplied as the string to be replaced,
 the query replace mode will toggle between string replace
 and regexp replace."
   (interactive)
   (let (str)
-    (setq str (vip-read-string-with-history
-	       (if vip-re-query-replace "Query replace regexp: "
+    (setq str (viper-read-string-with-history
+	       (if viper-re-query-replace "Query replace regexp: "
 		 "Query replace: ")
 	       nil  ; no initial
-	       'vip-replace1-history
-	       (car vip-replace1-history) ; default
+	       'viper-replace1-history
+	       (car viper-replace1-history) ; default
 	       ))
     (if (string= str "")
 	(progn
-	  (setq vip-re-query-replace (not vip-re-query-replace))
+	  (setq viper-re-query-replace (not viper-re-query-replace))
 	  (message "Query replace mode changed to %s"
-		   (if vip-re-query-replace "regexp replace"
+		   (if viper-re-query-replace "regexp replace"
 		     "string replace")))
-      (if vip-re-query-replace
+      (if viper-re-query-replace
 	  (query-replace-regexp
 	   str
-	   (vip-read-string-with-history
+	   (viper-read-string-with-history
 	    (format "Query replace regexp `%s' with: " str)
 	    nil  ; no initial
-	    'vip-replace1-history
-	    (car vip-replace1-history) ; default
+	    'viper-replace1-history
+	    (car viper-replace1-history) ; default
 	    ))
 	(query-replace
 	 str
-	 (vip-read-string-with-history
+	 (viper-read-string-with-history
 	  (format "Query replace `%s' with: " str)
 	  nil  ; no initial
-	  'vip-replace1-history
-	  (car vip-replace1-history) ; default
+	  'viper-replace1-history
+	  (car viper-replace1-history) ; default
 	  ))))))
 
 
 ;; marking
 
-(defun vip-mark-beginning-of-buffer ()
+(defun viper-mark-beginning-of-buffer ()
   "Mark beginning of buffer."
   (interactive)
   (push-mark (point))
@@ -3875,7 +3946,7 @@
   (exchange-point-and-mark)
   (message "Mark set at the beginning of buffer"))
 
-(defun vip-mark-end-of-buffer ()
+(defun viper-mark-end-of-buffer ()
   "Mark end of buffer."
   (interactive)
   (push-mark (point))
@@ -3883,16 +3954,16 @@
   (exchange-point-and-mark)
   (message "Mark set at the end of buffer"))
 
-(defun vip-mark-point ()
+(defun viper-mark-point ()
   "Set mark at point of buffer."
   (interactive)
   (let ((char (read-char)))
     (cond ((and (<= ?a char) (<= char ?z))
 	   (point-to-register (1+ (- char ?a))))
-	  ((= char ?<) (vip-mark-beginning-of-buffer))
-	  ((= char ?>) (vip-mark-end-of-buffer))
-	  ((= char ?.) (vip-set-mark-if-necessary))
-	  ((= char ?,) (vip-cycle-through-mark-ring))
+	  ((= char ?<) (viper-mark-beginning-of-buffer))
+	  ((= char ?>) (viper-mark-end-of-buffer))
+	  ((= char ?.) (viper-set-mark-if-necessary))
+	  ((= char ?,) (viper-cycle-through-mark-ring))
 	  ((= char ?D) (mark-defun))
 	  (t (error ""))
 	  )))
@@ -3908,7 +3979,7 @@
 ;; Then we save the current pos, which is M0, jump to M1 and pop M2 from
 ;; the ring into mark.  Push M2 back on the ring and set mark to M0.
 ;; etc.
-(defun vip-cycle-through-mark-ring ()
+(defun viper-cycle-through-mark-ring ()
   "Visit previous locations on the mark ring.
 One can use `` and '' to temporarily jump 1 step back."
   (let* ((sv-pt (point)))
@@ -3920,96 +3991,96 @@
        ;; Then push the current mark (popped off the ring) and set current
        ;; point to be the mark. Current pt as mark is discarded by the next
        ;; m, command.
-       (if (eq last-command 'vip-cycle-through-mark-ring)
+       (if (eq last-command 'viper-cycle-through-mark-ring)
 	   ()
 	 ;; save current mark if the first iteration
-	 (setq mark-ring (delete (vip-mark-marker) mark-ring))
+	 (setq mark-ring (delete (viper-mark-marker) mark-ring))
 	 (if (mark t)
 	     (push-mark (mark t) t)) )
        (pop-mark)
        (set-mark-command 1)
        ;; don't duplicate mark on the ring
-       (setq mark-ring (delete (vip-mark-marker) mark-ring))
+       (setq mark-ring (delete (viper-mark-marker) mark-ring))
        (push-mark sv-pt t)
-       (vip-deactivate-mark)
-       (setq this-command 'vip-cycle-through-mark-ring)
+       (viper-deactivate-mark)
+       (setq this-command 'viper-cycle-through-mark-ring)
        ))
        
 
-(defun vip-goto-mark (arg)
+(defun viper-goto-mark (arg)
   "Go to mark."
   (interactive "P")
   (let ((char (read-char))
-	(com (vip-getcom arg)))
-    (vip-goto-mark-subr char com nil)))
-
-(defun vip-goto-mark-and-skip-white (arg)
+	(com (viper-getcom arg)))
+    (viper-goto-mark-subr char com nil)))
+
+(defun viper-goto-mark-and-skip-white (arg)
   "Go to mark and skip to first non-white character on line."
   (interactive "P")
   (let ((char (read-char))
-	(com (vip-getCom arg)))
-    (vip-goto-mark-subr char com t)))
-
-(defun vip-goto-mark-subr (char com skip-white)
+	(com (viper-getCom arg)))
+    (viper-goto-mark-subr char com t)))
+
+(defun viper-goto-mark-subr (char com skip-white)
   (if (eobp) 
       (if (bobp)
 	  (error "Empty buffer")
 	(backward-char 1)))
-  (cond ((vip-valid-register char '(letter))
+  (cond ((viper-valid-register char '(letter))
 	 (let* ((buff (current-buffer))
 	        (reg (1+ (- char ?a)))
 	        (text-marker (get-register reg)))
-	   (if com (vip-move-marker-locally 'vip-com-point (point)))
-	   (if (not (vip-valid-marker text-marker))
-	       (error vip-EmptyTextmarker char))
-	   (if (and (vip-same-line (point) vip-last-jump)
-		    (= (point) vip-last-jump-ignore))
-	       (push-mark vip-last-jump t) 
+	   (if com (viper-move-marker-locally 'viper-com-point (point)))
+	   (if (not (viper-valid-marker text-marker))
+	       (error viper-EmptyTextmarker char))
+	   (if (and (viper-same-line (point) viper-last-jump)
+		    (= (point) viper-last-jump-ignore))
+	       (push-mark viper-last-jump t) 
 	     (push-mark nil t)) ; no msg
-	   (vip-register-to-point reg)
-	   (setq vip-last-jump (point-marker))
+	   (viper-register-to-point reg)
+	   (setq viper-last-jump (point-marker))
 	   (cond (skip-white 
 		  (back-to-indentation)
-		  (setq vip-last-jump-ignore (point))))
+		  (setq viper-last-jump-ignore (point))))
 	   (if com
 	       (if (equal buff (current-buffer))
-		   (vip-execute-com (if skip-white
-					'vip-goto-mark-and-skip-white
-				      'vip-goto-mark)
+		   (viper-execute-com (if skip-white
+					  'viper-goto-mark-and-skip-white
+					'viper-goto-mark)
 				    nil com)
 		 (switch-to-buffer buff)
-		 (goto-char vip-com-point)
-		 (vip-change-state-to-vi)
+		 (goto-char viper-com-point)
+		 (viper-change-state-to-vi)
 		 (error "")))))
 	((and (not skip-white) (= char ?`))
-	 (if com (vip-move-marker-locally 'vip-com-point (point)))
-	 (if (and (vip-same-line (point) vip-last-jump)
-		  (= (point) vip-last-jump-ignore))
-	     (goto-char vip-last-jump))
+	 (if com (viper-move-marker-locally 'viper-com-point (point)))
+	 (if (and (viper-same-line (point) viper-last-jump)
+		  (= (point) viper-last-jump-ignore))
+	     (goto-char viper-last-jump))
 	 (if (null (mark t)) (error "Mark is not set in this buffer"))
 	 (if (= (point) (mark t)) (pop-mark))
 	 (exchange-point-and-mark)
-	 (setq vip-last-jump (point-marker)
-	       vip-last-jump-ignore 0)
-	 (if com (vip-execute-com 'vip-goto-mark nil com)))
+	 (setq viper-last-jump (point-marker)
+	       viper-last-jump-ignore 0)
+	 (if com (viper-execute-com 'viper-goto-mark nil com)))
 	((and skip-white (= char ?'))
-	 (if com (vip-move-marker-locally 'vip-com-point (point)))
-	 (if (and (vip-same-line (point) vip-last-jump)
-		  (= (point) vip-last-jump-ignore))
-	     (goto-char vip-last-jump))
+	 (if com (viper-move-marker-locally 'viper-com-point (point)))
+	 (if (and (viper-same-line (point) viper-last-jump)
+		  (= (point) viper-last-jump-ignore))
+	     (goto-char viper-last-jump))
 	 (if (= (point) (mark t)) (pop-mark))
 	 (exchange-point-and-mark)
-	 (setq vip-last-jump (point))
+	 (setq viper-last-jump (point))
 	 (back-to-indentation)
-	 (setq vip-last-jump-ignore (point))
-	 (if com (vip-execute-com 'vip-goto-mark-and-skip-white nil com)))
-	(t (error vip-InvalidTextmarker char))))
+	 (setq viper-last-jump-ignore (point))
+	 (if com (viper-execute-com 'viper-goto-mark-and-skip-white nil com)))
+	(t (error viper-InvalidTextmarker char))))
 	
-(defun vip-insert-tab ()
+(defun viper-insert-tab ()
   (interactive)
   (insert-tab))
 
-(defun vip-exchange-point-and-mark ()
+(defun viper-exchange-point-and-mark ()
   (interactive)
   (exchange-point-and-mark)
   (back-to-indentation))
@@ -4017,26 +4088,26 @@
 ;; Input Mode Indentation
 
 ;; Returns t, if the string before point matches the regexp STR.
-(defsubst vip-looking-back (str)
+(defsubst viper-looking-back (str)
   (and (save-excursion (re-search-backward str nil t))
        (= (point) (match-end 0))))
 
 
-(defun vip-forward-indent ()
+(defun viper-forward-indent ()
   "Indent forward -- `C-t' in Vi."
   (interactive)
-  (setq vip-cted t)
-  (indent-to (+ (current-column) vip-shift-width)))
-
-(defun vip-backward-indent ()
+  (setq viper-cted t)
+  (indent-to (+ (current-column) viper-shift-width)))
+
+(defun viper-backward-indent ()
   "Backtab, C-d in VI"
   (interactive)
-  (if vip-cted
+  (if viper-cted
       (let ((p (point)) (c (current-column)) bol (indent t))
-	(if (vip-looking-back "[0^]")
+	(if (viper-looking-back "[0^]")
 	    (progn
 	      (if (eq ?^ (preceding-char))
-		  (setq vip-preserve-indent t))
+		  (setq viper-preserve-indent t))
 	      (delete-backward-char 1)
 	      (setq p (point))
 	      (setq indent nil)))
@@ -4046,47 +4117,50 @@
 	(if (re-search-backward "[^ \t]" bol 1) (forward-char))
 	(delete-region (point) p)
 	(if indent
-	    (indent-to (- c vip-shift-width)))
-	(if (or (bolp) (vip-looking-back "[^ \t]"))
-	    (setq vip-cted nil)))))
-
-(defun vip-autoindent ()
+	    (indent-to (- c viper-shift-width)))
+	(if (or (bolp) (viper-looking-back "[^ \t]"))
+	    (setq viper-cted nil)))))
+
+(defun viper-autoindent ()
   "Auto Indentation, Vi-style."
   (interactive)
   (let ((col (current-indentation)))
     (if abbrev-mode (expand-abbrev))
-    (if vip-preserve-indent
-	(setq vip-preserve-indent nil)
-      (setq vip-current-indent col))
+    (if viper-preserve-indent
+	(setq viper-preserve-indent nil)
+      (setq viper-current-indent col))
     ;; don't leave whitespace lines around
     (if (memq last-command
-	      '(vip-autoindent
-		vip-open-line vip-Open-line
-		vip-replace-state-exit-cmd))
+	      '(viper-autoindent
+		viper-open-line viper-Open-line
+		viper-replace-state-exit-cmd))
 	(indent-to-left-margin))
     ;; use \n instead of newline, or else <Return> will move the insert point
     ;;(newline 1)
     (insert "\n")
-    (if vip-auto-indent
+    (if viper-auto-indent
 	(progn
-	  (setq vip-cted t)
-	  (if (and vip-electric-mode
-		   (not (eq major-mode 'fundamental-mode)))
+	  (setq viper-cted t)
+	  (if (and viper-electric-mode
+		   (not
+		    (memq major-mode '(fundamental-mode
+				       text-mode
+				       paragraph-indent-text-mode ))))
 	      (indent-according-to-mode)
-	    (indent-to vip-current-indent))
+	    (indent-to viper-current-indent))
 	  ))
     ))
 
 	   
 ;; Viewing registers
 
-(defun vip-ket-function (arg)
+(defun viper-ket-function (arg)
   "Function called by \], the ket. View registers and call \]\]."
   (interactive "P")
   (let ((reg (read-char)))
-    (cond ((vip-valid-register reg '(letter Letter))
+    (cond ((viper-valid-register reg '(letter Letter))
 	   (view-register (downcase reg)))
-	  ((vip-valid-register reg '(digit))
+	  ((viper-valid-register reg '(digit))
 	   (let ((text (current-kill (- reg ?1) 'do-not-rotate)))
 	     (save-excursion 
 	       (set-buffer (get-buffer-create "*Output*"))
@@ -4096,22 +4170,22 @@
 	       (goto-char (point-min)))
 	     (display-buffer "*Output*")))
 	  ((= ?\] reg)
-	   (vip-next-heading arg))
+	   (viper-next-heading arg))
 	  (t (error
-	      vip-InvalidRegister reg)))))
-
-(defun vip-brac-function (arg)
+	      viper-InvalidRegister reg)))))
+
+(defun viper-brac-function (arg)
   "Function called by \[, the brac. View textmarkers and call \[\["
   (interactive "P")
   (let ((reg (read-char)))
     (cond ((= ?\[ reg)
-	   (vip-prev-heading arg))
+	   (viper-prev-heading arg))
 	  ((= ?\] reg)
-	   (vip-heading-end arg))
-	  ((vip-valid-register reg '(letter))
+	   (viper-heading-end arg))
+	  ((viper-valid-register reg '(letter))
 	   (let* ((val (get-register (1+ (- reg ?a))))
 		  (buf (if (not val) 
-			   (error vip-EmptyTextmarker reg)
+			   (error viper-EmptyTextmarker reg)
 			 (marker-buffer val)))
 		  (pos (marker-position val))
 		  line-no text (s pos) (e pos))
@@ -4145,16 +4219,16 @@
 				     reg (buffer-name buf) line-no))
 		     (insert (format "Here is some text around %c:\n\n %s" 
 				     reg text)))
-		 (insert (format vip-EmptyTextmarker reg)))
+		 (insert (format viper-EmptyTextmarker reg)))
 	       (goto-char (point-min)))
 	     (display-buffer "*Output*")))
-	  (t (error vip-InvalidTextmarker reg)))))
+	  (t (error viper-InvalidTextmarker reg)))))
   
 
 
 ;; commands in insertion mode
 
-(defun vip-delete-backward-word (arg)
+(defun viper-delete-backward-word (arg)
   "Delete previous word."
   (interactive "p")
   (save-excursion
@@ -4184,84 +4258,84 @@
     (delete-other-windows)
     ;; if 0 < viper-expert-level < viper-max-expert-level
     ;;    & dont-change-unless = t -- use it; else ask
-    (vip-ask-level dont-change-unless))
+    (viper-ask-level dont-change-unless))
   
-  (setq viper-always          	    	t
-	vip-ex-style-motion 	    	t
-	vip-ex-style-editing-in-insert  t
-	vip-want-ctl-h-help nil)
+  (setq viper-always          	    		t
+	viper-ex-style-motion 	    		t
+	viper-ex-style-editing-in-insert	t    
+	viper-want-ctl-h-help nil)
 
   (cond ((eq viper-expert-level 1) ; novice or beginner
 	 (global-set-key   ; in emacs-state 
-	  vip-toggle-key
-	  (if (vip-window-display-p) 'vip-iconify 'suspend-emacs))
-	 (setq vip-no-multiple-ESC	     t
-	       vip-re-search	    	     t
-	       vip-vi-style-in-minibuffer    t
-	       vip-search-wrap-around-t	     t
-	       vip-electric-mode	     nil
-	       vip-want-emacs-keys-in-vi     nil
-	       vip-want-emacs-keys-in-insert nil))
+	  viper-toggle-key
+	  (if (viper-window-display-p) 'viper-iconify 'suspend-emacs))
+	 (setq viper-no-multiple-ESC	       t
+	       viper-re-search	    	       t
+	       viper-vi-style-in-minibuffer    t
+	       viper-search-wrap-around-t      t
+	       viper-electric-mode	       nil
+	       viper-want-emacs-keys-in-vi     nil
+	       viper-want-emacs-keys-in-insert nil))
 	
 	((and (> viper-expert-level 1) (< viper-expert-level 5))
 	 ;; intermediate to guru
-	 (setq vip-no-multiple-ESC           (if (vip-window-display-p)
-						 t 'twice)
-	       vip-electric-mode	     t
-	       vip-want-emacs-keys-in-vi     t
-	       vip-want-emacs-keys-in-insert (> viper-expert-level 2))
-
-	 (if (eq viper-expert-level 4) ; respect user's ex-style motion
-	     	    	    	     ; and vip-no-multiple-ESC
+	 (setq viper-no-multiple-ESC           (if (viper-window-display-p)
+						   t 'twice)
+	       viper-electric-mode	       t
+	       viper-want-emacs-keys-in-vi     t
+	       viper-want-emacs-keys-in-insert (> viper-expert-level 2))
+
+	 (if (eq viper-expert-level 4)  ; respect user's ex-style motion
+					; and viper-no-multiple-ESC
 	     (progn
 	       (setq-default
-		vip-ex-style-editing-in-insert
-		(viper-standard-value 'vip-ex-style-editing-in-insert)
-		vip-ex-style-motion
-		(viper-standard-value 'vip-ex-style-motion))
-	       (setq vip-ex-style-motion 
-		     (viper-standard-value 'vip-ex-style-motion)
-		     vip-ex-style-editing-in-insert
-		     (viper-standard-value 'vip-ex-style-editing-in-insert)
-		     vip-re-search
-		     (viper-standard-value 'vip-re-search)
-		     vip-no-multiple-ESC 
-		     (viper-standard-value 'vip-no-multiple-ESC)))))
+		viper-ex-style-editing-in-insert
+		(viper-standard-value 'viper-ex-style-editing-in-insert)
+		viper-ex-style-motion
+		(viper-standard-value 'viper-ex-style-motion))
+	       (setq viper-ex-style-motion 
+		     (viper-standard-value 'viper-ex-style-motion)
+		     viper-ex-style-editing-in-insert
+		     (viper-standard-value 'viper-ex-style-editing-in-insert)
+		     viper-re-search
+		     (viper-standard-value 'viper-re-search)
+		     viper-no-multiple-ESC 
+		     (viper-standard-value 'viper-no-multiple-ESC)))))
 	
 	;; A wizard!!
 	;; Ideally, if 5 is selected, a buffer should pop up to let the
 	;; user toggle the values of variables.
-	(t (setq-default vip-ex-style-editing-in-insert
-			 (viper-standard-value 'vip-ex-style-editing-in-insert)
-			 vip-ex-style-motion
-			 (viper-standard-value 'vip-ex-style-motion))
-	   (setq  vip-want-ctl-h-help 
-		  (viper-standard-value 'vip-want-ctl-h-help)
+	(t (setq-default viper-ex-style-editing-in-insert
+			 (viper-standard-value 'viper-ex-style-editing-in-insert)
+			 viper-ex-style-motion
+			 (viper-standard-value 'viper-ex-style-motion))
+	   (setq  viper-want-ctl-h-help 
+		  (viper-standard-value 'viper-want-ctl-h-help)
 		  viper-always
 		  (viper-standard-value 'viper-always)
-		  vip-no-multiple-ESC 
-		  (viper-standard-value 'vip-no-multiple-ESC)
-		  vip-ex-style-motion 
-		  (viper-standard-value 'vip-ex-style-motion)
-		  vip-ex-style-editing-in-insert
-		  (viper-standard-value 'vip-ex-style-editing-in-insert)
-		  vip-re-search
-		  (viper-standard-value 'vip-re-search)
-		  vip-electric-mode 
-		  (viper-standard-value 'vip-electric-mode)
-		  vip-want-emacs-keys-in-vi 
-		  (viper-standard-value 'vip-want-emacs-keys-in-vi)
-		  vip-want-emacs-keys-in-insert
-		  (viper-standard-value 'vip-want-emacs-keys-in-insert))))
+		  viper-no-multiple-ESC 
+		  (viper-standard-value 'viper-no-multiple-ESC)
+		  viper-ex-style-motion 
+		  (viper-standard-value 'viper-ex-style-motion)
+		  viper-ex-style-editing-in-insert
+		  (viper-standard-value 'viper-ex-style-editing-in-insert)
+		  viper-re-search
+		  (viper-standard-value 'viper-re-search)
+		  viper-electric-mode 
+		  (viper-standard-value 'viper-electric-mode)
+		  viper-want-emacs-keys-in-vi 
+		  (viper-standard-value 'viper-want-emacs-keys-in-vi)
+		  viper-want-emacs-keys-in-insert
+		  (viper-standard-value 'viper-want-emacs-keys-in-insert))))
   
-  (vip-set-mode-vars-for vip-current-state)
+  (viper-set-mode-vars-for viper-current-state)
   (if (or viper-always
 	  (and (> viper-expert-level 0) (> 5 viper-expert-level)))
-      (vip-set-hooks)))
+      (viper-set-hooks)))
 
 ;; Ask user expert level.
-(defun vip-ask-level (dont-change-unless)
-  (let ((ask-buffer " *vip-ask-level*")
+(defun viper-ask-level (dont-change-unless)
+  (let ((ask-buffer " *viper-ask-level*")
 	level-changed repeated)
     (save-window-excursion
       (switch-to-buffer ask-buffer)
@@ -4283,24 +4357,24 @@
 You can change it at any time by typing `M-x viper-set-expert-level RET'
 	
  1 -- BEGINNER: Almost all Emacs features are suppressed.
-          Feels almost like straight Vi. File name completion and
-          command history in the minibuffer are thrown in as a bonus. 
-          To use Emacs productively, you must reach level 3 or higher.
+       Feels almost like straight Vi. File name completion and
+       command history in the minibuffer are thrown in as a bonus. 
+       To use Emacs productively, you must reach level 3 or higher.
  2 -- MASTER: C-c now has its standard Emacs meaning in Vi command state,
-	  so most Emacs commands can be used when Viper is in Vi state.
-	  Good progress---you are well on the way to level 3!
+       so most Emacs commands can be used when Viper is in Vi state.
+       Good progress---you are well on the way to level 3!
  3 -- GRAND MASTER: Like 3, but most Emacs commands are available also
-          in Viper's insert state.
- 4 -- GURU: Like 3, but user settings are respected for vip-no-multiple-ESC,
-	  vip-re-search, vip-ex-style-motion, & vip-ex-style-editing-in-insert
-	  variables. Adjust these settings to your taste.
+       in Viper's insert state.
+ 4 -- GURU: Like 3, but user settings are respected for viper-no-multiple-ESC,
+       viper-ex-style-motion, viper-ex-style-editing-in-insert, and
+       viper-re-search variables. Adjust these settings to your taste.
  5 -- WIZARD: Like 4, but user settings are also respected for viper-always,
-	  vip-electric-mode, vip-want-ctl-h-help, vip-want-emacs-keys-in-vi,
-	  and vip-want-emacs-keys-in-insert. Adjust these to your taste.
+       viper-electric-mode, viper-want-ctl-h-help, viper-want-emacs-keys-in-vi,
+       and viper-want-emacs-keys-in-insert. Adjust these to your taste.
       
 Please, specify your level now: ")
 	  
-	(setq viper-expert-level (- (vip-read-char-exclusive) ?0))
+	(setq viper-expert-level (- (viper-read-char-exclusive) ?0))
 	) ; end while
       
       ;; tell the user if level was changed
@@ -4311,23 +4385,23 @@
 		      viper-expert-level))
 	     (if (y-or-n-p "Do you wish to make this change permanent? ")
 		 ;; save the setting for viper-expert-level
-		 (vip-save-setting
+		 (viper-save-setting
 		  'viper-expert-level
 		  (format "Saving user level %d ..." viper-expert-level)
-		  vip-custom-file-name))
+		  viper-custom-file-name))
 	     ))
       (bury-buffer) ; remove ask-buffer from screen
       (message "")
       )))
 
 
-(defun vip-nil ()
+(defun viper-nil ()
   (interactive)
   (beep 1))
   
     
 ;; if ENFORCE-BUFFER is not nil, error if CHAR is a marker in another buffer
-(defun vip-register-to-point (char &optional enforce-buffer)
+(defun viper-register-to-point (char &optional enforce-buffer)
   "Like jump-to-register, but switches to another buffer in another window."
   (interactive "cViper register to point: ")
   (let ((val (get-register char)))
@@ -4337,20 +4411,20 @@
       (set-frame-configuration val))
      ((window-configuration-p val)
       (set-window-configuration val))
-     ((vip-valid-marker val)
+     ((viper-valid-marker val)
       (if (and enforce-buffer
 	       (not (equal (current-buffer) (marker-buffer val))))
-	  (error (concat vip-EmptyTextmarker " in this buffer")
+	  (error (concat viper-EmptyTextmarker " in this buffer")
 		 (1- (+ char ?a))))
       (pop-to-buffer  (marker-buffer val))
       (goto-char val))
      ((and (consp val) (eq (car val) 'file))
       (find-file (cdr val)))
      (t
-      (error vip-EmptyTextmarker (1- (+ char ?a)))))))
-
-
-(defun vip-save-kill-buffer ()
+      (error viper-EmptyTextmarker (1- (+ char ?a)))))))
+
+
+(defun viper-save-kill-buffer ()
   "Save then kill current buffer. "
   (interactive)
   (if (< viper-expert-level 2)
@@ -4362,74 +4436,76 @@
 
 ;;; Bug Report
 
-(defun vip-submit-report ()
+(defun viper-submit-report ()
   "Submit bug report on Viper."
   (interactive)
   (let ((reporter-prompt-for-summary-p t)
-	(vip-device-type (vip-device-type))
+	(viper-device-type (viper-device-type))
 	color-display-p frame-parameters
 	minibuffer-emacs-face minibuffer-vi-face minibuffer-insert-face
 	varlist salutation window-config)
     
     ;; If mode info is needed, add variable to `let' and then set it below,
     ;; like we did with color-display-p.
-    (setq color-display-p (if (vip-window-display-p) 
-			      (vip-color-display-p)
+    (setq color-display-p (if (viper-window-display-p) 
+			      (viper-color-display-p)
 			    'non-x)
-	  minibuffer-vi-face (if (vip-has-face-support-p)
-				 (vip-get-face vip-minibuffer-vi-face)
+	  minibuffer-vi-face (if (viper-has-face-support-p)
+				 (viper-get-face viper-minibuffer-vi-face)
 			       'non-x)
-	  minibuffer-insert-face (if (vip-has-face-support-p)
-				     (vip-get-face vip-minibuffer-insert-face)
+	  minibuffer-insert-face (if (viper-has-face-support-p)
+				     (viper-get-face 
+				      viper-minibuffer-insert-face)
 				   'non-x)
-	  minibuffer-emacs-face (if (vip-has-face-support-p)
-				    (vip-get-face vip-minibuffer-emacs-face)
+	  minibuffer-emacs-face (if (viper-has-face-support-p)
+				    (viper-get-face
+				     viper-minibuffer-emacs-face)
 				  'non-x)
 	  frame-parameters (if (fboundp 'frame-parameters)
 			       (frame-parameters (selected-frame))))
     
-    (setq varlist (list 'vip-vi-minibuffer-minor-mode
-		        'vip-insert-minibuffer-minor-mode
-		        'vip-vi-intercept-minor-mode
-		        'vip-vi-local-user-minor-mode     
-		        'vip-vi-kbd-minor-mode        	
-		        'vip-vi-global-user-minor-mode
-		        'vip-vi-state-modifier-minor-mode
-		        'vip-vi-diehard-minor-mode   
-		        'vip-vi-basic-minor-mode    
-		        'vip-replace-minor-mode 	  
-		        'vip-insert-intercept-minor-mode
-		        'vip-insert-local-user-minor-mode 
-		        'vip-insert-kbd-minor-mode     	
-		        'vip-insert-global-user-minor-mode
-		        'vip-insert-state-modifier-minor-mode
-		        'vip-insert-diehard-minor-mode 	
-		        'vip-insert-basic-minor-mode   
-		        'vip-emacs-intercept-minor-mode 
-		        'vip-emacs-local-user-minor-mode 
-		        'vip-emacs-kbd-minor-mode 
-		        'vip-emacs-global-user-minor-mode
-		        'vip-emacs-state-modifier-minor-mode
-		        'vip-automatic-iso-accents
-		        'vip-want-emacs-keys-in-insert
-		        'vip-want-emacs-keys-in-vi
-		        'vip-keep-point-on-undo
-		        'vip-no-multiple-ESC
-		        'vip-electric-mode
-		        'vip-ESC-key
-		        'vip-want-ctl-h-help
-		        'vip-ex-style-editing-in-insert
-		        'vip-delete-backwards-in-replace
-		        'vip-vi-style-in-minibuffer
-		        'vip-vi-state-hook
-		        'vip-insert-state-hook
-		        'vip-replace-state-hook
-		        'vip-emacs-state-hook
+    (setq varlist (list 'viper-vi-minibuffer-minor-mode
+		        'viper-insert-minibuffer-minor-mode
+		        'viper-vi-intercept-minor-mode
+		        'viper-vi-local-user-minor-mode     
+		        'viper-vi-kbd-minor-mode        	
+		        'viper-vi-global-user-minor-mode
+		        'viper-vi-state-modifier-minor-mode
+		        'viper-vi-diehard-minor-mode   
+		        'viper-vi-basic-minor-mode    
+		        'viper-replace-minor-mode 	  
+		        'viper-insert-intercept-minor-mode
+		        'viper-insert-local-user-minor-mode 
+		        'viper-insert-kbd-minor-mode     	
+		        'viper-insert-global-user-minor-mode
+		        'viper-insert-state-modifier-minor-mode
+		        'viper-insert-diehard-minor-mode 	
+		        'viper-insert-basic-minor-mode   
+		        'viper-emacs-intercept-minor-mode 
+		        'viper-emacs-local-user-minor-mode 
+		        'viper-emacs-kbd-minor-mode 
+		        'viper-emacs-global-user-minor-mode
+		        'viper-emacs-state-modifier-minor-mode
+		        'viper-automatic-iso-accents
+		        'viper-want-emacs-keys-in-insert
+		        'viper-want-emacs-keys-in-vi
+		        'viper-keep-point-on-undo
+		        'viper-no-multiple-ESC
+		        'viper-electric-mode
+		        'viper-ESC-key
+		        'viper-want-ctl-h-help
+		        'viper-ex-style-editing-in-insert
+		        'viper-delete-backwards-in-replace
+		        'viper-vi-style-in-minibuffer
+		        'viper-vi-state-hook
+		        'viper-insert-state-hook
+		        'viper-replace-state-hook
+		        'viper-emacs-state-hook
 		        'ex-cycle-other-window
 		        'ex-cycle-through-non-files
 		        'viper-expert-level
 		        'major-mode
-		        'vip-device-type
+		        'viper-device-type
 			'color-display-p
 			'frame-parameters
 			'minibuffer-vi-face
@@ -4442,8 +4518,8 @@
 
 -------------------------------------------------------------------")
 	  (setq window-config (current-window-configuration))
-	  (with-output-to-temp-buffer " *vip-info*"
-	    (switch-to-buffer " *vip-info*")
+	  (with-output-to-temp-buffer " *viper-info*"
+	    (switch-to-buffer " *viper-info*")
 	    (delete-other-windows)
 	    (princ "
 PLEASE FOLLOW THESE PROCEDURES
@@ -4486,7 +4562,7 @@
 	  (set-window-configuration window-config)
     
 	  (reporter-submit-bug-report "kifer@cs.sunysb.edu"
-				      (vip-version)
+				      (viper-version)
 				      varlist
 				      nil 'delete-other-windows
 				      salutation)
@@ -4503,8 +4579,8 @@
 ;; symbol in unread-command-events list may cause Emacs to turn this symbol
 ;; into an event. Below, we delete nil from event lists, since nil is the most
 ;; common symbol that might appear in this wrong context.
-(defun vip-set-unread-command-events (arg)
-  (if vip-emacs-p
+(defun viper-set-unread-command-events (arg)
+  (if viper-emacs-p
       (setq
        unread-command-events
        (let ((new-events
@@ -4513,7 +4589,7 @@
 		    ((sequencep arg)
 		     (listify-key-sequence arg))
 		    (t (error
-			"vip-set-unread-command-events: Invalid argument, %S"
+			"viper-set-unread-command-events: Invalid argument, %S"
 			arg)))))
 	 (if (not (eventp nil))
 	     (setq new-events (delq nil new-events)))
@@ -4522,23 +4598,23 @@
     (setq
      unread-command-events
      (append
-      (cond ((vip-characterp arg) (list (character-to-event arg)))
+      (cond ((viper-characterp arg) (list (character-to-event arg)))
 	    ((eventp arg)  (list arg))
 	    ((stringp arg) (mapcar 'character-to-event arg))
 	    ((vectorp arg) (append arg nil)) ; turn into list
-	    ((listp arg) (vip-eventify-list-xemacs arg))
+	    ((listp arg) (viper-eventify-list-xemacs arg))
 	    (t (error
-		"vip-set-unread-command-events: Invalid argument, %S" arg)))
+		"viper-set-unread-command-events: Invalid argument, %S" arg)))
       unread-command-events))))
 
 ;; list is assumed to be a list of events of characters
-(defun vip-eventify-list-xemacs (lis)
+(defun viper-eventify-list-xemacs (lis)
   (mapcar
    (function (lambda (elt)
-	       (cond ((vip-characterp elt) (character-to-event elt))
+	       (cond ((viper-characterp elt) (character-to-event elt))
 		     ((eventp elt)  elt)
 		     (t (error
-			 "vip-eventify-list-xemacs: can't convert to event, %S"
+			 "viper-eventify-list-xemacs: can't convert to event, %S"
 			 elt)))))
    lis))
   
--- a/lisp/viper/viper-ex.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-ex.el	Mon Aug 13 09:53:19 2007 +0200
@@ -25,15 +25,15 @@
 
 ;; Compiler pacifier
 (defvar read-file-name-map)
-(defvar vip-use-register)
-(defvar vip-s-string)
-(defvar vip-shift-width)
-(defvar vip-ex-history)
-(defvar vip-related-files-and-buffers-ring)
-(defvar vip-local-search-start-marker)
+(defvar viper-use-register)
+(defvar viper-s-string)
+(defvar viper-shift-width)
+(defvar viper-ex-history)
+(defvar viper-related-files-and-buffers-ring)
+(defvar viper-local-search-start-marker)
 (defvar viper-expert-level)
-(defvar vip-custom-file-name)
-(defvar vip-case-fold-search)
+(defvar viper-custom-file-name)
+(defvar viper-case-fold-search)
 (defvar explicit-shell-file-name)
 
 ;; loading happens only in non-interactive compilation
@@ -61,9 +61,9 @@
 
 ;;; Variables
 
-(defconst vip-ex-work-buf-name " *ex-working-space*")
-(defconst vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name))
-(defconst vip-ex-tmp-buf-name " *ex-tmp*")
+(defconst viper-ex-work-buf-name " *ex-working-space*")
+(defconst viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+(defconst viper-ex-tmp-buf-name " *ex-tmp*")
 
 
 ;;; Variable completion in :set command
@@ -168,11 +168,11 @@
   :group 'viper-ex)
 
 (defvar ex-nontrivial-find-file-function
-  (cond (ex-unix-type-shell 'vip-ex-nontrivial-find-file-unix)
-	((eq system-type 'emx) 'vip-ex-nontrivial-find-file-ms) ; OS/2
-	(vip-ms-style-os-p 'vip-ex-nontrivial-find-file-ms) ; a Microsoft OS
-	(vip-vms-os-p 'vip-ex-nontrivial-find-file-unix) ; VMS
-	(t  'vip-ex-nontrivial-find-file-unix) ; presumably UNIX
+  (cond (ex-unix-type-shell 'viper-ex-nontrivial-find-file-unix)
+	((eq system-type 'emx) 'viper-ex-nontrivial-find-file-ms) ; OS/2
+	(viper-ms-style-os-p 'viper-ex-nontrivial-find-file-ms) ; Microsoft OS
+	(viper-vms-os-p 'viper-ex-nontrivial-find-file-unix) ; VMS
+	(t  'viper-ex-nontrivial-find-file-unix) ; presumably UNIX
 	))
 
 ;; Remembers the previous Ex tag.
@@ -194,9 +194,9 @@
 ;; e.g., :r !date
 (defvar ex-cmdfile nil)
   
-;; flag used in vip-ex-read-file-name to indicate that we may be reading
+;; flag used in viper-ex-read-file-name to indicate that we may be reading
 ;; multiple file names. Used for :edit and :next
-(defvar vip-keep-reading-filename nil)
+(defvar viper-keep-reading-filename nil)
 
 (defcustom ex-cycle-other-window t
   "*If t, :n and :b cycles through files and buffers in other window.
@@ -211,19 +211,19 @@
   :group 'viper-ex)
 
 ;; Last shell command executed with :! command.
-(defvar vip-ex-last-shell-com nil)
+(defvar viper-ex-last-shell-com nil)
   
 ;; Indicates if Minibuffer was exited temporarily in Ex-command.
-(defvar vip-incomplete-ex-cmd nil)
+(defvar viper-incomplete-ex-cmd nil)
   
 ;; Remembers the last ex-command prompt.
-(defvar vip-last-ex-prompt "")
+(defvar viper-last-ex-prompt "")
 
 
 ;;; Code
   
 ;; Check if ex-token is an initial segment of STR
-(defun vip-check-sub (str)
+(defun viper-check-sub (str)
   (let ((length (length ex-token)))
     (if (and (<= length (length str))
   	     (string= ex-token (substring str 0 length)))
@@ -231,7 +231,7 @@
       (setq ex-token-type 'non-command))))
 
 ;; Get a complete ex command
-(defun vip-get-ex-com-subr ()
+(defun viper-get-ex-com-subr ()
   (let (case-fold-search)
     (set-mark (point))
     (re-search-forward "[a-zA-Z][a-zA-Z]*")
@@ -239,98 +239,98 @@
     (setq ex-token (buffer-substring (point) (mark t)))
     (exchange-point-and-mark)
     (cond ((looking-at "a")
-	   (cond ((looking-at "ab") (vip-check-sub "abbreviate"))
-		 ((looking-at "ar") (vip-check-sub "args"))
-		 (t (vip-check-sub "append"))))
-	  ((looking-at "h") (vip-check-sub "help"))
+	   (cond ((looking-at "ab") (viper-check-sub "abbreviate"))
+		 ((looking-at "ar") (viper-check-sub "args"))
+		 (t (viper-check-sub "append"))))
+	  ((looking-at "h") (viper-check-sub "help"))
 	  ((looking-at "c")
-	   (cond ((looking-at "cd") (vip-check-sub "cd"))
-		 ((looking-at "ch") (vip-check-sub "chdir"))
-		 ((looking-at "co") (vip-check-sub "copy"))
-		 (t (vip-check-sub "change"))))
-	  ((looking-at "d") (vip-check-sub "delete"))
-	  ((looking-at "b") (vip-check-sub "buffer"))
-	  ((looking-at "B") (vip-check-sub "Buffer"))
+	   (cond ((looking-at "cd") (viper-check-sub "cd"))
+		 ((looking-at "ch") (viper-check-sub "chdir"))
+		 ((looking-at "co") (viper-check-sub "copy"))
+		 (t (viper-check-sub "change"))))
+	  ((looking-at "d") (viper-check-sub "delete"))
+	  ((looking-at "b") (viper-check-sub "buffer"))
+	  ((looking-at "B") (viper-check-sub "Buffer"))
 	  ((looking-at "e")
-	   (if (looking-at "ex") (vip-check-sub "ex")
-	     (vip-check-sub "edit")))
-	  ((looking-at "f") (vip-check-sub "file"))
-	  ((looking-at "g") (vip-check-sub "global"))
-	  ((looking-at "i") (vip-check-sub "insert"))
-	  ((looking-at "j") (vip-check-sub "join"))
-	  ((looking-at "l") (vip-check-sub "list"))
+	   (if (looking-at "ex") (viper-check-sub "ex")
+	     (viper-check-sub "edit")))
+	  ((looking-at "f") (viper-check-sub "file"))
+	  ((looking-at "g") (viper-check-sub "global"))
+	  ((looking-at "i") (viper-check-sub "insert"))
+	  ((looking-at "j") (viper-check-sub "join"))
+	  ((looking-at "l") (viper-check-sub "list"))
 	  ((looking-at "m")
-	   (cond ((looking-at "map") (vip-check-sub "map"))
-		 ((looking-at "mar") (vip-check-sub "mark"))
-		 (t (vip-check-sub "move"))))
+	   (cond ((looking-at "map") (viper-check-sub "map"))
+		 ((looking-at "mar") (viper-check-sub "mark"))
+		 (t (viper-check-sub "move"))))
 	  ((looking-at "k[a-z][^a-z]")
 	   (setq ex-token "kmark")
 	   (forward-char 1)
 	   (exchange-point-and-mark))   ; this is canceled out by another
 					; exchange-point-and-mark at the end
-	  ((looking-at "k") (vip-check-sub "kmark"))
+	  ((looking-at "k") (viper-check-sub "kmark"))
 	  ((looking-at "n") (if (looking-at "nu")
-				(vip-check-sub "number")
-			      (vip-check-sub "next")))
-	  ((looking-at "N") (vip-check-sub "Next"))
-	  ((looking-at "o") (vip-check-sub "open"))
+				(viper-check-sub "number")
+			      (viper-check-sub "next")))
+	  ((looking-at "N") (viper-check-sub "Next"))
+	  ((looking-at "o") (viper-check-sub "open"))
 	  ((looking-at "p")
-	   (cond ((looking-at "pre") (vip-check-sub "preserve"))
-		 ((looking-at "pu") (vip-check-sub "put"))
-		 ((looking-at "pw") (vip-check-sub "pwd"))
-		 (t (vip-check-sub "print"))))
-	  ((looking-at "P") (vip-check-sub "PreviousRelatedFile"))
-	  ((looking-at "R") (vip-check-sub "RelatedFile"))
-	  ((looking-at "q") (vip-check-sub "quit"))
+	   (cond ((looking-at "pre") (viper-check-sub "preserve"))
+		 ((looking-at "pu") (viper-check-sub "put"))
+		 ((looking-at "pw") (viper-check-sub "pwd"))
+		 (t (viper-check-sub "print"))))
+	  ((looking-at "P") (viper-check-sub "PreviousRelatedFile"))
+	  ((looking-at "R") (viper-check-sub "RelatedFile"))
+	  ((looking-at "q") (viper-check-sub "quit"))
 	  ((looking-at "r")
-	   (cond ((looking-at "rec") (vip-check-sub "recover"))
-		 ((looking-at "rew") (vip-check-sub "rewind"))
-		 (t (vip-check-sub "read"))))
+	   (cond ((looking-at "rec") (viper-check-sub "recover"))
+		 ((looking-at "rew") (viper-check-sub "rewind"))
+		 (t (viper-check-sub "read"))))
 	  ((looking-at "s")
-	   (cond ((looking-at "se") (vip-check-sub "set"))
-		 ((looking-at "sh") (vip-check-sub "shell"))
-		 ((looking-at "so") (vip-check-sub "source"))
-		 ((looking-at "sr") (vip-check-sub "sr"))
-		 ((looking-at "st") (vip-check-sub "stop"))
-		 ((looking-at "sus") (vip-check-sub "suspend"))
-		 ((looking-at "subm") (vip-check-sub "submitReport"))
-		 (t (vip-check-sub "substitute"))))
+	   (cond ((looking-at "se") (viper-check-sub "set"))
+		 ((looking-at "sh") (viper-check-sub "shell"))
+		 ((looking-at "so") (viper-check-sub "source"))
+		 ((looking-at "sr") (viper-check-sub "sr"))
+		 ((looking-at "st") (viper-check-sub "stop"))
+		 ((looking-at "sus") (viper-check-sub "suspend"))
+		 ((looking-at "subm") (viper-check-sub "submitReport"))
+		 (t (viper-check-sub "substitute"))))
 	  ((looking-at "t")
-	   (if (looking-at "ta") (vip-check-sub "tag")
-	     (vip-check-sub "transfer")))
+	   (if (looking-at "ta") (viper-check-sub "tag")
+	     (viper-check-sub "transfer")))
 	  ((looking-at "u")
-	   (cond ((looking-at "una") (vip-check-sub "unabbreviate"))
-		 ((looking-at "unm") (vip-check-sub "unmap"))
-		 (t (vip-check-sub "undo"))))
+	   (cond ((looking-at "una") (viper-check-sub "unabbreviate"))
+		 ((looking-at "unm") (viper-check-sub "unmap"))
+		 (t (viper-check-sub "undo"))))
 	  ((looking-at "v")
-	   (cond ((looking-at "ve") (vip-check-sub "version"))
-		 ((looking-at "vi") (vip-check-sub "visual"))
-		 (t (vip-check-sub "vglobal"))))
+	   (cond ((looking-at "ve") (viper-check-sub "version"))
+		 ((looking-at "vi") (viper-check-sub "visual"))
+		 (t (viper-check-sub "vglobal"))))
 	  ((looking-at "w")
-	   (if (looking-at "wq") (vip-check-sub "wq")
-	     (vip-check-sub "write")))
+	   (if (looking-at "wq") (viper-check-sub "wq")
+	     (viper-check-sub "write")))
 	  ((looking-at "W")
 	   (if (looking-at "WW") 
-	       (vip-check-sub "WWrite")
-	     (vip-check-sub "Write")))
-	  ((looking-at "x") (vip-check-sub "xit"))
-	  ((looking-at "y") (vip-check-sub "yank"))
-	  ((looking-at "z") (vip-check-sub "z")))
+	       (viper-check-sub "WWrite")
+	     (viper-check-sub "Write")))
+	  ((looking-at "x") (viper-check-sub "xit"))
+	  ((looking-at "y") (viper-check-sub "yank"))
+	  ((looking-at "z") (viper-check-sub "z")))
     (exchange-point-and-mark)
     ))
 
 ;; Get an ex-token which is either an address or a command.
 ;; A token has a type, \(command, address, end-mark\), and a value
-(defun vip-get-ex-token ()
+(defun viper-get-ex-token ()
   (save-window-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (skip-chars-forward " \t|")
     (cond ((looking-at "#")
 	   (setq ex-token-type 'command)
 	   (setq ex-token (char-to-string (following-char)))
 	   (forward-char 1))
-	  ((looking-at "[a-z]") (vip-get-ex-com-subr))
+	  ((looking-at "[a-z]") (viper-get-ex-com-subr))
 	  ((looking-at "\\.")
 	   (forward-char 1)
 	   (setq ex-token-type 'dot))
@@ -358,7 +358,7 @@
 		  (forward-char 1)
 		  (setq ex-token-type 'plus))
 		 (t
-		  (error vip-BadAddress))))
+		  (error viper-BadAddress))))
 	  ((looking-at "-")
 	   (cond ((or (looking-at "-[-+]") (looking-at "-[\n|]"))
 		  (forward-char 1)
@@ -369,7 +369,7 @@
 		  (forward-char 1)
 		  (setq ex-token-type 'minus))
 		 (t
-		  (error vip-BadAddress))))
+		  (error viper-BadAddress))))
 	  ((looking-at "/")
 	   (forward-char 1)
 	   (set-mark (point))
@@ -377,7 +377,7 @@
 	     (while (and (not (eolp)) cont)
 	       ;;(re-search-forward "[^/]*/")
 	       (re-search-forward "[^/]*\\(/\\|\n\\)")
-	       (if (not (vip-looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/"))
+	       (if (not (viper-looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/"))
 		   (setq cont nil))))
 	   (backward-char 1)
 	   (setq ex-token (buffer-substring (point) (mark t)))
@@ -390,7 +390,7 @@
 	     (while (and (not (eolp)) cont)
 	       ;;(re-search-forward "[^\\?]*\\?")
 	       (re-search-forward "[^\\?]*\\(\\?\\|\n\\)")
-	       (if (not (vip-looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?"))
+	       (if (not (viper-looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?"))
 		   (setq cont nil))
 	       (backward-char 1)
 	       (if (not (looking-at "\n")) (forward-char 1))))
@@ -417,13 +417,13 @@
 	   (setq ex-token-type 'end-mark)
 	   (setq ex-token "goto"))
 	  (t
-	   (error vip-BadExCommand)))))
+	   (error viper-BadExCommand)))))
 
 ;; Reads Ex command. Tries to determine if it has to exit because command
 ;; is complete or invalid. If not, keeps reading command.
 (defun ex-cmd-read-exit ()
   (interactive)
-  (setq vip-incomplete-ex-cmd t)
+  (setq viper-incomplete-ex-cmd t)
   (let ((quit-regex1 (concat
 		      "\\(" "set[ \t]*"
 		      "\\|" "edit[ \t]*"
@@ -459,12 +459,12 @@
 		     "!*")))
 	
     (save-window-excursion ;; put cursor at the end of the Ex working buffer
-      (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-      (set-buffer vip-ex-work-buf)
+      (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+      (set-buffer viper-ex-work-buf)
       (goto-char (point-max)))
-    (cond ((vip-looking-back quit-regex1) (exit-minibuffer))
-	  ((vip-looking-back stay-regex)  (insert " "))
-	  ((vip-looking-back quit-regex2) (exit-minibuffer))
+    (cond ((viper-looking-back quit-regex1) (exit-minibuffer))
+	  ((viper-looking-back stay-regex)  (insert " "))
+	  ((viper-looking-back quit-regex2) (exit-minibuffer))
 	  (t (insert " ")))))
   
 ;; complete Ex command
@@ -477,45 +477,45 @@
 	    save-pos (point)))
 	
     (if (or (= dist 0)
-	    (vip-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
-	    (vip-looking-back
+	    (viper-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
+	    (viper-looking-back
 	     "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*+[ \t]+[a-zA-Z!=>&~]+"))
 	;; Preceding characters are not the ones allowed in an Ex command
 	;; or we have typed past command name.
 	;; Note: we didn't do parsing, so there may be surprises.
-	(if (or (vip-looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*")
-		(vip-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
+	(if (or (viper-looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*")
+		(viper-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
 		(looking-at "[^ \t\n\C-m]"))
 	    nil
 	  (with-output-to-temp-buffer "*Completions*" 
 	    (display-completion-list
-	     (vip-alist-to-list ex-token-alist))))
+	     (viper-alist-to-list ex-token-alist))))
       ;; Preceding chars may be part of a command name
       (setq string-to-complete (buffer-substring save-pos (point)))
       (setq completion-result
 	    (try-completion string-to-complete ex-token-alist))
       
       (cond ((eq completion-result t)  ; exact match--do nothing
-	     (vip-tmp-insert-at-eob " (Sole completion)"))
+	     (viper-tmp-insert-at-eob " (Sole completion)"))
 	    ((eq completion-result nil)
-	     (vip-tmp-insert-at-eob " (No match)"))
+	     (viper-tmp-insert-at-eob " (No match)"))
 	    (t  ;; partial completion
 	     (goto-char save-pos)
 	     (delete-region (point) (point-max))
 	     (insert completion-result)
 	     (let (case-fold-search)
 	       (setq compl-list
-		     (vip-filter-alist (concat "^" completion-result)
+		     (viper-filter-alist (concat "^" completion-result)
 				       ex-token-alist)))
 	     (if (> (length compl-list) 1)
 		 (with-output-to-temp-buffer "*Completions*" 
 		   (display-completion-list
-		    (vip-alist-to-list (reverse compl-list)))))))
+		    (viper-alist-to-list (reverse compl-list)))))))
       )))
     
 
 ;; Read Ex commands 
-(defun vip-ex (&optional string)
+(defun viper-ex (&optional string)
   (interactive)
   (or string
       (setq ex-g-flag nil
@@ -526,25 +526,25 @@
 	 (dot (point))
 	 prev-token-type com-str)
 	 
-    (vip-add-keymap vip-ex-cmd-map map)
+    (viper-add-keymap viper-ex-cmd-map map)
     
-    (setq com-str (or string (vip-read-string-with-history
+    (setq com-str (or string (viper-read-string-with-history
 			      ":" 
 			      nil
-			      'vip-ex-history
-			      (car vip-ex-history)
+			      'viper-ex-history
+			      (car viper-ex-history)
 			      map)))
     (save-window-excursion
       ;; just a precaution
-      (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-      (set-buffer vip-ex-work-buf)
+      (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+      (set-buffer viper-ex-work-buf)
       (delete-region (point-min) (point-max))
       (insert com-str "\n")
       (goto-char (point-min)))
     (setq ex-token-type nil
 	  ex-addresses nil)
     (while cont
-      (vip-get-ex-token)
+      (viper-get-ex-token)
       (cond ((memq ex-token-type '(command end-mark))
 	     (if address (setq ex-addresses (cons address ex-addresses)))
 	     (cond ((string= ex-token "global")
@@ -554,21 +554,21 @@
 		    (ex-global t)
 		    (setq cont nil))
 		   (t
-		    (vip-execute-ex-command)
+		    (viper-execute-ex-command)
 		    (save-window-excursion
-		      (setq vip-ex-work-buf
-			    (get-buffer-create vip-ex-work-buf-name))
-		      (set-buffer vip-ex-work-buf)
+		      (setq viper-ex-work-buf
+			    (get-buffer-create viper-ex-work-buf-name))
+		      (set-buffer viper-ex-work-buf)
 		      (skip-chars-forward " \t")
 		      (cond ((looking-at "|")
 			     (forward-char 1))
 			    ((looking-at "\n")
 			     (setq cont nil))
-			    (t (error "`%s': %s" ex-token vip-SpuriousText)))
+			    (t (error "`%s': %s" ex-token viper-SpuriousText)))
 		      ))
 		   ))
 	    ((eq ex-token-type 'non-command)
-	     (error "`%s': %s" ex-token vip-BadExCommand))
+	     (error "`%s': %s" ex-token viper-BadExCommand))
 	    ((eq ex-token-type 'whole)
 	     (setq address nil)
 	     (setq ex-addresses
@@ -586,16 +586,16 @@
 	     (if address (setq dot address))
 	     (setq ex-addresses
 		   (cons (if (null address) (point) address) ex-addresses)))
-	    (t (let ((ans (vip-get-ex-address-subr address dot)))
+	    (t (let ((ans (viper-get-ex-address-subr address dot)))
 		 (if ans (setq address ans)))))
       (setq prev-token-type ex-token-type))))
       
 
 ;; Get a regular expression and set `ex-variant', if found
-(defun vip-get-ex-pat ()
+(defun viper-get-ex-pat ()
   (save-window-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name))
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+    (set-buffer viper-ex-work-buf)
     (skip-chars-forward " \t")
     (if (looking-at "!")
 	(progn
@@ -618,7 +618,7 @@
 			(error
 			 "Missing closing delimiter for global regexp")
 		      (goto-char (point-max))))
-		(if (not (vip-looking-back
+		(if (not (viper-looking-back
 			  (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c)))
 		    (setq cont nil))))
 	    (setq ex-token
@@ -637,26 +637,26 @@
       c)))
 
 ;; get an ex command
-(defun vip-get-ex-command ()
+(defun viper-get-ex-command ()
   (save-window-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (if (looking-at "/") (forward-char 1))
     (skip-chars-forward " \t")
     (cond ((looking-at "[a-z]")
-	   (vip-get-ex-com-subr)
+	   (viper-get-ex-com-subr)
 	   (if (eq ex-token-type 'non-command)
-	       (error "`%s': %s" ex-token vip-BadExCommand)))
+	       (error "`%s': %s" ex-token viper-BadExCommand)))
 	  ((looking-at "[!=><&~]")
 	   (setq ex-token (char-to-string (following-char)))
 	   (forward-char 1))
-	  (t (error vip-BadExCommand)))))
+	  (t (error viper-BadExCommand)))))
 
 ;; Get an Ex option g or c
-(defun vip-get-ex-opt-gc (c)
+(defun viper-get-ex-opt-gc (c)
   (save-window-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (if (looking-at (format "%c" c)) (forward-char 1))
     (skip-chars-forward " \t")
     (cond ((looking-at "g")
@@ -670,7 +670,7 @@
 	  (t nil))))
 
 ;; Compute default addresses.  WHOLE-FLAG means use the whole buffer
-(defun vip-default-ex-addresses (&optional whole-flag)
+(defun viper-default-ex-addresses (&optional whole-flag)
   (cond ((null ex-addresses)
 	 (setq ex-addresses
 	       (if whole-flag
@@ -681,13 +681,13 @@
 	       (cons (car ex-addresses) ex-addresses)))))
 
 ;; Get an ex-address as a marker and set ex-flag if a flag is found
-(defun vip-get-ex-address ()
+(defun viper-get-ex-address ()
   (let ((address (point-marker))
 	(cont t))
     (setq ex-token "")
     (setq ex-flag nil)
     (while cont
-      (vip-get-ex-token)
+      (viper-get-ex-token)
       (cond ((eq ex-token-type 'command)
 	     (if (member ex-token '("print" "list" "#"))
 		 (progn
@@ -699,13 +699,13 @@
 	    ((eq ex-token-type 'whole)
 	     (error "Trailing address expected"))
 	    ((eq ex-token-type 'comma)
-	     (error "`%s': %s" ex-token vip-SpuriousText))
-	    (t (let ((ans (vip-get-ex-address-subr address (point-marker))))
+	     (error "`%s': %s" ex-token viper-SpuriousText))
+	    (t (let ((ans (viper-get-ex-address-subr address (point-marker))))
 		 (if ans (setq address ans))))))
     address))
 
 ;; Returns an address as a point
-(defun vip-get-ex-address-subr (old-address dot)
+(defun viper-get-ex-address-subr (old-address dot)
   (let ((address nil))
     (if (null old-address) (setq old-address dot))
     (cond ((eq ex-token-type 'dot)
@@ -742,7 +742,7 @@
 	   (save-excursion
 	     (if (null ex-token)
 		 (exchange-point-and-mark)
-	       (goto-char (vip-register-to-point
+	       (goto-char (viper-register-to-point
 			   (1+ (- ex-token ?a)) 'enforce-buffer)))
 	     (setq address (point-marker)))))
     address))
@@ -751,10 +751,10 @@
 ;; Search pattern and set address
 (defun ex-search-address (forward)
   (if (string= ex-token "")
-      (if (null vip-s-string)
-	  (error vip-NoPrevSearch)
-	(setq ex-token vip-s-string))
-    (setq vip-s-string ex-token))
+      (if (null viper-s-string)
+	  (error viper-NoPrevSearch)
+	(setq ex-token viper-s-string))
+    (setq viper-s-string ex-token))
   (if forward
       (progn
 	(forward-line 1)
@@ -763,13 +763,13 @@
     (re-search-backward ex-token)))
 
 ;; Get a buffer name and set `ex-count' and `ex-flag' if found
-(defun vip-get-ex-buffer ()
+(defun viper-get-ex-buffer ()
   (setq ex-buffer nil)
   (setq ex-count nil)
   (setq ex-flag nil)
   (save-window-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (skip-chars-forward " \t")
     (if (looking-at "[a-zA-Z]")
 	(progn
@@ -787,15 +787,15 @@
 	  (setq ex-flag t)
 	  (forward-char 1)))
     (if (not (looking-at "[\n|]"))
-	(error "`%s': %s" ex-token vip-SpuriousText))))
+	(error "`%s': %s" ex-token viper-SpuriousText))))
 
-(defun vip-get-ex-count ()
+(defun viper-get-ex-count ()
   (setq ex-variant nil
 	ex-count nil
 	ex-flag nil)
   (save-window-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (skip-chars-forward " \t")
     (if (looking-at "!")
 	(progn
@@ -814,7 +814,8 @@
 	  (forward-char 1)))
     (if (not (looking-at "[\n|]"))
 	(error "`%s': %s"
-	       (buffer-substring (point-min) (1- (point-max))) vip-BadExCommand))))
+	       (buffer-substring
+		(point-min) (1- (point-max))) viper-BadExCommand))))
 
 ;; Expand \% and \# in ex command
 (defun ex-expand-filsyms (cmd buf)
@@ -828,14 +829,14 @@
     (if (and (null pf) (string-match "[^\\]#\\|\\`#" cmd))
 	(error "No alternate file to substitute for `#'"))
     (save-excursion
-      (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
+      (set-buffer (get-buffer-create viper-ex-tmp-buf-name))
       (erase-buffer)
       (insert cmd)
       (goto-char (point-min))
       (while (re-search-forward "%\\|#" nil t)
 	(let ((data (match-data)) 
 	      (char (buffer-substring (match-beginning 0) (match-end 0))))
-	  (if (vip-looking-back (concat "\\\\" char))
+	  (if (viper-looking-back (concat "\\\\" char))
 	      (replace-match char)
 	    (store-match-data data)
 	    (if (string= char "%")
@@ -847,7 +848,7 @@
     ret))
 
 ;; Get a file name and set ex-variant, `ex-append' and `ex-offset' if found
-(defun vip-get-ex-file ()
+(defun viper-get-ex-file ()
   (let (prompt)
     (setq ex-file nil
 	  ex-variant nil
@@ -856,11 +857,11 @@
 	  ex-cmdfile nil)
     (save-excursion
       (save-window-excursion
-	(setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-	(set-buffer vip-ex-work-buf)
+	(setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+	(set-buffer viper-ex-work-buf)
 	(skip-chars-forward " \t")
 	(if (looking-at "!")
-	    (if (and (not (vip-looking-back "[ \t]"))
+	    (if (and (not (viper-looking-back "[ \t]"))
 		     ;; read doesn't have a corresponding :r! form, so ! is
 		     ;; immediately interpreted as a shell command.
 		     (not (string= ex-token "read")))
@@ -902,7 +903,7 @@
 			(progn
 			  ;; if file name comes from history, don't leave
 			  ;; minibuffer when the user types space
-			  (setq vip-incomplete-ex-cmd nil)
+			  (setq viper-incomplete-ex-cmd nil)
 			  ;; this must be the last clause in this progn
 			  (substring ex-file (match-beginning 0) (match-end 0))
 			  )
@@ -916,11 +917,11 @@
 	(setq prompt (buffer-substring (point-min) (point)))
 	))
     
-    (setq vip-last-ex-prompt prompt)
+    (setq viper-last-ex-prompt prompt)
     
     ;; If we just finished reading command, redisplay prompt
-    (if vip-incomplete-ex-cmd
-	(setq ex-file (vip-ex-read-file-name (format ":%s " prompt)))
+    (if viper-incomplete-ex-cmd
+	(setq ex-file (viper-ex-read-file-name (format ":%s " prompt)))
       ;; file was typed in-line
       (setq ex-file (or ex-file "")))
     ))
@@ -928,24 +929,24 @@
 
 ;; Completes file name or exits minibuffer. If Ex command accepts multiple
 ;; file names, arranges to re-enter the minibuffer.
-(defun vip-complete-filename-or-exit ()
+(defun viper-complete-filename-or-exit ()
   (interactive)
-  (setq vip-keep-reading-filename t) 
+  (setq viper-keep-reading-filename t) 
   ;; don't exit if directory---ex-commands don't 
   (cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer))
 	;; apparently the argument to an Ex command is
 	;; supposed to be a shell command
-	((vip-looking-back "^[ \t]*!.*")
+	((viper-looking-back "^[ \t]*!.*")
 	 (setq ex-cmdfile t)
 	 (insert " "))
 	(t
 	 (setq ex-cmdfile nil)
 	 (minibuffer-complete-word))))
 
-(defun vip-handle-! ()
+(defun viper-handle-! ()
   (interactive)
   (if (and (string=
-	    (buffer-string) (vip-abbreviate-file-name default-directory))
+	    (buffer-string) (viper-abbreviate-file-name default-directory))
 	   (member ex-token '("read" "write")))
       (erase-buffer))
   (insert "!"))
@@ -955,20 +956,20 @@
 
 ;; If user doesn't enter anything, then "" is returned, i.e., the
 ;; prompt-directory is not returned.
-(defun vip-ex-read-file-name (prompt)
+(defun viper-ex-read-file-name (prompt)
   (let* ((str "")
 	 (minibuffer-local-completion-map
 	  (copy-keymap minibuffer-local-completion-map))
 	 beg end cont val)
     
-    (vip-add-keymap ex-read-filename-map
-		    (if vip-emacs-p 
+    (viper-add-keymap ex-read-filename-map
+		    (if viper-emacs-p 
 			minibuffer-local-completion-map
 		      read-file-name-map)) 
 		    
-    (setq cont (setq vip-keep-reading-filename t))
+    (setq cont (setq viper-keep-reading-filename t))
     (while cont
-      (setq vip-keep-reading-filename nil
+      (setq viper-keep-reading-filename nil
 	    val (read-file-name (concat prompt str) nil default-directory))
       (if (string-match " " val)
 	  (setq val (concat "\\\"" val "\\\"")))
@@ -976,9 +977,9 @@
 			 val (if (equal val "") "" " ")))
 			 
       ;; Only edit, next, and Next commands accept multiple files.
-      ;; vip-keep-reading-filename is set in the anonymous function that is
+      ;; viper-keep-reading-filename is set in the anonymous function that is
       ;; bound to " " in ex-read-filename-map.
-      (setq cont (and vip-keep-reading-filename
+      (setq cont (and viper-keep-reading-filename
 		      (ex-cmd-accepts-multiple-files-p ex-token)))
       )
     
@@ -990,19 +991,20 @@
 	      (progn
 		(setq ex-cmdfile t)
 		(setq beg (1+ beg))
-		(setq vip-last-ex-prompt (concat vip-last-ex-prompt " !")))))
+		(setq viper-last-ex-prompt
+		      (concat viper-last-ex-prompt " !")))))
     (substring str (or beg 0) end)))
 
 ;; Execute ex command using the value of addresses
-(defun vip-execute-ex-command ()
-  (vip-deactivate-mark)
+(defun viper-execute-ex-command ()
+  (viper-deactivate-mark)
   (cond ((string= ex-token "args") (ex-args))
 	((string= ex-token "copy") (ex-copy nil))
 	((string= ex-token "cd") (ex-cd))
 	((string= ex-token "chdir") (ex-cd))
 	((string= ex-token "delete") (ex-delete))
 	((string= ex-token "edit") (ex-edit))
-	((string= ex-token "file") (vip-info-on-file))
+	((string= ex-token "file") (viper-info-on-file))
 	((string= ex-token "goto") (ex-goto))
 	((string= ex-token "help") (ex-help))
 	((string= ex-token "join") (ex-line "join"))
@@ -1021,7 +1023,7 @@
 	((string= ex-token "read") (ex-read))
 	((string= ex-token "recover") (ex-recover))
 	((string= ex-token "rewind") (ex-rewind))
-	((string= ex-token "submitReport") (vip-submit-report))
+	((string= ex-token "submitReport") (viper-submit-report))
 	((string= ex-token "set") (ex-set))
 	((string= ex-token "shell") (ex-shell))
 	((string= ex-token "source") (ex-source))
@@ -1031,15 +1033,15 @@
 	((string= ex-token "stop") (suspend-emacs))
 	((string= ex-token "transfer") (ex-copy nil))
 	((string= ex-token "buffer") (if ex-cycle-other-window
-					 (vip-switch-to-buffer-other-window)
-					 (vip-switch-to-buffer)))
+					 (viper-switch-to-buffer-other-window)
+				       (viper-switch-to-buffer)))
 	((string= ex-token "Buffer") (if ex-cycle-other-window
-					 (vip-switch-to-buffer)
-					 (vip-switch-to-buffer-other-window)))
+					 (viper-switch-to-buffer)
+				       (viper-switch-to-buffer-other-window)))
 	((string= ex-token "tag") (ex-tag))
-	((string= ex-token "undo") (vip-undo))
+	((string= ex-token "undo") (viper-undo))
 	((string= ex-token "unmap") (ex-unmap))
-	((string= ex-token "version") (vip-version))
+	((string= ex-token "version") (viper-version))
 	((string= ex-token "visual") (ex-edit))
 	((string= ex-token "write") (ex-write nil))
 	((string= ex-token "Write") (save-some-buffers))
@@ -1068,9 +1070,9 @@
 	     (string= ex-token "z")
 	     (string= ex-token "#"))
 	 (error "`%s': Command not implemented in Viper" ex-token))
-	(t (error "`%s': %s" ex-token vip-BadExCommand))))
+	(t (error "`%s': %s" ex-token viper-BadExCommand))))
 
-(defun vip-undisplayed-files ()
+(defun viper-undisplayed-files ()
   (mapcar
    (function 
     (lambda (b) 
@@ -1088,7 +1090,7 @@
 
 
 (defun ex-args ()
-  (let ((l (vip-undisplayed-files))
+  (let ((l (viper-undisplayed-files))
 	(args "")
 	(file-count 1))
     (while (not (null l))
@@ -1100,31 +1102,31 @@
 	(message "All files are already displayed")
       (save-excursion
 	(save-window-excursion
-	  (with-output-to-temp-buffer " *vip-info*"
+	  (with-output-to-temp-buffer " *viper-info*"
 	    (princ "\n\nThese files are not displayed in any window.\n")
 	    (princ "\n=============\n")
 	    (princ args)
 	    (princ "\n=============\n")
 	    (princ "\nThe numbers can be given as counts to :next. ")
 	    (princ "\n\nPress any key to continue...\n\n"))
-	  (vip-read-event))))))
+	  (viper-read-event))))))
 
 ;; Ex cd command. Default directory of this buffer changes
 (defun ex-cd ()
-  (vip-get-ex-file)
+  (viper-get-ex-file)
   (if (string= ex-file "")
       (setq ex-file "~"))
   (setq default-directory (file-name-as-directory (expand-file-name ex-file))))
 
 ;; Ex copy and move command.  DEL-FLAG means delete
 (defun ex-copy (del-flag)
-  (vip-default-ex-addresses)
-  (let ((address (vip-get-ex-address))
+  (viper-default-ex-addresses)
+  (let ((address (viper-get-ex-address))
 	(end (car ex-addresses)) (beg (car (cdr ex-addresses))))
     (goto-char end)
     (save-excursion
       (push-mark beg t)
-      (vip-enlarge-region (mark t) (point))
+      (viper-enlarge-region (mark t) (point))
       (if del-flag
 	  (kill-region (point) (mark t))
 	(copy-region-as-kill (point) (mark t)))
@@ -1149,19 +1151,19 @@
 
 ;; Ex delete command
 (defun ex-delete ()
-  (vip-default-ex-addresses)
-  (vip-get-ex-buffer)
+  (viper-default-ex-addresses)
+  (viper-get-ex-buffer)
   (let ((end (car ex-addresses)) (beg (car (cdr ex-addresses))))
-    (if (> beg end) (error vip-FirstAddrExceedsSecond))
+    (if (> beg end) (error viper-FirstAddrExceedsSecond))
     (save-excursion
-      (vip-enlarge-region beg end)
+      (viper-enlarge-region beg end)
       (exchange-point-and-mark)
       (if ex-count
 	  (progn
 	    (set-mark (point))
 	    (forward-line (1- ex-count)))
 	(set-mark end))
-      (vip-enlarge-region (point) (mark t))
+      (viper-enlarge-region (point) (mark t))
       (if ex-flag
 	  ;; show text to be deleted and ask for confirmation
 	  (progn
@@ -1174,12 +1176,12 @@
 	       (error "")))
 	    (save-excursion (kill-buffer " *delete text*")))
 	(if ex-buffer
-	    (cond ((vip-valid-register ex-buffer '(Letter))
-		   (vip-append-to-register
+	    (cond ((viper-valid-register ex-buffer '(Letter))
+		   (viper-append-to-register
 		    (downcase ex-buffer) (point) (mark t)))
-		  ((vip-valid-register ex-buffer)
+		  ((viper-valid-register ex-buffer)
 		   (copy-to-register ex-buffer (point) (mark t) nil))
-		  (t (error vip-InvalidRegister ex-buffer))))
+		  (t (error viper-InvalidRegister ex-buffer))))
 	(kill-region (point) (mark t))))))
 
 
@@ -1191,11 +1193,11 @@
 ;; with the first file in its argument list
 (defun ex-edit (&optional file)
   (if (not file)
-      (vip-get-ex-file))
+      (viper-get-ex-file))
   (cond ((and (string= ex-file "") buffer-file-name)
-	 (setq ex-file  (vip-abbreviate-file-name (buffer-file-name))))
+	 (setq ex-file  (viper-abbreviate-file-name (buffer-file-name))))
 	((string= ex-file "")
-	 (error vip-NoFileSpecified)))
+	 (error viper-NoFileSpecified)))
       
   (let (msg do-edit)
     (if buffer-file-name
@@ -1223,20 +1225,20 @@
       (progn 
 	(ex-find-file ex-file)
 	(or (eq major-mode 'dired-mode)
-	    (vip-change-state-to-vi))
+	    (viper-change-state-to-vi))
 	(goto-char (point-min)))
     (switch-to-buffer file))
   (if ex-offset
       (progn
 	(save-window-excursion
-	  (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-	  (set-buffer vip-ex-work-buf)
+	  (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+	  (set-buffer viper-ex-work-buf)
 	  (delete-region (point-min) (point-max))
 	  (insert ex-offset "\n")
 	  (goto-char (point-min)))
-	(goto-char (vip-get-ex-address))
+	(goto-char (viper-get-ex-address))
 	(beginning-of-line)))
-  (ex-fixup-history vip-last-ex-prompt ex-file))
+  (ex-fixup-history viper-last-ex-prompt ex-file))
 
 ;; Find-file FILESPEC if it appears to specify a single file.
 ;; Otherwise, assume that FILES{EC is a wildcard.
@@ -1269,33 +1271,33 @@
 		ex-g-variant t)
 	(setq ex-g-flag t
 	      ex-g-variant nil)))
-    (vip-get-ex-pat)
+    (viper-get-ex-pat)
     (if (null ex-token)
 	(error "`%s': Missing regular expression" gcommand)))
   
   (if (string= ex-token "")
-      (if (null vip-s-string)
-	  (error vip-NoPrevSearch)
-	(setq ex-g-pat vip-s-string))
+      (if (null viper-s-string)
+	  (error viper-NoPrevSearch)
+	(setq ex-g-pat viper-s-string))
     (setq ex-g-pat ex-token
-	  vip-s-string ex-token))
+	  viper-s-string ex-token))
   (if (null ex-addresses)
       (setq ex-addresses (list (point-max) (point-min)))
-    (vip-default-ex-addresses))
+    (viper-default-ex-addresses))
   (let ((marks nil)
 	(mark-count 0)
 	(end (car ex-addresses))
 	(beg (car (cdr ex-addresses)))
 	com-str)
-    (if (> beg end) (error vip-FirstAddrExceedsSecond))
+    (if (> beg end) (error viper-FirstAddrExceedsSecond))
     (save-excursion
-      (vip-enlarge-region beg end)
+      (viper-enlarge-region beg end)
       (exchange-point-and-mark)
       (let ((cont t) (limit (point-marker)))
 	(exchange-point-and-mark)
 	;; skip the last line if empty
 	(beginning-of-line)
-	(if (eobp) (vip-backward-char-carefully))
+	(if (eobp) (viper-backward-char-carefully))
 	(while (and cont (not (bobp)) (>= (point) limit))
 	  (beginning-of-line)
 	  (set-mark (point))
@@ -1312,12 +1314,12 @@
 	    (forward-line -1)
 	    (end-of-line)))))
     (save-window-excursion
-      (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-      (set-buffer vip-ex-work-buf)
+      (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+      (set-buffer viper-ex-work-buf)
       (setq com-str (buffer-substring (1+ (point)) (1- (point-max)))))
     (while marks
       (goto-char (car marks))
-      (vip-ex com-str)
+      (viper-ex com-str)
       (setq mark-count (1- mark-count))
       (setq marks (cdr marks)))))
 
@@ -1331,12 +1333,12 @@
 
 ;; Ex line commands.  COM is join, shift-right or shift-left
 (defun ex-line (com)
-  (vip-default-ex-addresses)
-  (vip-get-ex-count)
+  (viper-default-ex-addresses)
+  (viper-get-ex-count)
   (let ((end (car ex-addresses)) (beg (car (cdr ex-addresses))) point)
-    (if (> beg end) (error vip-FirstAddrExceedsSecond))
+    (if (> beg end) (error viper-FirstAddrExceedsSecond))
     (save-excursion
-      (vip-enlarge-region beg end)
+      (viper-enlarge-region beg end)
       (exchange-point-and-mark)
       (if ex-count
 	  (progn
@@ -1371,10 +1373,10 @@
 	((or (string= com "right") (string= com "left"))
 	 (indent-rigidly
 	  (min beg end) (max beg end)
-	  (if (string= com "right") vip-shift-width (- vip-shift-width)))
+	  (if (string= com "right") viper-shift-width (- viper-shift-width)))
 	 (goto-char (max beg end))
 	 (end-of-line)
-	 (vip-forward-char-carefully))))
+	 (viper-forward-char-carefully))))
 
 
 ;; Ex mark command
@@ -1384,8 +1386,8 @@
 	(setq ex-addresses
 	      (cons (point) nil)))
     (save-window-excursion
-      (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-      (set-buffer vip-ex-work-buf)
+      (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+      (set-buffer viper-ex-work-buf)
       (skip-chars-forward " \t")
       (if (looking-at "[a-z]")
 	  (progn
@@ -1393,7 +1395,7 @@
 	    (forward-char 1)
 	    (skip-chars-forward " \t")
 	    (if (not (looking-at "[\n|]"))
-		(error "`%s': %s" ex-token vip-SpuriousText)))
+		(error "`%s': %s" ex-token viper-SpuriousText)))
 	(error "`%s' requires a following letter" ex-token)))
     (save-excursion
       (goto-char (car ex-addresses))
@@ -1407,7 +1409,7 @@
     (let (count l)
       (if (not find-alt-file) 
 	  (progn
-	    (vip-get-ex-file)
+	    (viper-get-ex-file)
 	    (if (or (char-or-string-p ex-offset)
 		    (and (not (string= "" ex-file)) 
 		         (not (string-match "^[0-9]+$" ex-file))))
@@ -1418,7 +1420,7 @@
 	      (if (= count 0) (setq count 1))
 	      (if (< count 0) (error "Usage: `next <count>' (count >= 0)"))))
 	(setq count 1))
-      (setq l (vip-undisplayed-files))
+      (setq l (viper-undisplayed-files))
       (while (> count 0)
 	(while (and (not (null l)) (null (car l)))
 	  (setq l (cdr l)))
@@ -1434,22 +1436,22 @@
 		(set-window-buffer w (get-file-buffer (car l)))
 		(bury-buffer b)
 		;; this puts "next <count>" in the ex-command history
-		(ex-fixup-history vip-last-ex-prompt ex-file))
+		(ex-fixup-history viper-last-ex-prompt ex-file))
 	    (error "Not that many undisplayed files")))))))
 
 
 (defun ex-next-related-buffer (direction &optional no-recursion)
   
-  (vip-ring-rotate1 vip-related-files-and-buffers-ring direction)
+  (viper-ring-rotate1 viper-related-files-and-buffers-ring direction)
   
   (let ((file-or-buffer-name 
-	 (vip-current-ring-item vip-related-files-and-buffers-ring))
-	(old-ring vip-related-files-and-buffers-ring)
+	 (viper-current-ring-item viper-related-files-and-buffers-ring))
+	(old-ring viper-related-files-and-buffers-ring)
 	(old-win (selected-window))
 	skip-rest buf wind)
     
-    (or (and (ring-p vip-related-files-and-buffers-ring)
-	     (> (ring-length vip-related-files-and-buffers-ring) 0))
+    (or (and (ring-p viper-related-files-and-buffers-ring)
+	     (> (ring-length viper-related-files-and-buffers-ring) 0))
 	(error "This buffer has no related files or buffers"))
 	
     (or (stringp file-or-buffer-name)
@@ -1461,10 +1463,10 @@
 		     (find-file-noselect file-or-buffer-name))
 		    ))
     
-    (if (not (vip-buffer-live-p buf))
+    (if (not (viper-buffer-live-p buf))
 	(error "Didn't find buffer %S or file %S"
 	       file-or-buffer-name
-	       (vip-abbreviate-file-name
+	       (viper-abbreviate-file-name
 		(expand-file-name file-or-buffer-name))))
 	  
     (if (equal buf (current-buffer))
@@ -1477,12 +1479,12 @@
     (if skip-rest
 	()
       ;; setup buffer
-      (if (setq wind (vip-get-visible-buffer-window buf))
+      (if (setq wind (viper-get-visible-buffer-window buf))
 	  ()
-	(setq wind (get-lru-window (if vip-xemacs-p nil 'visible)))
+	(setq wind (get-lru-window (if viper-xemacs-p nil 'visible)))
 	(set-window-buffer wind buf))
 	    
-      (if (vip-window-display-p)
+      (if (viper-window-display-p)
 	  (progn
 	    (raise-frame (window-frame wind))
 	    (if (equal (window-frame wind) (window-frame old-win))
@@ -1492,9 +1494,9 @@
 	
       (save-excursion
 	(set-buffer buf)
-	(setq vip-related-files-and-buffers-ring old-ring))
+	(setq viper-related-files-and-buffers-ring old-ring))
       
-      (setq vip-local-search-start-marker (point-marker))
+      (setq viper-local-search-start-marker (point-marker))
       )))
   
     
@@ -1506,10 +1508,10 @@
 ;; Ex put
 (defun ex-put ()
   (let ((point (if (null ex-addresses) (point) (car ex-addresses))))
-    (vip-get-ex-buffer)
-    (setq vip-use-register ex-buffer)
+    (viper-get-ex-buffer)
+    (setq viper-use-register ex-buffer)
     (goto-char point)
-    (if (bobp) (vip-Put-back 1) (vip-put-back 1))))
+    (if (bobp) (viper-Put-back 1) (viper-put-back 1))))
 
 ;; Ex print working directory
 (defun ex-pwd ()
@@ -1519,8 +1521,8 @@
 (defun ex-quit ()
   ;; skip "!", if it is q!. In Viper q!, w!, etc., behave as q, w, etc.
   (save-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (if (looking-at "!") (forward-char 1)))
   (if (< viper-expert-level 3)
       (save-buffers-kill-emacs)
@@ -1529,35 +1531,35 @@
 
 ;; Ex read command
 (defun ex-read ()
-  (vip-get-ex-file)
+  (viper-get-ex-file)
   (let ((point (if (null ex-addresses) (point) (car ex-addresses)))
 	command)
     (goto-char point)
-    (vip-add-newline-at-eob-if-necessary)
+    (viper-add-newline-at-eob-if-necessary)
     (if (not (or (bobp) (eobp))) (forward-line 1))
     (if (and (not ex-variant) (string= ex-file ""))
 	(progn
 	  (if (null buffer-file-name)
-	      (error vip-NoFileSpecified))
+	      (error viper-NoFileSpecified))
 	  (setq ex-file buffer-file-name)))
     (if ex-cmdfile
 	(progn
 	  (setq command (ex-expand-filsyms ex-file (current-buffer)))
 	  (shell-command command t))
       (insert-file-contents ex-file)))
-  (ex-fixup-history vip-last-ex-prompt ex-file))
+  (ex-fixup-history viper-last-ex-prompt ex-file))
   
 ;; this function fixes ex-history for some commands like ex-read, ex-edit
 (defun ex-fixup-history (&rest args)  
-  (setq vip-ex-history
-	(cons (mapconcat 'identity args " ") (cdr vip-ex-history))))
+  (setq viper-ex-history
+	(cons (mapconcat 'identity args " ") (cdr viper-ex-history))))
   
 
 ;; Ex recover from emacs \#file\#
 (defun ex-recover ()
-  (vip-get-ex-file)
+  (viper-get-ex-file)
   (if (or ex-append ex-offset)
-      (error "`recover': %s" vip-SpuriousText))
+      (error "`recover': %s" viper-SpuriousText))
   (if (string= ex-file "")
       (progn
 	(if (null buffer-file-name)
@@ -1585,11 +1587,11 @@
     (define-key
       minibuffer-local-completion-map " " 'minibuffer-complete-and-exit)
     (define-key minibuffer-local-completion-map "=" 'exit-minibuffer)
-    (if (vip-set-unread-command-events
+    (if (viper-set-unread-command-events
 	 (ex-get-inline-cmd-args "[ \t]*[a-zA-Z]*[ \t]*" nil "\C-m"))
 	(progn
 	  (setq batch t)
-	  (vip-set-unread-command-events ?\C-m)))
+	  (viper-set-unread-command-events ?\C-m)))
     (message ":set  <Variable> [= <Value>]")
     (or batch (sit-for 2))
     
@@ -1598,7 +1600,7 @@
 			       (completing-read ":set " ex-variable-alist)))
       (message ":set <Variable> [= <Value>]")
       ;; if there are unread events, don't wait
-      (or (vip-set-unread-command-events "") (sit-for 2))
+      (or (viper-set-unread-command-events "") (sit-for 2))
       ) ; while
     str))
 
@@ -1610,7 +1612,7 @@
 	(ask-if-save t)
 	(auto-cmd-label "; don't touch or else...")
 	(delete-turn-on-auto-fill-pattern
-	 "([ \t]*add-hook[ \t]+'vip-insert-state-hooks[ \t]+'turn-on-auto-fill.*)")
+	 "([ \t]*add-hook[ \t]+'viper-insert-state-hooks[ \t]+'turn-on-auto-fill.*)")
 	actual-lisp-cmd lisp-cmd-del-pattern
 	val2 orig-var)
     (setq orig-var var)
@@ -1618,35 +1620,35 @@
 	   (setq ask-if-save nil
 		 set-cmd nil))
 	  ((member var '("ai" "autoindent"))
-	   (setq var "vip-auto-indent"
+	   (setq var "viper-auto-indent"
 		 set-cmd "setq"
 		 ask-if-save nil
 		 val "t"))
 	  ((member var '("ai-g" "autoindent-global"))
-	   (kill-local-variable 'vip-auto-indent)
-	   (setq var "vip-auto-indent"
+	   (kill-local-variable 'viper-auto-indent)
+	   (setq var "viper-auto-indent"
 		 set-cmd "setq-default"
 		 val "t"))
 	  ((member var '("noai" "noautoindent"))
-	   (setq var "vip-auto-indent"
+	   (setq var "viper-auto-indent"
 		 ask-if-save nil
 		 val "nil"))
 	  ((member var '("noai-g" "noautoindent-global"))
-	   (kill-local-variable 'vip-auto-indent)
-	   (setq var "vip-auto-indent"
+	   (kill-local-variable 'viper-auto-indent)
+	   (setq var "viper-auto-indent"
 		 set-cmd "setq-default"
 		 val "nil"))
 	  ((member var '("ic" "ignorecase"))
-	   (setq var "vip-case-fold-search"
+	   (setq var "viper-case-fold-search"
 		 val "t"))
 	  ((member var '("noic" "noignorecase"))
-	   (setq var "vip-case-fold-search"
+	   (setq var "viper-case-fold-search"
 		 val "nil"))
 	  ((member var '("ma" "magic"))
-	   (setq var "vip-re-search"
+	   (setq var "viper-re-search"
 		 val "t"))
   	  ((member var '("noma" "nomagic"))
-	   (setq var "vip-re-search"
+	   (setq var "viper-re-search"
 		 val "nil"))
 	  ((member var '("ro" "readonly"))
 	   (setq var "buffer-read-only"
@@ -1661,16 +1663,16 @@
 	   (setq var "blink-matching-paren"
 		 val "nil"))
 	  ((member var '("ws" "wrapscan"))
-	   (setq var "vip-search-wrap-around-t"
+	   (setq var "viper-search-wrap-around-t"
 		 val "t"))
 	  ((member var '("nows" "nowrapscan"))
-	   (setq var "vip-search-wrap-around-t"
+	   (setq var "viper-search-wrap-around-t"
 		 val "nil")))
     (if (and set-cmd (eq val 0)) ; value must be set by the user
 	(let ((cursor-in-echo-area t))
 	  (message ":set %s = <Value>" var)
 	  ;; if there are unread events, don't wait
-	  (or (vip-set-unread-command-events "") (sit-for 2))
+	  (or (viper-set-unread-command-events "") (sit-for 2))
 	  (setq val (read-string (format ":set %s = " var)))
 	  (ex-fixup-history "set" orig-var val)
 	  
@@ -1688,7 +1690,7 @@
 		  
 	  (cond
 	   ((member var '("sw" "shiftwidth"))
-	    (setq var "vip-shift-width"))
+	    (setq var "viper-shift-width"))
 	   ((member var '("ts" "tabstop"))
 	    ;; make it take effect in curr buff and new bufs
 	    (setq var "tab-width"
@@ -1718,24 +1720,24 @@
     
     (if (and ask-if-save
 	     (y-or-n-p (format "Do you want to save this setting in %s "
-			       vip-custom-file-name)))
+			       viper-custom-file-name)))
 	(progn
-	  (vip-save-string-in-file 
-	   actual-lisp-cmd vip-custom-file-name
+	  (viper-save-string-in-file 
+	   actual-lisp-cmd viper-custom-file-name
 	   ;; del pattern
 	   lisp-cmd-del-pattern)
 	  (if (string= var "fill-column")
 	      (if (> val2 0)
-		  (vip-save-string-in-file
+		  (viper-save-string-in-file
 		   (concat
-		    "(add-hook 'vip-insert-state-hooks 'turn-on-auto-fill) "
+		    "(add-hook 'viper-insert-state-hooks 'turn-on-auto-fill) "
 		    auto-cmd-label)
-		   vip-custom-file-name
+		   viper-custom-file-name
 		   delete-turn-on-auto-fill-pattern)
-		(vip-save-string-in-file
-		 nil vip-custom-file-name delete-turn-on-auto-fill-pattern)
-		(vip-save-string-in-file
-		 nil vip-custom-file-name
+		(viper-save-string-in-file
+		 nil viper-custom-file-name delete-turn-on-auto-fill-pattern)
+		(viper-save-string-in-file
+		 nil viper-custom-file-name
 		 ;; del pattern
 		 lisp-cmd-del-pattern)
 		))
@@ -1761,8 +1763,8 @@
 ;; special meaning
 (defun ex-get-inline-cmd-args (regex-forw &optional chars-back replace-str)
   (save-excursion
-    (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-    (set-buffer vip-ex-work-buf)
+    (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+    (set-buffer viper-ex-work-buf)
     (goto-char (point-min))
     (re-search-forward regex-forw nil t)
     (let ((beg (point))
@@ -1778,7 +1780,7 @@
       (if replace-str
 	  (while (re-search-forward " +" nil t)
 	    (replace-match replace-str nil t)
-	    (vip-forward-char-carefully)))
+	    (viper-forward-char-carefully)))
       (goto-char end)
       (buffer-substring beg end))))
 
@@ -1792,53 +1794,53 @@
   (condition-case nil
       (progn
 	(pop-to-buffer (get-buffer-create "*info*"))
-	(info (if vip-xemacs-p "viper.info" "viper"))
+	(info (if viper-xemacs-p "viper.info" "viper"))
 	(message "Type `i' to search for a specific topic"))
     (error (beep 1)
-	   (with-output-to-temp-buffer " *vip-info*"
+	   (with-output-to-temp-buffer " *viper-info*"
 	     (princ (format "
 The Info file for Viper does not seem to be installed.
 
 This file is part of the standard distribution of %sEmacs.
 Please contact your system administrator. "
-			    (if vip-xemacs-p "X" "")
+			    (if viper-xemacs-p "X" "")
 			    ))))))
 
-;; Ex source command. Loads the file specified as argument or `~/.vip'
+;; Ex source command. Loads the file specified as argument or `~/.viper'
 (defun ex-source ()
-  (vip-get-ex-file)
+  (viper-get-ex-file)
   (if (string= ex-file "")
-      (load vip-custom-file-name)
+      (load viper-custom-file-name)
     (load ex-file)))
 
 ;; Ex substitute command
-;; If REPEAT use previous regexp which is ex-reg-exp or vip-s-string
+;; If REPEAT use previous regexp which is ex-reg-exp or viper-s-string
 (defun ex-substitute (&optional repeat r-flag) 
   (let ((opt-g nil)
 	(opt-c nil)
 	(matched-pos nil)
-	(case-fold-search vip-case-fold-search)
+	(case-fold-search viper-case-fold-search)
 	delim pat repl)
-    (if repeat (setq ex-token nil) (setq delim (vip-get-ex-pat)))
+    (if repeat (setq ex-token nil) (setq delim (viper-get-ex-pat)))
     (if (null ex-token)
 	(progn
-	  (setq pat (if r-flag vip-s-string ex-reg-exp))
+	  (setq pat (if r-flag viper-s-string ex-reg-exp))
 	  (or (stringp pat)
 	      (error "No previous pattern to use in substitution"))
 	  (setq repl ex-repl
 		delim (string-to-char pat)))
-      (setq pat (if (string= ex-token "") vip-s-string ex-token))
-      (setq vip-s-string pat
+      (setq pat (if (string= ex-token "") viper-s-string ex-token))
+      (setq viper-s-string pat
 	    ex-reg-exp pat)
-      (setq delim (vip-get-ex-pat))
+      (setq delim (viper-get-ex-pat))
       (if (null ex-token)
 	  (setq ex-token ""
 		ex-repl "")
 	(setq repl ex-token
 	      ex-repl ex-token)))
-    (while (vip-get-ex-opt-gc delim)
+    (while (viper-get-ex-opt-gc delim)
       (if (string= ex-token "g") (setq opt-g t) (setq opt-c t)))
-    (vip-get-ex-count)
+    (viper-get-ex-count)
     (if ex-count
 	(save-excursion
 	  (if ex-addresses (goto-char (car ex-addresses)))
@@ -1854,7 +1856,7 @@
 	  (end (car (cdr ex-addresses)))
 	  eol-mark)
       (save-excursion
-	(vip-enlarge-region beg end)
+	(viper-enlarge-region beg end)
 	(let ((limit (save-excursion
 		       (goto-char (max (point) (mark t)))
 		       (point-marker))))
@@ -1874,7 +1876,7 @@
 			      (error "Can't perform Ex substitution: No previous replacement pattern"))
 			  (replace-match repl t))))
 		  (end-of-line)
-		  (vip-forward-char-carefully))
+		  (viper-forward-char-carefully))
 	      (if (null pat)
 		  (error
 		   "Can't repeat Ex substitution: No previous regular expression"))
@@ -1886,7 +1888,7 @@
 			(error "Can't perform Ex substitution: No previous replacement pattern"))
 		    (replace-match repl t)))
 	      (end-of-line)
-	      (vip-forward-char-carefully))))))
+	      (viper-forward-char-carefully))))))
     (if matched-pos (goto-char matched-pos))
     (beginning-of-line)
     (if opt-c (message "done"))))
@@ -1895,28 +1897,28 @@
 (defun ex-tag ()
   (let (tag)
     (save-window-excursion
-      (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-      (set-buffer vip-ex-work-buf)
+      (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+      (set-buffer viper-ex-work-buf)
       (skip-chars-forward " \t")
       (set-mark (point))
       (skip-chars-forward "^ |\t\n")
       (setq tag (buffer-substring (mark t) (point))))
     (if (not (string= tag "")) (setq ex-tag tag))
-    (vip-change-state-to-emacs)
+    (viper-change-state-to-emacs)
     (condition-case conds
 	(progn
 	  (if (string= tag "")
 	      (find-tag ex-tag t)
 	    (find-tag-other-window ex-tag))
-	  (vip-change-state-to-vi))
+	  (viper-change-state-to-vi))
       (error
-       (vip-change-state-to-vi)
-       (vip-message-conditions conds)))))
+       (viper-change-state-to-vi)
+       (viper-message-conditions conds)))))
 
 ;; Ex write command
 (defun ex-write (q-flag)
-  (vip-default-ex-addresses t)
-  (vip-get-ex-file)
+  (viper-default-ex-addresses t)
+  (viper-get-ex-file)
   (let ((end (car ex-addresses))
 	(beg (car (cdr ex-addresses))) 
 	(orig-buf (current-buffer))
@@ -1925,10 +1927,10 @@
 	(buff-changed-p (buffer-modified-p))
 	temp-buf writing-same-file region
 	file-exists writing-whole-file)
-    (if (> beg end) (error vip-FirstAddrExceedsSecond))
+    (if (> beg end) (error viper-FirstAddrExceedsSecond))
     (if ex-cmdfile
 	(progn
-	  (vip-enlarge-region beg end)
+	  (viper-enlarge-region beg end)
 	  (shell-command-on-region (point) (mark t) ex-file))
       (if (and (string= ex-file "") (not (buffer-file-name)))
 	  (setq ex-file
@@ -1987,7 +1989,7 @@
 	      (t ; writing a region
 	       (unwind-protect 
 		   (save-excursion
-		     (vip-enlarge-region beg end)
+		     (viper-enlarge-region beg end)
 		     (setq region (buffer-substring (point) (mark t)))
 		     ;; create temp buffer for the region
 		     (setq temp-buf (get-buffer-create " *ex-write*"))
@@ -2022,19 +2024,19 @@
 
 (defun ex-write-info (exists file-name beg end)
   (message "`%s'%s %d lines, %d characters"
-	   (vip-abbreviate-file-name file-name)
+	   (viper-abbreviate-file-name file-name)
 	   (if exists "" " [New file]")
 	   (count-lines beg (min (1+ end) (point-max)))
 	   (- end beg)))
 
 ;; Ex yank command
 (defun ex-yank ()
-  (vip-default-ex-addresses)
-  (vip-get-ex-buffer)
+  (viper-default-ex-addresses)
+  (viper-get-ex-buffer)
   (let ((end (car ex-addresses)) (beg (car (cdr ex-addresses))))
-    (if (> beg end) (error vip-FirstAddrExceedsSecond))
+    (if (> beg end) (error viper-FirstAddrExceedsSecond))
     (save-excursion
-      (vip-enlarge-region beg end)
+      (viper-enlarge-region beg end)
       (exchange-point-and-mark)
       (if (or ex-g-flag ex-g-variant)
 	  (error "Can't execute `yank' within `global'"))
@@ -2043,32 +2045,33 @@
 	    (set-mark (point))
 	    (forward-line (1- ex-count)))
 	(set-mark end))
-      (vip-enlarge-region (point) (mark t))
-      (if ex-flag (error "`yank': %s" vip-SpuriousText))
+      (viper-enlarge-region (point) (mark t))
+      (if ex-flag (error "`yank': %s" viper-SpuriousText))
       (if ex-buffer
-	  (cond ((vip-valid-register ex-buffer '(Letter))
-		 (vip-append-to-register
+	  (cond ((viper-valid-register ex-buffer '(Letter))
+		 (viper-append-to-register
 		  (downcase ex-buffer) (point) (mark t)))
-		((vip-valid-register ex-buffer)
+		((viper-valid-register ex-buffer)
 		 (copy-to-register ex-buffer (point) (mark t) nil))
-		(t (error vip-InvalidRegister ex-buffer))))
+		(t (error viper-InvalidRegister ex-buffer))))
       (copy-region-as-kill (point) (mark t)))))
 
 ;; Execute shell command
 (defun ex-command ()
   (let (command)
     (save-window-excursion
-      (setq vip-ex-work-buf (get-buffer-create vip-ex-work-buf-name)) 
-      (set-buffer vip-ex-work-buf)
+      (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 
+      (set-buffer viper-ex-work-buf)
       (skip-chars-forward " \t")
       (setq command (buffer-substring (point) (point-max)))
       (end-of-line))
     (setq command (ex-expand-filsyms command (current-buffer)))
     (if (and (> (length command) 0) (string= "!" (substring command 0 1)))
-	(if vip-ex-last-shell-com
-	    (setq command (concat vip-ex-last-shell-com (substring command 1)))
+	(if viper-ex-last-shell-com
+	    (setq command
+		  (concat viper-ex-last-shell-com (substring command 1)))
 	  (error "No previous shell command")))
-    (setq vip-ex-last-shell-com command)
+    (setq viper-ex-last-shell-com command)
     (if (null ex-addresses)
 	(shell-command command)
       (let ((end (car ex-addresses)) (beg (car (cdr ex-addresses))))
@@ -2076,7 +2079,7 @@
 	(save-excursion
 	  (goto-char beg)
 	  (set-mark end)
-	  (vip-enlarge-region (point) (mark t))
+	  (viper-enlarge-region (point) (mark t))
 	  (shell-command-on-region (point) (mark t) command t))
 	(goto-char beg)))))
 
@@ -2088,14 +2091,14 @@
 		(if (null ex-addresses) (point-max) (car ex-addresses))))))
 
 ;; Give information on the file visited by the current buffer
-(defun vip-info-on-file ()
+(defun viper-info-on-file ()
   (interactive)
-  (let ((pos1 (vip-line-pos 'start))
-	(pos2 (vip-line-pos 'end))
+  (let ((pos1 (viper-line-pos 'start))
+	(pos2 (viper-line-pos 'end))
 	lines file info)
-    (setq lines (count-lines (point-min) (vip-line-pos 'end))
+    (setq lines (count-lines (point-min) (viper-line-pos 'end))
 	  file (if (buffer-file-name)
-		   (concat (vip-abbreviate-file-name (buffer-file-name)) ":")
+		   (concat (viper-abbreviate-file-name (buffer-file-name)) ":")
 		 (concat (buffer-name) " [Not visiting any file]:"))
 	  info (format "line=%d/%d pos=%d/%d col=%d %s"
 		       (if (= pos1 pos2)
@@ -2109,27 +2112,27 @@
 	   (window-width (minibuffer-window)))
 	(message (concat file " " info))
       (save-window-excursion
-	(with-output-to-temp-buffer " *vip-info*"
+	(with-output-to-temp-buffer " *viper-info*"
 	  (princ (concat "\n"
 			 file "\n\n\t" info
 			 "\n\n\nPress any key to continue...\n\n")))
-	(vip-read-event)
-	(kill-buffer " *vip-info*")))
+	(viper-read-event)
+	(kill-buffer " *viper-info*")))
     ))
 
 ;; display all variables set through :set
 (defun ex-show-vars ()
-  (with-output-to-temp-buffer " *vip-info*"
-    (princ (if vip-auto-indent
+  (with-output-to-temp-buffer " *viper-info*"
+    (princ (if viper-auto-indent
 	       "autoindent (local)\n" "noautoindent (local)\n"))
-    (princ (if (default-value 'vip-auto-indent) 
+    (princ (if (default-value 'viper-auto-indent) 
 	       "autoindent (global) \n" "noautoindent (global) \n"))
-    (princ (if vip-case-fold-search "ignorecase\n" "noignorecase\n"))
-    (princ (if vip-re-search "magic\n" "nomagic\n"))
+    (princ (if viper-case-fold-search "ignorecase\n" "noignorecase\n"))
+    (princ (if viper-re-search "magic\n" "nomagic\n"))
     (princ (if buffer-read-only "readonly\n" "noreadonly\n"))
     (princ (if blink-matching-paren "showmatch\n" "noshowmatch\n"))
-    (princ (if vip-search-wrap-around-t "wrapscan\n" "nowrapscan\n"))
-    (princ (format "shiftwidth \t\t= %S\n" vip-shift-width))
+    (princ (if viper-search-wrap-around-t "wrapscan\n" "nowrapscan\n"))
+    (princ (format "shiftwidth \t\t= %S\n" viper-shift-width))
     (princ (format "tabstop (local) \t= %S\n" tab-width))
     (princ (format "tabstop (global) \t= %S\n" (default-value 'tab-width)))
     (princ (format "wrapmargin (local) \t= %S\n"
--- a/lisp/viper/viper-init.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-init.el	Mon Aug 13 09:53:19 2007 +0200
@@ -27,7 +27,6 @@
 (defvar mark-even-if-inactive)
 (defvar viper-version)
 (defvar viper-expert-level)
-(defvar vip-expert-level)
 ;; end pacifier
 
 
@@ -35,33 +34,32 @@
 (defun viper-version ()
   (interactive)
   (message "Viper version is %s" viper-version)) 
-(defalias 'vip-version 'viper-version)
 
 ;; Is it XEmacs?
-(defconst vip-xemacs-p (string-match "\\(Lucid\\|XEmacs\\)" emacs-version))
+(defconst viper-xemacs-p (string-match "XEmacs" emacs-version))
 ;; Is it Emacs?
-(defconst vip-emacs-p (not vip-xemacs-p))
+(defconst viper-emacs-p (not viper-xemacs-p))
 ;; Tell whether we are running as a window application or on a TTY
-(defsubst vip-device-type ()
-  (if vip-emacs-p
+(defsubst viper-device-type ()
+  (if viper-emacs-p
       window-system
     (device-type (selected-device))))
 ;; in XEmacs: device-type is tty on tty and stream in batch.
-(defun vip-window-display-p ()
-  (and (vip-device-type) (not (memq (vip-device-type) '(tty stream pc)))))
+(defun viper-window-display-p ()
+  (and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
 
-(defcustom vip-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95))
+(defcustom viper-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95))
   "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95."
   :type 'boolean
   :tag "Is it Microsoft-made OS?"
   :group 'viper)
-(defcustom vip-vms-os-p (memq system-type '(vax-vms axp-vms))
+(defcustom viper-vms-os-p (memq system-type '(vax-vms axp-vms))
   "Tells if Emacs is running under VMS."
   :type 'boolean
   :tag "Is it VMS?"
   :group 'viper)
 
-(defcustom vip-force-faces nil
+(defcustom viper-force-faces nil
   "If t, Viper will think that it is running on a display that supports faces.
 This is provided as a temporary relief for users of graphics-capable terminals
 that Viper doesn't know about.
@@ -69,189 +67,183 @@
   :type 'boolean
   :group 'viper)
 
-(defun vip-has-face-support-p ()
-  (cond ((vip-window-display-p))
-	(vip-force-faces)
-	(vip-emacs-p (memq (vip-device-type) '(pc)))
-	(vip-xemacs-p (memq (vip-device-type) '(tty pc)))))
-
-(defun vip-convert-standard-file-name (fname)
-  (if vip-emacs-p
-      (convert-standard-filename fname)
-    ;; hopefully, XEmacs adds this functionality
-    fname))
+(defun viper-has-face-support-p ()
+  (cond ((viper-window-display-p))
+	(viper-force-faces)
+	(viper-emacs-p (memq (viper-device-type) '(pc)))
+	(viper-xemacs-p (memq (viper-device-type) '(tty pc)))))
 
 
 ;;; Macros
 
-(defmacro vip-deflocalvar (var default-value &optional documentation)
+(defmacro viper-deflocalvar (var default-value &optional documentation)
   (` (progn
        (defvar (, var) (, default-value)
 	       (, (format "%s\n\(buffer local\)" documentation)))
        (make-variable-buffer-local '(, var))
      )))
 
-(defmacro vip-loop (count body)
-  "(vip-loop COUNT BODY) Execute BODY COUNT times."
+(defmacro viper-loop (count body)
+  "(viper-loop COUNT BODY) Execute BODY COUNT times."
   (list 'let (list (list 'count count))
 	(list 'while '(> count 0)
 	      body
 	      '(setq count (1- count))
 	      )))
 
-(defmacro vip-buffer-live-p (buf)
+(defmacro viper-buffer-live-p (buf)
   (` (and (, buf) (get-buffer (, buf)) (buffer-name (get-buffer (, buf))))))
   
 ;; return buffer-specific macro definition, given a full macro definition
-(defmacro vip-kbd-buf-alist (macro-elt)
+(defmacro viper-kbd-buf-alist (macro-elt)
   (` (nth 1 (, macro-elt))))
 ;; get a pair: (curr-buffer . macro-definition)
-(defmacro vip-kbd-buf-pair (macro-elt)
-  (` (assoc (buffer-name) (vip-kbd-buf-alist (, macro-elt)))))
+(defmacro viper-kbd-buf-pair (macro-elt)
+  (` (assoc (buffer-name) (viper-kbd-buf-alist (, macro-elt)))))
 ;; get macro definition for current buffer
-(defmacro vip-kbd-buf-definition (macro-elt)
-  (` (cdr (vip-kbd-buf-pair (, macro-elt)))))
+(defmacro viper-kbd-buf-definition (macro-elt)
+  (` (cdr (viper-kbd-buf-pair (, macro-elt)))))
   
 ;; return mode-specific macro definitions, given a full macro definition
-(defmacro vip-kbd-mode-alist (macro-elt)
+(defmacro viper-kbd-mode-alist (macro-elt)
   (` (nth 2 (, macro-elt))))
 ;; get a pair: (major-mode . macro-definition)
-(defmacro vip-kbd-mode-pair (macro-elt)
-  (` (assoc major-mode (vip-kbd-mode-alist (, macro-elt)))))
+(defmacro viper-kbd-mode-pair (macro-elt)
+  (` (assoc major-mode (viper-kbd-mode-alist (, macro-elt)))))
 ;; get macro definition for the current major mode
-(defmacro vip-kbd-mode-definition (macro-elt)
-  (` (cdr (vip-kbd-mode-pair (, macro-elt)))))
+(defmacro viper-kbd-mode-definition (macro-elt)
+  (` (cdr (viper-kbd-mode-pair (, macro-elt)))))
   
 ;; return global macro definition, given a full macro definition
-(defmacro vip-kbd-global-pair (macro-elt)
+(defmacro viper-kbd-global-pair (macro-elt)
   (` (nth 3 (, macro-elt))))
 ;; get global macro definition from an elt of macro-alist
-(defmacro vip-kbd-global-definition (macro-elt)
-  (` (cdr (vip-kbd-global-pair (, macro-elt)))))
+(defmacro viper-kbd-global-definition (macro-elt)
+  (` (cdr (viper-kbd-global-pair (, macro-elt)))))
   
 ;; last elt of a sequence
-(defsubst vip-seq-last-elt (seq)
+(defsubst viper-seq-last-elt (seq)
   (elt seq (1- (length seq))))
   
 
-(defvar vip-minibuffer-overlay-priority 300)
-(defvar vip-replace-overlay-priority 400)
-(defvar vip-search-overlay-priority 500)
+(defvar viper-minibuffer-overlay-priority 300)
+(defvar viper-replace-overlay-priority 400)
+(defvar viper-search-overlay-priority 500)
   
 
 ;;; Viper minor modes
 
 ;; Mode for vital things like \e, C-z.
-(vip-deflocalvar vip-vi-intercept-minor-mode nil)
+(viper-deflocalvar viper-vi-intercept-minor-mode nil)
 
-(vip-deflocalvar vip-vi-basic-minor-mode nil
+(viper-deflocalvar viper-vi-basic-minor-mode nil
   "Viper's minor mode for Vi bindings.")
   
-(vip-deflocalvar vip-vi-local-user-minor-mode nil
+(viper-deflocalvar viper-vi-local-user-minor-mode nil
   "Auxiliary minor mode for user-defined local bindings in Vi state.")
 
-(vip-deflocalvar vip-vi-global-user-minor-mode nil
+(viper-deflocalvar viper-vi-global-user-minor-mode nil
   "Auxiliary minor mode for user-defined global bindings in Vi state.")
 
-(vip-deflocalvar vip-vi-state-modifier-minor-mode nil
+(viper-deflocalvar viper-vi-state-modifier-minor-mode nil
   "Minor mode used to make major-mode-specific modification to Vi state.")
 
-(vip-deflocalvar vip-vi-diehard-minor-mode nil
+(viper-deflocalvar viper-vi-diehard-minor-mode nil
   "This minor mode is in effect when the user wants Viper to be Vi.")
 
-(vip-deflocalvar vip-vi-kbd-minor-mode nil
+(viper-deflocalvar viper-vi-kbd-minor-mode nil
   "Minor mode for Ex command macros in Vi state.
 The corresponding keymap stores key bindings of Vi macros defined with
 the Ex command :map.")
 
 ;; Mode for vital things like \e, C-z.
-(vip-deflocalvar vip-insert-intercept-minor-mode nil)
+(viper-deflocalvar viper-insert-intercept-minor-mode nil)
 
-(vip-deflocalvar vip-insert-basic-minor-mode nil
+(viper-deflocalvar viper-insert-basic-minor-mode nil
   "Viper's minor mode for bindings in Insert mode.")
 
-(vip-deflocalvar vip-insert-local-user-minor-mode nil
+(viper-deflocalvar viper-insert-local-user-minor-mode nil
   "Auxiliary minor mode for buffer-local user-defined bindings in Insert state.
 This is a way to overshadow normal Insert mode bindings locally to certain
 designated buffers.")
 
-(vip-deflocalvar vip-insert-global-user-minor-mode nil
+(viper-deflocalvar viper-insert-global-user-minor-mode nil
   "Auxiliary minor mode for global user-defined bindings in Insert state.")
 
-(vip-deflocalvar vip-insert-state-modifier-minor-mode nil
+(viper-deflocalvar viper-insert-state-modifier-minor-mode nil
   "Minor mode used to make major-mode-specific modification to Insert state.")
 
-(vip-deflocalvar vip-insert-diehard-minor-mode nil
+(viper-deflocalvar viper-insert-diehard-minor-mode nil
   "Minor mode that simulates Vi very closely.
 Not recommened, except for the novice user.")
 
-(vip-deflocalvar vip-insert-kbd-minor-mode nil
+(viper-deflocalvar viper-insert-kbd-minor-mode nil
 "Minor mode for Ex command macros Insert state.
 The corresponding keymap stores key bindings of Vi macros defined with
 the Ex command :map!.")
 
-(vip-deflocalvar vip-replace-minor-mode nil
+(viper-deflocalvar viper-replace-minor-mode nil
   "Minor mode in effect in replace state (cw, C, and the like commands).")
 
 ;; Mode for vital things like \C-z and \C-x)
 ;; This is t, by default. So, any new buffer will have C-z defined as
 ;; switch to Vi, unless we switched states in this buffer
-(vip-deflocalvar vip-emacs-intercept-minor-mode t)
+(viper-deflocalvar viper-emacs-intercept-minor-mode t)
   
-(vip-deflocalvar vip-emacs-local-user-minor-mode t
+(viper-deflocalvar viper-emacs-local-user-minor-mode t
   "Minor mode for local user bindings effective in Emacs state.
 Users can use it to override Emacs bindings when Viper is in its Emacs
 state.")  
   
-(vip-deflocalvar vip-emacs-global-user-minor-mode t
+(viper-deflocalvar viper-emacs-global-user-minor-mode t
   "Minor mode for global user bindings in effect in Emacs state.
 Users can use it to override Emacs bindings when Viper is in its Emacs
 state.")  
 
-(vip-deflocalvar vip-emacs-kbd-minor-mode t
+(viper-deflocalvar viper-emacs-kbd-minor-mode t
   "Minor mode for Vi style macros in Emacs state.
 The corresponding keymap stores key bindings of Vi macros defined with
-`vip-record-kbd-macro' command. There is no Ex-level command to do this
+`viper-record-kbd-macro' command. There is no Ex-level command to do this
 interactively.")
 
-(vip-deflocalvar vip-emacs-state-modifier-minor-mode t
+(viper-deflocalvar viper-emacs-state-modifier-minor-mode t
   "Minor mode used to make major-mode-specific modification to Emacs state.
 For instance, a Vi purist may want to bind `dd' in Dired mode to a function
 that deletes a file.")
 
-(vip-deflocalvar vip-vi-minibuffer-minor-mode nil
+(viper-deflocalvar viper-vi-minibuffer-minor-mode nil
    "Minor mode that forces Vi-style when the Minibuffer is in Vi state.")
 
-(vip-deflocalvar vip-insert-minibuffer-minor-mode nil
+(viper-deflocalvar viper-insert-minibuffer-minor-mode nil
    "Minor mode that forces Vi-style when the Minibuffer is in Insert state.")
   
 
 
 ;; Some common error messages
 
-(defconst vip-SpuriousText "Spurious text after command"  "")
-(defconst vip-BadExCommand "Not an editor command"   "")
-(defconst vip-InvalidCommandArgument "Invalid command argument"   "")
-(defconst vip-NoPrevSearch "No previous search string"   "")
-(defconst vip-EmptyRegister "`%c': Nothing in this register"   "")
-(defconst vip-InvalidRegister "`%c': Invalid register"   "")
-(defconst vip-EmptyTextmarker "`%c': Text marker doesn't point anywhere"   "")
-(defconst vip-InvalidTextmarker "`%c': Invalid text marker"   "")
-(defconst vip-InvalidViCommand "Invalid command"   "")
-(defconst vip-BadAddress "Ill-formed address"   "")
-(defconst vip-FirstAddrExceedsSecond "First address exceeds second"   "")
-(defconst vip-NoFileSpecified "No file specified"   "")
+(defconst viper-SpuriousText "Spurious text after command"  "")
+(defconst viper-BadExCommand "Not an editor command"   "")
+(defconst viper-InvalidCommandArgument "Invalid command argument"   "")
+(defconst viper-NoPrevSearch "No previous search string"   "")
+(defconst viper-EmptyRegister "`%c': Nothing in this register"   "")
+(defconst viper-InvalidRegister "`%c': Invalid register"   "")
+(defconst viper-EmptyTextmarker "`%c': Text marker doesn't point anywhere"   "")
+(defconst viper-InvalidTextmarker "`%c': Invalid text marker"   "")
+(defconst viper-InvalidViCommand "Invalid command"   "")
+(defconst viper-BadAddress "Ill-formed address"   "")
+(defconst viper-FirstAddrExceedsSecond "First address exceeds second"   "")
+(defconst viper-NoFileSpecified "No file specified"   "")
 
 ;; Is t until viper-mode executes for the very first time. 
 ;; Prevents recursive descend into startup messages.
-(defvar vip-first-time t)
+(defvar viper-first-time t)
 
-(defvar viper-expert-level (if (boundp 'vip-expert-level) vip-expert-level 0)
+(defvar viper-expert-level (if (boundp 'viper-expert-level) viper-expert-level 0)
   "User's expert level.
-The minor mode vip-vi-diehard-minor-mode is in effect when
-viper-expert-level is 1 or 2 or when vip-want-emacs-keys-in-vi is t.
-The minor mode vip-insert-diehard-minor-mode is in effect when
-viper-expert-level is 1 or 2 or if vip-want-emacs-keys-in-insert is t.
+The minor mode viper-vi-diehard-minor-mode is in effect when
+viper-expert-level is 1 or 2 or when viper-want-emacs-keys-in-vi is t.
+The minor mode viper-insert-diehard-minor-mode is in effect when
+viper-expert-level is 1 or 2 or if viper-want-emacs-keys-in-insert is t.
 Use `M-x viper-set-expert-level' to change this.")
 
 ;; Max expert level supported by Viper. This is NOT a user option.
@@ -261,8 +253,8 @@
 
 ;;; ISO characters
   
-(vip-deflocalvar vip-automatic-iso-accents nil "")
-(defcustom vip-automatic-iso-accents nil
+(viper-deflocalvar viper-automatic-iso-accents nil "")
+(defcustom viper-automatic-iso-accents nil
   "*If non-nil, ISO accents will be turned on in insert/replace emacs states and turned off in vi-state. 
 For some users, this behavior may be too primitive. In this case, use
 insert/emacs/vi state hooks."
@@ -273,15 +265,15 @@
 ;; VI-style Undo
 
 ;; Used to 'undo' complex commands, such as replace and insert commands.
-(vip-deflocalvar vip-undo-needs-adjustment nil)
-(put 'vip-undo-needs-adjustment 'permanent-local t)
+(viper-deflocalvar viper-undo-needs-adjustment nil)
+(put 'viper-undo-needs-adjustment 'permanent-local t)
 
 ;; A mark that Viper puts on buffer-undo-list.  Marks the beginning of a
 ;; complex command that must be undone atomically. If inserted, it is
-;; erased by vip-change-state-to-vi and vip-repeat.
-(defconst vip-buffer-undo-list-mark 'viper)
+;; erased by viper-change-state-to-vi and viper-repeat.
+(defconst viper-buffer-undo-list-mark 'viper)
 
-(defcustom vip-keep-point-on-undo nil
+(defcustom viper-keep-point-on-undo nil
   "*Non-nil means not to move point while undoing commands.
 This style is different from Emacs and Vi. Try it to see if
 it better fits your working style."
@@ -291,20 +283,26 @@
 
 ;; Replace mode and changing text
 
-;; Viper's own after/before change functions, which get vip-add-hook'ed to
+;; Viper's own after/before change functions, which get viper-add-hook'ed to
 ;; Emacs's
-(vip-deflocalvar vip-after-change-functions nil "")
-(vip-deflocalvar vip-before-change-functions nil "")
-(vip-deflocalvar vip-post-command-hooks nil "")
-(vip-deflocalvar vip-pre-command-hooks nil "")
+(viper-deflocalvar viper-after-change-functions nil "")
+(viper-deflocalvar viper-before-change-functions nil "")
+(viper-deflocalvar viper-post-command-hooks nil "")
+(viper-deflocalvar viper-pre-command-hooks nil "")
 
 ;; Can be used to pass global states around for short period of time
-(vip-deflocalvar vip-intermediate-command nil "")
+(viper-deflocalvar viper-intermediate-command nil "")
+
+;; This is used to pass the right Vi command key sequence to
+;; viper-set-destructive-command whenever (this-command-keys) doesn't give the
+;; right result. For instance, in commands like c/bla<RET>, (this-command-keys)
+;; will return ^M, which invoked exit-minibuffer, while we need "c/"
+(defconst viper-this-command-keys nil)
 
 ;; Indicates that the current destructive command has started in replace mode.
-(vip-deflocalvar vip-began-as-replace nil "")
+(viper-deflocalvar viper-began-as-replace nil "")
 
-(defcustom vip-allow-multiline-replace-regions t
+(defcustom viper-allow-multiline-replace-regions t
   "If non-nil, Viper will allow multi-line replace regions.
 This is an extension to standard Vi.
 If nil, commands that attempt to replace text spanning multiple lines first
@@ -312,114 +310,104 @@
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-replace-overlay-cursor-color "Red"
+(defcustom viper-replace-overlay-cursor-color "Red"
   "*Cursor color when Viper is in Replace state."
   :type 'string
   :group 'viper)
-(defcustom vip-insert-state-cursor-color "Green"
+(defcustom viper-insert-state-cursor-color "Green"
   "Cursor color when Viper is in insert state."
   :type 'string
   :group 'viper)
 
 ;; place to save cursor colow when switching to insert mode
-(vip-deflocalvar vip-saved-cursor-color nil "")
+(viper-deflocalvar viper-saved-cursor-color nil "")
   
-(vip-deflocalvar vip-replace-overlay nil "")
-(put 'vip-replace-overlay 'permanent-local t)
+(viper-deflocalvar viper-replace-overlay nil "")
+(put 'viper-replace-overlay 'permanent-local t)
 
-(defcustom vip-replace-overlay-pixmap "gray3"
-  "Pixmap to use for search face on non-color displays."
-  :type 'string
-  :group 'viper)
-(defcustom vip-search-face-pixmap "gray3"
-  "Pixmap to use for search face on non-color displays."
-  :type 'string
-  :group 'viper)
-
-
-(defcustom vip-replace-region-end-delimiter "$"
+(defcustom viper-replace-region-end-delimiter "$"
   "A string marking the end of replacement regions.
-It is used only with TTYs or if `vip-use-replace-region-delimiters'
+It is used only with TTYs or if `viper-use-replace-region-delimiters'
 is non-nil."
   :type 'string
   :group 'viper)
-(defcustom vip-replace-region-start-delimiter ""
+(defcustom viper-replace-region-start-delimiter ""
   "A string marking the beginning of replacement regions.
-It is used only with TTYs or if `vip-use-replace-region-delimiters'
+It is used only with TTYs or if `viper-use-replace-region-delimiters'
 is non-nil."
   :type 'string
   :group 'viper)
-(defcustom vip-use-replace-region-delimiters (not (vip-has-face-support-p))
-  "*If non-nil, Viper will always use `vip-replace-region-end-delimiter' and
-`vip-replace-region-start-delimiter' to delimit replacement regions, even on
+(defcustom viper-use-replace-region-delimiters (not (viper-has-face-support-p))
+  "*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
+`viper-replace-region-start-delimiter' to delimit replacement regions, even on
 color displays. By default, the delimiters are used only on TTYs."
   :type 'boolean
   :group 'viper)
   
 ;; XEmacs requires glyphs
-(if vip-xemacs-p
+(if viper-xemacs-p
     (progn
-      (or (glyphp vip-replace-region-end-delimiter)
-	  (setq vip-replace-region-end-delimiter
-		(make-glyph vip-replace-region-end-delimiter)))
-      (or (glyphp vip-replace-region-start-delimiter)
-	  (setq vip-replace-region-start-delimiter
-		(make-glyph vip-replace-region-start-delimiter)))
+      (or (glyphp viper-replace-region-end-delimiter)
+	  (setq viper-replace-region-end-delimiter
+		(make-glyph viper-replace-region-end-delimiter)))
+      (or (glyphp viper-replace-region-start-delimiter)
+	  (setq viper-replace-region-start-delimiter
+		(make-glyph viper-replace-region-start-delimiter)))
       ))
       
   
 ;; These are local marker that must be initialized to nil and moved with
-;; `vip-move-marker-locally'
+;; `viper-move-marker-locally'
 ;;
 ;; Remember the last position inside the replace region.
-(vip-deflocalvar vip-last-posn-in-replace-region nil)
+(viper-deflocalvar viper-last-posn-in-replace-region nil)
 ;; Remember the last position while inserting
-(vip-deflocalvar vip-last-posn-while-in-insert-state nil)
-(put 'vip-last-posn-in-replace-region 'permanent-local t)
-(put 'vip-last-posn-while-in-insert-state 'permanent-local t)
+(viper-deflocalvar viper-last-posn-while-in-insert-state nil)
+(put 'viper-last-posn-in-replace-region 'permanent-local t)
+(put 'viper-last-posn-while-in-insert-state 'permanent-local t)
 
-(vip-deflocalvar vip-sitting-in-replace nil "")
-(put 'vip-sitting-in-replace 'permanent-local t)
+(viper-deflocalvar viper-sitting-in-replace nil "")
+(put 'viper-sitting-in-replace 'permanent-local t)
   
 ;; Remember the number of characters that have to be deleted in replace
 ;; mode to compensate for the inserted characters.
-(vip-deflocalvar vip-replace-chars-to-delete 0 "")
-(vip-deflocalvar vip-replace-chars-deleted 0 "")
+(viper-deflocalvar viper-replace-chars-to-delete 0 "")
+(viper-deflocalvar viper-replace-chars-deleted 0 "")
 
 ;; Insertion ring and command ring
-(defcustom vip-insertion-ring-size 14
+(defcustom viper-insertion-ring-size 14
   "The size of history of inserted text.
 This is a list where Viper keeps the history of previously inserted pieces of
 text."
   :type 'integer
   :group 'viper)
 ;; The insertion ring.
-(defvar vip-insertion-ring nil)
+(defvar viper-insertion-ring nil)
 ;; This is temp insertion ring. Used to do rotation for display purposes.
-;; When rotation just started, it is initialized to vip-insertion-ring.
-(defvar vip-temp-insertion-ring nil)
-(defvar vip-last-inserted-string-from-insertion-ring "")
+;; When rotation just started, it is initialized to viper-insertion-ring.
+(defvar viper-temp-insertion-ring nil)
+(defvar viper-last-inserted-string-from-insertion-ring "")
 
-(defcustom vip-command-ring-size 14
+(defcustom viper-command-ring-size 14
   "The size of history of Vi commands repeatable with dot."
   :type 'integer
   :group 'viper)
 ;; The command ring.
-(defvar vip-command-ring nil)
+(defvar viper-command-ring nil)
 ;; This is temp command ring. Used to do rotation for display purposes.
-;; When rotation just started, it is initialized to vip-command-ring.
-(defvar vip-temp-command-ring nil)
+;; When rotation just started, it is initialized to viper-command-ring.
+(defvar viper-temp-command-ring nil)
 
 ;; Fast keyseq and ESC keyseq timeouts
-(defcustom vip-fast-keyseq-timeout 200
+(defcustom viper-fast-keyseq-timeout 200
   "*Key sequence separated by no more than this many milliseconds is viewed as a Vi-style macro, if such a macro is defined.
 Setting this too high may slow down your typing. Setting this value too low
 will make it hard to use Vi-stile timeout macros."
   :type 'integer
   :group 'viper)
 
-(defcustom vip-ESC-keyseq-timeout (if (vip-window-display-p)
-				      0 vip-fast-keyseq-timeout)
+(defcustom viper-ESC-keyseq-timeout (if (viper-window-display-p)
+				      0 viper-fast-keyseq-timeout)
   "*Key sequence beginning with ESC and separated by no more than this many milliseconds is considered to be generated by a keyboard function key.
 Setting this too high may slow down switching from insert to vi state. Setting
 this value too low will make it impossible to use function keys in insert mode
@@ -430,29 +418,29 @@
 ;; Modes and related variables
 
 ;; Current mode.  One of: `emacs-state', `vi-state', `insert-state'
-(vip-deflocalvar vip-current-state 'emacs-state)
+(viper-deflocalvar viper-current-state 'emacs-state)
 
 
 ;; Autoindent in insert
 
 ;; Variable that keeps track of whether C-t has been pressed.
-(vip-deflocalvar vip-cted nil "")
+(viper-deflocalvar viper-cted nil "")
 
 ;; Preserve the indent value, used by C-d in insert mode.
-(vip-deflocalvar vip-current-indent 0)
+(viper-deflocalvar viper-current-indent 0)
 
 ;; Whether to preserve the indent, used by C-d in insert mode.
-(vip-deflocalvar vip-preserve-indent nil)
+(viper-deflocalvar viper-preserve-indent nil)
 
-(vip-deflocalvar vip-auto-indent nil "")
-(defcustom vip-auto-indent nil
+(viper-deflocalvar viper-auto-indent nil "")
+(defcustom viper-auto-indent nil
   "*Enable autoindent, if t.
 This is a buffer-local variable."
   :type 'boolean
   :group 'viper)
 
-(vip-deflocalvar vip-electric-mode t "")
-(defcustom vip-electric-mode t
+(viper-deflocalvar viper-electric-mode t "")
+(defcustom viper-electric-mode t
   "*If t, electrify Viper.
 Currently, this only electrifies auto-indentation, making it appropriate to the
 mode of the buffer.
@@ -462,14 +450,14 @@
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-shift-width 8
+(defcustom viper-shift-width 8
   "*The shiftwidth variable."
   :type 'integer
   :group 'viper)
 
 ;; Variables for repeating destructive commands
 
-(defcustom vip-keep-point-on-repeat t
+(defcustom viper-keep-point-on-repeat t
   "*If t, don't move point when repeating previous command.
 This is useful for doing repeated changes with the '.' key.
 The user can change this to nil, if she likes when the cursor moves
@@ -478,40 +466,40 @@
   :group 'viper) 
 
 ;; Remember insert point as a marker.  This is a local marker that must be
-;; initialized to nil and moved with `vip-move-marker-locally'.
-(vip-deflocalvar vip-insert-point nil)
-(put 'vip-insert-point 'permanent-local t)
+;; initialized to nil and moved with `viper-move-marker-locally'.
+(viper-deflocalvar viper-insert-point nil)
+(put 'viper-insert-point 'permanent-local t)
 
 ;; This remembers the point before dabbrev-expand was called.
-;; If vip-insert-point turns out to be bigger than that, it is reset
-;; back to vip-pre-command-point.
+;; If viper-insert-point turns out to be bigger than that, it is reset
+;; back to viper-pre-command-point.
 ;; The reason this is needed is because dabbrev-expand (and possibly
 ;; others) may jump to before the insertion point, delete something and
 ;; then reinsert a bigger piece. For instance:  bla^blo
-;; If dabbrev-expand is called after `blo' and ^ undicates vip-insert-point,
+;; If dabbrev-expand is called after `blo' and ^ undicates viper-insert-point,
 ;; then point jumps to the beginning of `blo'. If expansion is found, `blablo'
 ;; is deleted, and we have |^, where | denotes point. Next, dabbrev-expand
 ;; will insert the expansion, and we get: blablo^
 ;; Whatever we insert next goes before the ^, i.e., before the
-;; vip-insert-point marker. So, Viper will think that nothing was
+;; viper-insert-point marker. So, Viper will think that nothing was
 ;; inserted. Remembering the orig position of the marker circumvents the
 ;; problem.
 ;; We don't know of any command, except dabbrev-expand, that has the same
 ;; problem. However, the same trick can be used if such a command is
 ;; discovered later.
 ;;
-(vip-deflocalvar vip-pre-command-point nil)
-(put 'vip-pre-command-point 'permanent-local t) ; this is probably an overkill
+(viper-deflocalvar viper-pre-command-point nil)
+(put 'viper-pre-command-point 'permanent-local t) ; this is probably an overkill
 
 ;; This is used for saving inserted text.
-(defvar vip-last-insertion  nil)
+(defvar viper-last-insertion  nil)
   
 ;; Remembers the last replaced region.
-(defvar vip-last-replace-region "")
+(defvar viper-last-replace-region "")
   
 ;; Remember com point as a marker.
-;; This is a local marker. Should be moved with `vip-move-marker-locally'
-(vip-deflocalvar vip-com-point nil)
+;; This is a local marker. Should be moved with `viper-move-marker-locally'
+(viper-deflocalvar viper-com-point nil)
 
 ;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys)
 ;; It is used to re-execute last destructive command.
@@ -523,53 +511,53 @@
 ;; INSERTED-TEXT is text inserted by that command (in case of o, c, C, i, r
 ;; commands).
 ;; COMMAND-KEYS are the keys that were typed to invoke the command.
-(defvar vip-d-com nil)
+(defvar viper-d-com nil)
 
 ;; The character remembered by the Vi `r' command.
-(defvar vip-d-char nil)
+(defvar viper-d-char nil)
 
 ;; Name of register to store deleted or yanked strings
-(defvar vip-use-register nil)
+(defvar viper-use-register nil)
 
 
 
 ;; Variables for Moves and Searches
 
 ;; For use by `;' command.
-(defvar vip-f-char nil)
+(defvar viper-f-char nil)
 
 ;; For use by `.' command.
-(defvar vip-F-char nil)
+(defvar viper-F-char nil)
 
 ;; For use by `;' command.
-(defvar vip-f-forward nil)
+(defvar viper-f-forward nil)
 
 ;; For use by `;' command.
-(defvar vip-f-offset nil)
+(defvar viper-f-offset nil)
 
 ;; Last search string
-(defvar vip-s-string "")
+(defvar viper-s-string "")
 
-(defcustom vip-quote-string "> "
+(defcustom viper-quote-string "> "
   "String inserted at the beginning of quoted region."
   :type 'string
   :group 'viper)
 
 ;; If t, search is forward.
-(defvar vip-s-forward nil)
+(defvar viper-s-forward nil)
 
-(defcustom vip-case-fold-search nil
+(defcustom viper-case-fold-search nil
   "*If not nil, search ignores cases."
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-re-search t
+(defcustom viper-re-search t
   "*If not nil, search is regexp search, otherwise vanilla search."
   :type 'boolean
   :tag "Regexp Search"
   :group 'viper)
 
-(defcustom vip-search-scroll-threshold 2
+(defcustom viper-search-scroll-threshold 2
   "*If search lands within this threshnold from the window top/bottom,
 the window will be scrolled up or down appropriately, to reveal context.
 If you want Viper search to behave as usual in Vi, set this variable to a
@@ -577,81 +565,81 @@
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-re-query-replace t
+(defcustom viper-re-query-replace t
   "*If t then do regexp replace, if nil then do string replace."
   :type 'boolean
   :tag "Regexp Query Replace"
   :group 'viper)
 
-(defcustom vip-re-replace t
+(defcustom viper-re-replace t
   "*If t, do regexp replace. nil means do string replace."
   :type 'boolean
   :tag "Regexp Replace"
   :group 'viper)
 
-(defcustom vip-parse-sexp-ignore-comments t
+(defcustom viper-parse-sexp-ignore-comments t
   "*If t, `%' ignores the parentheses that occur inside comments."
   :type 'boolean
   :group 'viper)
 
-(vip-deflocalvar vip-ex-style-motion t "")
-(defcustom vip-ex-style-motion t
+(viper-deflocalvar viper-ex-style-motion t "")
+(defcustom viper-ex-style-motion t
   "*If t, the commands l,h do not cross lines, etc (Ex-style).
 If nil, these commands cross line boundaries."
   :type 'boolean
   :group 'viper)
 
-(vip-deflocalvar vip-ex-style-editing-in-insert t "")
-(defcustom vip-ex-style-editing-in-insert t
+(viper-deflocalvar viper-ex-style-editing-in-insert t "")
+(defcustom viper-ex-style-editing-in-insert t
   "*If t, `Backspace' and `Delete' don't cross line boundaries in insert, etc.
 Note: this doesn't preclude `Backspace' and `Delete' from deleting characters
 by moving past the insertion point. This is a feature, not a bug."
   :type 'boolean
   :group 'viper)
 
-(vip-deflocalvar vip-ESC-moves-cursor-back vip-ex-style-editing-in-insert "")
-(defcustom vip-ESC-moves-cursor-back nil
+(viper-deflocalvar viper-ESC-moves-cursor-back viper-ex-style-editing-in-insert "")
+(defcustom viper-ESC-moves-cursor-back nil
   "*If t, ESC moves cursor back when changing from insert to vi state.
 If nil, the cursor stays where it was."
   :type 'boolean
   :group 'viper)
 
-(vip-deflocalvar vip-delete-backwards-in-replace nil "")
-(defcustom vip-delete-backwards-in-replace nil
+(viper-deflocalvar viper-delete-backwards-in-replace nil "")
+(defcustom viper-delete-backwards-in-replace nil
   "*If t, DEL key will delete characters while moving the cursor backwards.
 If nil, the cursor will move backwards without deleting anything."
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-buffer-search-char nil
+(defcustom viper-buffer-search-char nil
   "*Key used for buffer-searching. Must be a character type, e.g., ?g."
   :type '(choice (const nil) character)
   :group 'viper)
 
-(defcustom vip-search-wrap-around-t t
+(defcustom viper-search-wrap-around-t t
   "*If t, search wraps around."
   :type 'boolean
   :tag "Search Wraps Around"
   :group 'viper)
   
-(vip-deflocalvar vip-related-files-and-buffers-ring nil "")
-(defcustom vip-related-files-and-buffers-ring nil
+(viper-deflocalvar viper-related-files-and-buffers-ring nil "")
+(defcustom viper-related-files-and-buffers-ring nil
   "*List of file and buffer names that are considered to be related to the current buffer.
 Related buffers can be cycled through via :R and :P commands."
   :type 'boolean
   :group 'viper)
-(put 'vip-related-files-and-buffers-ring 'permanent-local t)
+(put 'viper-related-files-and-buffers-ring 'permanent-local t)
 
 ;; Used to find out if we are done with searching the current buffer.
-(vip-deflocalvar vip-local-search-start-marker nil)
+(viper-deflocalvar viper-local-search-start-marker nil)
 ;; As above, but global
-(defvar vip-search-start-marker (make-marker))
+(defvar viper-search-start-marker (make-marker))
 
 ;; the search overlay
-(vip-deflocalvar vip-search-overlay nil)
+(viper-deflocalvar viper-search-overlay nil)
 
 
-(defvar vip-heading-start 
+(defvar viper-heading-start 
   (concat "^\\s-*(\\s-*defun\\s-\\|"			        ; lisp
 	  "^{\\s-*$\\|^[_a-zA-Z][^()]*[()].*{\\s-*$\\|"	        ; C/C++
 	  "^\\s-*class.*{\\|^\\s-*struct.*{\\|^\\s-*enum.*{\\|"
@@ -660,7 +648,7 @@
 	  "^.+:-")			                        ; prolog
   "*Regexps for Headings. Used by \[\[ and \]\].")
 
-(defvar vip-heading-end 
+(defvar viper-heading-end 
   (concat "^}\\|"						; C/C++
 	  "^\\\\end{\\|"					; latex
 	  "^@end \\|"						; texinfo
@@ -675,106 +663,270 @@
 ;; inside the lines.
 
 ;; Remembers position of the last jump done using ``'.
-(vip-deflocalvar vip-last-jump  nil)
+(viper-deflocalvar viper-last-jump  nil)
 ;; Remembers position of the last jump done using `''.
-(vip-deflocalvar vip-last-jump-ignore 0)
+(viper-deflocalvar viper-last-jump-ignore 0)
 
 ;; History variables
 
 ;; History of search strings.
-(defvar vip-search-history  (list ""))
+(defvar viper-search-history  (list ""))
 ;; History of query-replace strings used as a source.
-(defvar vip-replace1-history nil)
+(defvar viper-replace1-history nil)
 ;; History of query-replace strings used as replacement.
-(defvar vip-replace2-history nil)
+(defvar viper-replace2-history nil)
 ;; History of region quoting strings.
-(defvar vip-quote-region-history (list vip-quote-string))
+(defvar viper-quote-region-history (list viper-quote-string))
 ;; History of Ex-style commands.
-(defvar vip-ex-history nil)
+(defvar viper-ex-history nil)
 ;; History of shell commands.
-(defvar vip-shell-history nil)
+(defvar viper-shell-history nil)
 
 
 ;; Last shell command. There are two of these, one for Ex (in viper-ex)
 ;; and one for Vi.
 
 ;; Last shell command executed with ! command.
-(defvar vip-last-shell-com nil)
+(defvar viper-last-shell-com nil)
+
+
+;;; Face-saving tricks
+
+;;(defcustom viper-replace-overlay-pixmap "gray3"
+;;  "Pixmap to use for search face on non-color displays."
+;;  :type 'string
+;;  :group 'viper)
+;;(defcustom viper-search-face-pixmap "gray3"
+;;  "Pixmap to use for search face on non-color displays."
+;;  :type 'string
+;;  :group 'viper)
+
+(defun viper-hide-face (face)
+  (if (and (viper-has-face-support-p) viper-emacs-p)
+      (add-to-list 'facemenu-unlisted-faces face)))
+
+
+(defgroup viper-highlighting nil
+  "Hilighting of replace region, search pattern, minibuffer, etc."
+  :prefix "viper-"
+  :group 'viper)
+
+;;(defvar viper-search-face
+;;  (if (viper-has-face-support-p)
+;;      (progn
+;;	(make-face 'viper-search-face)
+;;	(or (face-differs-from-default-p 'viper-search-face)
+;;	    ;; face wasn't set in .viper or .Xdefaults
+;;	    (if (viper-can-use-colors "Black" "khaki")
+;;		(progn
+;;		  (set-face-background 'viper-search-face "khaki")
+;;		  (set-face-foreground 'viper-search-face "Black"))
+;;	      (set-face-underline-p 'viper-search-face t)
+;;	      (viper-set-face-pixmap 'viper-search-face
+;;				     viper-search-face-pixmap))) 
+;;	'viper-search-face))
+;;  "*Face used to flash out the search pattern.")
+
+(defface viper-search-face
+  '((((class color)) (:foreground "Black" :background "khaki"))
+    (t (:underline t :stipple "gray3")))
+  "*Face used to flash out the search pattern."
+  :group 'viper-highlighting)
+;; An internal variable. Viper takes the face from here.
+(defvar viper-search-face 'viper-search-face)
+(viper-hide-face 'viper-search-face)
+  
+;;(defvar viper-replace-overlay-face
+;;  (if (viper-has-face-support-p)
+;;      (progn
+;;	(make-face 'viper-replace-overlay-face)
+;;	(or (face-differs-from-default-p 'viper-replace-overlay-face)
+;;	    (progn
+;;	      (if (viper-can-use-colors "darkseagreen2" "Black")
+;;		  (progn
+;;		    (set-face-background
+;;		     'viper-replace-overlay-face "darkseagreen2")
+;;		    (set-face-foreground 'viper-replace-overlay-face "Black")))
+;;	      (set-face-underline-p 'viper-replace-overlay-face t)
+;;	      (viper-set-face-pixmap
+;;	       'viper-replace-overlay-face viper-replace-overlay-pixmap)))
+;;	'viper-replace-overlay-face))
+;;  "*Face for highlighting replace regions on a window display.")
+
+(defface viper-replace-overlay-face
+  '((((class color)) (:foreground "Black" :background "darkseagreen2"))
+    (t (:underline t :stipple "gray3")))
+  "*Face for highlighting replace regions on a window display."
+  :group 'viper-highlighting)
+;; An internal variable. Viper takes the face from here.
+(defvar viper-replace-overlay-face 'viper-replace-overlay-face)
+(viper-hide-face 'viper-replace-overlay-face)
 
+;;(defvar viper-minibuffer-emacs-face
+;;  (if (viper-has-face-support-p)
+;;      (progn
+;;	(make-face 'viper-minibuffer-emacs-face)
+;;	(or (face-differs-from-default-p 'viper-minibuffer-emacs-face)
+;;	    ;; face wasn't set in .viper or .Xdefaults
+;;	    (if viper-vi-style-in-minibuffer
+;;		;; emacs state is an exception in the minibuffer
+;;		(if (viper-can-use-colors "darkseagreen2" "Black")
+;;		    (progn
+;;		      (set-face-background
+;;		       'viper-minibuffer-emacs-face "darkseagreen2")
+;;		      (set-face-foreground
+;;		       'viper-minibuffer-emacs-face "Black"))
+;;		  (copy-face 'modeline 'viper-minibuffer-emacs-face))
+;;	      ;; emacs state is the main state in the minibuffer
+;;	      (if (viper-can-use-colors "Black" "pink")
+;;		  (progn
+;;		    (set-face-background 'viper-minibuffer-emacs-face "pink") 
+;;		    (set-face-foreground
+;;		     'viper-minibuffer-emacs-face "Black"))
+;;		(copy-face 'italic 'viper-minibuffer-emacs-face))
+;;	      ))
+;;	'viper-minibuffer-emacs-face))
+;;  "Face used in the Minibuffer when it is in Emacs state.")
+
+(defface viper-minibuffer-emacs-face
+  '((((class color)) (:foreground "Black" :background "darkseagreen2"))
+    (t (:bold t)))
+  "Face used in the Minibuffer when it is in Emacs state."
+  :group 'viper-highlighting)
+;; An internal variable. Viper takes the face from here.
+(defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs-face)
+(viper-hide-face 'viper-minibuffer-emacs-face)
+    
+;;(defvar viper-minibuffer-insert-face
+;;  (if (viper-has-face-support-p)
+;;      (progn
+;;	(make-face 'viper-minibuffer-insert-face)
+;;	(or (face-differs-from-default-p 'viper-minibuffer-insert-face)
+;;	    (if viper-vi-style-in-minibuffer
+;;		(if (viper-can-use-colors "Black" "pink")
+;;		    (progn
+;;		      (set-face-background 'viper-minibuffer-insert-face "pink") 
+;;		      (set-face-foreground
+;;		       'viper-minibuffer-insert-face "Black"))
+;;		  (copy-face 'italic 'viper-minibuffer-insert-face))
+;;	      ;; If Insert state is an exception
+;;	      (if (viper-can-use-colors "darkseagreen2" "Black")
+;;		  (progn
+;;		    (set-face-background
+;;		     'viper-minibuffer-insert-face "darkseagreen2")
+;;		    (set-face-foreground
+;;		     'viper-minibuffer-insert-face "Black"))
+;;		(copy-face 'modeline 'viper-minibuffer-insert-face))
+;;	      (viper-italicize-face 'viper-minibuffer-insert-face)))
+;;	'viper-minibuffer-insert-face))
+;;  "Face used in the Minibuffer when it is in Insert state.")
+
+(defface viper-minibuffer-insert-face
+  '((((class color)) (:foreground "Black" :background "pink"))
+    (t (:italic t)))
+  "Face used in the Minibuffer when it is in Insert state."
+  :group 'viper-highlighting)
+;; An internal variable. Viper takes the face from here.
+(defvar viper-minibuffer-insert-face 'viper-minibuffer-insert-face)
+(viper-hide-face 'viper-minibuffer-insert-face)
+    
+;;(defvar viper-minibuffer-vi-face
+;;  (if (viper-has-face-support-p)
+;;      (progn
+;;	(make-face 'viper-minibuffer-vi-face)
+;;	(or (face-differs-from-default-p 'viper-minibuffer-vi-face)
+;;	    (if viper-vi-style-in-minibuffer
+;;		(if (viper-can-use-colors "Black" "grey")
+;;		    (progn
+;;		      (set-face-background 'viper-minibuffer-vi-face "grey")
+;;		      (set-face-foreground 'viper-minibuffer-vi-face "Black"))
+;;		  (copy-face 'bold 'viper-minibuffer-vi-face))
+;;	      (copy-face 'bold 'viper-minibuffer-vi-face)
+;;	      (invert-face 'viper-minibuffer-vi-face)))
+;;	'viper-minibuffer-vi-face))
+;;  "Face used in the Minibuffer when it is in Vi state.")
+
+(defface viper-minibuffer-vi-face
+  '((((class color)) (:foreground "DarkGreen" :background "grey"))
+    (t (:inverse-video t)))
+  "Face used in the Minibuffer when it is in Vi state."
+  :group 'viper-highlighting)
+;; An internal variable. Viper takes the face from here.
+(defvar viper-minibuffer-vi-face 'viper-minibuffer-vi-face)
+(viper-hide-face 'viper-minibuffer-vi-face)
+    
+;; the current face to be used in the minibuffer
+(viper-deflocalvar viper-minibuffer-current-face viper-minibuffer-emacs-face "")
 
 
 ;;; Miscellaneous
 
-(defvar vip-inhibit-startup-message nil
+(defvar viper-inhibit-startup-message nil
   "Whether Viper startup message should be inhibited.")
 
-(defcustom vip-spell-function 'ispell-region
+(defcustom viper-spell-function 'ispell-region
   "Spell function used by #s<move> command to spell."
   :type 'function
   :group 'viper)
 
-(defcustom vip-tags-file-name "TAGS"
+(defcustom viper-tags-file-name "TAGS"
   "The tags file used by Viper."
   :type 'string
   :group 'viper)
 
-;; Indicates if we are in the middle of executing a command that takes another
-;; command as an argument, e.g., cw, dw, etc.
-(defvar vip-inside-command-argument-action nil)
-
 ;; Minibuffer
 
-(defcustom vip-vi-style-in-minibuffer t
+(defcustom viper-vi-style-in-minibuffer t
   "If t, use vi-style editing in minibuffer.
-Should be set in `~/.vip' file."
+Should be set in `~/.viper' file."
   :type 'boolean
   :group 'viper)
   
 ;; overlay used in the minibuffer to indicate which state it is in
-(vip-deflocalvar vip-minibuffer-overlay nil)
+(viper-deflocalvar viper-minibuffer-overlay nil)
 
 ;; Hook, specific to Viper, which is run just *before* exiting the minibuffer.
 ;; Beginning with Emacs 19.26, the standard `minibuffer-exit-hook' is run
 ;; *after* exiting the minibuffer
-(defvar vip-minibuffer-exit-hook nil)
+(defvar viper-minibuffer-exit-hook nil)
        
 
 ;; Mode line
-(defconst vip-vi-state-id  	"<V> "
+(defconst viper-vi-state-id  	"<V> "
   "Mode line tag identifying the Vi mode of Viper.")
-(defconst vip-emacs-state-id	"<E> "
+(defconst viper-emacs-state-id	"<E> "
   "Mode line tag identifying the Emacs mode of Viper.")
-(defconst vip-insert-state-id	"<I> "
+(defconst viper-insert-state-id	"<I> "
   "Mode line tag identifying the Insert mode of Viper.")
-(defconst vip-replace-state-id	"<R> "
+(defconst viper-replace-state-id	"<R> "
   "Mode line tag identifying the Replace mode of Viper.")
 
 
-(defcustom vip-vi-state-hook nil
+(defcustom viper-vi-state-hook nil
   "*Hooks run just before the switch to Vi mode is completed."
   :type 'hook
   :group 'viper)
-(defcustom vip-insert-state-hook nil
+(defcustom viper-insert-state-hook nil
   "*Hooks run just before the switch to Insert mode is completed."
   :type 'hook
   :group 'viper)
-(defcustom vip-replace-state-hook nil
+(defcustom viper-replace-state-hook nil
   "*Hooks run just before the switch to Replace mode is completed."
   :type 'hook
   :group 'viper)
-(defcustom vip-emacs-state-hook nil
+(defcustom viper-emacs-state-hook nil
   "*Hooks run just before the switch to Emacs mode is completed."
   :type 'hook
   :group 'viper)
   
-(defcustom vip-load-hook nil
+(defcustom viper-load-hook nil
   "Hooks run just after loading Viper."
   :type 'hook
   :group 'viper)
   
 
 ;;; Local Variables:
-;;; eval: (put 'vip-deflocalvar 'lisp-indent-hook 'defun)
+;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
 ;;; End:
 
 ;;;  viper-ex.el ends here
--- a/lisp/viper/viper-keym.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-keym.el	Mon Aug 13 09:53:19 2007 +0200
@@ -25,11 +25,11 @@
 
 ;; compiler pacifier
 (defvar viper-always)
-(defvar vip-current-state)
-(defvar vip-mode-string)
+(defvar viper-current-state)
+(defvar viper-mode-string)
 (defvar viper-expert-level)
-(defvar vip-ex-style-editing-in-insert)
-(defvar vip-ex-style-motion)
+(defvar viper-ex-style-editing-in-insert)
+(defvar viper-ex-style-motion)
 
 ;; loading happens only in non-interactive compilation
 ;; in order to spare non-viperized emacs from being viperized
@@ -46,43 +46,43 @@
 
 ;;; Variables
 
-(defvar vip-toggle-key "\C-z"
+(defvar viper-toggle-key "\C-z"
   "The key used to change states from emacs to Vi and back.
 In insert mode, this key also functions as Meta. 
-Must be set in .vip file or prior to loading Viper.
+Must be set in .viper file or prior to loading Viper.
 This setting cannot be changed interactively.")
 
-(defvar vip-ESC-key "\e" 
+(defvar viper-ESC-key "\e" 
   "Key used to ESC. 
-Must be set in .vip file or prior to loading Viper.
+Must be set in .viper file or prior to loading Viper.
 This setting cannot be changed interactively.")
   
 ;;; Emacs keys in other states.  
 
-(defcustom vip-want-emacs-keys-in-insert t
+(defcustom viper-want-emacs-keys-in-insert t
   "*Set to nil if you want complete Vi compatibility in insert mode.
 Complete compatibility with Vi is not recommended for power use of Viper."
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-want-emacs-keys-in-vi t
+(defcustom viper-want-emacs-keys-in-vi t
   "*Set to nil if you want complete Vi compatibility in Vi mode.
 Full Vi compatibility is not recommended for power use of Viper."
   :type 'boolean
   :group 'viper)
 
-(defcustom vip-no-multiple-ESC  t
+(defcustom viper-no-multiple-ESC  t
   "*If true, multiple ESC in Vi mode will cause bell to ring.
 This is set to t on a windowing terminal and to 'twice on a dumb
 terminal (unless the user level is 1, 2, or 5). On a dumb terminal, this
 enables cursor keys and is generally more convenient, as terminals usually
 don't have a convenient Meta key.
-Setting vip-no-multiple-ESC to nil will allow as many multiple ESC,
+Setting viper-no-multiple-ESC to nil will allow as many multiple ESC,
 as is allowed by the major mode in effect."
   :type 'boolean
   :group 'viper) 
 
-(defcustom vip-want-ctl-h-help nil
+(defcustom viper-want-ctl-h-help nil
   "*If t then C-h is bound to help-command in insert mode, if nil then it is
 bound to delete-backward-char."
   :type 'boolean
@@ -93,76 +93,76 @@
 
 ;; Keymaps for vital things like \e and C-z.
 ;; Not for users
-(defvar vip-vi-intercept-map (make-sparse-keymap))
-(defvar vip-insert-intercept-map (make-sparse-keymap))
-(defvar vip-emacs-intercept-map (make-sparse-keymap))
+(defvar viper-vi-intercept-map (make-sparse-keymap))
+(defvar viper-insert-intercept-map (make-sparse-keymap))
+(defvar viper-emacs-intercept-map (make-sparse-keymap))
 
 ;; keymap used to zap all keymaps other than function-key-map,
 ;; device-function-key-map, etc.
-(defvar vip-overriding-map (make-sparse-keymap))
+(defvar viper-overriding-map (make-sparse-keymap))
   
-(vip-deflocalvar vip-vi-local-user-map (make-sparse-keymap)
+(viper-deflocalvar viper-vi-local-user-map (make-sparse-keymap)
   "Keymap for user-defined local bindings.
 Useful for changing bindings such as ZZ in certain major modes.
 For instance, in letter-mode, one may want to bind ZZ to
 mh-send-letter. In a newsreader such as gnus, tin, or rn, ZZ could be bound
 to save-buffers-kill-emacs then post article, etc.")
-(put 'vip-vi-local-user-map 'permanent-local t)	
+(put 'viper-vi-local-user-map 'permanent-local t)	
 
-(defvar vip-vi-global-user-map (make-sparse-keymap)
+(defvar viper-vi-global-user-map (make-sparse-keymap)
   "Keymap for user-defined global bindings.
 These bindings are seen in all Viper buffers.")
 
-(defvar vip-vi-basic-map (make-keymap)
+(defvar viper-vi-basic-map (make-keymap)
   "This is the main keymap in effect in Viper's Vi state.
 This map is global, shared by all buffers.")
 
-(defvar  vip-vi-kbd-map (make-sparse-keymap)
+(defvar  viper-vi-kbd-map (make-sparse-keymap)
   "This keymap keeps keyboard macros defined via the :map command.")
 
-(defvar vip-vi-diehard-map (make-sparse-keymap)
+(defvar viper-vi-diehard-map (make-sparse-keymap)
   "This keymap is in use when the user asks Viper to simulate Vi very closely.
 This happens when viper-expert-level is 1 or 2. See viper-set-expert-level.")
   
 
-(vip-deflocalvar vip-insert-local-user-map (make-sparse-keymap)
+(viper-deflocalvar viper-insert-local-user-map (make-sparse-keymap)
   "Auxiliary map for per-buffer user-defined keybindings in Insert state.")
-(put 'vip-insert-local-user-map 'permanent-local t)	
+(put 'viper-insert-local-user-map 'permanent-local t)	
 
-(defvar vip-insert-global-user-map (make-sparse-keymap)
+(defvar viper-insert-global-user-map (make-sparse-keymap)
   "Auxiliary map for global user-defined bindings in Insert state.")
 
-(defvar vip-insert-basic-map (make-sparse-keymap)
+(defvar viper-insert-basic-map (make-sparse-keymap)
   "The basic insert-mode keymap.")
 
-(defvar vip-insert-diehard-map (make-keymap)
+(defvar viper-insert-diehard-map (make-keymap)
   "Map used when user wants vi-style keys in insert mode.
 Most of the Emacs keys are suppressed. This map overshadows
-vip-insert-basic-map. Not recommended, except for novice users.")
+viper-insert-basic-map. Not recommended, except for novice users.")
 
-(defvar  vip-insert-kbd-map  (make-sparse-keymap)
+(defvar  viper-insert-kbd-map  (make-sparse-keymap)
   "This keymap keeps VI-style kbd macros for insert mode.")
 
-(defvar vip-replace-map (make-sparse-keymap)
+(defvar viper-replace-map (make-sparse-keymap)
   "Map used in Viper's replace state.")
   
-(defvar vip-emacs-global-user-map (make-sparse-keymap)
+(defvar viper-emacs-global-user-map (make-sparse-keymap)
   "Auxiliary map for global user-defined bindings in Emacs state.")
 
-(defvar  vip-emacs-kbd-map  (make-sparse-keymap)
+(defvar  viper-emacs-kbd-map  (make-sparse-keymap)
   "This keymap keeps Vi-style kbd macros for emacs mode.")
   
-(vip-deflocalvar vip-emacs-local-user-map  (make-sparse-keymap)
+(viper-deflocalvar viper-emacs-local-user-map  (make-sparse-keymap)
   "Auxiliary map for local user-defined bindings in Emacs state.")
-(put 'vip-emacs-local-user-map 'permanent-local t)  
+(put 'viper-emacs-local-user-map 'permanent-local t)  
 
 ;; This keymap should stay empty
-(defvar vip-empty-keymap (make-sparse-keymap))
+(defvar viper-empty-keymap (make-sparse-keymap))
 
 ;; This was the main Vi mode in old versions of VIP which may have been
 ;; extensively used by VIP users. We declare it as a global var
-;; and, after .vip is loaded, we add this keymap to vip-vi-basic-map.
-(defvar vip-mode-map (make-sparse-keymap))
+;; and, after .viper is loaded, we add this keymap to viper-vi-basic-map.
+(defvar viper-mode-map (make-sparse-keymap))
 
 
 ;;; Variables used by minor modes
@@ -171,296 +171,296 @@
 ;; ((major-mode . keymap) (major-mode . keymap) ...)
 ;; Viper uses these keymaps to make user-requested adjustments
 ;; to its Vi state in various major modes.")
-(defvar vip-vi-state-modifier-alist nil)
+(defvar viper-vi-state-modifier-alist nil)
 
 ;; Association list of the form 
 ;; ((major-mode . keymap) (major-mode . keymap) ...)
 ;; Viper uses these keymaps to make user-requested adjustments
 ;; to its Insert state in various major modes.")
-(defvar vip-insert-state-modifier-alist nil)
+(defvar viper-insert-state-modifier-alist nil)
 
 ;; Association list of the form 
 ;; ((major-mode . keymap) (major-mode . keymap) ...)
 ;; Viper uses these keymaps to make user-requested adjustments
 ;; to its Emacs state in various major modes.
-(defvar vip-emacs-state-modifier-alist nil)
+(defvar viper-emacs-state-modifier-alist nil)
 
-;; Tells vip-add-local-keys to create a new vip-vi-local-user-map for new
+;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new
 ;; buffers. Not a user option.
-(vip-deflocalvar vip-need-new-vi-local-map t "")
-(put 'vip-need-new-vi-local-map  'permanent-local t)
+(viper-deflocalvar viper-need-new-vi-local-map t "")
+(put 'viper-need-new-vi-local-map  'permanent-local t)
 
-;; Tells vip-add-local-keys to create a new vip-insert-local-user-map for new
-;; buffers. Not a user option.
-(vip-deflocalvar vip-need-new-insert-local-map t "")
-(put 'vip-need-new-insert-local-map  'permanent-local t)
+;; Tells viper-add-local-keys to create a new viper-insert-local-user-map for
+;; new buffers. Not a user option.
+(viper-deflocalvar viper-need-new-insert-local-map t "")
+(put 'viper-need-new-insert-local-map  'permanent-local t)
 
-;; Tells vip-add-local-keys to create a new vip-emacs-local-user-map for new
-;; buffers. Not a user option.
-(vip-deflocalvar vip-need-new-emacs-local-map t "")
-(put 'vip-need-new-emacs-local-map  'permanent-local t)
+;; Tells viper-add-local-keys to create a new viper-emacs-local-user-map for
+;; new buffers. Not a user option.
+(viper-deflocalvar viper-need-new-emacs-local-map t "")
+(put 'viper-need-new-emacs-local-map  'permanent-local t)
 
 
 
 ;; Insert mode keymap
 
 ;; for novice users, pretend you are the real vi.
-(define-key vip-insert-diehard-map "\t"   'vip-insert-tab)
-(define-key vip-insert-diehard-map "\C-a" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-b" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-c" 'vip-change-state-to-vi)
-(define-key vip-insert-diehard-map "\C-e" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-f" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-g" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-i" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-k" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-l" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-n" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-o" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-p" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-q" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-r" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-s" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-u" 'vip-erase-line)
-(define-key vip-insert-diehard-map "\C-x" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-y" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-z" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-]" 'self-insert-command)
-(define-key vip-insert-diehard-map "\C-_" 'self-insert-command)
+(define-key viper-insert-diehard-map "\t"   'viper-insert-tab)
+(define-key viper-insert-diehard-map "\C-a" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-b" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-c" 'viper-change-state-to-vi)
+(define-key viper-insert-diehard-map "\C-e" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-f" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-g" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-i" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-k" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-l" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-n" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-o" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-p" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-q" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-r" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-s" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-u" 'viper-erase-line)
+(define-key viper-insert-diehard-map "\C-x" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-y" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-z" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-]" 'self-insert-command)
+(define-key viper-insert-diehard-map "\C-_" 'self-insert-command)
 
 (let ((i ?\ ))
   (while (<= i ?~)
-    (define-key vip-insert-diehard-map (make-string 1 i) 'self-insert-command)
+    (define-key viper-insert-diehard-map (make-string 1 i) 'self-insert-command)
     (setq i (1+ i))))
 
 ;; Insert mode map when user wants emacs style
-(define-key vip-insert-basic-map "\C-d" 'vip-backward-indent)
-(define-key vip-insert-basic-map "\C-w" 'vip-delete-backward-word)
-(define-key vip-insert-basic-map "\C-t" 'vip-forward-indent)
-(define-key vip-insert-basic-map 
-  (if vip-xemacs-p [(shift tab)] [S-tab]) 'vip-insert-tab)
-(define-key vip-insert-basic-map "\C-v" 'quoted-insert)
-(define-key vip-insert-basic-map "\C-?" 'vip-del-backward-char-in-insert)
-(define-key vip-insert-basic-map "\C-\\" 'vip-alternate-Meta-key)
-(define-key vip-insert-basic-map vip-toggle-key 'vip-escape-to-vi)
-(define-key vip-insert-basic-map "\C-c\M-p"
-  'vip-insert-prev-from-insertion-ring)
-(define-key vip-insert-basic-map "\C-c\M-n"
-  'vip-insert-next-from-insertion-ring)
+(define-key viper-insert-basic-map "\C-d" 'viper-backward-indent)
+(define-key viper-insert-basic-map "\C-w" 'viper-delete-backward-word)
+(define-key viper-insert-basic-map "\C-t" 'viper-forward-indent)
+(define-key viper-insert-basic-map 
+  (if viper-xemacs-p [(shift tab)] [S-tab]) 'viper-insert-tab)
+(define-key viper-insert-basic-map "\C-v" 'quoted-insert)
+(define-key viper-insert-basic-map "\C-?" 'viper-del-backward-char-in-insert)
+(define-key viper-insert-basic-map "\C-\\" 'viper-alternate-Meta-key)
+(define-key viper-insert-basic-map viper-toggle-key 'viper-escape-to-vi)
+(define-key viper-insert-basic-map "\C-c\M-p"
+  'viper-insert-prev-from-insertion-ring)
+(define-key viper-insert-basic-map "\C-c\M-n"
+  'viper-insert-next-from-insertion-ring)
 
 
 ;; Replace keymap
-(define-key vip-replace-map "\C-t" 'vip-forward-indent)
-(define-key vip-replace-map "\C-j" 'vip-replace-state-carriage-return)
-(define-key vip-replace-map "\C-m" 'vip-replace-state-carriage-return)
-(define-key vip-replace-map "\C-?" 'vip-del-backward-char-in-replace)
+(define-key viper-replace-map "\C-t" 'viper-forward-indent)
+(define-key viper-replace-map "\C-j" 'viper-replace-state-carriage-return)
+(define-key viper-replace-map "\C-m" 'viper-replace-state-carriage-return)
+(define-key viper-replace-map "\C-?" 'viper-del-backward-char-in-replace)
 
 
 
 ;; Vi keymaps
 
-(define-key vip-vi-basic-map "\C-^" 
-  (function (lambda () (interactive) (vip-ex "e#"))))
-(define-key vip-vi-basic-map "\C-b" 'vip-scroll-screen-back)
-(define-key vip-vi-basic-map "\C-d" 'vip-scroll-up)
-(define-key vip-vi-basic-map "\C-e" 'vip-scroll-up-one)
-(define-key vip-vi-basic-map "\C-f" 'vip-scroll-screen)
-(define-key vip-vi-basic-map "\C-m" 'vip-next-line-at-bol)
-(define-key vip-vi-basic-map "\C-u" 'vip-scroll-down)
-(define-key vip-vi-basic-map "\C-y" 'vip-scroll-down-one)
-(define-key vip-vi-basic-map "\C-s" 'vip-isearch-forward)
-(define-key vip-vi-basic-map "\C-r" 'vip-isearch-backward)
-(define-key vip-vi-basic-map "\C-c/" 'vip-toggle-search-style)
-(define-key vip-vi-basic-map "\C-cg" 'vip-info-on-file)
+(define-key viper-vi-basic-map "\C-^" 
+  (function (lambda () (interactive) (viper-ex "e#"))))
+(define-key viper-vi-basic-map "\C-b" 'viper-scroll-screen-back)
+(define-key viper-vi-basic-map "\C-d" 'viper-scroll-up)
+(define-key viper-vi-basic-map "\C-e" 'viper-scroll-up-one)
+(define-key viper-vi-basic-map "\C-f" 'viper-scroll-screen)
+(define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)
+(define-key viper-vi-basic-map "\C-u" 'viper-scroll-down)
+(define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one)
+(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward)
+(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward)
+(define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style)
+(define-key viper-vi-basic-map "\C-cg" 'viper-info-on-file)
 
-(define-key vip-vi-basic-map "\C-c\M-p" 'vip-prev-destructive-command)
-(define-key vip-vi-basic-map "\C-c\M-n" 'vip-next-destructive-command)
+(define-key viper-vi-basic-map "\C-c\M-p" 'viper-prev-destructive-command)
+(define-key viper-vi-basic-map "\C-c\M-n" 'viper-next-destructive-command)
 
 
-(define-key vip-vi-basic-map " " 'vip-forward-char)
-(define-key vip-vi-basic-map "!" 'vip-command-argument)
-(define-key vip-vi-basic-map "\"" 'vip-command-argument)
-(define-key vip-vi-basic-map "#" 'vip-command-argument)
-(define-key vip-vi-basic-map "$" 'vip-goto-eol)
-(define-key vip-vi-basic-map "%" 'vip-paren-match)
-(define-key vip-vi-basic-map "&"
-  (function (lambda () (interactive) (vip-ex "&"))))
-(define-key vip-vi-basic-map "'" 'vip-goto-mark-and-skip-white)
-(define-key vip-vi-basic-map "(" 'vip-backward-sentence)
-(define-key vip-vi-basic-map ")" 'vip-forward-sentence)
-(define-key vip-vi-basic-map "*" 'call-last-kbd-macro)
-(define-key vip-vi-basic-map "+" 'vip-next-line-at-bol)
-(define-key vip-vi-basic-map "," 'vip-repeat-find-opposite)
-(define-key vip-vi-basic-map "-" 'vip-previous-line-at-bol)
-(define-key vip-vi-basic-map "." 'vip-repeat)
-(define-key vip-vi-basic-map "/" 'vip-search-forward)
+(define-key viper-vi-basic-map " " 'viper-forward-char)
+(define-key viper-vi-basic-map "!" 'viper-command-argument)
+(define-key viper-vi-basic-map "\"" 'viper-command-argument)
+(define-key viper-vi-basic-map "#" 'viper-command-argument)
+(define-key viper-vi-basic-map "$" 'viper-goto-eol)
+(define-key viper-vi-basic-map "%" 'viper-paren-match)
+(define-key viper-vi-basic-map "&"
+  (function (lambda () (interactive) (viper-ex "&"))))
+(define-key viper-vi-basic-map "'" 'viper-goto-mark-and-skip-white)
+(define-key viper-vi-basic-map "(" 'viper-backward-sentence)
+(define-key viper-vi-basic-map ")" 'viper-forward-sentence)
+(define-key viper-vi-basic-map "*" 'call-last-kbd-macro)
+(define-key viper-vi-basic-map "+" 'viper-next-line-at-bol)
+(define-key viper-vi-basic-map "," 'viper-repeat-find-opposite)
+(define-key viper-vi-basic-map "-" 'viper-previous-line-at-bol)
+(define-key viper-vi-basic-map "." 'viper-repeat)
+(define-key viper-vi-basic-map "/" 'viper-search-forward)
 
-(define-key vip-vi-basic-map "0" 'vip-beginning-of-line)
-(define-key vip-vi-basic-map "1" 'vip-digit-argument)
-(define-key vip-vi-basic-map "2" 'vip-digit-argument)
-(define-key vip-vi-basic-map "3" 'vip-digit-argument)
-(define-key vip-vi-basic-map "4" 'vip-digit-argument)
-(define-key vip-vi-basic-map "5" 'vip-digit-argument)
-(define-key vip-vi-basic-map "6" 'vip-digit-argument)
-(define-key vip-vi-basic-map "7" 'vip-digit-argument)
-(define-key vip-vi-basic-map "8" 'vip-digit-argument)
-(define-key vip-vi-basic-map "9" 'vip-digit-argument)
+(define-key viper-vi-basic-map "0" 'viper-beginning-of-line)
+(define-key viper-vi-basic-map "1" 'viper-digit-argument)
+(define-key viper-vi-basic-map "2" 'viper-digit-argument)
+(define-key viper-vi-basic-map "3" 'viper-digit-argument)
+(define-key viper-vi-basic-map "4" 'viper-digit-argument)
+(define-key viper-vi-basic-map "5" 'viper-digit-argument)
+(define-key viper-vi-basic-map "6" 'viper-digit-argument)
+(define-key viper-vi-basic-map "7" 'viper-digit-argument)
+(define-key viper-vi-basic-map "8" 'viper-digit-argument)
+(define-key viper-vi-basic-map "9" 'viper-digit-argument)
 
-(define-key vip-vi-basic-map ":" 'vip-ex)
-(define-key vip-vi-basic-map ";" 'vip-repeat-find)
-(define-key vip-vi-basic-map "<" 'vip-command-argument)
-(define-key vip-vi-basic-map "=" 'vip-command-argument)
-(define-key vip-vi-basic-map ">" 'vip-command-argument)
-(define-key vip-vi-basic-map "?" 'vip-search-backward)
-(define-key vip-vi-basic-map "@" 'vip-register-macro)
+(define-key viper-vi-basic-map ":" 'viper-ex)
+(define-key viper-vi-basic-map ";" 'viper-repeat-find)
+(define-key viper-vi-basic-map "<" 'viper-command-argument)
+(define-key viper-vi-basic-map "=" 'viper-command-argument)
+(define-key viper-vi-basic-map ">" 'viper-command-argument)
+(define-key viper-vi-basic-map "?" 'viper-search-backward)
+(define-key viper-vi-basic-map "@" 'viper-register-macro)
 
-(define-key vip-vi-basic-map "A" 'vip-Append)
-(define-key vip-vi-basic-map "B" 'vip-backward-Word)
-(define-key vip-vi-basic-map "C" 'vip-change-to-eol)
-(define-key vip-vi-basic-map "D" 'vip-kill-line)
-(define-key vip-vi-basic-map "E" 'vip-end-of-Word)
-(define-key vip-vi-basic-map "F" 'vip-find-char-backward)
-(define-key vip-vi-basic-map "G" 'vip-goto-line)
-(define-key vip-vi-basic-map "H" 'vip-window-top)
-(define-key vip-vi-basic-map "I" 'vip-Insert)
-(define-key vip-vi-basic-map "J" 'vip-join-lines)
-(define-key vip-vi-basic-map "K" 'vip-nil)
-(define-key vip-vi-basic-map "L" 'vip-window-bottom)
-(define-key vip-vi-basic-map "M" 'vip-window-middle)
-(define-key vip-vi-basic-map "N" 'vip-search-Next)
-(define-key vip-vi-basic-map "O" 'vip-Open-line)
-(define-key vip-vi-basic-map "P" 'vip-Put-back)
-(define-key vip-vi-basic-map "Q" 'vip-query-replace)
-(define-key vip-vi-basic-map "R" 'vip-overwrite)
-(define-key vip-vi-basic-map "S" 'vip-substitute-line)
-(define-key vip-vi-basic-map "T" 'vip-goto-char-backward)
-(define-key vip-vi-basic-map "U" 'vip-undo)
-(define-key vip-vi-basic-map "V" 'find-file-other-window)
-(define-key vip-vi-basic-map "W" 'vip-forward-Word)
-(define-key vip-vi-basic-map "X" 'vip-delete-backward-char)
-(define-key vip-vi-basic-map "Y" 'vip-yank-line)
-(define-key vip-vi-basic-map "ZZ" 'vip-save-kill-buffer)
+(define-key viper-vi-basic-map "A" 'viper-Append)
+(define-key viper-vi-basic-map "B" 'viper-backward-Word)
+(define-key viper-vi-basic-map "C" 'viper-change-to-eol)
+(define-key viper-vi-basic-map "D" 'viper-kill-line)
+(define-key viper-vi-basic-map "E" 'viper-end-of-Word)
+(define-key viper-vi-basic-map "F" 'viper-find-char-backward)
+(define-key viper-vi-basic-map "G" 'viper-goto-line)
+(define-key viper-vi-basic-map "H" 'viper-window-top)
+(define-key viper-vi-basic-map "I" 'viper-Insert)
+(define-key viper-vi-basic-map "J" 'viper-join-lines)
+(define-key viper-vi-basic-map "K" 'viper-nil)
+(define-key viper-vi-basic-map "L" 'viper-window-bottom)
+(define-key viper-vi-basic-map "M" 'viper-window-middle)
+(define-key viper-vi-basic-map "N" 'viper-search-Next)
+(define-key viper-vi-basic-map "O" 'viper-Open-line)
+(define-key viper-vi-basic-map "P" 'viper-Put-back)
+(define-key viper-vi-basic-map "Q" 'viper-query-replace)
+(define-key viper-vi-basic-map "R" 'viper-overwrite)
+(define-key viper-vi-basic-map "S" 'viper-substitute-line)
+(define-key viper-vi-basic-map "T" 'viper-goto-char-backward)
+(define-key viper-vi-basic-map "U" 'viper-undo)
+(define-key viper-vi-basic-map "V" 'find-file-other-window)
+(define-key viper-vi-basic-map "W" 'viper-forward-Word)
+(define-key viper-vi-basic-map "X" 'viper-delete-backward-char)
+(define-key viper-vi-basic-map "Y" 'viper-yank-line)
+(define-key viper-vi-basic-map "ZZ" 'viper-save-kill-buffer)
 
-(define-key vip-vi-basic-map "\\" 'vip-escape-to-emacs)
-(define-key vip-vi-basic-map "[" 'vip-brac-function)
-(define-key vip-vi-basic-map "]" 'vip-ket-function)
-(define-key vip-vi-basic-map "\C-\\" 'vip-alternate-Meta-key)
-(define-key vip-vi-basic-map "^" 'vip-bol-and-skip-white)
-(define-key vip-vi-basic-map "`" 'vip-goto-mark)
+(define-key viper-vi-basic-map "\\" 'viper-escape-to-emacs)
+(define-key viper-vi-basic-map "[" 'viper-brac-function)
+(define-key viper-vi-basic-map "]" 'viper-ket-function)
+(define-key viper-vi-basic-map "\C-\\" 'viper-alternate-Meta-key)
+(define-key viper-vi-basic-map "^" 'viper-bol-and-skip-white)
+(define-key viper-vi-basic-map "`" 'viper-goto-mark)
 
-(define-key vip-vi-basic-map "a" 'vip-append)
-(define-key vip-vi-basic-map "b" 'vip-backward-word)
-(define-key vip-vi-basic-map "c" 'vip-command-argument)
-(define-key vip-vi-basic-map "d" 'vip-command-argument)
-(define-key vip-vi-basic-map "e" 'vip-end-of-word)
-(define-key vip-vi-basic-map "f" 'vip-find-char-forward)
-(define-key vip-vi-basic-map "g" 'vip-nil)
-(define-key vip-vi-basic-map "h" 'vip-backward-char)
-(define-key vip-vi-basic-map "i" 'vip-insert)
-(define-key vip-vi-basic-map "j" 'vip-next-line)
-(define-key vip-vi-basic-map "k" 'vip-previous-line)
-(define-key vip-vi-basic-map "l" 'vip-forward-char)
-(define-key vip-vi-basic-map "m" 'vip-mark-point)
-(define-key vip-vi-basic-map "n" 'vip-search-next)
-(define-key vip-vi-basic-map "o" 'vip-open-line)
-(define-key vip-vi-basic-map "p" 'vip-put-back)
-(define-key vip-vi-basic-map "q" 'vip-nil)
-(define-key vip-vi-basic-map "r" 'vip-replace-char)
-(define-key vip-vi-basic-map "s" 'vip-substitute)
-(define-key vip-vi-basic-map "t" 'vip-goto-char-forward)
-(define-key vip-vi-basic-map "u" 'vip-undo)
-(define-key vip-vi-basic-map "v" 'find-file)
-(define-key vip-vi-basic-map "\C-v" 'find-file-other-frame)
-(define-key vip-vi-basic-map "w" 'vip-forward-word)
-(define-key vip-vi-basic-map "x" 'vip-delete-char)
-(define-key vip-vi-basic-map "y" 'vip-command-argument)
-(define-key vip-vi-basic-map "zH" 'vip-line-to-top)
-(define-key vip-vi-basic-map "zM" 'vip-line-to-middle)
-(define-key vip-vi-basic-map "zL" 'vip-line-to-bottom)
-(define-key vip-vi-basic-map "z\C-m" 'vip-line-to-top)
-(define-key vip-vi-basic-map "z." 'vip-line-to-middle)
-(define-key vip-vi-basic-map "z-" 'vip-line-to-bottom)
+(define-key viper-vi-basic-map "a" 'viper-append)
+(define-key viper-vi-basic-map "b" 'viper-backward-word)
+(define-key viper-vi-basic-map "c" 'viper-command-argument)
+(define-key viper-vi-basic-map "d" 'viper-command-argument)
+(define-key viper-vi-basic-map "e" 'viper-end-of-word)
+(define-key viper-vi-basic-map "f" 'viper-find-char-forward)
+(define-key viper-vi-basic-map "g" 'viper-nil)
+(define-key viper-vi-basic-map "h" 'viper-backward-char)
+(define-key viper-vi-basic-map "i" 'viper-insert)
+(define-key viper-vi-basic-map "j" 'viper-next-line)
+(define-key viper-vi-basic-map "k" 'viper-previous-line)
+(define-key viper-vi-basic-map "l" 'viper-forward-char)
+(define-key viper-vi-basic-map "m" 'viper-mark-point)
+(define-key viper-vi-basic-map "n" 'viper-search-next)
+(define-key viper-vi-basic-map "o" 'viper-open-line)
+(define-key viper-vi-basic-map "p" 'viper-put-back)
+(define-key viper-vi-basic-map "q" 'viper-nil)
+(define-key viper-vi-basic-map "r" 'viper-replace-char)
+(define-key viper-vi-basic-map "s" 'viper-substitute)
+(define-key viper-vi-basic-map "t" 'viper-goto-char-forward)
+(define-key viper-vi-basic-map "u" 'viper-undo)
+(define-key viper-vi-basic-map "v" 'find-file)
+(define-key viper-vi-basic-map "\C-v" 'find-file-other-frame)
+(define-key viper-vi-basic-map "w" 'viper-forward-word)
+(define-key viper-vi-basic-map "x" 'viper-delete-char)
+(define-key viper-vi-basic-map "y" 'viper-command-argument)
+(define-key viper-vi-basic-map "zH" 'viper-line-to-top)
+(define-key viper-vi-basic-map "zM" 'viper-line-to-middle)
+(define-key viper-vi-basic-map "zL" 'viper-line-to-bottom)
+(define-key viper-vi-basic-map "z\C-m" 'viper-line-to-top)
+(define-key viper-vi-basic-map "z." 'viper-line-to-middle)
+(define-key viper-vi-basic-map "z-" 'viper-line-to-bottom)
 
-(define-key vip-vi-basic-map "{" 'vip-backward-paragraph)
-(define-key vip-vi-basic-map "|" 'vip-goto-col)
-(define-key vip-vi-basic-map "}" 'vip-forward-paragraph)
-(define-key vip-vi-basic-map "~" 'vip-toggle-case)
-(define-key vip-vi-basic-map "\C-?" 'vip-backward-char)
-(define-key vip-vi-basic-map "_" 'vip-nil)
+(define-key viper-vi-basic-map "{" 'viper-backward-paragraph)
+(define-key viper-vi-basic-map "|" 'viper-goto-col)
+(define-key viper-vi-basic-map "}" 'viper-forward-paragraph)
+(define-key viper-vi-basic-map "~" 'viper-toggle-case)
+(define-key viper-vi-basic-map "\C-?" 'viper-backward-char)
+(define-key viper-vi-basic-map "_" 'viper-nil)
   
 ;;; Escape from Emacs to Vi for one command
-(global-set-key "\C-c\\" 'vip-escape-to-vi)  ; everywhere
+(global-set-key "\C-c\\" 'viper-escape-to-vi)  ; everywhere
 
-;;; This is vip-vi-diehard-map. Used when vip-vi-diehard-minor-mode is on.
+;;; This is viper-vi-diehard-map. Used when viper-vi-diehard-minor-mode is on.
 
-(define-key vip-vi-diehard-map "\C-a" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-c" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-g" 'vip-info-on-file)
-(define-key vip-vi-diehard-map "\C-i" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-k" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-l" 'redraw-display)
-(define-key vip-vi-diehard-map "\C-n" 'vip-next-line)
-(define-key vip-vi-diehard-map "\C-o" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-p" 'vip-previous-line)
-(define-key vip-vi-diehard-map "\C-q" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-r" 'redraw-display)
-(define-key vip-vi-diehard-map "\C-s" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-t" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-v" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-w" 'vip-nil)
-(define-key vip-vi-diehard-map "@" 'vip-nil)
-(define-key vip-vi-diehard-map "_" 'vip-nil)
-(define-key vip-vi-diehard-map "*" 'vip-nil)
-(define-key vip-vi-diehard-map "#" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-_" 'vip-nil)
-(define-key vip-vi-diehard-map "\C-]" 'vip-nil) ; This is actually tags.
+(define-key viper-vi-diehard-map "\C-a" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-c" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-g" 'viper-info-on-file)
+(define-key viper-vi-diehard-map "\C-i" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-k" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-l" 'redraw-display)
+(define-key viper-vi-diehard-map "\C-n" 'viper-next-line)
+(define-key viper-vi-diehard-map "\C-o" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-p" 'viper-previous-line)
+(define-key viper-vi-diehard-map "\C-q" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-r" 'redraw-display)
+(define-key viper-vi-diehard-map "\C-s" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-t" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-v" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-w" 'viper-nil)
+(define-key viper-vi-diehard-map "@" 'viper-nil)
+(define-key viper-vi-diehard-map "_" 'viper-nil)
+(define-key viper-vi-diehard-map "*" 'viper-nil)
+(define-key viper-vi-diehard-map "#" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-_" 'viper-nil)
+(define-key viper-vi-diehard-map "\C-]" 'viper-nil) ; This is actually tags.
 
 
 ;;; Minibuffer keymap
   
 
-(defvar vip-minibuffer-map (make-sparse-keymap)
+(defvar viper-minibuffer-map (make-sparse-keymap)
   "Keymap used to modify keys when Minibuffer is in Insert state.")
   
-(define-key vip-minibuffer-map "\C-m" 'vip-exit-minibuffer)
-(define-key vip-minibuffer-map "\C-j" 'vip-exit-minibuffer)
+(define-key viper-minibuffer-map "\C-m" 'viper-exit-minibuffer)
+(define-key viper-minibuffer-map "\C-j" 'viper-exit-minibuffer)
 
 ;; Map used to read Ex-style commands.
-(defvar vip-ex-cmd-map (make-sparse-keymap))
-(define-key vip-ex-cmd-map " "  'ex-cmd-read-exit)
-(define-key vip-ex-cmd-map "\t" 'ex-cmd-complete)
+(defvar viper-ex-cmd-map (make-sparse-keymap))
+(define-key viper-ex-cmd-map " "  'ex-cmd-read-exit)
+(define-key viper-ex-cmd-map "\t" 'ex-cmd-complete)
 
 ;; Keymap for reading file names in Ex-style commands.
 (defvar ex-read-filename-map (make-sparse-keymap))
-(define-key ex-read-filename-map " " 'vip-complete-filename-or-exit)
-(define-key ex-read-filename-map "!" 'vip-handle-!)
+(define-key ex-read-filename-map " " 'viper-complete-filename-or-exit)
+(define-key ex-read-filename-map "!" 'viper-handle-!)
 
 ;; Some other maps
-(defvar vip-slash-and-colon-map (make-sparse-keymap)
+(defvar viper-slash-and-colon-map (make-sparse-keymap)
   "This map redefines `/' and `:' to behave as in Vi.
 Useful in some modes, such as Gnus, MH, etc.")
-(define-key vip-slash-and-colon-map ":" 'vip-ex)
-(define-key vip-slash-and-colon-map "/" 'vip-search-forward)
+(define-key viper-slash-and-colon-map ":" 'viper-ex)
+(define-key viper-slash-and-colon-map "/" 'viper-search-forward)
 
-(defvar vip-comint-mode-modifier-map (make-sparse-keymap)
+(defvar viper-comint-mode-modifier-map (make-sparse-keymap)
   "This map modifies comint mode.")
-(define-key vip-comint-mode-modifier-map "\C-m" 'comint-send-input)
-(define-key vip-comint-mode-modifier-map "\C-d" 'comint-delchar-or-maybe-eof)
+(define-key viper-comint-mode-modifier-map "\C-m" 'comint-send-input)
+(define-key viper-comint-mode-modifier-map "\C-d" 'comint-delchar-or-maybe-eof)
 
-(defvar vip-dired-modifier-map (make-sparse-keymap)
+(defvar viper-dired-modifier-map (make-sparse-keymap)
   "This map modifies Dired behavior.")
-(define-key vip-dired-modifier-map ":" 'vip-ex)
-(define-key vip-dired-modifier-map "/" 'vip-search-forward)
+(define-key viper-dired-modifier-map ":" 'viper-ex)
+(define-key viper-dired-modifier-map "/" 'viper-search-forward)
 
-(defvar vip-help-modifier-map (make-sparse-keymap)
+(defvar viper-help-modifier-map (make-sparse-keymap)
   "This map modifies Help mode behavior.")
-(define-key vip-help-modifier-map "q" (if vip-xemacs-p 'help-mode-quit))
+(define-key viper-help-modifier-map "q" (if viper-xemacs-p 'help-mode-quit))
 
 
 
 ;;; Code
 
-(defun vip-add-local-keys (state alist)
+(defun viper-add-local-keys (state alist)
   "Override some vi-state or insert-state bindings in the current buffer.
 The effect is seen in the current buffer only.
 Useful for customizing  mailer buffers, gnus, etc.
@@ -469,64 +469,64 @@
 Normally, this would be called from a hook to a major mode or
 on a per buffer basis.
 Usage:
-      (vip-add-local-keys state '((key-str . func) (key-str . func)...))   "
+      (viper-add-local-keys state '((key-str . func) (key-str . func)...))   "
       
   (let (map)
     (cond ((eq state 'vi-state)
-	   (if vip-need-new-vi-local-map
-	       (setq vip-vi-local-user-map (make-sparse-keymap)))
-	   (setq vip-need-new-vi-local-map nil
-		 map vip-vi-local-user-map))
+	   (if viper-need-new-vi-local-map
+	       (setq viper-vi-local-user-map (make-sparse-keymap)))
+	   (setq viper-need-new-vi-local-map nil
+		 map viper-vi-local-user-map))
 	  ((eq state 'insert-state)
-	   (if vip-need-new-insert-local-map
-	       (setq vip-insert-local-user-map (make-sparse-keymap)))
-	   (setq vip-need-new-insert-local-map nil
-		 map vip-insert-local-user-map))
+	   (if viper-need-new-insert-local-map
+	       (setq viper-insert-local-user-map (make-sparse-keymap)))
+	   (setq viper-need-new-insert-local-map nil
+		 map viper-insert-local-user-map))
 	  ((eq state 'emacs-state)
-	   (if vip-need-new-emacs-local-map
-	       (setq vip-emacs-local-user-map (make-sparse-keymap)))
-	   (setq vip-need-new-emacs-local-map nil
-		 map vip-emacs-local-user-map))
+	   (if viper-need-new-emacs-local-map
+	       (setq viper-emacs-local-user-map (make-sparse-keymap)))
+	   (setq viper-need-new-emacs-local-map nil
+		 map viper-emacs-local-user-map))
 	  (t 
 	   (error
-	    "Invalid state in vip-add-local-keys: %S. Valid states: vi-state, insert-state or emacs-state" state)))
+	    "Invalid state in viper-add-local-keys: %S. Valid states: vi-state, insert-state or emacs-state" state)))
 
-    (vip-modify-keymap map alist)
-    (vip-normalize-minor-mode-map-alist)
-    (vip-set-mode-vars-for vip-current-state)))
+    (viper-modify-keymap map alist)
+    (viper-normalize-minor-mode-map-alist)
+    (viper-set-mode-vars-for viper-current-state)))
 
-(defun vip-zap-local-keys ()
-  "Unconditionally reset Viper vip-*-local-user-map's.
+(defun viper-zap-local-keys ()
+  "Unconditionally reset Viper viper-*-local-user-map's.
 Rarely useful, but if u made a mistake by switching to a mode that adds
 undesirable local keys, e.g., comint-mode, then this function can restore
 sanity."
   (interactive)
-  (setq vip-vi-local-user-map (make-sparse-keymap)
-	vip-need-new-vi-local-map nil
-	vip-insert-local-user-map (make-sparse-keymap)
-	vip-need-new-insert-local-map nil
-	vip-emacs-local-user-map (make-sparse-keymap)
-	vip-need-new-emacs-local-map nil)
-  (vip-normalize-minor-mode-map-alist))
+  (setq viper-vi-local-user-map (make-sparse-keymap)
+	viper-need-new-vi-local-map nil
+	viper-insert-local-user-map (make-sparse-keymap)
+	viper-need-new-insert-local-map nil
+	viper-emacs-local-user-map (make-sparse-keymap)
+	viper-need-new-emacs-local-map nil)
+  (viper-normalize-minor-mode-map-alist))
     
 
-(defun vip-modify-major-mode (mode state keymap)
+(defun viper-modify-major-mode (mode state keymap)
   "Modify key bindings in a major-mode in a Viper state using a keymap.
 
 If the default for a major mode is emacs-state, then modifications to this
 major mode may not take effect until the buffer switches state to Vi,
-Insert or Emacs. If this happens, add vip-change-state-to-emacs to this
+Insert or Emacs. If this happens, add viper-change-state-to-emacs to this
 major mode's hook. If no such hook exists, you may have to put an advice on
-the function that invokes the major mode. See vip-set-hooks for hints.
+the function that invokes the major mode. See viper-set-hooks for hints.
 
 The above needs not to be done for major modes that come up in Vi or Insert
 state by default.
 
-Arguments: (major-mode vip-state keymap)"
+Arguments: (major-mode viper-state keymap)"
   (let ((alist
-	 (cond ((eq state 'vi-state) 'vip-vi-state-modifier-alist)
-	       ((eq state 'insert-state) 'vip-insert-state-modifier-alist)
-	       ((eq state 'emacs-state) 'vip-emacs-state-modifier-alist)))
+	 (cond ((eq state 'vi-state) 'viper-vi-state-modifier-alist)
+	       ((eq state 'insert-state) 'viper-insert-state-modifier-alist)
+	       ((eq state 'emacs-state) 'viper-emacs-state-modifier-alist)))
 	elt)
     (if (setq elt (assoc mode (eval alist)))
 	(set alist (delq elt (eval alist))))
@@ -536,74 +536,74 @@
     ;; normalize in the actual buffer where changes to the keymap are
     ;; to take place. However, it doesn't hurt, and it helps whenever this
     ;; function is actually called from within the right buffer.
-    (vip-normalize-minor-mode-map-alist)
+    (viper-normalize-minor-mode-map-alist)
     
-    (vip-set-mode-vars-for vip-current-state)))
+    (viper-set-mode-vars-for viper-current-state)))
 
     
 ;; Displays variables that control Viper's keymaps
-(defun vip-debug-keymaps ()
+(defun viper-debug-keymaps ()
   (interactive)
-  (with-output-to-temp-buffer " *vip-debug*"
+  (with-output-to-temp-buffer " *viper-debug*"
     (princ (format "Buffer name:  %s\n\n" (buffer-name)))
     (princ "Variables:  \n")
     (princ (format "major-mode:  %S\n" major-mode))
-    (princ (format "vip-current-state:  %S\n" vip-current-state))
-    (princ (format "vip-mode-string:  %S\n\n" vip-mode-string))
-    (princ (format "vip-vi-intercept-minor-mode:  %S\n"
-		   vip-vi-intercept-minor-mode))
-    (princ (format "vip-insert-intercept-minor-mode:  %S\n"
-		   vip-insert-intercept-minor-mode))
-    (princ (format "vip-emacs-intercept-minor-mode:  %S\n"
-		   vip-emacs-intercept-minor-mode))
-    (princ (format "vip-vi-minibuffer-minor-mode:  %S\n"
-		   vip-vi-minibuffer-minor-mode))
-    (princ (format "vip-insert-minibuffer-minor-mode:  %S\n\n"
-		   vip-insert-minibuffer-minor-mode))
-    (princ (format "vip-vi-local-user-minor-mode:  %S\n"
-		   vip-vi-local-user-minor-mode))
-    (princ (format "vip-vi-global-user-minor-mode:  %S\n"
-		   vip-vi-global-user-minor-mode))
-    (princ (format "vip-vi-kbd-minor-mode:  %S\n" vip-vi-kbd-minor-mode))
-    (princ (format "vip-vi-state-modifier-minor-mode:  %S\n"
-		   vip-vi-state-modifier-minor-mode))
-    (princ (format "vip-vi-diehard-minor-mode:  %S\n"
-		   vip-vi-diehard-minor-mode))
-    (princ (format "vip-vi-basic-minor-mode:  %S\n" vip-vi-basic-minor-mode))
-    (princ (format "vip-replace-minor-mode:  %S\n" vip-replace-minor-mode))
-    (princ (format "vip-insert-local-user-minor-mode:  %S\n"
-		   vip-insert-local-user-minor-mode))
-    (princ (format "vip-insert-global-user-minor-mode:  %S\n"
-		   vip-insert-global-user-minor-mode))
-    (princ (format "vip-insert-kbd-minor-mode:  %S\n"
-		   vip-insert-kbd-minor-mode)) 
-    (princ (format "vip-insert-state-modifier-minor-mode:  %S\n"
-		   vip-insert-state-modifier-minor-mode))
-    (princ (format "vip-insert-diehard-minor-mode:  %S\n"
-		   vip-insert-diehard-minor-mode))
-    (princ (format "vip-insert-basic-minor-mode:  %S\n"
-		   vip-insert-basic-minor-mode))
-    (princ (format "vip-emacs-local-user-minor-mode:  %S\n"
-		   vip-emacs-local-user-minor-mode))
-    (princ (format "vip-emacs-kbd-minor-mode:  %S\n"
-		   vip-emacs-kbd-minor-mode))
-    (princ (format "vip-emacs-global-user-minor-mode:  %S\n"
-		   vip-emacs-global-user-minor-mode))
-    (princ (format "vip-emacs-state-modifier-minor-mode:  %S\n"
-		   vip-emacs-state-modifier-minor-mode))
+    (princ (format "viper-current-state:  %S\n" viper-current-state))
+    (princ (format "viper-mode-string:  %S\n\n" viper-mode-string))
+    (princ (format "viper-vi-intercept-minor-mode:  %S\n"
+		   viper-vi-intercept-minor-mode))
+    (princ (format "viper-insert-intercept-minor-mode:  %S\n"
+		   viper-insert-intercept-minor-mode))
+    (princ (format "viper-emacs-intercept-minor-mode:  %S\n"
+		   viper-emacs-intercept-minor-mode))
+    (princ (format "viper-vi-minibuffer-minor-mode:  %S\n"
+		   viper-vi-minibuffer-minor-mode))
+    (princ (format "viper-insert-minibuffer-minor-mode:  %S\n\n"
+		   viper-insert-minibuffer-minor-mode))
+    (princ (format "viper-vi-local-user-minor-mode:  %S\n"
+		   viper-vi-local-user-minor-mode))
+    (princ (format "viper-vi-global-user-minor-mode:  %S\n"
+		   viper-vi-global-user-minor-mode))
+    (princ (format "viper-vi-kbd-minor-mode:  %S\n" viper-vi-kbd-minor-mode))
+    (princ (format "viper-vi-state-modifier-minor-mode:  %S\n"
+		   viper-vi-state-modifier-minor-mode))
+    (princ (format "viper-vi-diehard-minor-mode:  %S\n"
+		   viper-vi-diehard-minor-mode))
+    (princ (format "viper-vi-basic-minor-mode:  %S\n" viper-vi-basic-minor-mode))
+    (princ (format "viper-replace-minor-mode:  %S\n" viper-replace-minor-mode))
+    (princ (format "viper-insert-local-user-minor-mode:  %S\n"
+		   viper-insert-local-user-minor-mode))
+    (princ (format "viper-insert-global-user-minor-mode:  %S\n"
+		   viper-insert-global-user-minor-mode))
+    (princ (format "viper-insert-kbd-minor-mode:  %S\n"
+		   viper-insert-kbd-minor-mode)) 
+    (princ (format "viper-insert-state-modifier-minor-mode:  %S\n"
+		   viper-insert-state-modifier-minor-mode))
+    (princ (format "viper-insert-diehard-minor-mode:  %S\n"
+		   viper-insert-diehard-minor-mode))
+    (princ (format "viper-insert-basic-minor-mode:  %S\n"
+		   viper-insert-basic-minor-mode))
+    (princ (format "viper-emacs-local-user-minor-mode:  %S\n"
+		   viper-emacs-local-user-minor-mode))
+    (princ (format "viper-emacs-kbd-minor-mode:  %S\n"
+		   viper-emacs-kbd-minor-mode))
+    (princ (format "viper-emacs-global-user-minor-mode:  %S\n"
+		   viper-emacs-global-user-minor-mode))
+    (princ (format "viper-emacs-state-modifier-minor-mode:  %S\n"
+		   viper-emacs-state-modifier-minor-mode))
     
     (princ (format "\nviper-expert-level  %S\n" viper-expert-level))
-    (princ (format "vip-no-multiple-ESC  %S\n" vip-no-multiple-ESC))
+    (princ (format "viper-no-multiple-ESC  %S\n" viper-no-multiple-ESC))
     (princ (format "viper-always  %S\n" viper-always))
-    (princ (format "vip-ex-style-motion  %S\n"
-		   vip-ex-style-motion))
-    (princ (format "vip-ex-style-editing-in-insert  %S\n"
-		   vip-ex-style-editing-in-insert))
-    (princ (format "vip-want-emacs-keys-in-vi  %S\n"
-		   vip-want-emacs-keys-in-vi)) 
-    (princ (format "vip-want-emacs-keys-in-insert  %S\n"
-		   vip-want-emacs-keys-in-insert)) 
-    (princ (format "vip-want-ctl-h-help  %S\n" vip-want-ctl-h-help))
+    (princ (format "viper-ex-style-motion  %S\n"
+		   viper-ex-style-motion))
+    (princ (format "viper-ex-style-editing-in-insert  %S\n"
+		   viper-ex-style-editing-in-insert))
+    (princ (format "viper-want-emacs-keys-in-vi  %S\n"
+		   viper-want-emacs-keys-in-vi)) 
+    (princ (format "viper-want-emacs-keys-in-insert  %S\n"
+		   viper-want-emacs-keys-in-insert)) 
+    (princ (format "viper-want-ctl-h-help  %S\n" viper-want-ctl-h-help))
     
     (princ "\n\n\n")
     (princ (format "Default value for minor-mode-map-alist:  \n%S\n\n"
@@ -615,9 +615,9 @@
 
 ;;; Keymap utils
 	     
-(defun vip-add-keymap (mapsrc mapdst) 
+(defun viper-add-keymap (mapsrc mapdst) 
   "Add contents of mapsrc to mapdst. It is assumed that mapsrc is sparse."
-  (if vip-xemacs-p
+  (if viper-xemacs-p
       (map-keymap (function (lambda (key binding)
 			      (define-key mapdst key binding)))
 		  mapsrc)
@@ -627,7 +627,7 @@
 		 ))
      (cdr mapsrc))))
   
-(defun vip-modify-keymap (map alist)
+(defun viper-modify-keymap (map alist)
    "Modifies MAP with bindings specified in the ALIST. The alist has the
 form ((key . function) (key . function) ... )."
    (mapcar (function (lambda (p)
@@ -636,7 +636,7 @@
 
 
 ;;; Local Variables:
-;;; eval: (put 'vip-deflocalvar 'lisp-indent-hook 'defun)
+;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
 ;;; End:
 
 
--- a/lisp/viper/viper-macs.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-macs.el	Mon Aug 13 09:53:19 2007 +0200
@@ -24,10 +24,10 @@
 (provide 'viper-macs)
 
 ;; compiler pacifier
-(defvar vip-ex-work-buf)
-(defvar vip-custom-file-name)
-(defvar vip-current-state)
-(defvar vip-fast-keyseq-timeout)
+(defvar viper-ex-work-buf)
+(defvar viper-custom-file-name)
+(defvar viper-current-state)
+(defvar viper-fast-keyseq-timeout)
 
 ;; loading happens only in non-interactive compilation
 ;; in order to spare non-viperized emacs from being viperized
@@ -52,27 +52,27 @@
 ;;; Variables
 
 ;; Register holding last macro.
-(defvar vip-last-macro-reg nil)
+(defvar viper-last-macro-reg nil)
 
 ;; format of the elements of kbd alists: 
 ;; (name ((buf . macr)...(buf . macr)) ((maj-mode . macr)...) (t . macr))
 ;; kbd macro alist for Vi state
-(defvar vip-vi-kbd-macro-alist nil)
+(defvar viper-vi-kbd-macro-alist nil)
 ;; same for insert/replace state
-(defvar vip-insert-kbd-macro-alist nil)
+(defvar viper-insert-kbd-macro-alist nil)
 ;; same for emacs state
-(defvar vip-emacs-kbd-macro-alist nil)
+(defvar viper-emacs-kbd-macro-alist nil)
 
 ;; Internal var that passes info between start-kbd-macro and end-kbd-macro
 ;; in :map and :map!
-(defvar vip-kbd-macro-parameters nil)
+(defvar viper-kbd-macro-parameters nil)
 
-(defvar vip-this-kbd-macro nil
+(defvar viper-this-kbd-macro nil
   "Vector of keys representing the name of currently running Viper kbd macro.")
-(defvar vip-last-kbd-macro nil
+(defvar viper-last-kbd-macro nil
   "Vector of keys representing the name of last Viper keyboard macro.")
 
-(defcustom vip-repeat-from-history-key 'f12
+(defcustom viper-repeat-from-history-key 'f12
   "Prefix key for accessing previously typed Vi commands.
 
 The previous command is accessible, as usual, via `.'. The command before this
@@ -93,7 +93,7 @@
   (let ((mod-char "")
 	macro-name macro-body map-args ins)
     (save-window-excursion
-      (set-buffer vip-ex-work-buf)
+      (set-buffer viper-ex-work-buf)
       (if (looking-at "!")
 	  (progn
 	    (setq ins t
@@ -102,19 +102,19 @@
     (setq map-args (ex-map-read-args mod-char)
 	  macro-name (car map-args)
 	  macro-body (cdr map-args))
-    (setq vip-kbd-macro-parameters (list ins mod-char macro-name macro-body))
+    (setq viper-kbd-macro-parameters (list ins mod-char macro-name macro-body))
     (if macro-body
-	(vip-end-mapping-kbd-macro 'ignore)
+	(viper-end-mapping-kbd-macro 'ignore)
       (ex-fixup-history (format "map%s %S" mod-char
-				(vip-display-macro macro-name)))
+				(viper-display-macro macro-name)))
       ;; if defining macro for insert, switch there for authentic WYSIWYG
-      (if ins (vip-change-state-to-insert))
+      (if ins (viper-change-state-to-insert))
       (start-kbd-macro nil)
-      (define-key vip-vi-intercept-map "\C-x)" 'vip-end-mapping-kbd-macro)
-      (define-key vip-insert-intercept-map "\C-x)" 'vip-end-mapping-kbd-macro)
-      (define-key vip-emacs-intercept-map "\C-x)" 'vip-end-mapping-kbd-macro)
+      (define-key viper-vi-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
+      (define-key viper-insert-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
+      (define-key viper-emacs-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
       (message "Mapping %S in %s state. Hit `C-x )' to complete the mapping"
-	       (vip-display-macro macro-name)
+	       (viper-display-macro macro-name)
 	       (if ins "Insert" "Vi")))
     ))
     
@@ -124,7 +124,7 @@
   (let ((mod-char "")
 	temp macro-name ins)
     (save-window-excursion
-      (set-buffer vip-ex-work-buf)
+      (set-buffer viper-ex-work-buf)
       (if (looking-at "!")
 	  (progn
 	    (setq ins t
@@ -132,10 +132,10 @@
 	    (forward-char 1))))
 
     (setq macro-name (ex-unmap-read-args mod-char))
-    (setq temp (vip-fixup-macro (vconcat macro-name))) ;; copy and fixup
+    (setq temp (viper-fixup-macro (vconcat macro-name))) ;; copy and fixup
     (ex-fixup-history (format "unmap%s %S" mod-char
-			      (vip-display-macro temp)))
-    (vip-unrecord-kbd-macro macro-name (if ins 'insert-state 'vi-state))
+			      (viper-display-macro temp)))
+    (viper-unrecord-kbd-macro macro-name (if ins 'insert-state 'vi-state))
     ))
     
 
@@ -179,31 +179,31 @@
 	      (format
 	       ":map%s %s"
 	       variant (if (> (length key-seq) 0)
-			   (prin1-to-string (vip-display-macro key-seq))
+			   (prin1-to-string (viper-display-macro key-seq))
 			 "")))
 	(message message)
-	(setq event (vip-read-key))
-	;;(setq event (vip-read-event))
+	(setq event (viper-read-key))
+	;;(setq event (viper-read-event))
 	(setq key
-	      (if (vip-mouse-event-p event)
+	      (if (viper-mouse-event-p event)
 		  (progn
 		    (message "%s (No mouse---only keyboard keys, please)"
 			     message)
 		    (sit-for 2)
 		    nil)
-		(vip-event-key event)))
+		(viper-event-key event)))
 	)
       (setq macro-name key-seq))
     
     (if (= (length macro-name) 0)
 	(error "Can't map an empty macro name"))
-    (setq macro-name (vip-fixup-macro macro-name))
-    (if (vip-char-array-p macro-name)
-	(setq macro-name (vip-char-array-to-macro macro-name)))
+    (setq macro-name (viper-fixup-macro macro-name))
+    (if (viper-char-array-p macro-name)
+	(setq macro-name (viper-char-array-to-macro macro-name)))
     
     (if macro-body
-	(cond ((vip-char-array-p macro-body)
-	       (setq macro-body (vip-char-array-to-macro macro-body)))
+	(cond ((viper-char-array-p macro-body)
+	       (setq macro-body (viper-char-array-to-macro macro-body)))
 	      ((vectorp macro-body) nil)
 	      (t (error "map: Invalid syntax in macro definition"))))
     (setq cursor-in-echo-area nil)(sit-for 0) ; this overcomes xemacs tty bug
@@ -215,14 +215,14 @@
 (defun ex-unmap-read-args (variant)
   (let ((cursor-in-echo-area t)
 	(macro-alist (if (string= variant "!")
-			 vip-insert-kbd-macro-alist
-		       vip-vi-kbd-macro-alist))
+			 viper-insert-kbd-macro-alist
+		       viper-vi-kbd-macro-alist))
 	;; these are disabled just in case, to avoid surprises when doing
 	;; completing-read
-	vip-vi-kbd-minor-mode vip-insert-kbd-minor-mode
-	vip-emacs-kbd-minor-mode
-	vip-vi-intercept-minor-mode vip-insert-intercept-minor-mode
-	vip-emacs-intercept-minor-mode
+	viper-vi-kbd-minor-mode viper-insert-kbd-minor-mode
+	viper-emacs-kbd-minor-mode
+	viper-vi-intercept-minor-mode viper-insert-intercept-minor-mode
+	viper-emacs-intercept-minor-mode
 	event message
 	key key-seq macro-name)
     (setq macro-name (ex-get-inline-cmd-args ".*unma?p?[!]*[ \t]*"))
@@ -246,29 +246,29 @@
 		      ":unmap%s %s"
 		      variant (if (> (length key-seq) 0)
 				  (prin1-to-string
-				   (vip-display-macro key-seq))
+				   (viper-display-macro key-seq))
 				"")))
 	       (setq key-seq
-		     (vip-do-sequence-completion key-seq macro-alist message))
+		     (viper-do-sequence-completion key-seq macro-alist message))
 	       ))
 	(setq message 
 	      (format
 	       ":unmap%s %s"
 	       variant (if (> (length key-seq) 0)
 			   (prin1-to-string
-			    (vip-display-macro key-seq))
+			    (viper-display-macro key-seq))
 			 "")))
 	(message message)
-	(setq event (vip-read-key))
-	;;(setq event (vip-read-event))
+	(setq event (viper-read-key))
+	;;(setq event (viper-read-event))
 	(setq key
-	      (if (vip-mouse-event-p event)
+	      (if (viper-mouse-event-p event)
 		  (progn
 		    (message "%s (No mouse---only keyboard keys, please)"
 			     message)
 		    (sit-for 2)
 		    nil)
-		(vip-event-key event)))
+		(viper-event-key event)))
 	)
       (setq macro-name key-seq))
 
@@ -286,35 +286,35 @@
 ;; optional argument IGNORE, if t, indicates that we are dealing with an
 ;; existing macro that needs to be registered, but there is no need to
 ;; terminate a kbd macro.
-(defun vip-end-mapping-kbd-macro (&optional ignore)
+(defun viper-end-mapping-kbd-macro (&optional ignore)
   (interactive)
-  (define-key vip-vi-intercept-map "\C-x)" nil)
-  (define-key vip-insert-intercept-map "\C-x)" nil)
-  (define-key vip-emacs-intercept-map "\C-x)" nil)
+  (define-key viper-vi-intercept-map "\C-x)" nil)
+  (define-key viper-insert-intercept-map "\C-x)" nil)
+  (define-key viper-emacs-intercept-map "\C-x)" nil)
   (if (and (not ignore)
-	   (or (not vip-kbd-macro-parameters)
+	   (or (not viper-kbd-macro-parameters)
 	       (not defining-kbd-macro)))
       (error "Not mapping a kbd-macro"))
-  (let ((mod-char (nth 1 vip-kbd-macro-parameters))
-	(ins (nth 0 vip-kbd-macro-parameters))
-	(macro-name (nth 2 vip-kbd-macro-parameters))
-	(macro-body (nth 3 vip-kbd-macro-parameters)))
-    (setq vip-kbd-macro-parameters nil)
+  (let ((mod-char (nth 1 viper-kbd-macro-parameters))
+	(ins (nth 0 viper-kbd-macro-parameters))
+	(macro-name (nth 2 viper-kbd-macro-parameters))
+	(macro-body (nth 3 viper-kbd-macro-parameters)))
+    (setq viper-kbd-macro-parameters nil)
     (or ignore
 	(progn
 	  (end-kbd-macro nil)
-	  (setq macro-body (vip-events-to-macro last-kbd-macro))
+	  (setq macro-body (viper-events-to-macro last-kbd-macro))
 	  ;; always go back to Vi, since this is where we started
 	  ;; defining macro
-	  (vip-change-state-to-vi)))
+	  (viper-change-state-to-vi)))
     
-    (vip-record-kbd-macro macro-name
+    (viper-record-kbd-macro macro-name
 			  (if ins 'insert-state 'vi-state)
-			  (vip-display-macro macro-body))
+			  (viper-display-macro macro-body))
     
     (ex-fixup-history (format "map%s %S %S" mod-char
-			      (vip-display-macro macro-name)
-			      (vip-display-macro macro-body)))
+			      (viper-display-macro macro-name)
+			      (viper-display-macro macro-body)))
     ))
 
 
@@ -325,8 +325,8 @@
 ;; accepts as macro names: strings and vectors.
 ;; strings must be strings of characters; vectors must be vectors of keys
 ;; in canonic form. the canonic form is essentially the form used in XEmacs
-(defun vip-record-kbd-macro (macro-name state macro-body &optional scope)
-  "Record a Vi macro. Can be used in `.vip' file to define permanent macros.
+(defun viper-record-kbd-macro (macro-name state macro-body &optional scope)
+  "Record a Vi macro. Can be used in `.viper' file to define permanent macros.
 MACRO-NAME is a string of characters or a vector of keys. STATE is
 either `vi-state' or `insert-state'. It specifies the Viper state in which to
 define the macro. MACRO-BODY is a string that represents the keyboard macro.
@@ -337,16 +337,16 @@
 	 (macro-alist-var
 	  (cond ((eq state 'vi-state)
 		 (setq state-name "Vi state"
-		       keymap vip-vi-kbd-map)
-		 'vip-vi-kbd-macro-alist)
+		       keymap viper-vi-kbd-map)
+		 'viper-vi-kbd-macro-alist)
 		((memq state '(insert-state replace-state))
 		 (setq state-name "Insert state"
-		       keymap vip-insert-kbd-map)
-		 'vip-insert-kbd-macro-alist)
+		       keymap viper-insert-kbd-map)
+		 'viper-insert-kbd-macro-alist)
 		(t
 		 (setq state-name "Emacs state"
-		       keymap vip-emacs-kbd-map)
-		 'vip-emacs-kbd-macro-alist)
+		       keymap viper-emacs-kbd-map)
+		 'viper-emacs-kbd-macro-alist)
 		 ))
 	 new-elt old-elt old-sub-elt msg
 	 temp lis lis2)
@@ -355,13 +355,13 @@
 	(error "Can't map an empty macro name"))
 	
     ;; Macro-name is usually a vector. However, command history or macros
-    ;; recorded in ~/.vip may be recorded as strings. So, convert to vectors.
-    (setq macro-name (vip-fixup-macro macro-name))
-    (if (vip-char-array-p macro-name)
-	(setq macro-name (vip-char-array-to-macro macro-name)))
-    (setq macro-body (vip-fixup-macro macro-body))
-    (if (vip-char-array-p macro-body)
-	(setq macro-body (vip-char-array-to-macro macro-body)))
+    ;; recorded in ~/.viper may be recorded as strings. So, convert to vectors.
+    (setq macro-name (viper-fixup-macro macro-name))
+    (if (viper-char-array-p macro-name)
+	(setq macro-name (viper-char-array-to-macro macro-name)))
+    (setq macro-body (viper-fixup-macro macro-body))
+    (if (viper-char-array-p macro-body)
+	(setq macro-body (viper-char-array-to-macro macro-body)))
 	
     ;; don't ask if scope is given and is of the right type
     (or (eq scope t)
@@ -377,11 +377,11 @@
 		  (setq msg
 			(format
 			 "%S is mapped to %s for %s in `%s'"
-			 (vip-display-macro macro-name)
-			 (vip-abbreviate-string
+			 (viper-display-macro macro-name)
+			 (viper-abbreviate-string
 			  (format
 			   "%S"
-			   (setq temp (vip-display-macro macro-body)))
+			   (setq temp (viper-display-macro macro-body)))
 			  14 "" ""
 			  (if (stringp temp) "  ....\"" "  ....]"))
 			 state-name (buffer-name)))
@@ -393,11 +393,11 @@
 		  (setq msg
 			(format
 			 "%S is mapped to %s for %s in `%S'"
-			 (vip-display-macro macro-name)
-			 (vip-abbreviate-string
+			 (viper-display-macro macro-name)
+			 (viper-abbreviate-string
 			  (format
 			   "%S"
-			   (setq temp (vip-display-macro macro-body)))
+			   (setq temp (viper-display-macro macro-body)))
 			  14 "" ""
 			  (if (stringp macro-body) "  ....\"" "  ....]"))
 			 state-name major-mode))
@@ -406,33 +406,33 @@
 		  (setq msg
 			(format
 			 "%S is globally mapped to %s in %s"
-			 (vip-display-macro macro-name)
-			 (vip-abbreviate-string
+			 (viper-display-macro macro-name)
+			 (viper-abbreviate-string
 			  (format
 			   "%S"
-			   (setq temp (vip-display-macro macro-body)))
+			   (setq temp (viper-display-macro macro-body)))
 			  14 "" ""
 			  (if (stringp macro-body) "  ....\"" "  ....]"))
 			 state-name))
 		  t)))
 	  (if (y-or-n-p
 	       (format "Save this macro in %s? "
-		       (vip-abbreviate-file-name vip-custom-file-name)))
-	      (vip-save-string-in-file 
-	       (format "\n(vip-record-kbd-macro %S '%S %s '%S)"
-		       (vip-display-macro macro-name)
+		       (viper-abbreviate-file-name viper-custom-file-name)))
+	      (viper-save-string-in-file 
+	       (format "\n(viper-record-kbd-macro %S '%S %s '%S)"
+		       (viper-display-macro macro-name)
 		       state
 		       ;; if we don't let vector macro-body through %S,
 		       ;; the symbols `\.' `\[' etc will be converted into
 		       ;; characters, causing invalid read  error on recorded
-		       ;; macros in .vip.
+		       ;; macros in .viper.
 		       ;; I am not sure is macro-body can still be a string at
 		       ;; this point, but I am preserving this option anyway.
 		       (if (vectorp macro-body)
 			   (format "%S" macro-body)
 			 macro-body)
 		       scope) 
-	       vip-custom-file-name))
+	       viper-custom-file-name))
 	  
 	  (message msg)
 	  ))
@@ -451,11 +451,11 @@
 	    ;; insert new-elt in macro-alist-var and keep the list sorted
 	    (define-key
 	      keymap
-	      (vector (vip-key-to-emacs-key (aref macro-name 0)))
-	      'vip-exec-mapped-kbd-macro)
+	      (vector (viper-key-to-emacs-key (aref macro-name 0)))
+	      'viper-exec-mapped-kbd-macro)
 	    (setq lis (eval macro-alist-var))
-	    (while (and lis (string< (vip-array-to-string (car (car lis)))
-				     (vip-array-to-string macro-name)))
+	    (while (and lis (string< (viper-array-to-string (car (car lis)))
+				     (viper-array-to-string macro-name)))
 	      (setq lis2 (cons (car lis) lis2))
 	      (setq lis (cdr lis)))
 	    
@@ -463,90 +463,90 @@
 	    (set macro-alist-var (append lis2 (cons new-elt lis)))
 	    (setq old-elt new-elt)))
     (setq old-sub-elt
-	  (cond ((eq scope t) (vip-kbd-global-pair old-elt))
-		((symbolp scope) (assoc scope (vip-kbd-mode-alist old-elt)))
-		((stringp scope) (assoc scope (vip-kbd-buf-alist old-elt)))))
+	  (cond ((eq scope t) (viper-kbd-global-pair old-elt))
+		((symbolp scope) (assoc scope (viper-kbd-mode-alist old-elt)))
+		((stringp scope) (assoc scope (viper-kbd-buf-alist old-elt)))))
     (if old-sub-elt 
 	(setcdr old-sub-elt macro-body)
       (cond ((symbolp scope) (setcar (cdr (cdr old-elt))
 				     (cons (cons scope macro-body)
-					   (vip-kbd-mode-alist old-elt))))
+					   (viper-kbd-mode-alist old-elt))))
 	    ((stringp scope) (setcar (cdr old-elt)
 				     (cons (cons scope macro-body)
-					   (vip-kbd-buf-alist old-elt))))))
+					   (viper-kbd-buf-alist old-elt))))))
     ))
   
 
     
-;; macro name must be a vector of vip-style keys
-(defun vip-unrecord-kbd-macro (macro-name state)
+;; macro name must be a vector of viper-style keys
+(defun viper-unrecord-kbd-macro (macro-name state)
   "Delete macro MACRO-NAME from Viper STATE.
-MACRO-NAME must be a vector of vip-style keys. This command is used by Viper
-internally, but the user can also use it in ~/.vip to delete pre-defined macros
-supplied with Viper. The best way to avoid mistakes in macro names to be passed
-to this function is to use vip-describe-kbd-macros and copy the name from
-there."
+MACRO-NAME must be a vector of viper-style keys. This command is used by Viper
+internally, but the user can also use it in ~/.viper to delete pre-defined
+macros supplied with Viper. The best way to avoid mistakes in macro names to be
+passed to this function is to use viper-describe-kbd-macros and copy the name
+from there."
   (let* (state-name keymap 
 	 (macro-alist-var
 	  (cond ((eq state 'vi-state)
 		 (setq state-name "Vi state"
-		       keymap vip-vi-kbd-map)
-		 'vip-vi-kbd-macro-alist)
+		       keymap viper-vi-kbd-map)
+		 'viper-vi-kbd-macro-alist)
 		((memq state '(insert-state replace-state))
 		 (setq state-name "Insert state"
-		       keymap vip-insert-kbd-map)
-		 'vip-insert-kbd-macro-alist)
+		       keymap viper-insert-kbd-map)
+		 'viper-insert-kbd-macro-alist)
 		(t
 		 (setq state-name "Emacs state"
-		       keymap vip-emacs-kbd-map)
-		 'vip-emacs-kbd-macro-alist)
+		       keymap viper-emacs-kbd-map)
+		 'viper-emacs-kbd-macro-alist)
 		))
 	 buf-mapping mode-mapping global-mapping
 	 macro-pair macro-entry)
 	 	
     ;; Macro-name is usually a vector. However, command history or macros
-    ;; recorded in ~/.vip may appear as strings. So, convert to vectors.
-    (setq macro-name (vip-fixup-macro macro-name))
-    (if (vip-char-array-p macro-name)
-	(setq macro-name (vip-char-array-to-macro macro-name)))
+    ;; recorded in ~/.viper may appear as strings. So, convert to vectors.
+    (setq macro-name (viper-fixup-macro macro-name))
+    (if (viper-char-array-p macro-name)
+	(setq macro-name (viper-char-array-to-macro macro-name)))
 
     (setq macro-entry (assoc macro-name (eval macro-alist-var)))
     (if (= (length macro-name) 0)
 	(error "Can't unmap an empty macro name"))
     (if (null macro-entry)
 	(error "%S is not mapped to a macro for %s in `%s'"
-	       (vip-display-macro macro-name)
+	       (viper-display-macro macro-name)
 	       state-name (buffer-name)))
 	
-    (setq buf-mapping (vip-kbd-buf-pair macro-entry)
-	  mode-mapping (vip-kbd-mode-pair macro-entry)
-	  global-mapping (vip-kbd-global-pair macro-entry))
+    (setq buf-mapping (viper-kbd-buf-pair macro-entry)
+	  mode-mapping (viper-kbd-mode-pair macro-entry)
+	  global-mapping (viper-kbd-global-pair macro-entry))
 	
     (cond ((and (cdr buf-mapping)
 		(or (and (not (cdr mode-mapping)) (not (cdr global-mapping)))
 		    (y-or-n-p
 		     (format "Unmap %S for `%s' only? "
-			     (vip-display-macro macro-name)
+			     (viper-display-macro macro-name)
 			     (buffer-name)))))
 	   (setq macro-pair buf-mapping)
 	   (message "%S is unmapped for %s in `%s'" 
-		    (vip-display-macro macro-name)
+		    (viper-display-macro macro-name)
 		    state-name (buffer-name)))
 	  ((and (cdr mode-mapping)
 		(or (not (cdr global-mapping))
 		    (y-or-n-p
 		     (format "Unmap %S for the major mode `%S' only? "
-			     (vip-display-macro macro-name)
+			     (viper-display-macro macro-name)
 			     major-mode))))
 	   (setq macro-pair mode-mapping)
 	   (message "%S is unmapped for %s in %S"
-		    (vip-display-macro macro-name) state-name major-mode))
-	  ((cdr (setq macro-pair (vip-kbd-global-pair macro-entry)))
+		    (viper-display-macro macro-name) state-name major-mode))
+	  ((cdr (setq macro-pair (viper-kbd-global-pair macro-entry)))
 	   (message
 	    "Global mapping for %S in %s is removed"
-	    (vip-display-macro macro-name) state-name))
+	    (viper-display-macro macro-name) state-name))
 	  (t (error "%S is not mapped to a macro for %s in `%s'"
-		    (vip-display-macro macro-name)
+		    (viper-display-macro macro-name)
 		    state-name (buffer-name))))
     (setcdr macro-pair nil)
     (or (cdr buf-mapping)
@@ -554,19 +554,19 @@
 	(cdr global-mapping)
 	(progn
 	  (set macro-alist-var (delq macro-entry (eval macro-alist-var)))
-	  (if (vip-can-release-key (aref macro-name 0) 
+	  (if (viper-can-release-key (aref macro-name 0) 
 				   (eval macro-alist-var))
 	      (define-key
 		keymap
-		(vector (vip-key-to-emacs-key (aref macro-name 0)))
+		(vector (viper-key-to-emacs-key (aref macro-name 0)))
 		nil))
 	  ))
     ))
     
 ;; Check if MACRO-ALIST has an entry for a macro name starting with
 ;; CHAR. If not, this indicates that the binding for this char
-;; in vip-vi/insert-kbd-map can be released.
-(defun vip-can-release-key (char macro-alist)
+;; in viper-vi/insert-kbd-map can be released.
+(defun viper-can-release-key (char macro-alist)
   (let ((lis macro-alist)
 	(can-release t)
 	macro-name)
@@ -579,52 +579,52 @@
     can-release))
 
 
-(defun vip-exec-mapped-kbd-macro (count)
+(defun viper-exec-mapped-kbd-macro (count)
   "Dispatch kbd macro."
   (interactive "P")
-  (let* ((macro-alist (cond ((eq vip-current-state 'vi-state)
-			     vip-vi-kbd-macro-alist)
-			    ((memq vip-current-state
+  (let* ((macro-alist (cond ((eq viper-current-state 'vi-state)
+			     viper-vi-kbd-macro-alist)
+			    ((memq viper-current-state
 				   '(insert-state replace-state))
-			     vip-insert-kbd-macro-alist)
+			     viper-insert-kbd-macro-alist)
 			    (t
-			     vip-emacs-kbd-macro-alist)))
+			     viper-emacs-kbd-macro-alist)))
 	(unmatched-suffix "")
 	;; Macros and keys are executed with other macros turned off
 	;; For macros, this is done to avoid macro recursion
-	vip-vi-kbd-minor-mode vip-insert-kbd-minor-mode
-	vip-emacs-kbd-minor-mode
+	viper-vi-kbd-minor-mode viper-insert-kbd-minor-mode
+	viper-emacs-kbd-minor-mode
 	next-best-match keyseq event-seq
 	macro-first-char macro-alist-elt macro-body
 	command)
     
     (setq macro-first-char last-command-event
-	  event-seq (vip-read-fast-keysequence macro-first-char macro-alist)
-	  keyseq (vip-events-to-macro event-seq)
+	  event-seq (viper-read-fast-keysequence macro-first-char macro-alist)
+	  keyseq (viper-events-to-macro event-seq)
 	  macro-alist-elt (assoc keyseq macro-alist)
-	  next-best-match (vip-find-best-matching-macro macro-alist keyseq))
+	  next-best-match (viper-find-best-matching-macro macro-alist keyseq))
 	  
     (if (null macro-alist-elt)
 	(setq macro-alist-elt (car next-best-match)
 	      unmatched-suffix (subseq event-seq (cdr next-best-match))))
 
     (cond ((null macro-alist-elt))
-	  ((setq macro-body (vip-kbd-buf-definition macro-alist-elt)))
-	  ((setq macro-body (vip-kbd-mode-definition macro-alist-elt)))
-	  ((setq macro-body (vip-kbd-global-definition macro-alist-elt))))
+	  ((setq macro-body (viper-kbd-buf-definition macro-alist-elt)))
+	  ((setq macro-body (viper-kbd-mode-definition macro-alist-elt)))
+	  ((setq macro-body (viper-kbd-global-definition macro-alist-elt))))
 				 
     ;; when defining keyboard macro, don't use the macro mappings
     (if (and macro-body (not defining-kbd-macro))
 	;; block cmd executed as part of a macro from entering command history
 	(let ((command-history command-history))
-	  (setq vip-this-kbd-macro (car macro-alist-elt))
-	  (execute-kbd-macro (vip-macro-to-events macro-body) count)
-	  (setq vip-this-kbd-macro nil
-		vip-last-kbd-macro (car macro-alist-elt))
-	  (vip-set-unread-command-events unmatched-suffix))
+	  (setq viper-this-kbd-macro (car macro-alist-elt))
+	  (execute-kbd-macro (viper-macro-to-events macro-body) count)
+	  (setq viper-this-kbd-macro nil
+		viper-last-kbd-macro (car macro-alist-elt))
+	  (viper-set-unread-command-events unmatched-suffix))
       ;; If not a macro, or the macro is suppressed while defining another
       ;; macro, put keyseq back on the event queue
-      (vip-set-unread-command-events event-seq)
+      (viper-set-unread-command-events event-seq)
       ;; if the user typed arg, then use it if prefix arg is not set by
       ;; some other command (setting prefix arg can happen if we do, say,
       ;; 2dw and there is a macro starting with 2. Then control will go to
@@ -640,36 +640,36 @@
 
 ;;; Displaying and completing macros
     
-(defun vip-describe-kbd-macros ()
+(defun viper-describe-kbd-macros ()
   "Show currently defined keyboard macros."
   (interactive)
-  (with-output-to-temp-buffer " *vip-info*"
+  (with-output-to-temp-buffer " *viper-info*"
     (princ "Macros in Vi state:\n===================\n")
-    (mapcar 'vip-describe-one-macro vip-vi-kbd-macro-alist)
+    (mapcar 'viper-describe-one-macro viper-vi-kbd-macro-alist)
     (princ "\n\nMacros in Insert and Replace states:\n====================================\n")
-    (mapcar 'vip-describe-one-macro vip-insert-kbd-macro-alist)
+    (mapcar 'viper-describe-one-macro viper-insert-kbd-macro-alist)
     (princ "\n\nMacros in Emacs state:\n======================\n")
-    (mapcar 'vip-describe-one-macro vip-emacs-kbd-macro-alist)
+    (mapcar 'viper-describe-one-macro viper-emacs-kbd-macro-alist)
     ))
     
-(defun vip-describe-one-macro (macro)
+(defun viper-describe-one-macro (macro)
   (princ (format "\n  *** Mappings for %S:\n      ------------\n"
-		 (vip-display-macro (car macro))))
+		 (viper-display-macro (car macro))))
   (princ "   ** Buffer-specific:")
-  (if (vip-kbd-buf-alist macro)
-      (mapcar 'vip-describe-one-macro-elt (vip-kbd-buf-alist macro))
+  (if (viper-kbd-buf-alist macro)
+      (mapcar 'viper-describe-one-macro-elt (viper-kbd-buf-alist macro))
     (princ "  none\n"))
   (princ "\n   ** Mode-specific:")
-  (if (vip-kbd-mode-alist macro)
-      (mapcar 'vip-describe-one-macro-elt (vip-kbd-mode-alist macro))
+  (if (viper-kbd-mode-alist macro)
+      (mapcar 'viper-describe-one-macro-elt (viper-kbd-mode-alist macro))
     (princ "  none\n"))
   (princ "\n   ** Global:")
-  (if (vip-kbd-global-definition macro)
-      (princ (format "\n           %S" (cdr (vip-kbd-global-pair macro))))
+  (if (viper-kbd-global-definition macro)
+      (princ (format "\n           %S" (cdr (viper-kbd-global-pair macro))))
     (princ "  none"))
   (princ "\n"))
   
-(defun vip-describe-one-macro-elt (elt)
+(defun viper-describe-one-macro-elt (elt)
   (let ((name (car elt))
 	(defn (cdr elt)))
     (princ (format "\n       * %S:\n           %S\n" name defn))))
@@ -677,23 +677,23 @@
     
     
 ;; check if SEQ is a prefix of some car of an element in ALIST
-(defun vip-keyseq-is-a-possible-macro (seq alist)
-  (let ((converted-seq (vip-events-to-macro seq)))
+(defun viper-keyseq-is-a-possible-macro (seq alist)
+  (let ((converted-seq (viper-events-to-macro seq)))
     (eval (cons 'or 
 		(mapcar
 		 (function (lambda (elt)
-			     (vip-prefix-subseq-p converted-seq elt)))
-		 (vip-this-buffer-macros alist))))))
+			     (viper-prefix-subseq-p converted-seq elt)))
+		 (viper-this-buffer-macros alist))))))
 		 
 ;; whether SEQ1 is a prefix of SEQ2
-(defun vip-prefix-subseq-p (seq1 seq2)
+(defun viper-prefix-subseq-p (seq1 seq2)
   (let ((len1 (length seq1))
 	(len2 (length seq2)))
     (if (<= len1 len2)
 	(equal seq1 (subseq seq2 0 len1)))))
 	
 ;; find the longest common prefix
-(defun vip-common-seq-prefix (&rest seqs)
+(defun viper-common-seq-prefix (&rest seqs)
   (let* ((first (car seqs))
 	 (rest (cdr seqs))
 	 (pref [])
@@ -713,15 +713,15 @@
     pref))
     
 ;; get all sequences that match PREFIX from a given A-LIST
-(defun vip-extract-matching-alist-members (pref alist)
+(defun viper-extract-matching-alist-members (pref alist)
   (delq nil (mapcar (function (lambda (elt)
-				(if (vip-prefix-subseq-p pref elt)
+				(if (viper-prefix-subseq-p pref elt)
 				    elt)))
-		    (vip-this-buffer-macros alist))))
+		    (viper-this-buffer-macros alist))))
 		    
-(defun vip-do-sequence-completion (seq alist compl-message)
-  (let* ((matches (vip-extract-matching-alist-members seq alist))
-	 (new-seq (apply 'vip-common-seq-prefix matches))
+(defun viper-do-sequence-completion (seq alist compl-message)
+  (let* ((matches (viper-extract-matching-alist-members seq alist))
+	 (new-seq (apply 'viper-common-seq-prefix matches))
 	 )
     (cond ((and (equal seq new-seq) (= (length matches) 1))
 	   (message "%s (Sole completion)" compl-message)
@@ -733,24 +733,24 @@
 	  ((member seq matches) 
 	   (message "%s (Complete, but not unique)" compl-message)
 	   (sit-for 2)
-	   (vip-display-vector-completions matches))
+	   (viper-display-vector-completions matches))
 	  ((equal seq new-seq)
-	   (vip-display-vector-completions matches)))
+	   (viper-display-vector-completions matches)))
     new-seq))
 	
 	 
-(defun vip-display-vector-completions (list)
+(defun viper-display-vector-completions (list)
   (with-output-to-temp-buffer "*Completions*"
     (display-completion-list 
      (mapcar 'prin1-to-string
-	     (mapcar 'vip-display-macro list)))))
+	     (mapcar 'viper-display-macro list)))))
   
 				  
     
 ;; alist is the alist of macros
 ;; str is the fast key sequence entered
 ;; returns: (matching-macro-def . unmatched-suffix-start-index)
-(defun vip-find-best-matching-macro (alist str)
+(defun viper-find-best-matching-macro (alist str)
   (let ((lis alist)
 	(def-len 0)
 	(str-len (length str))
@@ -760,9 +760,9 @@
 	    def-len (length (car macro-def)))
       (if (and (>= str-len def-len)
 	       (equal (car macro-def) (subseq str 0 def-len)))
-	  (if (or (vip-kbd-buf-definition macro-def)
-		  (vip-kbd-mode-definition macro-def)
-		  (vip-kbd-global-definition macro-def))
+	  (if (or (viper-kbd-buf-definition macro-def)
+		  (viper-kbd-mode-definition macro-def)
+		  (viper-kbd-global-definition macro-def))
 	      (setq found t))
 	)
       (setq lis (cdr lis)))
@@ -778,14 +778,14 @@
     
     
 ;; returns a list of names of macros defined for the current buffer
-(defun vip-this-buffer-macros (macro-alist)
+(defun viper-this-buffer-macros (macro-alist)
   (let (candidates)
     (setq candidates
 	  (mapcar (function
 		   (lambda (elt)
-		     (if (or (vip-kbd-buf-definition elt)
-			     (vip-kbd-mode-definition elt)
-			     (vip-kbd-global-definition elt))
+		     (if (or (viper-kbd-buf-definition elt)
+			     (viper-kbd-mode-definition elt)
+			     (viper-kbd-global-definition elt))
 			 (car elt))))
 		  macro-alist))
     (setq candidates (delq nil candidates))))
@@ -793,10 +793,10 @@
   
 ;; if seq of Viper key symbols (representing a macro) can be converted to a
 ;; string--do so. Otherwise, do nothing.
-(defun vip-display-macro (macro-name-or-body)
-  (cond ((vip-char-symbol-sequence-p macro-name-or-body)
+(defun viper-display-macro (macro-name-or-body)
+  (cond ((viper-char-symbol-sequence-p macro-name-or-body)
 	 (mapconcat 'symbol-name macro-name-or-body ""))
-	((vip-char-array-p macro-name-or-body)
+	((viper-char-array-p macro-name-or-body)
 	 (mapconcat 'char-to-string macro-name-or-body ""))
 	(t macro-name-or-body)))
     
@@ -809,27 +809,27 @@
 ;; during a macro definition, then something like (switch-frame ...) might get
 ;; in. Another reason for purging lists-events is that we can't store them in
 ;; textual form (say, in .emacs) and then read them back.
-(defun vip-events-to-macro (event-seq)
+(defun viper-events-to-macro (event-seq)
   (vconcat (delq nil (mapcar (function (lambda (elt)
 					 (if (consp elt)
 					     nil
-					   (vip-event-key elt))))
+					   (viper-event-key elt))))
 			     event-seq))))
   
 ;; convert strings or arrays of characters to Viper macro form
-(defun vip-char-array-to-macro (array)
+(defun viper-char-array-to-macro (array)
   (let ((vec (vconcat array))
 	macro)
-    (if vip-xemacs-p
+    (if viper-xemacs-p
 	(setq macro (mapcar 'character-to-event vec))
       (setq macro vec))
-    (vconcat (mapcar 'vip-event-key macro))))
+    (vconcat (mapcar 'viper-event-key macro))))
     
 ;; For macros bodies and names, goes over MACRO and checks if all members are
 ;; names of keys (actually, it only checks if they are symbols or lists
 ;; if a digit is found, it is converted into a symbol (e.g., 0 -> \0, etc).
 ;; If MACRO is not a list or vector -- doesn't change MACRO.
-(defun vip-fixup-macro (macro)
+(defun viper-fixup-macro (macro)
   (let ((len (length macro))
 	(idx 0)
 	elt break)
@@ -848,7 +848,7 @@
 				    (intern (char-to-string (+ ?0 elt)))))
 			   )))
 		((listp elt)
-		 (vip-fixup-macro elt))
+		 (viper-fixup-macro elt))
 		((symbolp elt) nil)
 		(t (setq break t)))
 	  (setq idx (1+ idx))))
@@ -857,15 +857,15 @@
 	  (error "Wrong type macro component, symbol-or-listp, %S" elt)
 	macro)))
   
-(defun vip-char-array-p (array)
-  (eval (cons 'and (mapcar 'vip-characterp array))))
+(defun viper-char-array-p (array)
+  (eval (cons 'and (mapcar 'viper-characterp array))))
   
-(defun vip-macro-to-events (macro-body)
-  (vconcat (mapcar 'vip-key-to-emacs-key macro-body)))
+(defun viper-macro-to-events (macro-body)
+  (vconcat (mapcar 'viper-key-to-emacs-key macro-body)))
 	    
 			 
 ;; check if vec is a vector of character symbols
-(defun vip-char-symbol-sequence-p (vec)
+(defun viper-char-symbol-sequence-p (vec)
   (and
    (sequencep vec)
    (eval
@@ -878,7 +878,7 @@
 
 ;; Check if vec is a vector of key-press events representing characters
 ;; XEmacs only
-(defun vip-event-vector-p (vec)
+(defun viper-event-vector-p (vec)
   (and (vectorp vec)
        (eval (cons 'and (mapcar '(lambda (elt) (if (eventp elt) t)) vec)))))
     
@@ -889,15 +889,15 @@
 ;; strokes, read the rest. Return the vector of keys that was entered in
 ;; this fast succession of key strokes.
 ;; A fast keysequence is one that is terminated by a pause longer than
-;; vip-fast-keyseq-timeout.
-(defun vip-read-fast-keysequence (event macro-alist)
+;; viper-fast-keyseq-timeout.
+(defun viper-read-fast-keysequence (event macro-alist)
   (let ((lis (vector event))
 	next-event)
-    (while (and (vip-fast-keysequence-p)
-		(vip-keyseq-is-a-possible-macro lis macro-alist))
-      (setq next-event (vip-read-key))
-      ;;(setq next-event (vip-read-event))
-      (or (vip-mouse-event-p next-event)
+    (while (and (viper-fast-keysequence-p)
+		(viper-keyseq-is-a-possible-macro lis macro-alist))
+      (setq next-event (viper-read-key))
+      ;;(setq next-event (viper-read-event))
+      (or (viper-mouse-event-p next-event)
 	  (setq lis (vconcat lis (vector next-event)))))
     lis))
 
@@ -905,7 +905,7 @@
 ;;; Keyboard macros in registers
 
 ;; sets register to last-kbd-macro carefully.
-(defun vip-set-register-macro (reg)
+(defun viper-set-register-macro (reg)
   (if (get-register reg)
       (if (y-or-n-p "Register contains data. Overwrite? ")
 	  ()
@@ -913,35 +913,35 @@
 	 "Macro not saved in register. Can still be invoked via `C-x e'")))
   (set-register reg last-kbd-macro))
 
-(defun vip-register-macro (count)
+(defun viper-register-macro (count)
   "Keyboard macros in registers - a modified \@ command."
   (interactive "P")
   (let ((reg (downcase (read-char))))
     (cond ((or (and (<= ?a reg) (<= reg ?z)))
-	   (setq vip-last-macro-reg reg)
+	   (setq viper-last-macro-reg reg)
 	   (if defining-kbd-macro
 	       (progn
 		 (end-kbd-macro)
-		 (vip-set-register-macro reg))
+		 (viper-set-register-macro reg))
 	     (execute-kbd-macro (get-register reg) count)))
 	  ((or (= ?@ reg) (= ?\^j reg) (= ?\^m reg))
-	   (if vip-last-macro-reg 
+	   (if viper-last-macro-reg 
 	       nil
 	       (error "No previous kbd macro"))
-	   (execute-kbd-macro (get-register vip-last-macro-reg) count))
+	   (execute-kbd-macro (get-register viper-last-macro-reg) count))
 	  ((= ?\# reg)
 	   (start-kbd-macro count))
 	  ((= ?! reg)
 	   (setq reg (downcase (read-char)))
 	   (if (or (and (<= ?a reg) (<= reg ?z)))
 	       (progn
-	       (setq vip-last-macro-reg reg)
-	       (vip-set-register-macro reg))))
+	       (setq viper-last-macro-reg reg)
+	       (viper-set-register-macro reg))))
 	  (t
 	   (error "`%c': Unknown register" reg)))))
 	   
 
-(defun vip-global-execute ()
+(defun viper-global-execute ()
   "Call last keyboad macro for each line in the region."
   (if (> (point) (mark t)) (exchange-point-and-mark))
   (beginning-of-line)
--- a/lisp/viper/viper-mous.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-mous.el	Mon Aug 13 09:53:19 2007 +0200
@@ -26,11 +26,11 @@
 ;; compiler pacifier
 (defvar double-click-time)
 (defvar mouse-track-multi-click-time)
-(defvar vip-search-start-marker)
-(defvar vip-local-search-start-marker)
-(defvar vip-search-history)
-(defvar vip-s-string)
-(defvar vip-re-search)
+(defvar viper-search-start-marker)
+(defvar viper-local-search-start-marker)
+(defvar viper-search-history)
+(defvar viper-s-string)
+(defvar viper-re-search)
 
 ;; loading happens only in non-interactive compilation
 ;; in order to spare non-viperized emacs from being viperized
@@ -49,7 +49,7 @@
 
 (defgroup viper-mouse nil
   "Support for Viper special mouse-bound commands"
-  :prefix "vip-"
+  :prefix "viper-"
   :group 'viper)
 
 
@@ -57,13 +57,13 @@
   
 ;; Variable used for catching the switch-frame event.
 ;; If non-nil, indicates that previous-frame should be the selected
-;; one. Used by vip-mouse-click-get-word. Not a user option.
-(defvar vip-frame-of-focus nil)
+;; one. Used by viper-mouse-click-get-word. Not a user option.
+(defvar viper-frame-of-focus nil)
     
 ;; Frame that was selected before the switch-frame event.
-(defconst vip-current-frame-saved (selected-frame))
+(defconst viper-current-frame-saved (selected-frame))
   
-(defcustom vip-surrounding-word-function 'vip-surrounding-word
+(defcustom viper-surrounding-word-function 'viper-surrounding-word
   "*Function that determines what constitutes a word for clicking events.
 Takes two parameters: a COUNT, indicating how many words to return, 
 and CLICK-COUNT, telling whether this is the first click, a double-click,
@@ -73,8 +73,8 @@
        
 ;; time interval in millisecond within which successive clicks are
 ;; considered related
-(defcustom vip-multiclick-timeout (if (vip-window-display-p)
-				      (if vip-xemacs-p
+(defcustom viper-multiclick-timeout (if (viper-window-display-p)
+				      (if viper-xemacs-p
 					  mouse-track-multi-click-time
 					double-click-time)
 				    500)
@@ -84,55 +84,63 @@
   :group 'viper-mouse)
 
 ;; current event click count; XEmacs only
-(defvar vip-current-click-count 0)
+(defvar viper-current-click-count 0)
 ;; time stamp of the last click event; XEmacs only
-(defvar vip-last-click-event-timestamp 0)
+(defvar viper-last-click-event-timestamp 0)
 
 ;; Local variable used to toggle wraparound search on click.
-(vip-deflocalvar  vip-mouse-click-search-noerror t)
+(viper-deflocalvar  viper-mouse-click-search-noerror t)
 	
 ;; Local variable used to delimit search after wraparound.
-(vip-deflocalvar  vip-mouse-click-search-limit nil)
+(viper-deflocalvar  viper-mouse-click-search-limit nil)
 	
 ;; remembers prefix argument to pass along to commands invoked by second
 ;; click.
 ;; This is needed because in Emacs (not XEmacs), assigning to preix-arg
 ;; causes Emacs to count the second click as if it was a single click
-(defvar vip-global-prefix-argument nil)
+(defvar viper-global-prefix-argument nil)
+
+
+;; same keys, but parsed
+(defvar viper-mouse-up-search-key-parsed nil)
+(defvar viper-mouse-down-search-key-parsed nil)
+(defvar viper-mouse-up-insert-key-parsed nil)
+(defvar viper-mouse-down-insert-key-parsed nil)
+
 
 
 
 ;;; Code
 
-(defsubst vip-multiclick-p ()
-  (not (vip-sit-for-short vip-multiclick-timeout t)))
+(defsubst viper-multiclick-p ()
+  (not (viper-sit-for-short viper-multiclick-timeout t)))
 
 ;; Returns window where click occurs
-(defsubst vip-mouse-click-window (click)
-  (if vip-xemacs-p
+(defsubst viper-mouse-click-window (click)
+  (if viper-xemacs-p
       (event-window click)
     (posn-window (event-start click))))
 
 ;; Returns window where click occurs
-(defsubst vip-mouse-click-frame (click)
-  (window-frame (vip-mouse-click-window click)))
+(defsubst viper-mouse-click-frame (click)
+  (window-frame (viper-mouse-click-window click)))
 
 ;; Returns the buffer of the window where click occurs
-(defsubst vip-mouse-click-window-buffer (click)
-  (window-buffer (vip-mouse-click-window click)))
+(defsubst viper-mouse-click-window-buffer (click)
+  (window-buffer (viper-mouse-click-window click)))
 
 ;; Returns the name of the buffer in the window where click occurs
-(defsubst vip-mouse-click-window-buffer-name (click)
-  (buffer-name (vip-mouse-click-window-buffer click)))
+(defsubst viper-mouse-click-window-buffer-name (click)
+  (buffer-name (viper-mouse-click-window-buffer click)))
 
 ;; Returns position of a click
-(defsubst vip-mouse-click-posn (click)
-  (if vip-xemacs-p
+(defsubst viper-mouse-click-posn (click)
+  (if viper-xemacs-p
       (event-point click)
     (posn-point (event-start click))))
 	     
 
-(defun vip-surrounding-word (count click-count)
+(defun viper-surrounding-word (count click-count)
    "Returns word surrounding point according to a heuristic.
 COUNT indicates how many regions to return.
 If CLICK-COUNT is 1, `word' is a word in Vi sense.
@@ -153,16 +161,16 @@
      (if (> click-count 2)
 	 (save-excursion
 	   (beginning-of-line)
-	   (vip-skip-all-separators-forward 'within-line)
+	   (viper-skip-all-separators-forward 'within-line)
 	   (setq beg (point))
 	   (end-of-line)
 	   (setq result (buffer-substring beg (point))))
        
-       (if (and (not (vip-looking-at-alphasep))
-		(or (save-excursion (vip-backward-char-carefully)
-				    (vip-looking-at-alpha))
-		    (save-excursion (vip-forward-char-carefully)
-				    (vip-looking-at-alpha))))
+       (if (and (not (viper-looking-at-alphasep))
+		(or (save-excursion (viper-backward-char-carefully)
+				    (viper-looking-at-alpha))
+		    (save-excursion (viper-forward-char-carefully)
+				    (viper-looking-at-alpha))))
 	   (setq modifiers
 		 (cond ((looking-at "\\\\") "\\\\")
 		       ((looking-at "-") "C-C-")
@@ -172,7 +180,7 @@
 		       ((looking-at "[<>]") "<>")
 		       ((looking-at "[`']") "`'")
 		       ((looking-at "\\^") "\\^")
-		       ((vip-looking-at-separator) "")
+		       ((viper-looking-at-separator) "")
 		       (t (char-to-string (following-char))))
 		 ))
        
@@ -183,45 +191,45 @@
        
        
        (save-excursion
-	 (cond ((> click-count 1) (vip-skip-nonseparators 'backward))
-	       ((vip-looking-at-alpha modifiers)
-		(vip-skip-alpha-backward modifiers))
-	       ((not (vip-looking-at-alphasep modifiers))
-		(vip-skip-nonalphasep-backward))
+	 (cond ((> click-count 1) (viper-skip-nonseparators 'backward))
+	       ((viper-looking-at-alpha modifiers)
+		(viper-skip-alpha-backward modifiers))
+	       ((not (viper-looking-at-alphasep modifiers))
+		(viper-skip-nonalphasep-backward))
 	       (t (if (> click-count 1)
-		      (vip-skip-nonseparators 'backward)
-		    (vip-skip-alpha-backward modifiers))))
+		      (viper-skip-nonseparators 'backward)
+		    (viper-skip-alpha-backward modifiers))))
 
 	 (setq word-beg (point))
 	 
 	 (setq skip-flag nil) ; don't move 1 char forw the first time
 	 (while (> count 0)
-	   (if skip-flag (vip-forward-char-carefully 1))
+	   (if skip-flag (viper-forward-char-carefully 1))
 	   (setq skip-flag t) ; now always move 1 char forward
 	   (if (> click-count 1)
-	       (vip-skip-nonseparators 'forward)
-	     (vip-skip-alpha-forward modifiers))
+	       (viper-skip-nonseparators 'forward)
+	     (viper-skip-alpha-forward modifiers))
 	   (setq count (1- count)))
 
 	 (setq result (buffer-substring word-beg (point))))
        ) ; if
      ;; XEmacs doesn't have set-text-properties, but there buffer-substring
      ;; doesn't return properties together with the string, so it's not needed.
-     (if vip-emacs-p
+     (if viper-emacs-p
 	 (set-text-properties 0 (length result) nil result))
      result
      ))
 
 
-(defun vip-mouse-click-get-word (click count click-count)
+(defun viper-mouse-click-get-word (click count click-count)
   "Returns word surrounding the position of a mouse click.
 Click may be in another window. Current window and buffer isn't changed.
 On single or double click, returns the word as determined by
-`vip-surrounding-word-function'."
+`viper-surrounding-word-function'."
      
   (let ((click-word "")
-	(click-pos (vip-mouse-click-posn click))
-	(click-buf (vip-mouse-click-window-buffer click)))
+	(click-pos (viper-mouse-click-posn click))
+	(click-buf (viper-mouse-click-window-buffer click)))
     (or (natnump count) (setq count 1))
     (or (natnump click-count) (setq click-count 1))
      
@@ -233,21 +241,21 @@
 	
 	      (goto-char click-pos)
 	      (setq click-word
-		    (funcall vip-surrounding-word-function count click-count)))
+		    (funcall viper-surrounding-word-function count click-count)))
 	  (error "Click must be over a window."))
 	click-word))))
 
 
-(defun vip-mouse-click-insert-word (click arg)
+(defun viper-mouse-click-insert-word (click arg)
   "Insert word clicked or double-clicked on.
 With prefix argument, N, insert that many words.
 This command must be bound to a mouse click.
 The double-click action of the same mouse button must not be bound
 \(or it must be bound to the same function\).
-See `vip-surrounding-word' for the definition of a word in this case."
+See `viper-surrounding-word' for the definition of a word in this case."
   (interactive "e\nP")
-  (if vip-frame-of-focus	;; to handle clicks in another frame
-      (select-frame vip-frame-of-focus))
+  (if viper-frame-of-focus	;; to handle clicks in another frame
+      (select-frame viper-frame-of-focus))
       
   ;; turn arg into a number
   (cond ((integerp arg) nil)
@@ -256,168 +264,175 @@
 	 (setq arg (car arg)))
 	(t (setq arg 1)))
       
-  (let (click-count interrupting-event)
-    (if (and
-	 (vip-multiclick-p)
-	 ;; This trick checks if there is a pending mouse event
-	 ;; if so, we use this latter event and discard the current mouse click
-	 ;; If the next pending event is not a mouse event, we execute
-	 ;; the current mouse event
-	 (progn
-	   (setq interrupting-event (vip-read-event))
-	   (vip-mouse-event-p last-input-event)))
-	(progn ;; interrupted wait
-	  (setq vip-global-prefix-argument arg)
-	  ;; count this click for XEmacs
-	  (vip-event-click-count click))
-      ;; uninterrupted wait or the interrupting event wasn't a mouse event
-      (setq click-count (vip-event-click-count click))
-      (if (> click-count 1)
-	  (setq arg vip-global-prefix-argument
-		vip-global-prefix-argument nil))
-      (insert (vip-mouse-click-get-word click arg click-count))
-      (if (and interrupting-event
-	       (eventp interrupting-event)
-	       (not (vip-mouse-event-p interrupting-event)))
-	  (vip-set-unread-command-events interrupting-event))
-      )))
+  (if (not (eq (key-binding viper-mouse-down-insert-key-parsed)
+	       'viper-mouse-catch-frame-switch))
+      () ; do nothing
+    (let (click-count interrupting-event)
+      (if (and
+	   (viper-multiclick-p)
+	   ;; This trick checks if there is a pending mouse event if so, we use
+	   ;; this latter event and discard the current mouse click If the next
+	   ;; pending event is not a mouse event, we execute the current mouse
+	   ;; event
+	   (progn
+	     (setq interrupting-event (viper-read-event))
+	     (viper-mouse-event-p last-input-event)))
+	  (progn ; interrupted wait
+	    (setq viper-global-prefix-argument arg)
+	    ;; count this click for XEmacs
+	    (viper-event-click-count click))
+	;; uninterrupted wait or the interrupting event wasn't a mouse event
+	(setq click-count (viper-event-click-count click))
+	(if (> click-count 1)
+	    (setq arg viper-global-prefix-argument
+		  viper-global-prefix-argument nil))
+	(insert (viper-mouse-click-get-word click arg click-count))
+	(if (and interrupting-event
+		 (eventp interrupting-event)
+		 (not (viper-mouse-event-p interrupting-event)))
+	    (viper-set-unread-command-events interrupting-event))
+	))))
   
 ;; arg is an event. accepts symbols and numbers, too
-(defun vip-mouse-event-p (event)
+(defun viper-mouse-event-p (event)
   (if (eventp event)
       (string-match "\\(mouse-\\|frame\\|screen\\|track\\)"
-		    (prin1-to-string (vip-event-key event)))))
+		    (prin1-to-string (viper-event-key event)))))
   
 ;; XEmacs has no double-click events. So, we must simulate.
 ;; So, we have to simulate event-click-count.
-(defun vip-event-click-count (click)
-  (if vip-xemacs-p
+(defun viper-event-click-count (click)
+  (if viper-xemacs-p
       (progn
 	;; if more than 1 second
-	(if (> (- (event-timestamp click) vip-last-click-event-timestamp)
-	       vip-multiclick-timeout)
-	    (setq vip-current-click-count 0))
-	(setq vip-last-click-event-timestamp (event-timestamp click)
-	      vip-current-click-count (1+ vip-current-click-count)))
+	(if (> (- (event-timestamp click) viper-last-click-event-timestamp)
+	       viper-multiclick-timeout)
+	    (setq viper-current-click-count 0))
+	(setq viper-last-click-event-timestamp (event-timestamp click)
+	      viper-current-click-count (1+ viper-current-click-count)))
     (event-click-count click)))
     
 
 
-(defun vip-mouse-click-search-word (click arg)
+(defun viper-mouse-click-search-word (click arg)
    "Find the word clicked or double-clicked on. Word may be in another window.
 With prefix argument, N, search for N-th occurrence.
 This command must be bound to a mouse click. The double-click action of the
 same button must not be bound \(or it must be bound to the same function\).
-See `vip-surrounding-word' for the details on what constitutes a word for
+See `viper-surrounding-word' for the details on what constitutes a word for
 this command."
   (interactive "e\nP")
-  (if vip-frame-of-focus	;; to handle clicks in another frame
-      (select-frame vip-frame-of-focus))
-  (let (click-word click-count
-	(previous-search-string vip-s-string))
-    
-    (if (and
-	 (vip-multiclick-p)
-	 ;; This trick checks if there is a pending mouse event
-	 ;; if so, we use this latter event and discard the current mouse click
-	 ;; If the next pending event is not a mouse event, we execute
-	 ;; the current mouse event
-	 (progn
-	   (vip-read-event)
-	   (vip-mouse-event-p last-input-event)))
-	(progn ;; interrupted wait
-	  (setq vip-global-prefix-argument 
-		(or vip-global-prefix-argument arg))
-	  ;; remember command that was before the multiclick
-	  (setq this-command last-command)
-	  ;; make sure we counted this event---needed for XEmacs only
-	  (vip-event-click-count click))
-      ;; uninterrupted wait
-      (setq click-count (vip-event-click-count click))
-      (setq click-word (vip-mouse-click-get-word click nil click-count))
-    
-      (if (> click-count 1)
-	  (setq arg vip-global-prefix-argument
-		vip-global-prefix-argument nil))
-      (setq arg (or arg 1))
+  (if viper-frame-of-focus	;; to handle clicks in another frame
+      (select-frame viper-frame-of-focus))
+  (if (not (eq (key-binding viper-mouse-down-search-key-parsed)
+	       'viper-mouse-catch-frame-switch))
+      () ; do nothing
+    (let ((previous-search-string viper-s-string)
+	  click-word click-count)
     
-      (vip-deactivate-mark)
-      (if (or (not (string= click-word vip-s-string))
-	      (not (markerp vip-search-start-marker))
-	      (not (equal (marker-buffer vip-search-start-marker)
-			  (current-buffer)))
-	      (not (eq last-command 'vip-mouse-click-search-word)))
-	  (progn
-	    (setq  vip-search-start-marker (point-marker)
-		   vip-local-search-start-marker vip-search-start-marker
-		   vip-mouse-click-search-noerror t
-		   vip-mouse-click-search-limit nil)
-	    
-	    ;; make search string known to Viper
-	    (setq vip-s-string (if vip-re-search
-				   (regexp-quote click-word)
-				 click-word))
-	    (if (not (string= vip-s-string (car vip-search-history)))
-		(setq vip-search-history
-		      (cons vip-s-string vip-search-history)))
-	    ))
-      
-      (push-mark nil t)
-      (while (> arg 0)
-	(vip-forward-word 1)
-	(condition-case nil
+      (if (and
+	   (viper-multiclick-p)
+	   ;; This trick checks if there is a pending mouse event if so, we use
+	   ;; this latter event and discard the current mouse click If the next
+	   ;; pending event is not a mouse event, we execute the current mouse
+	   ;; event
+	   (progn
+	     (viper-read-event)
+	     (viper-mouse-event-p last-input-event)))
+	  (progn ; interrupted wait
+	    (setq viper-global-prefix-argument 
+		  (or viper-global-prefix-argument arg))
+	    ;; remember command that was before the multiclick
+	    (setq this-command last-command)
+	    ;; make sure we counted this event---needed for XEmacs only
+	    (viper-event-click-count click))
+	;; uninterrupted wait
+	(setq click-count (viper-event-click-count click))
+	(setq click-word (viper-mouse-click-get-word click nil click-count))
+	
+	(if (> click-count 1)
+	    (setq arg viper-global-prefix-argument
+		  viper-global-prefix-argument nil))
+	(setq arg (or arg 1))
+	
+	(viper-deactivate-mark)
+	(if (or (not (string= click-word viper-s-string))
+		(not (markerp viper-search-start-marker))
+		(not (equal (marker-buffer viper-search-start-marker)
+			    (current-buffer)))
+		(not (eq last-command 'viper-mouse-click-search-word)))
 	    (progn
-	      (if (not (search-forward click-word vip-mouse-click-search-limit
-				       vip-mouse-click-search-noerror))
-		  (progn
-		    (setq vip-mouse-click-search-noerror nil)
-		    (setq vip-mouse-click-search-limit
-			  (save-excursion
-			    (if (and
-				 (markerp vip-local-search-start-marker)
-				 (marker-buffer vip-local-search-start-marker))
-				(goto-char vip-local-search-start-marker))
-			    (vip-line-pos 'end)))
-			    
-		    (goto-char (point-min))
-		    (search-forward click-word
-				    vip-mouse-click-search-limit nil)))
-	      (goto-char (match-beginning 0))
-	      (message "Searching for: %s" vip-s-string)
-	      (if (<= arg 1) ; found the right occurrence of the pattern
-		  (progn
-		    (vip-adjust-window)
-		    (vip-flash-search-pattern)))
-	      )
-	  (error (beep 1)
-		 (if (or (not (string= click-word previous-search-string))
-			 (not (eq  last-command 'vip-mouse-click-search-word)))
-		     (message "`%s': String not found in %s"
-			      vip-s-string (buffer-name (current-buffer)))
-		   (message
-		    "`%s': Last occurrence in %s. Back to beginning of search"
-		    click-word (buffer-name (current-buffer)))
-		   (setq arg 1) ;; to terminate the loop
-		   (sit-for 2))
-		 (setq  vip-mouse-click-search-noerror t) 
-		 (setq  vip-mouse-click-search-limit nil)
-		 (if (and (markerp vip-local-search-start-marker)
-			  (marker-buffer vip-local-search-start-marker))
-		     (goto-char vip-local-search-start-marker))))
-	(setq arg (1- arg)))
-      )))
+	      (setq  viper-search-start-marker (point-marker)
+		     viper-local-search-start-marker viper-search-start-marker
+		     viper-mouse-click-search-noerror t
+		     viper-mouse-click-search-limit nil)
+	      
+	      ;; make search string known to Viper
+	      (setq viper-s-string (if viper-re-search
+				       (regexp-quote click-word)
+				   click-word))
+	      (if (not (string= viper-s-string (car viper-search-history)))
+		  (setq viper-search-history
+			(cons viper-s-string viper-search-history)))
+	      ))
+	
+	(push-mark nil t)
+	(while (> arg 0)
+	  (viper-forward-word 1)
+	  (condition-case nil
+	      (progn
+		(if (not (search-forward
+			  click-word viper-mouse-click-search-limit
+			  viper-mouse-click-search-noerror))
+		    (progn
+		      (setq viper-mouse-click-search-noerror nil)
+		      (setq viper-mouse-click-search-limit
+			    (save-excursion
+			      (if (and
+				   (markerp viper-local-search-start-marker)
+				   (marker-buffer viper-local-search-start-marker))
+				  (goto-char viper-local-search-start-marker))
+			      (viper-line-pos 'end)))
+		      
+		      (goto-char (point-min))
+		      (search-forward click-word
+				      viper-mouse-click-search-limit nil)))
+		(goto-char (match-beginning 0))
+		(message "Searching for: %s" viper-s-string)
+		(if (<= arg 1) ; found the right occurrence of the pattern
+		    (progn
+		      (viper-adjust-window)
+		      (viper-flash-search-pattern)))
+		)
+	    (error (beep 1)
+		   (if (or (not (string= click-word previous-search-string))
+			   (not (eq  last-command 'viper-mouse-click-search-word)))
+		       (message "`%s': String not found in %s"
+				viper-s-string (buffer-name (current-buffer)))
+		     (message
+		      "`%s': Last occurrence in %s. Back to beginning of search"
+		      click-word (buffer-name (current-buffer)))
+		     (setq arg 1) ;; to terminate the loop
+		     (sit-for 2))
+		   (setq  viper-mouse-click-search-noerror t) 
+		   (setq  viper-mouse-click-search-limit nil)
+		   (if (and (markerp viper-local-search-start-marker)
+			    (marker-buffer viper-local-search-start-marker))
+		       (goto-char viper-local-search-start-marker))))
+	  (setq arg (1- arg)))
+	))))
   
-(defun vip-mouse-catch-frame-switch (event arg)
+(defun viper-mouse-catch-frame-switch (event arg)
   "Catch the event of switching frame.
-Usually is bound to a 'down-mouse' event to work properly. See sample
+Usually is bound to a `down-mouse' event to work properly. See sample
 bindings in the Viper manual."
   (interactive "e\nP")
-  (setq vip-frame-of-focus nil)
-  ;; pass prefix arg along to vip-mouse-click-search/insert-word
+  (setq viper-frame-of-focus nil)
+  ;; pass prefix arg along to viper-mouse-click-search/insert-word
   (setq prefix-arg arg)
   (if (eq last-command 'handle-switch-frame)
-      (setq vip-frame-of-focus vip-current-frame-saved))
-  ;; make Emacs forget that it executed vip-mouse-catch-frame-switch
+      (setq viper-frame-of-focus viper-current-frame-saved))
+  ;; make Emacs forget that it executed viper-mouse-catch-frame-switch
   (setq this-command last-command))
       
 ;; Called just before switching frames. Saves the old selected frame.
@@ -431,18 +446,185 @@
 ;; Also, in Emacs sending input to frame B generates handle-switch-frame
 ;; event, while in XEmacs it doesn't.
 ;; All this accounts for the difference in the behavior of
-;; vip-mouse-click-* commands when you click in a frame other than the one
+;; viper-mouse-click-* commands when you click in a frame other than the one
 ;; that was the last to receive input. In Emacs, focus will be in frame A
-;; until you do something other than vip-mouse-click-* command.
+;; until you do something other than viper-mouse-click-* command.
 ;; In XEmacs, you have to manually select frame B (with the mouse click) in
 ;; order to shift focus to frame B.
-(defsubst vip-remember-current-frame (frame)
+(defsubst viper-remember-current-frame (frame)
   (setq last-command 'handle-switch-frame
-	vip-current-frame-saved (selected-frame)))
+	viper-current-frame-saved (selected-frame)))
+
+
+;; The key is of the form (MODIFIER ... BUTTON-NUMBER)
+;; Converts into a valid mouse button spec for the appropriate version of
+;; Emacs. EVENT-TYPE is either `up' or `down'. Up returns button-up key; down
+;; returns button-down key.
+(defun viper-parse-mouse-key (key-var event-type)
+  (let ((key (eval key-var))
+	button-spec meta-spec shift-spec control-spec key-spec)
+    (if (null key)
+	;; just return nil
+	()
+      (setq button-spec
+	    (cond ((memq 1 key)
+		   (if viper-emacs-p
+		       (if (eq 'up event-type)
+			   "mouse-1" "down-mouse-1")
+		     (if (eq 'up event-type)
+			 'button1up 'button1)))
+		  ((memq 2 key)
+		   (if viper-emacs-p
+		       (if (eq 'up event-type)
+			   "mouse-2" "down-mouse-2")
+		     (if (eq 'up event-type)
+			 'button2up 'button2)))
+		  ((memq 3 key)
+		   (if viper-emacs-p
+		       (if (eq 'up event-type)
+			   "mouse-3" "down-mouse-3")
+		     (if (eq 'up event-type)
+			 'button3up 'button3)))
+		  (t (error
+		      "%S: invalid button number, %S" key-var key)))
+	    meta-spec
+	    (if (memq 'meta key)
+		(if viper-emacs-p "M-" 'meta)
+	      (if viper-emacs-p "" nil))
+	    shift-spec
+	    (if (memq 'shift key)
+		(if viper-emacs-p "S-" 'shift)
+	      (if viper-emacs-p "" nil))
+	    control-spec
+	    (if (memq 'control key)
+		(if viper-emacs-p "C-" 'control)
+	      (if viper-emacs-p "" nil)))
+
+      (setq key-spec (if viper-emacs-p
+			 (vector
+			  (intern
+			   (concat
+			    control-spec meta-spec shift-spec button-spec)))
+		       (vector
+			(delq
+			 nil
+			 (list
+			  control-spec meta-spec shift-spec button-spec)))))
+      )))
+
+(defun viper-unbind-mouse-search-key ()
+  (if viper-mouse-up-search-key-parsed
+      (global-unset-key viper-mouse-up-search-key-parsed))
+  (if viper-mouse-down-search-key-parsed
+      (global-unset-key viper-mouse-down-search-key-parsed))
+  (setq viper-mouse-up-search-key-parsed nil
+	viper-mouse-down-search-key-parsed nil))
+
+(defun viper-unbind-mouse-insert-key ()
+  (if viper-mouse-up-insert-key-parsed
+      (global-unset-key viper-mouse-up-insert-key-parsed))
+  (if viper-mouse-down-insert-key-parsed
+      (global-unset-key viper-mouse-down-insert-key-parsed))
+  (setq viper-mouse-up-insert-key-parsed nil
+	viper-mouse-down-insert-key-parsed nil))
+
+;; If FORCE, bind even if this mouse action is already bound to something else
+(defun viper-bind-mouse-search-key (&optional force)
+  (setq viper-mouse-up-search-key-parsed
+	(viper-parse-mouse-key 'viper-mouse-search-key 'up)
+	viper-mouse-down-search-key-parsed
+	(viper-parse-mouse-key 'viper-mouse-search-key 'down))
+  (cond ((or (null viper-mouse-up-search-key-parsed)
+	     (null viper-mouse-down-search-key-parsed))
+	 nil) ; just quit
+	((and (null force) 
+	      (key-binding viper-mouse-up-search-key-parsed)
+	      (not (eq (key-binding viper-mouse-up-search-key-parsed)
+		       'viper-mouse-click-search-word)))
+	 (message 
+	  "%S already bound to a mouse event. Viper mouse-search feature disabled"
+	  viper-mouse-up-search-key-parsed))
+	((and (null force) 
+	      (key-binding viper-mouse-down-search-key-parsed)
+	      (not (eq (key-binding viper-mouse-down-search-key-parsed)
+		       'viper-mouse-catch-frame-switch)))
+	 (message
+	  "%S already bound to a mouse event. Viper mouse-search feature disabled"
+	  viper-mouse-down-search-key-parsed))
+	(t 
+	 (global-set-key viper-mouse-up-search-key-parsed
+			 'viper-mouse-click-search-word)
+	 (global-set-key viper-mouse-down-search-key-parsed
+			 'viper-mouse-catch-frame-switch))))
+
+;; If FORCE, bind even if this mouse action is already bound to something else
+(defun viper-bind-mouse-insert-key (&optional force)
+  (setq viper-mouse-up-insert-key-parsed
+	(viper-parse-mouse-key 'viper-mouse-insert-key 'up)
+	viper-mouse-down-insert-key-parsed
+	(viper-parse-mouse-key 'viper-mouse-insert-key 'down))
+  (cond ((or (null viper-mouse-up-insert-key-parsed)
+	     (null viper-mouse-down-insert-key-parsed))
+	 nil) ; just quit
+	((and (null force)
+	      (key-binding viper-mouse-up-insert-key-parsed)
+	      (not (eq (key-binding viper-mouse-up-insert-key-parsed)
+		       'viper-mouse-click-insert-word)))
+	 (message 
+	  "%S already bound to a mouse event. Viper mouse-insert feature disabled"
+	  viper-mouse-up-insert-key-parsed))
+	((and (null force)
+	      (key-binding viper-mouse-down-insert-key-parsed)
+	      (not (eq (key-binding viper-mouse-down-insert-key-parsed)
+		       'viper-mouse-catch-frame-switch)))
+	 (message
+	  "%S already bound to a mouse event. Viper mouse-insert feature disabled"
+	  viper-mouse-down-insert-key-parsed))
+	(t 
+	 (global-set-key viper-mouse-up-insert-key-parsed
+			 'viper-mouse-click-insert-word)
+	 (global-set-key viper-mouse-down-insert-key-parsed
+			 'viper-mouse-catch-frame-switch))))
+
+(defun viper-reset-mouse-search-key (symb val)
+  (viper-unbind-mouse-search-key)
+  (set symb val)
+  (viper-bind-mouse-search-key 'force))
+
+(defun viper-reset-mouse-insert-key (symb val)
+  (viper-unbind-mouse-insert-key)
+  (set symb val)
+  (viper-bind-mouse-insert-key 'force))
+
+
+(defcustom viper-mouse-search-key '(meta shift 1)
+  "*Key used to click-search in Viper.
+Must be a list that specifies the mouse button and modifiers. The supported
+modifiers are `meta', `shift', and `control'. For instance, `(meta shift 1)'
+means that holding the meta and shift keys down and clicking on a word with
+mouse button 1 will initiate search for that word in the buffer that was
+current just before the click. This buffer may be different from the one where
+the click occurred."
+  :type 'list
+  :set 'viper-reset-mouse-search-key
+  :group 'viper-mouse)
+
+(defcustom viper-mouse-insert-key '(meta shift 2)
+  "*Key used to click-insert in Viper.
+Must be a list that specifies the mouse button and modifiers. The supported
+modifiers are `meta', `shift', and `control'. For instance, `(meta shift 2)'
+means that holding the meta and shift keys down and clicking on a word with
+mouse button 2 will insert that word at the cursor in the buffer that was
+current just before the click. This buffer may be different from the one where 
+the click occurred."
+  :type 'list
+  :set 'viper-reset-mouse-insert-key
+  :group 'viper-mouse)
+	   
 
 
 ;;; Local Variables:
-;;; eval: (put 'vip-deflocalvar 'lisp-indent-hook 'defun)
+;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
 ;;; End:
 
 
--- a/lisp/viper/viper-util.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper-util.el	Mon Aug 13 09:53:19 2007 +0200
@@ -23,18 +23,18 @@
 ;; Code
 
 ;; Compiler pacifier
-(defvar vip-overriding-map)
+(defvar viper-overriding-map)
 (defvar pm-color-alist)
 (defvar zmacs-region-stays)
-(defvar vip-minibuffer-current-face)
-(defvar vip-minibuffer-insert-face)
-(defvar vip-minibuffer-vi-face)
-(defvar vip-minibuffer-emacs-face)
-(defvar vip-replace-overlay-face)
-(defvar vip-fast-keyseq-timeout)
+(defvar viper-minibuffer-current-face)
+(defvar viper-minibuffer-insert-face)
+(defvar viper-minibuffer-vi-face)
+(defvar viper-minibuffer-emacs-face)
+(defvar viper-replace-overlay-face)
+(defvar viper-fast-keyseq-timeout)
 (defvar ex-unix-type-shell)
 (defvar ex-unix-type-shell-options)
-(defvar vip-ex-tmp-buf-name)
+(defvar viper-ex-tmp-buf-name)
 
 (require 'cl)
 (require 'ring)
@@ -50,225 +50,114 @@
 (require 'viper-init)
 
 
+;; A fix for NeXT Step
+;; Should go away, when NS people fix the design flaw, which leaves the
+;; two x-* functions undefined.
+(if (and (not (fboundp 'x-display-color-p)) (fboundp 'ns-display-color-p))
+    (fset 'x-display-color-p (symbol-function 'ns-display-color-p)))
+(if (and (not (fboundp 'x-color-defined-p)) (fboundp 'ns-color-defined-p))
+      (fset 'x-color-defined-p (symbol-function 'ns-color-defined-p)))
+
 
 ;;; XEmacs support
 
-;; A fix for NeXT Step
-;; Should probably be eliminated in later versions.
-(if (and (vip-window-display-p) (eq (vip-device-type) 'ns))
-    (progn
-      (fset 'x-display-color-p (symbol-function 'ns-display-color-p))
-      (fset 'x-color-defined-p (symbol-function 'ns-color-defined-p))
-      ))
 
-(if vip-xemacs-p
+(if viper-xemacs-p
     (progn
-      (fset 'vip-read-event (symbol-function 'next-command-event))
-      (fset 'vip-make-overlay (symbol-function 'make-extent))
-      (fset 'vip-overlay-start (symbol-function 'extent-start-position))
-      (fset 'vip-overlay-end (symbol-function 'extent-end-position))
-      (fset 'vip-overlay-put (symbol-function 'set-extent-property))
-      (fset 'vip-overlay-p (symbol-function 'extentp))
-      (fset 'vip-overlay-get (symbol-function 'extent-property))
-      (fset 'vip-move-overlay (symbol-function 'set-extent-endpoints))
-      (if (vip-window-display-p)
-	  (fset 'vip-iconify (symbol-function 'iconify-frame)))
-      (cond ((vip-has-face-support-p)
-	     (fset 'vip-get-face (symbol-function 'get-face))
-	     (fset 'vip-color-defined-p
+      (fset 'viper-read-event (symbol-function 'next-command-event))
+      (fset 'viper-make-overlay (symbol-function 'make-extent))
+      (fset 'viper-overlay-start (symbol-function 'extent-start-position))
+      (fset 'viper-overlay-end (symbol-function 'extent-end-position))
+      (fset 'viper-overlay-put (symbol-function 'set-extent-property))
+      (fset 'viper-overlay-p (symbol-function 'extentp))
+      (fset 'viper-overlay-get (symbol-function 'extent-property))
+      (fset 'viper-move-overlay (symbol-function 'set-extent-endpoints))
+      (if (viper-window-display-p)
+	  (fset 'viper-iconify (symbol-function 'iconify-frame)))
+      (cond ((viper-has-face-support-p)
+	     (fset 'viper-get-face (symbol-function 'get-face))
+	     (fset 'viper-color-defined-p
 		   (symbol-function 'valid-color-name-p))
 	     )))
-  (fset 'vip-read-event (symbol-function 'read-event))
-  (fset 'vip-make-overlay (symbol-function 'make-overlay))
-  (fset 'vip-overlay-start (symbol-function 'overlay-start))
-  (fset 'vip-overlay-end (symbol-function 'overlay-end))
-  (fset 'vip-overlay-put (symbol-function 'overlay-put))
-  (fset 'vip-overlay-p (symbol-function 'overlayp))
-  (fset 'vip-overlay-get (symbol-function 'overlay-get))
-  (fset 'vip-move-overlay (symbol-function 'move-overlay))
-  (if (vip-window-display-p)
-      (fset 'vip-iconify (symbol-function 'iconify-or-deiconify-frame)))
-  (cond ((vip-has-face-support-p)
-	 (fset 'vip-get-face (symbol-function 'internal-get-face))
-	 (fset 'vip-color-defined-p (symbol-function 'x-color-defined-p))
+  (fset 'viper-read-event (symbol-function 'read-event))
+  (fset 'viper-make-overlay (symbol-function 'make-overlay))
+  (fset 'viper-overlay-start (symbol-function 'overlay-start))
+  (fset 'viper-overlay-end (symbol-function 'overlay-end))
+  (fset 'viper-overlay-put (symbol-function 'overlay-put))
+  (fset 'viper-overlay-p (symbol-function 'overlayp))
+  (fset 'viper-overlay-get (symbol-function 'overlay-get))
+  (fset 'viper-move-overlay (symbol-function 'move-overlay))
+  (if (viper-window-display-p)
+      (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame)))
+  (cond ((viper-has-face-support-p)
+	 (fset 'viper-get-face (symbol-function 'internal-get-face))
+	 (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p))
 	 )))
 
 
-(fset 'vip-characterp
+(fset 'viper-characterp
       (symbol-function
-       (if vip-xemacs-p 'characterp 'integerp)))
+       (if viper-xemacs-p 'characterp 'integerp)))
 
-(defsubst vip-color-display-p ()
-  (if vip-emacs-p
+(defsubst viper-color-display-p ()
+  (if viper-emacs-p
       (x-display-color-p)
     (eq (device-class (selected-device)) 'color)))
    
-(defsubst vip-get-cursor-color ()
-  (if vip-emacs-p
+(defsubst viper-get-cursor-color ()
+  (if viper-emacs-p
       (cdr (assoc 'cursor-color (frame-parameters)))
     (color-instance-name (frame-property (selected-frame) 'cursor-color))))
   
-(defun vip-set-face-pixmap (face pixmap)
-  "Set face pixmap on a monochrome display."
-  (if (and (vip-window-display-p) (not (vip-color-display-p)))
-      (condition-case nil
-	  (set-face-background-pixmap face pixmap)
-	(error
-	 (message "Pixmap not found for %S: %s" (face-name face) pixmap)
-	 (sit-for 1)))))
+;;(defun viper-set-face-pixmap (face pixmap)
+;;  "Set face pixmap on a monochrome display."
+;;  (if (and (viper-window-display-p) (not (viper-color-display-p)))
+;;      (condition-case nil
+;;	  (set-face-background-pixmap face pixmap)
+;;	(error
+;;	 (message "Pixmap not found for %S: %s" (face-name face) pixmap)
+;;	 (sit-for 1)))))
 
   
 ;; OS/2
-(cond ((eq (vip-device-type) 'pm)
-       (fset 'vip-color-defined-p
+(cond ((eq (viper-device-type) 'pm)
+       (fset 'viper-color-defined-p
 	     (function (lambda (color) (assoc color pm-color-alist))))))
     
 ;; needed to smooth out the difference between Emacs and XEmacs
-(defsubst vip-italicize-face (face)
-  (if vip-xemacs-p
-      (make-face-italic face)
-    (make-face-italic face nil 'noerror)))
+;;(defsubst viper-italicize-face (face)
+;;  (if viper-xemacs-p
+;;      (make-face-italic face)
+;;    (make-face-italic face nil 'noerror)))
     
 ;; test if display is color and the colors are defined
-(defsubst vip-can-use-colors (&rest colors)
-  (if (vip-color-display-p)
-      (not (memq nil (mapcar 'vip-color-defined-p colors)))
-    ))
-
-(defun vip-hide-face (face)
-  (if (and (vip-has-face-support-p) vip-emacs-p)
-      (add-to-list 'facemenu-unlisted-faces face)))
+;;(defsubst viper-can-use-colors (&rest colors)
+;;  (if (viper-color-display-p)
+;;      (not (memq nil (mapcar 'viper-color-defined-p colors)))
+;;    ))
 
 ;; cursor colors
-(defun vip-change-cursor-color (new-color)
-  (if (and (vip-window-display-p)  (vip-color-display-p)
-	   (stringp new-color) (vip-color-defined-p new-color)
-	   (not (string= new-color (vip-get-cursor-color))))
+(defun viper-change-cursor-color (new-color)
+  (if (and (viper-window-display-p)  (viper-color-display-p)
+	   (stringp new-color) (viper-color-defined-p new-color)
+	   (not (string= new-color (viper-get-cursor-color))))
       (modify-frame-parameters
        (selected-frame) (list (cons 'cursor-color new-color)))))
 	 
-(defun vip-save-cursor-color ()
-  (if (and (vip-window-display-p) (vip-color-display-p))
-      (let ((color (vip-get-cursor-color)))
-	(if (and (stringp color) (vip-color-defined-p color)
-		 (not (string= color vip-replace-overlay-cursor-color)))
-	    (vip-overlay-put vip-replace-overlay 'vip-cursor-color color)))))
+(defun viper-save-cursor-color ()
+  (if (and (viper-window-display-p) (viper-color-display-p))
+      (let ((color (viper-get-cursor-color)))
+	(if (and (stringp color) (viper-color-defined-p color)
+		 (not (string= color viper-replace-overlay-cursor-color)))
+	    (viper-overlay-put viper-replace-overlay 'viper-cursor-color color)))))
 	
 ;; restore cursor color from replace overlay
-(defsubst vip-restore-cursor-color-after-replace ()
-  (vip-change-cursor-color
-   (vip-overlay-get vip-replace-overlay 'vip-cursor-color)))
-(defsubst vip-restore-cursor-color-after-insert ()
-  (vip-change-cursor-color vip-saved-cursor-color))
+(defsubst viper-restore-cursor-color-after-replace ()
+  (viper-change-cursor-color
+   (viper-overlay-get viper-replace-overlay 'viper-cursor-color)))
+(defsubst viper-restore-cursor-color-after-insert ()
+  (viper-change-cursor-color viper-saved-cursor-color))
 	 
-
-;; Face-saving tricks
-
-(defvar vip-search-face
-  (if (vip-has-face-support-p)
-      (progn
-	(make-face 'vip-search-face)
-	(vip-hide-face 'vip-search-face)
-	(or (face-differs-from-default-p 'vip-search-face)
-	    ;; face wasn't set in .vip or .Xdefaults
-	    (if (vip-can-use-colors "Black" "khaki")
-		(progn
-		  (set-face-background 'vip-search-face "khaki")
-		  (set-face-foreground 'vip-search-face "Black"))
-	      (set-face-underline-p 'vip-search-face t)
-	      (vip-set-face-pixmap 'vip-search-face vip-search-face-pixmap)))
-	'vip-search-face))
-  "*Face used to flash out the search pattern.")
-  
-(defvar vip-replace-overlay-face
-  (if (vip-has-face-support-p)
-      (progn
-	(make-face 'vip-replace-overlay-face)
-	(vip-hide-face 'vip-replace-overlay-face)
-	(or (face-differs-from-default-p 'vip-replace-overlay-face)
-	    (progn
-	      (if (vip-can-use-colors "darkseagreen2" "Black")
-		  (progn
-		    (set-face-background
-		     'vip-replace-overlay-face "darkseagreen2")
-		    (set-face-foreground 'vip-replace-overlay-face "Black")))
-	      (set-face-underline-p 'vip-replace-overlay-face t)
-	      (vip-set-face-pixmap
-	       'vip-replace-overlay-face vip-replace-overlay-pixmap)))
-	'vip-replace-overlay-face))
-  "*Face for highlighting replace regions on a window display.")
-
-(defvar vip-minibuffer-emacs-face
-  (if (vip-has-face-support-p)
-      (progn
-	(make-face 'vip-minibuffer-emacs-face)
-	(vip-hide-face 'vip-minibuffer-emacs-face)
-	(or (face-differs-from-default-p 'vip-minibuffer-emacs-face)
-	    ;; face wasn't set in .vip or .Xdefaults
-	    (if vip-vi-style-in-minibuffer
-		;; emacs state is an exception in the minibuffer
-		(if (vip-can-use-colors "darkseagreen2" "Black")
-		    (progn
-		      (set-face-background
-		       'vip-minibuffer-emacs-face "darkseagreen2")
-		      (set-face-foreground
-		       'vip-minibuffer-emacs-face "Black"))
-		  (copy-face 'modeline 'vip-minibuffer-emacs-face))
-	      ;; emacs state is the main state in the minibuffer
-	      (if (vip-can-use-colors "Black" "pink")
-		  (progn
-		    (set-face-background 'vip-minibuffer-emacs-face "pink") 
-		    (set-face-foreground
-		     'vip-minibuffer-emacs-face "Black"))
-		(copy-face 'italic 'vip-minibuffer-emacs-face))
-	      ))
-	'vip-minibuffer-emacs-face))
-  "Face used in the Minibuffer when it is in Emacs state.")
-    
-(defvar vip-minibuffer-insert-face
-  (if (vip-has-face-support-p)
-      (progn
-	(make-face 'vip-minibuffer-insert-face)
-	(vip-hide-face 'vip-minibuffer-insert-face)
-	(or (face-differs-from-default-p 'vip-minibuffer-insert-face)
-	    (if vip-vi-style-in-minibuffer
-		(if (vip-can-use-colors "Black" "pink")
-		    (progn
-		      (set-face-background 'vip-minibuffer-insert-face "pink") 
-		      (set-face-foreground
-		       'vip-minibuffer-insert-face "Black"))
-		  (copy-face 'italic 'vip-minibuffer-insert-face))
-	      ;; If Insert state is an exception
-	      (if (vip-can-use-colors "darkseagreen2" "Black")
-		  (progn
-		    (set-face-background
-		     'vip-minibuffer-insert-face "darkseagreen2")
-		    (set-face-foreground
-		     'vip-minibuffer-insert-face "Black"))
-		(copy-face 'modeline 'vip-minibuffer-insert-face))
-	      (vip-italicize-face 'vip-minibuffer-insert-face)))
-	'vip-minibuffer-insert-face))
-  "Face used in the Minibuffer when it is in Insert state.")
-    
-(defvar vip-minibuffer-vi-face
-  (if (vip-has-face-support-p)
-      (progn
-	(make-face 'vip-minibuffer-vi-face)
-	(vip-hide-face 'vip-minibuffer-vi-face)
-	(or (face-differs-from-default-p 'vip-minibuffer-vi-face)
-	    (if vip-vi-style-in-minibuffer
-		(if (vip-can-use-colors "Black" "grey")
-		    (progn
-		      (set-face-background 'vip-minibuffer-vi-face "grey")
-		      (set-face-foreground 'vip-minibuffer-vi-face "Black"))
-		  (copy-face 'bold 'vip-minibuffer-vi-face))
-	      (copy-face 'bold 'vip-minibuffer-vi-face)
-	      (invert-face 'vip-minibuffer-vi-face)))
-	'vip-minibuffer-vi-face))
-  "Face used in the Minibuffer when it is in Vi state.")
-    
-;; the current face to be used in the minibuffer
-(vip-deflocalvar vip-minibuffer-current-face vip-minibuffer-emacs-face "")
    
 
 ;; Check the current version against the major and minor version numbers
@@ -280,10 +169,10 @@
 ;; will be nil (when op is =, >, or >=) and t (when op is <, <=), which may be
 ;; incorrect. However, this gives correct result in our cases, since we are
 ;; testing for sufficiently high Emacs versions.
-(defun vip-check-version (op major minor &optional type-of-emacs)
+(defun viper-check-version (op major minor &optional type-of-emacs)
   (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version))
-      (and (cond ((eq type-of-emacs 'xemacs) vip-xemacs-p)
-		 ((eq type-of-emacs 'emacs) vip-emacs-p)
+      (and (cond ((eq type-of-emacs 'xemacs) viper-xemacs-p)
+		 ((eq type-of-emacs 'emacs) viper-emacs-p)
 		 (t t))
 	   (cond ((eq op '=) (and (= emacs-minor-version minor)
 				  (= emacs-major-version major)))
@@ -294,39 +183,13 @@
 			   (funcall op emacs-minor-version minor)
 			 t)))
 		 (t
-		  (error "%S: Invalid op in vip-check-version" op))))
+		  (error "%S: Invalid op in viper-check-version" op))))
     (cond ((memq op '(= > >=)) nil)
 	  ((memq op '(< <=)) t))))
 	  
-;;;; warn if it is a wrong version of emacs
-;;(if (or (vip-check-version '< 19 35 'emacs)
-;;	(vip-check-version '< 19 15 'xemacs))
-;;    (progn
-;;      (with-output-to-temp-buffer " *vip-info*"
-;;	(switch-to-buffer " *vip-info*")
-;;	(insert
-;;	 (format "
-;;
-;;This version of Viper requires 
-;;
-;;\t Emacs 19.35 and higher
-;;\t OR
-;;\t XEmacs 19.15 and higher
-;;
-;;It is unlikely to work under Emacs version %s
-;;that you are using... " emacs-version))
-;;
-;;	(if noninteractive
-;;	    ()
-;;	  (beep 1)
-;;	  (beep 1)
-;;	  (insert "\n\nType any key to continue... ")
-;;	  (vip-read-event)))
-;;      (kill-buffer " *vip-info*")))
-  
 
-(defun vip-get-visible-buffer-window (wind)
-  (if vip-xemacs-p
+(defun viper-get-visible-buffer-window (wind)
+  (if viper-xemacs-p
       (get-buffer-window wind t)
     (get-buffer-window wind 'visible)))
     
@@ -336,7 +199,7 @@
 ;; If pos is 'end, returns line end. If pos is 'mid, returns line center.
 ;; Pos = 'indent returns beginning of indentation.
 ;; Otherwise, returns point. Current point is not moved in any case."
-(defun vip-line-pos (pos)
+(defun viper-line-pos (pos)
   (let ((cur-pos (point))
         (result))
     (cond
@@ -345,7 +208,7 @@
      ((equal pos 'end)
       (end-of-line))
      ((equal pos 'mid)
-      (goto-char (+ (vip-line-pos 'start) (vip-line-pos 'end) 2)))
+      (goto-char (+ (viper-line-pos 'start) (viper-line-pos 'end) 2)))
      ((equal pos 'indent)
       (back-to-indentation))
      (t   nil))
@@ -360,9 +223,9 @@
 ;; 
 ;; This is useful for moving markers that are supposed to be local.
 ;; For this, VAR-NAME should be made buffer-local with nil as a default.
-;; Then, each time this var is used in `vip-move-marker-locally' in a new
+;; Then, each time this var is used in `viper-move-marker-locally' in a new
 ;; buffer, a new marker will be created.
-(defun vip-move-marker-locally (var pos &optional buffer)
+(defun viper-move-marker-locally (var pos &optional buffer)
   (if (markerp (eval var))
       ()
     (set var (make-marker)))
@@ -370,7 +233,7 @@
 
 
 ;; Print CONDITIONS as a message.
-(defun vip-message-conditions (conditions)
+(defun viper-message-conditions (conditions)
   (let ((case (car conditions)) (msg (cdr conditions)))
     (if (null msg)
 	(message "%s" case)
@@ -382,7 +245,7 @@
 ;;; List/alist utilities
 	
 ;; Convert LIST to an alist
-(defun vip-list-to-alist (lst)
+(defun viper-list-to-alist (lst)
   (let ((alist))
     (while lst
       (setq alist (cons (list (car lst)) alist))
@@ -390,7 +253,7 @@
     alist))	
 
 ;; Convert ALIST to a list.
-(defun vip-alist-to-list (alst)
+(defun viper-alist-to-list (alst)
   (let ((lst))
     (while alst
       (setq lst (cons (car (car alst)) lst))
@@ -398,7 +261,7 @@
     lst))
 
 ;; Filter ALIST using REGEXP. Return alist whose elements match the regexp.
-(defun vip-filter-alist (regexp alst)
+(defun viper-filter-alist (regexp alst)
   (interactive "s x")
   (let ((outalst) (inalst alst))
     (while (car inalst)
@@ -408,7 +271,7 @@
     outalst))    
        
 ;; Filter LIST using REGEXP. Return list whose elements match the regexp.
-(defun vip-filter-list (regexp lst)
+(defun viper-filter-list (regexp lst)
   (interactive "s x")
   (let ((outlst) (inlst lst))
     (while (car inlst)
@@ -421,7 +284,7 @@
 ;; Append LIS2 to LIS1, both alists, by side-effect and returns LIS1
 ;; LIS2 is modified by filtering it: deleting its members of the form
 ;; \(car elt\) such that (car elt') is in LIS1.
-(defun vip-append-filter-alist (lis1 lis2)
+(defun viper-append-filter-alist (lis1 lis2)
   (let ((temp lis1)
 	elt)
   
@@ -437,7 +300,7 @@
 
 ;;; Support for :e and file globbing
 
-(defun vip-ex-nontrivial-find-file-unix (filespec)
+(defun viper-ex-nontrivial-find-file-unix (filespec)
   "Glob the file spec and visit all files matching the spec.
 This function is designed to work under Unix. It may also work under VMS.
 
@@ -452,11 +315,11 @@
 	 ;; using cond in anticipation of further additions
 	 (cond (ex-unix-type-shell-options)
 	       ))
-	(command (cond (vip-ms-style-os-p (format "\"ls -1 -d %s\"" filespec))
+	(command (cond (viper-ms-style-os-p (format "\"ls -1 -d %s\"" filespec))
 		       (t (format "ls -1 -d %s" filespec))))
 	file-list status)
     (save-excursion 
-      (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
+      (set-buffer (get-buffer-create viper-ex-tmp-buf-name))
       (erase-buffer)
       (setq status
 	    (if gshell-options
@@ -473,35 +336,35 @@
 	  (save-excursion
 	    (skip-chars-forward " \t\n\j")
 	    (if (looking-at "ls:")
-		(vip-forward-Word 1))
+		(viper-forward-Word 1))
 	    (error "%s: %s"
 		   (if (stringp  gshell)
 		       gshell
 		     "shell")
-		   (buffer-substring (point) (vip-line-pos 'end)))
+		   (buffer-substring (point) (viper-line-pos 'end)))
 	    ))
       (goto-char (point-min))
-      (setq file-list (vip-get-filenames-from-buffer 'one-per-line)))
+      (setq file-list (viper-get-filenames-from-buffer 'one-per-line)))
 
     (mapcar 'find-file file-list)
     ))
 
-(defun vip-ex-nontrivial-find-file-ms (filespec)
+(defun viper-ex-nontrivial-find-file-ms (filespec)
   "Glob the file spec and visit all files matching the spec.
 This function is designed to work under MS type systems, such as NT, W95, and
 DOS. It may also work under OS/2.
 
 The users of Unix-type shells should be able to use
-`vip-ex-nontrivial-find-file-unix', making it into the value of the variable 
+`viper-ex-nontrivial-find-file-unix', making it into the value of the variable 
 `ex-nontrivial-find-file-function'. If this doesn't work, the user may have
-to write a custom function, similar to `vip-ex-nontrivial-find-file-unix'."
+to write a custom function, similar to `viper-ex-nontrivial-find-file-unix'."
   (save-excursion 
-    (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
+    (set-buffer (get-buffer-create viper-ex-tmp-buf-name))
     (erase-buffer)
     (insert filespec)
     (goto-char (point-min))
     (mapcar 'find-file
-	    (vip-glob-ms-windows-files (vip-get-filenames-from-buffer)))
+	    (viper-glob-ms-windows-files (viper-get-filenames-from-buffer)))
     ))
 
 
@@ -509,7 +372,7 @@
 ;; return a list of file names listed in the buffer beginning at point
 ;; If optional arg is supplied, assume each filename is listed on a separate
 ;; line
-(defun vip-get-filenames-from-buffer (&optional one-per-line)
+(defun viper-get-filenames-from-buffer (&optional one-per-line)
   (let ((skip-chars (if one-per-line "\t\n" " \t\n"))
 	 result fname delim)
     (skip-chars-forward skip-chars)
@@ -532,9 +395,9 @@
     result))
 
 ;; convert MS-DOS wildcards to regexp
-(defun vip-wildcard-to-regexp (wcard)
+(defun viper-wildcard-to-regexp (wcard)
   (save-excursion
-    (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
+    (set-buffer (get-buffer-create viper-ex-tmp-buf-name))
     (erase-buffer)
     (insert wcard)
     (goto-char (point-min))
@@ -551,7 +414,7 @@
 
 ;; glob windows files
 ;; LIST is expected to be in reverse order
-(defun vip-glob-ms-windows-files (list)
+(defun viper-glob-ms-windows-files (list)
   (let ((tmp list)
 	(case-fold-search t)
 	tmp2)
@@ -563,7 +426,7 @@
 			t  ; return full names
 			;; the regexp part: globs the file names
 			(concat "^"
-				(vip-wildcard-to-regexp
+				(viper-wildcard-to-regexp
 				 (file-name-nondirectory (car tmp)))
 				"$"))
 		       tmp2))
@@ -574,7 +437,7 @@
 ;;; Insertion ring
 
 ;; Rotate RING's index. DIRection can be positive or negative.
-(defun vip-ring-rotate1 (ring dir)
+(defun viper-ring-rotate1 (ring dir)
   (if (and (ring-p ring) (> (ring-length ring) 0))
       (progn
 	(setcar ring (cond ((> dir 0)
@@ -583,57 +446,58 @@
 			    (ring-minus1 (car ring) (ring-length ring)))
 			   ;; don't rotate if dir = 0
 			   (t (car ring))))
-	(vip-current-ring-item ring)
+	(viper-current-ring-item ring)
 	)))
 	
-(defun vip-special-ring-rotate1 (ring dir)
-  (if (memq vip-intermediate-command
+(defun viper-special-ring-rotate1 (ring dir)
+  (if (memq viper-intermediate-command
 	    '(repeating-display-destructive-command
 	      repeating-insertion-from-ring))
-      (vip-ring-rotate1 ring dir)
+      (viper-ring-rotate1 ring dir)
     ;; don't rotate otherwise
-    (vip-ring-rotate1 ring 0)))
+    (viper-ring-rotate1 ring 0)))
     
 ;; current ring item; if N is given, then so many items back from the
 ;; current
-(defun vip-current-ring-item (ring &optional n)
+(defun viper-current-ring-item (ring &optional n)
   (setq n (or n 0))
   (if (and (ring-p ring) (> (ring-length ring) 0))
       (aref (cdr (cdr ring)) (mod (- (car ring) 1 n) (ring-length ring)))))
     
 ;; push item onto ring. the second argument is a ring-variable, not value.
-(defun vip-push-onto-ring (item ring-var)
+(defun viper-push-onto-ring (item ring-var)
   (or (ring-p (eval ring-var))
       (set ring-var (make-ring (eval (intern (format "%S-size" ring-var))))))
   (or (null item) ; don't push nil
       (and (stringp item) (string= item "")) ; or empty strings
-      (equal item (vip-current-ring-item (eval ring-var))) ; or old stuff
-      ;; Since vip-set-destructive-command checks if we are inside vip-repeat,
-      ;;    we don't check whether this-command-keys is a `.'.
-      ;;    The cmd vip-repeat makes a call to the current function only if
-      ;;    `.' is executing a command from the command history. It doesn't
-      ;;    call the push-onto-ring function if `.' is simply repeating the
-      ;;    last destructive command.
-      ;; We only check for ESC (which happens when we do insert with a
-      ;;    prefix argument, or if this-command-keys doesn't give anything
-      ;;    meaningful (in that case we don't know what to show to the user).
-      (and (eq ring-var 'vip-command-ring)
+      (equal item (viper-current-ring-item (eval ring-var))) ; or old stuff
+      ;; Since viper-set-destructive-command checks if we are inside
+      ;; viper-repeat, we don't check whether this-command-keys is a `.'.  The
+      ;; cmd viper-repeat makes a call to the current function only if `.' is
+      ;; executing a command from the command history. It doesn't call the
+      ;; push-onto-ring function if `.' is simply repeating the last
+      ;; destructive command.  We only check for ESC (which happens when we do
+      ;; insert with a prefix argument, or if this-command-keys doesn't give
+      ;; anything meaningful (in that case we don't know what to show to the
+      ;; user).
+      (and (eq ring-var 'viper-command-ring)
 	   (string-match "\\([0-9]*\e\\|^[ \t]*$\\|escape\\)"
-			 (vip-array-to-string (this-command-keys))))
-      (vip-ring-insert (eval ring-var) item))
+			 (viper-array-to-string (this-command-keys))))
+      (viper-ring-insert (eval ring-var) item))
   )
   
 
 ;; removing elts from ring seems to break it
-(defun vip-cleanup-ring (ring)
+(defun viper-cleanup-ring (ring)
   (or (< (ring-length ring) 2)
-      (null (vip-current-ring-item ring))
+      (null (viper-current-ring-item ring))
       ;; last and previous equal
-      (if (equal (vip-current-ring-item ring) (vip-current-ring-item ring 1))
-	  (vip-ring-pop ring))))
+      (if (equal (viper-current-ring-item ring)
+		 (viper-current-ring-item ring 1))
+	  (viper-ring-pop ring))))
 	  
 ;; ring-remove seems to be buggy, so we concocted this for our purposes.
-(defun vip-ring-pop (ring)
+(defun viper-ring-pop (ring)
   (let* ((ln (ring-length ring))
 	 (vec (cdr (cdr ring)))
 	 (veclen (length vec))
@@ -654,7 +518,7 @@
 	top-elt
 	))
 	
-(defun vip-ring-insert (ring item)
+(defun viper-ring-insert (ring item)
   (let* ((ln (ring-length ring))
 	 (vec (cdr (cdr ring)))
 	 (veclen (length vec))
@@ -682,7 +546,7 @@
 ;; POST-STRING is a string to append to the abbrev string.
 ;; ABBREV_SIGN is a string to be inserted before POST-STRING
 ;; if the orig string was truncated. 
-(defun vip-abbreviate-string (string max-len
+(defun viper-abbreviate-string (string max-len
 				     pre-string post-string abbrev-sign)
   (let (truncated-str)
     (setq truncated-str
@@ -695,7 +559,7 @@
 	  (t (format "%s%s%s" pre-string truncated-str post-string)))))
 
 ;; tells if we are over a whitespace-only line
-(defsubst vip-over-whitespace-line ()
+(defsubst viper-over-whitespace-line ()
   (save-excursion
     (beginning-of-line)
     (looking-at "^[ \t]*$")))
@@ -707,7 +571,7 @@
 ;; If given, MESSAGE is a message to be displayed after that.
 ;; This message is erased after 2 secs, if erase-msg is non-nil.
 ;; Arguments: var message custom-file &optional erase-message
-(defun vip-save-setting (var message custom-file &optional erase-msg)
+(defun viper-save-setting (var message custom-file &optional erase-msg)
   (let* ((var-name (symbol-name var))
 	 (var-val (if (boundp var) (eval var)))
 	 (regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z---_']*[ \t\n)]" var-name))
@@ -736,7 +600,7 @@
       
 ;; Save STRING in CUSTOM-FILE. If PATTERN is non-nil, remove strings that
 ;; match this pattern.
-(defun vip-save-string-in-file (string custom-file &optional pattern)
+(defun viper-save-string-in-file (string custom-file &optional pattern)
   (let ((buf (find-file-noselect (substitute-in-file-name custom-file))))
     (save-excursion
       (set-buffer buf)
@@ -753,132 +617,137 @@
 
 ;; Search
 
-(defun vip-flash-search-pattern ()
-  (if (vip-overlay-p vip-search-overlay)
-      (vip-move-overlay vip-search-overlay (match-beginning 0) (match-end 0))
-    (setq vip-search-overlay
-	  (vip-make-overlay
+(defun viper-flash-search-pattern ()
+  (if (viper-overlay-p viper-search-overlay)
+      (viper-move-overlay
+       viper-search-overlay (match-beginning 0) (match-end 0))
+    (setq viper-search-overlay
+	  (viper-make-overlay
 	   (match-beginning 0) (match-end 0) (current-buffer))))
   
-  (vip-overlay-put vip-search-overlay 'priority vip-search-overlay-priority)
-  (if (vip-has-face-support-p)
+  (viper-overlay-put
+   viper-search-overlay 'priority viper-search-overlay-priority)
+  (if (viper-has-face-support-p)
       (progn
-	(vip-overlay-put vip-search-overlay 'face vip-search-face)
+	(viper-overlay-put viper-search-overlay 'face viper-search-face)
 	(sit-for 2)
-	(vip-overlay-put vip-search-overlay 'face nil))))
+	(viper-overlay-put viper-search-overlay 'face nil))))
 
 
 ;; Replace state
 
-(defsubst vip-move-replace-overlay (beg end)
-  (vip-move-overlay vip-replace-overlay beg end))
+(defsubst viper-move-replace-overlay (beg end)
+  (viper-move-overlay viper-replace-overlay beg end))
   
-(defun vip-set-replace-overlay (beg end)
-  (if (vip-overlay-p vip-replace-overlay)
-      (vip-move-replace-overlay beg end)
-    (setq vip-replace-overlay (vip-make-overlay beg end (current-buffer)))
+(defun viper-set-replace-overlay (beg end)
+  (if (viper-overlay-p viper-replace-overlay)
+      (viper-move-replace-overlay beg end)
+    (setq viper-replace-overlay (viper-make-overlay beg end (current-buffer)))
     ;; never detach
-    (vip-overlay-put
-     vip-replace-overlay (if vip-emacs-p 'evaporate 'detachable) nil)
-    (vip-overlay-put 
-     vip-replace-overlay 'priority vip-replace-overlay-priority)
+    (viper-overlay-put
+     viper-replace-overlay (if viper-emacs-p 'evaporate 'detachable) nil)
+    (viper-overlay-put 
+     viper-replace-overlay 'priority viper-replace-overlay-priority)
     ;; If Emacs will start supporting overlay maps, as it currently supports
-    ;; text-property maps, we could do away with vip-replace-minor-mode and
+    ;; text-property maps, we could do away with viper-replace-minor-mode and
     ;; just have keymap attached to replace overlay.
-    ;;(vip-overlay-put
-    ;; vip-replace-overlay
-    ;; (if vip-xemacs-p 'keymap 'local-map)
-    ;; vip-replace-map)
+    ;;(viper-overlay-put
+    ;; viper-replace-overlay
+    ;; (if viper-xemacs-p 'keymap 'local-map)
+    ;; viper-replace-map)
     ) 
-  (if (vip-has-face-support-p)
-      (vip-overlay-put vip-replace-overlay 'face vip-replace-overlay-face))
-  (vip-save-cursor-color)
-  (vip-change-cursor-color vip-replace-overlay-cursor-color)
+  (if (viper-has-face-support-p)
+      (viper-overlay-put
+       viper-replace-overlay 'face viper-replace-overlay-face))
+  (viper-save-cursor-color)
+  (viper-change-cursor-color viper-replace-overlay-cursor-color)
   )
   
       
-(defun vip-set-replace-overlay-glyphs (before-glyph after-glyph)
-  (if (or (not (vip-has-face-support-p))
-	  vip-use-replace-region-delimiters)
-      (let ((before-name (if vip-xemacs-p 'begin-glyph 'before-string))
-	    (after-name (if vip-xemacs-p 'end-glyph 'after-string)))
-	(vip-overlay-put vip-replace-overlay before-name before-glyph)
-	(vip-overlay-put vip-replace-overlay after-name after-glyph))))
+(defun viper-set-replace-overlay-glyphs (before-glyph after-glyph)
+  (if (or (not (viper-has-face-support-p))
+	  viper-use-replace-region-delimiters)
+      (let ((before-name (if viper-xemacs-p 'begin-glyph 'before-string))
+	    (after-name (if viper-xemacs-p 'end-glyph 'after-string)))
+	(viper-overlay-put viper-replace-overlay before-name before-glyph)
+	(viper-overlay-put viper-replace-overlay after-name after-glyph))))
   
-(defun vip-hide-replace-overlay ()
-  (vip-set-replace-overlay-glyphs nil nil)
-  (vip-restore-cursor-color-after-replace)
-  (vip-restore-cursor-color-after-insert)
-  (if (vip-has-face-support-p)
-      (vip-overlay-put vip-replace-overlay 'face nil)))
+(defun viper-hide-replace-overlay ()
+  (viper-set-replace-overlay-glyphs nil nil)
+  (viper-restore-cursor-color-after-replace)
+  (viper-restore-cursor-color-after-insert)
+  (if (viper-has-face-support-p)
+      (viper-overlay-put viper-replace-overlay 'face nil)))
 
     
-(defsubst vip-replace-start ()
-  (vip-overlay-start vip-replace-overlay))
-(defsubst vip-replace-end ()
-  (vip-overlay-end vip-replace-overlay))
+(defsubst viper-replace-start ()
+  (viper-overlay-start viper-replace-overlay))
+(defsubst viper-replace-end ()
+  (viper-overlay-end viper-replace-overlay))
  
 
 ;; Minibuffer
 
-(defun vip-set-minibuffer-overlay ()
-  (vip-check-minibuffer-overlay)
-  (if (vip-has-face-support-p)
+(defun viper-set-minibuffer-overlay ()
+  (viper-check-minibuffer-overlay)
+  (if (viper-has-face-support-p)
       (progn
-	(vip-overlay-put
-	 vip-minibuffer-overlay 'face vip-minibuffer-current-face)
-	(vip-overlay-put 
-	 vip-minibuffer-overlay 'priority vip-minibuffer-overlay-priority)
+	(viper-overlay-put
+	 viper-minibuffer-overlay 'face viper-minibuffer-current-face)
+	(viper-overlay-put 
+	 viper-minibuffer-overlay 'priority viper-minibuffer-overlay-priority)
 	;; never detach
-	(vip-overlay-put
-	 vip-minibuffer-overlay (if vip-emacs-p 'evaporate 'detachable) nil)
-	;; make vip-minibuffer-overlay open-ended
+	(viper-overlay-put
+	 viper-minibuffer-overlay
+	 (if viper-emacs-p 'evaporate 'detachable)
+	 nil)
+	;; make viper-minibuffer-overlay open-ended
 	;; In emacs, it is made open ended at creation time
-	(if vip-xemacs-p
+	(if viper-xemacs-p
 	    (progn
-	      (vip-overlay-put vip-minibuffer-overlay 'start-open nil)
-	      (vip-overlay-put vip-minibuffer-overlay 'end-open nil)))
+	      (viper-overlay-put viper-minibuffer-overlay 'start-open nil)
+	      (viper-overlay-put viper-minibuffer-overlay 'end-open nil)))
 	)))
        
-(defun vip-check-minibuffer-overlay ()
-  (or (vip-overlay-p vip-minibuffer-overlay)
-      (setq vip-minibuffer-overlay
-	    (if vip-xemacs-p
-		(vip-make-overlay 1 (1+ (buffer-size)) (current-buffer))
+(defun viper-check-minibuffer-overlay ()
+  (or (viper-overlay-p viper-minibuffer-overlay)
+      (setq viper-minibuffer-overlay
+	    (if viper-xemacs-p
+		(viper-make-overlay 1 (1+ (buffer-size)) (current-buffer))
 	      ;; make overlay open-ended
-	      (vip-make-overlay
+	      (viper-make-overlay
 	       1 (1+ (buffer-size)) (current-buffer) nil 'rear-advance)))
       ))
 
 
-(defsubst vip-is-in-minibuffer ()
+(defsubst viper-is-in-minibuffer ()
   (string-match "\*Minibuf-" (buffer-name)))
   
 
 
 ;;; XEmacs compatibility
 
-(defun vip-abbreviate-file-name (file)
-  (if vip-emacs-p
+(defun viper-abbreviate-file-name (file)
+  (if viper-emacs-p
       (abbreviate-file-name file)
     ;; XEmacs requires addl argument
     (abbreviate-file-name file t)))
     
 ;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg 
 ;; in sit-for, so this function smoothes out the differences.
-(defsubst vip-sit-for-short (val &optional nodisp)
-  (if vip-xemacs-p
+(defsubst viper-sit-for-short (val &optional nodisp)
+  (if viper-xemacs-p
       (sit-for (/ val 1000.0) nodisp)
     (sit-for 0 val nodisp)))
 
 ;; EVENT may be a single event of a sequence of events
-(defsubst vip-ESC-event-p (event)
+(defsubst viper-ESC-event-p (event)
   (let ((ESC-keys '(?\e (control \[) escape))
-	(key (vip-event-key event)))
+	(key (viper-event-key event)))
     (member key ESC-keys)))
 
 ;; checks if object is a marker, has a buffer, and points to within that buffer
-(defun vip-valid-marker (marker)
+(defun viper-valid-marker (marker)
   (if (and (markerp marker) (marker-buffer marker))
       (let ((buf (marker-buffer marker))
 	    (pos (marker-position marker)))
@@ -886,27 +755,27 @@
 	  (set-buffer buf)
 	  (and (<= pos (point-max)) (<= (point-min) pos))))))
   
-(defsubst vip-mark-marker ()
-  (if vip-xemacs-p
+(defsubst viper-mark-marker ()
+  (if viper-xemacs-p
       (mark-marker t)
     (mark-marker)))
 
 ;; like (set-mark-command nil) but doesn't push twice, if (car mark-ring)
 ;; is the same as (mark t).
-(defsubst vip-set-mark-if-necessary ()
-  (setq mark-ring (delete (vip-mark-marker) mark-ring))
+(defsubst viper-set-mark-if-necessary ()
+  (setq mark-ring (delete (viper-mark-marker) mark-ring))
   (set-mark-command nil))
        
 ;; In transient mark mode (zmacs mode), it is annoying when regions become
 ;; highlighted due to Viper's pushing marks. So, we deactivate marks, unless
 ;; the user explicitly wants highlighting, e.g., by hitting '' or ``
-(defun vip-deactivate-mark ()
-  (if vip-xemacs-p
+(defun viper-deactivate-mark ()
+  (if viper-xemacs-p
       (zmacs-deactivate-region)
     (deactivate-mark)))
 
-(defsubst vip-leave-region-active ()
-  (if vip-xemacs-p
+(defsubst viper-leave-region-active ()
+  (if viper-xemacs-p
       (setq zmacs-region-stays t)))
 
 ;; Check if arg is a valid character for register
@@ -914,7 +783,7 @@
 ;; Letter means lowercase letters, Letter means uppercase letters, and
 ;; digit means digits from 1 to 9.
 ;; If TYPE is nil, then down/uppercase letters and digits are allowed.
-(defun vip-valid-register (reg &optional type)
+(defun viper-valid-register (reg &optional type)
   (or type (setq type '(letter Letter digit)))
   (or (if (memq 'letter type)
 	  (and (<= ?a reg) (<= reg ?z)))
@@ -925,22 +794,11 @@
       ))
 
     
-(defsubst vip-events-to-keys (events)
-  (cond (vip-xemacs-p (events-to-keys events))
+(defsubst viper-events-to-keys (events)
+  (cond (viper-xemacs-p (events-to-keys events))
 	(t events)))
 		  
 	
-(defun vip-eval-after-load (file form)
-  (if vip-emacs-p
-      (eval-after-load file form)
-    (or (assoc file after-load-alist)
-	(setq after-load-alist (cons (list file) after-load-alist)))
-    (let ((elt (assoc file after-load-alist)))
-      (or (member form (cdr elt))
-	  (setq elt (nconc elt (list form)))))
-    form
-    ))
-
 ;; This is here because Emacs changed the way local hooks work.
 ;;
 ;;Add to the value of HOOK the function FUNCTION.
@@ -952,7 +810,7 @@
 ;;HOOK should be a symbol, and FUNCTION may be any valid function.  If
 ;;HOOK is void, it is first set to nil.  If HOOK's value is a single
 ;;function, it is changed to a list of functions."
-(defun vip-add-hook (hook function &optional append)
+(defun viper-add-hook (hook function &optional append)
   (if (not (boundp hook)) (set hook nil))
   ;; If the hook value is a single function, turn it into a list.
   (let ((old (symbol-value hook)))
@@ -970,8 +828,8 @@
 ;; Remove from the value of HOOK the function FUNCTION.
 ;; HOOK should be a symbol, and FUNCTION may be any valid function.  If
 ;; FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the
-;; list of hooks to run in HOOK, then nothing is done.  See `vip-add-hook'."
-(defun vip-remove-hook (hook function)
+;; list of hooks to run in HOOK, then nothing is done.  See `viper-add-hook'."
+(defun viper-remove-hook (hook function)
   (if (or (not (boundp hook))		;unbound symbol, or
 	  (null (symbol-value hook))	;value is nil, or
 	  (null function))		;function is nil, then
@@ -987,15 +845,15 @@
     
 ;; it is suggested that an event must be copied before it is assigned to
 ;; last-command-event in XEmacs
-(defun vip-copy-event (event)
-  (if vip-xemacs-p
+(defun viper-copy-event (event)
+  (if viper-xemacs-p
       (copy-event event)
     event))
     
 ;; like read-event, but in XEmacs also try to convert to char, if possible
-(defun vip-read-event-convert-to-char ()
+(defun viper-read-event-convert-to-char ()
   (let (event)
-    (if vip-emacs-p
+    (if viper-emacs-p
 	(read-event)
       (setq event (next-command-event))
       (or (event-to-character event)
@@ -1003,57 +861,66 @@
     ))
 
 ;; This function lets function-key-map convert key sequences into logical
-;; keys. This does a better job than vip-read-event when it comes to kbd
+;; keys. This does a better job than viper-read-event when it comes to kbd
 ;; macros, since it enables certain macros to be shared between X and TTY modes
 ;; by correctly mapping key sequences for Left/Right/... (one an ascii
 ;; terminal) into logical keys left, right, etc.
-(defun vip-read-key () 
-  (let ((overriding-local-map vip-overriding-map) 
+(defun viper-read-key () 
+  (let ((overriding-local-map viper-overriding-map) 
 	(inhibit-quit t)
-        key) 
-    (use-global-map vip-overriding-map) 
-    (setq key (elt (read-key-sequence nil) 0)) 
-    (use-global-map global-map) 
+	help-char key) 
+    (use-global-map viper-overriding-map) 
+    (unwind-protect
+	(setq key (elt (read-key-sequence nil) 0)) 
+      (use-global-map global-map))
     key))
 
 
 ;; Emacs has a bug in eventp, which causes (eventp nil) to return (nil)
 ;; instead of nil, if '(nil) was previously inadvertently assigned to
 ;; unread-command-events
-(defun vip-event-key (event)
+(defun viper-event-key (event)
   (or (and event (eventp event))
-      (error "vip-event-key: Wrong type argument, eventp, %S" event))
-  (when (cond (vip-xemacs-p (or (key-press-event-p event)
-				(mouse-event-p event)))
+      (error "viper-event-key: Wrong type argument, eventp, %S" event))
+  (when (cond (viper-xemacs-p (or (key-press-event-p event)
+				  (mouse-event-p event)))
 	      (t t))
     (let ((mod (event-modifiers event))
 	  basis)
       (setq basis
 	    (cond
-	     (vip-xemacs-p
+	     (viper-xemacs-p
 	      (cond ((key-press-event-p event)
 		     (event-key event))
 		    ((button-event-p event)
 		     (concat "mouse-" (prin1-to-string (event-button event))))
 		    (t 
-		     (error "vip-event-key: Unknown event, %S" event))))
+		     (error "viper-event-key: Unknown event, %S" event))))
 	     (t 
 	      ;; Emacs doesn't handle capital letters correctly, since
 	      ;; \S-a isn't considered the same as A (it behaves as
 	      ;; plain `a' instead). So we take care of this here
-	      (cond ((and (vip-characterp event) (<= ?A event) (<= event ?Z))
+	      (cond ((and (viper-characterp event) (<= ?A event) (<= event ?Z))
 		     (setq mod nil
 			   event event))
 		    ;; Emacs has the oddity whereby characters 128+char
 		    ;; represent M-char *if* this appears inside a string.
 		    ;; So, we convert them manually to (meta char).
-		    ((and (vip-characterp event)
+		    ((and (viper-characterp event)
 			  (< ?\C-? event) (<= event 255))
 		     (setq mod '(meta)
 			   event (- event ?\C-? 1)))
+		    ((and (null mod) (eq event 'return))
+		     (setq event ?\C-m))
+		    ((and (null mod) (eq event 'space))
+		     (setq event ?\ ))
+		    ((and (null mod) (eq event 'delete))
+		     (setq event ?\C-?))
+		    ((and (null mod) (eq event 'backspace))
+		     (setq event ?\C-h))
 		    (t (event-basic-type event)))
 	      )))
-      (if (vip-characterp basis)
+      (if (viper-characterp basis)
 	  (setq basis
 		(if (= basis ?\C-?)
 		    (list 'control '\?) ; taking care of an emacs bug
@@ -1062,9 +929,9 @@
 	  (append mod (list basis))
 	basis))))
     
-(defun vip-key-to-emacs-key (key)
+(defun viper-key-to-emacs-key (key)
   (let (key-name char-p modifiers mod-char-list base-key base-key-name)
-    (cond (vip-xemacs-p key)
+    (cond (viper-xemacs-p key)
 
 	  ((symbolp key)
 	   (setq key-name (symbol-name key))
@@ -1072,10 +939,10 @@
 		  (string-to-char key-name))
 		 ;; Emacs doesn't recognize `return' and `escape' as events on
 		 ;; dumb terminals, so we translate them into characters
-		 ((and vip-emacs-p (not (vip-window-display-p))
+		 ((and viper-emacs-p (not (viper-window-display-p))
 		       (string= key-name "return"))
 		  ?\C-m)
-		 ((and vip-emacs-p (not (vip-window-display-p))
+		 ((and viper-emacs-p (not (viper-window-display-p))
 		       (string= key-name "escape"))
 		  ?\e)
 		 ;; pass symbol-event as is
@@ -1083,7 +950,7 @@
 
 	  ((listp key)
 	   (setq modifiers (subseq key 0 (1- (length key)))
-		 base-key (vip-seq-last-elt key)
+		 base-key (viper-seq-last-elt key)
 		 base-key-name (symbol-name base-key)
 		 char-p (= (length base-key-name) 1))
 	   (setq mod-char-list
@@ -1112,27 +979,27 @@
 ;; characters, will return a string. Otherwise, will return a string
 ;; representing a vector of converted events. If the input was a Viper macro,
 ;; will return a string that represents this macro as a vector.
-(defun vip-array-to-string (event-seq)
+(defun viper-array-to-string (event-seq)
   (let (temp temp2)
     (cond ((stringp event-seq) event-seq)
-	  ((vip-event-vector-p event-seq)
-	    (setq temp (mapcar 'vip-event-key event-seq))
-	    (cond ((vip-char-symbol-sequence-p temp)
+	  ((viper-event-vector-p event-seq)
+	    (setq temp (mapcar 'viper-event-key event-seq))
+	    (cond ((viper-char-symbol-sequence-p temp)
 		   (mapconcat 'symbol-name temp ""))
-		  ((and (vip-char-array-p
-			 (setq temp2 (mapcar 'vip-key-to-character temp))))
+		  ((and (viper-char-array-p
+			 (setq temp2 (mapcar 'viper-key-to-character temp))))
 		   (mapconcat 'char-to-string temp2 ""))
 		  (t (prin1-to-string (vconcat temp)))))
-	  ((vip-char-symbol-sequence-p event-seq)
+	  ((viper-char-symbol-sequence-p event-seq)
 	   (mapconcat 'symbol-name event-seq ""))
 	  ((and (vectorp event-seq) 
-		(vip-char-array-p
-		 (setq temp (mapcar 'vip-key-to-character event-seq))))
+		(viper-char-array-p
+		 (setq temp (mapcar 'viper-key-to-character event-seq))))
 	   (mapconcat 'char-to-string temp ""))
 	  (t (prin1-to-string event-seq)))))
 
-(defun vip-key-press-events-to-chars (events)
-  (mapconcat (if vip-emacs-p
+(defun viper-key-press-events-to-chars (events)
+  (mapconcat (if viper-emacs-p
 		 'char-to-string
 	       (function
 		(lambda (elt) (char-to-string (event-to-character elt)))))
@@ -1141,14 +1008,14 @@
 	   
     
 ;; Uses different timeouts for ESC-sequences and others
-(defsubst vip-fast-keysequence-p ()
-  (not (vip-sit-for-short 
-	(if (vip-ESC-event-p last-input-event)
-	    vip-ESC-keyseq-timeout
-	  vip-fast-keyseq-timeout)
+(defsubst viper-fast-keysequence-p ()
+  (not (viper-sit-for-short 
+	(if (viper-ESC-event-p last-input-event)
+	    viper-ESC-keyseq-timeout
+	  viper-fast-keyseq-timeout)
 	t)))
     
-(defun vip-read-char-exclusive ()
+(defun viper-read-char-exclusive ()
   (let (char
 	(echo-keystrokes 1))
     (while (null char)
@@ -1156,14 +1023,15 @@
 	  (setq char (read-char))
 	(error
 	 ;; skip event if not char
-	 (vip-read-event))))
+	 (viper-read-event))))
     char))
 
 ;; key is supposed to be in viper's representation, e.g., (control l), a
 ;; character, etc.
-(defun vip-key-to-character (key)
+(defun viper-key-to-character (key)
   (cond ((eq key 'space) ?\ )
 	((eq key 'delete) ?\C-?)
+	((eq key 'return) ?\C-m)
 	((eq key 'backspace) ?\C-h)
 	((and (symbolp key)
 	      (= 1 (length (symbol-name key))))
@@ -1176,21 +1044,21 @@
 	(t key)))
     
       
-(defun vip-setup-master-buffer (&rest other-files-or-buffers)
+(defun viper-setup-master-buffer (&rest other-files-or-buffers)
   "Set up the current buffer as a master buffer.
 Arguments become related buffers. This function should normally be used in
 the `Local variables' section of a file."
-  (setq vip-related-files-and-buffers-ring 
+  (setq viper-related-files-and-buffers-ring 
 	(make-ring (1+ (length other-files-or-buffers))))
   (mapcar '(lambda (elt)
-	     (vip-ring-insert vip-related-files-and-buffers-ring elt))
+	     (viper-ring-insert viper-related-files-and-buffers-ring elt))
 	  other-files-or-buffers)
-  (vip-ring-insert vip-related-files-and-buffers-ring (buffer-name))
+  (viper-ring-insert viper-related-files-and-buffers-ring (buffer-name))
   )
 
 ;;; Movement utilities
 
-(defcustom vip-syntax-preference 'strict-vi
+(defcustom viper-syntax-preference 'strict-vi
   "*Syntax type characterizing Viper's alphanumeric symbols.
 `emacs' means only word constituents are considered to be alphanumeric.
 Word constituents are symbols specified as word constituents by the current
@@ -1204,116 +1072,118 @@
 		 (const extended) (const emacs))
   :group 'viper)
 
-(vip-deflocalvar vip-ALPHA-char-class "w"
+(viper-deflocalvar viper-ALPHA-char-class "w"
   "String of syntax classes characterizing Viper's alphanumeric symbols.
 In addition, the symbol `_' may be considered alphanumeric if
-`vip-syntax-preference'is `reformed-vi'.")
+`viper-syntax-preference'is `reformed-vi'.")
 
-(vip-deflocalvar vip-strict-ALPHA-chars "a-zA-Z0-9_"
+(viper-deflocalvar viper-strict-ALPHA-chars "a-zA-Z0-9_"
   "Regexp matching the set of alphanumeric characters acceptable to strict
 Vi.")
-(vip-deflocalvar vip-strict-SEP-chars " \t\n"
+(viper-deflocalvar viper-strict-SEP-chars " \t\n"
   "Regexp matching the set of alphanumeric characters acceptable to strict
 Vi.")
 
-(vip-deflocalvar vip-SEP-char-class " -"
+(viper-deflocalvar viper-SEP-char-class " -"
   "String of syntax classes for Vi separators.
 Usually contains ` ', linefeed, TAB or formfeed.")
 
-(defun vip-update-alphanumeric-class ()
-  "Set the syntax class of Viper alphanumerals according to `vip-syntax-preference'.
-Must be called in order for changes to `vip-syntax-preference' to take effect."
+(defun viper-update-alphanumeric-class ()
+  "Set the syntax class of Viper alphanumerals according to `viper-syntax-preference'.
+Must be called in order for changes to `viper-syntax-preference' to take effect."
   (interactive)
   (setq-default
-   vip-ALPHA-char-class
-   (cond ((eq vip-syntax-preference 'emacs) "w")     ; only word constituents
-	 ((eq vip-syntax-preference 'extended) "w_") ; word & symbol chars
+   viper-ALPHA-char-class
+   (cond ((eq viper-syntax-preference 'emacs) "w")     ; only word constituents
+	 ((eq viper-syntax-preference 'extended) "w_") ; word & symbol chars
 	 (t "w"))))     ; vi syntax: word constituents and the symbol `_'
 
 ;; addl-chars are characters to be temporarily considered as alphanumerical
-(defun vip-looking-at-alpha (&optional addl-chars)
+(defun viper-looking-at-alpha (&optional addl-chars)
   (or (stringp addl-chars) (setq addl-chars ""))
-  (if (eq vip-syntax-preference 'reformed-vi)
+  (if (eq viper-syntax-preference 'reformed-vi)
       (setq addl-chars (concat addl-chars "_")))
   (let ((char (char-after (point))))
     (if char
-	(if (eq vip-syntax-preference 'strict-vi)
-	    (looking-at (concat "[" vip-strict-ALPHA-chars addl-chars "]"))
+	(if (eq viper-syntax-preference 'strict-vi)
+	    (looking-at (concat "[" viper-strict-ALPHA-chars addl-chars "]"))
 	  (or (memq char
 		    ;; convert string to list
 		    (append (vconcat addl-chars) nil))
 	      (memq (char-syntax char)
-		    (append (vconcat vip-ALPHA-char-class) nil)))))
+		    (append (vconcat viper-ALPHA-char-class) nil)))))
     ))
 
-(defun vip-looking-at-separator ()
+(defun viper-looking-at-separator ()
   (let ((char (char-after (point))))
     (if char
 	(or (eq char ?\n) ; RET is always a separator in Vi
 	    (memq (char-syntax char)
-		  (append (vconcat vip-SEP-char-class) nil))))))
+		  (append (vconcat viper-SEP-char-class) nil))))))
 
-(defsubst vip-looking-at-alphasep (&optional addl-chars)
-  (or (vip-looking-at-separator) (vip-looking-at-alpha addl-chars)))
+(defsubst viper-looking-at-alphasep (&optional addl-chars)
+  (or (viper-looking-at-separator) (viper-looking-at-alpha addl-chars)))
 
-(defun vip-skip-alpha-forward (&optional addl-chars)
+(defun viper-skip-alpha-forward (&optional addl-chars)
   (or (stringp addl-chars) (setq addl-chars ""))
-  (vip-skip-syntax
+  (viper-skip-syntax
    'forward 
-   (cond ((eq vip-syntax-preference 'strict-vi)
+   (cond ((eq viper-syntax-preference 'strict-vi)
 	  "")
-	 (t vip-ALPHA-char-class ))
-   (cond ((eq vip-syntax-preference 'strict-vi)
-	  (concat vip-strict-ALPHA-chars addl-chars))
+	 (t viper-ALPHA-char-class))
+   (cond ((eq viper-syntax-preference 'strict-vi)
+	  (concat viper-strict-ALPHA-chars addl-chars))
 	 (t addl-chars))))
 
-(defun vip-skip-alpha-backward (&optional addl-chars)
+(defun viper-skip-alpha-backward (&optional addl-chars)
   (or (stringp addl-chars) (setq addl-chars ""))
-  (vip-skip-syntax
+  (viper-skip-syntax
    'backward 
-   (cond ((eq vip-syntax-preference 'strict-vi)
+   (cond ((eq viper-syntax-preference 'strict-vi)
 	  "")
-	 (t vip-ALPHA-char-class ))
-   (cond ((eq vip-syntax-preference 'strict-vi)
-	  (concat vip-strict-ALPHA-chars addl-chars))
+	 (t viper-ALPHA-char-class))
+   (cond ((eq viper-syntax-preference 'strict-vi)
+	  (concat viper-strict-ALPHA-chars addl-chars))
 	 (t addl-chars))))
 
 ;; weird syntax tables may confuse strict-vi style
-(defsubst vip-skip-all-separators-forward (&optional within-line)
-  (vip-skip-syntax 'forward
-		   vip-SEP-char-class
-		   (or within-line "\n")
-		   (if within-line (vip-line-pos 'end))))
-(defsubst vip-skip-all-separators-backward (&optional within-line)
-  (vip-skip-syntax 'backward
-		   vip-SEP-char-class
-		   (or within-line "\n")
-		   (if within-line (vip-line-pos 'start))))
-(defun vip-skip-nonseparators (direction)
+(defsubst viper-skip-all-separators-forward (&optional within-line)
+  (viper-skip-syntax 'forward
+		     viper-SEP-char-class
+		     (or within-line "\n")
+		     (if within-line (viper-line-pos 'end))))
+(defsubst viper-skip-all-separators-backward (&optional within-line)
+  (viper-skip-syntax 'backward
+		     viper-SEP-char-class
+		     (or within-line "\n")
+		     (if within-line (viper-line-pos 'start))))
+(defun viper-skip-nonseparators (direction)
   (let ((func (intern (format "skip-syntax-%S" direction))))
-    (funcall func (concat "^" vip-SEP-char-class)
-	     (vip-line-pos (if (eq direction 'forward) 'end 'start)))))
+    (funcall func (concat "^" viper-SEP-char-class)
+	     (viper-line-pos (if (eq direction 'forward) 'end 'start)))))
 
-(defun vip-skip-nonalphasep-forward ()
-  (if (eq vip-syntax-preference 'strict-vi)
+(defun viper-skip-nonalphasep-forward ()
+  (if (eq viper-syntax-preference 'strict-vi)
       (skip-chars-forward
-       (concat "^" vip-strict-SEP-chars vip-strict-ALPHA-chars))
+       (concat "^" viper-strict-SEP-chars viper-strict-ALPHA-chars))
     (skip-syntax-forward
      (concat
-      "^" vip-ALPHA-char-class vip-SEP-char-class) (vip-line-pos 'end))))
-(defun vip-skip-nonalphasep-backward ()
-  (if (eq vip-syntax-preference 'strict-vi)
+      "^" viper-ALPHA-char-class viper-SEP-char-class) (viper-line-pos 'end))))
+(defun viper-skip-nonalphasep-backward ()
+  (if (eq viper-syntax-preference 'strict-vi)
       (skip-chars-backward
-       (concat "^" vip-strict-SEP-chars vip-strict-ALPHA-chars))
+       (concat "^" viper-strict-SEP-chars viper-strict-ALPHA-chars))
     (skip-syntax-backward
      (concat
-      "^" vip-ALPHA-char-class vip-SEP-char-class) (vip-line-pos 'start))))
+      "^"
+      viper-ALPHA-char-class viper-SEP-char-class)
+     (viper-line-pos 'start))))
 
 ;; Skip SYNTAX like skip-syntax-* and ADDL-CHARS like skip-chars-*
 ;; Return the number of chars traveled.
 ;; Either SYNTAX or ADDL-CHARS can be nil, in which case they are interpreted
 ;; as an empty string.
-(defun vip-skip-syntax (direction syntax addl-chars &optional limit)
+(defun viper-skip-syntax (direction syntax addl-chars &optional limit)
   (let ((total 0)
 	(local 1)
 	(skip-chars-func (intern (format "skip-chars-%S" direction)))
@@ -1334,7 +1204,7 @@
   
 
 ;;; Local Variables:
-;;; eval: (put 'vip-deflocalvar 'lisp-indent-hook 'defun)
+;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
 ;;; End:
 
 ;;;  viper-util.el ends here
--- a/lisp/viper/viper.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/viper/viper.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,4 +1,4 @@
-;;; viper.el --- A full-featured Vi emulator for GNU Emacs 19 and XEmacs 19,
+;;; viper.el --- A full-featured Vi emulator for GNU Emacs and XEmacs,
 ;;		 a VI Plan for Emacs Rescue,
 ;;		 and a venomous VI PERil.
 ;;		 Viper Is also a Package for Emacs Rebels.
@@ -8,7 +8,7 @@
 
 ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
-(defconst viper-version "2.95 of July 9, 1997"
+(defconst viper-version "2.96 of August 7, 1997"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -30,7 +30,7 @@
 
 ;;; Commentary:
 
-;; Viper is a full-featured Vi emulator for Emacs 19.  It emulates and
+;; Viper is a full-featured Vi emulator for Emacs and XEmacs. It emulates and
 ;; improves upon the standard features of Vi and, at the same time, allows
 ;; full access to all Emacs facilities.  Viper supports multiple undo,
 ;; file name completion, command, file, and search history and it extends
@@ -124,41 +124,40 @@
 ;; 
 ;;     (add-hook 'your-favorite-mode 'viper-mode)
 ;; or    
-;;     (add-hook 'your-favorite-mode 'vip-change-state-to-emacs)
+;;     (add-hook 'your-favorite-mode 'viper-change-state-to-emacs)
 ;; 
 ;; whichever applies. The right thing to do, however, is to complain to the
 ;; author of the respective package. (Sometimes they also neglect to equip
 ;; their  modes with hooks, which is one more reason for complaining.)
 ;; 
 ;; 2. Keymap handling
-;;    Because Emacs 19 has an elegant mechanism for turning minor mode keymaps
-;;    on and off, implementation of Viper has been greatly simplified. Viper
-;;    has several minor modes.
+;;    Each Viper state (insert, vi, replace) is implemented as a collection of
+;;    several minor modes, each with its own keymap.
 ;;
 ;; Viper's  Vi state consists of seven minor modes:
 ;;
-;;  vip-vi-intercept-minor-mode
-;;  vip-vi-local-user-minor-mode
-;;  vip-vi-global-user-minor-mode
-;;  vip-vi-kbd-minor-mode
-;;  vip-vi-state-modifier-minor-mode
-;;  vip-vi-diehard-minor-mode
-;;  vip-vi-basic-minor-mode
+;;  viper-vi-intercept-minor-mode
+;;  viper-vi-local-user-minor-mode
+;;  viper-vi-global-user-minor-mode
+;;  viper-vi-kbd-minor-mode
+;;  viper-vi-state-modifier-minor-mode
+;;  viper-vi-diehard-minor-mode
+;;  viper-vi-basic-minor-mode
 ;;
 ;;  Bindings done to the keymap of the first mode overshadow those done to
 ;;  the second, which, in turn, overshadows those done to the third, etc.
 ;;
-;;  The last vip-vi-basic-minor-mode contains most of the usual Vi bindings
+;;  The last viper-vi-basic-minor-mode contains most of the usual Vi bindings
 ;;  in its edit mode. This mode provides access to all Emacs facilities.
 ;;  Novice users, however, may want to set their viper-expert-level to 1
-;;  in their .vip file. This will enable vip-vi-diehard-minor-mode. This
+;;  in their .viper file. This will enable viper-vi-diehard-minor-mode. This
 ;;  minor mode's bindings make Viper simulate the usual Vi very closely.
 ;;  For instance,  C-c will not have its standard Emacs binding
 ;;  and so many of the goodies of Emacs are not available.
 ;;
 ;;  A skilled user should set viper-expert-level to at least 3. This will
 ;;  enable `C-c' and many Emacs facilities will become available.
-;;  In this case, vip-vi-diehard-minor-mode is inactive.
+;;  In this case, viper-vi-diehard-minor-mode is inactive.
 ;;
 ;;  Viper gurus should have at least
 ;;      (setq viper-expert-level 4)
@@ -167,13 +166,13 @@
 ;;  Pick-and-choose users may want to put
 ;;      (setq viper-expert-level 5)
 ;;  in ~/.viper. Viper will then leave it up to the user to set the variables
-;;  vip-want-*  See viper-set-expert-level for details.
+;;  viper-want-*  See viper-set-expert-level for details.
 ;;
-;;  The very first minor mode, vip-vi-intercept-minor-mode, is of no
+;;  The very first minor mode, viper-vi-intercept-minor-mode, is of no
 ;;  concern for the user. It is needed to bind Viper's vital keys, such as
 ;;  ESC and C-z.
 ;;
-;;  The second mode,  vip-vi-local-user-minor-mode, usually has an
+;;  The second mode,  viper-vi-local-user-minor-mode, usually has an
 ;;  empty keymap. However, the user can set bindings in this keymap, which
 ;;  will overshadow the corresponding bindings in the other two minor
 ;;  modes. This is useful, for example, for setting up ZZ in gnus,
@@ -181,109 +180,110 @@
 ;;  Likewise, in Dired mode, you may want to bind ZN and ZP to commands
 ;;  that would visit the next or the previous file in the Dired buffer.
 ;;  Setting local keys is tricky, so don't do it directly. Instead, use
-;;  vip-add-local-keys function (see its doc).
+;;  viper-add-local-keys function (see its doc).
 ;;
-;;  The third minor mode, vip-vi-global-user-minor-mode, is also intended
-;;  for the users but, unlike vip-vi-local-user-minor-mode, its key
+;;  The third minor mode, viper-vi-global-user-minor-mode, is also intended
+;;  for the users but, unlike viper-vi-local-user-minor-mode, its key
 ;;  bindings are seen in all Viper buffers. This mode keys can be done
 ;;  with define-key command.
 ;;
-;;  The fourth minor mode, vip-vi-kbd-minor-mode, is used by keyboard
+;;  The fourth minor mode, viper-vi-kbd-minor-mode, is used by keyboard
 ;;  macros. Users are NOT supposed to modify this keymap directly.
 ;;
-;;  The fifth mode, vip-vi-state-modifier-minor-mode, can be used to set
+;;  The fifth mode, viper-vi-state-modifier-minor-mode, can be used to set
 ;;  key bindings that are visible in some major modes but not in others.
 ;;
 ;;  Users are allowed to modify keymaps that belong to
-;;  vip-vi-local-user-minor-mode, vip-vi-global-user-minor-mode,
-;;  and vip-vi-state-modifier-minor-mode only.
+;;  viper-vi-local-user-minor-mode, viper-vi-global-user-minor-mode,
+;;  and viper-vi-state-modifier-minor-mode only.
 ;;
 ;;  Viper's Insert state also has seven minor modes:
 ;;
-;;      vip-insert-intercept-minor-mode
-;;  	vip-insert-local-user-minor-mode
-;;  	vip-insert-global-user-minor-mode
-;;  	vip-insert-kbd-minor-mode
-;;      vip-insert-state-modifier-minor-mode
-;;  	vip-insert-diehard-minor-mode
-;;  	vip-insert-basic-minor-mode
+;;      viper-insert-intercept-minor-mode
+;;  	viper-insert-local-user-minor-mode
+;;  	viper-insert-global-user-minor-mode
+;;  	viper-insert-kbd-minor-mode
+;;      viper-insert-state-modifier-minor-mode
+;;  	viper-insert-diehard-minor-mode
+;;  	viper-insert-basic-minor-mode
 ;;
-;;  As with VI's editing modes, the first mode, vip-insert-intercept-minor-mode
-;;  is used to bind vital keys that are not to be changed by the user.
+;;  As with VI's editing modes, the first mode,
+;;  viper-insert-intercept-minor-mode is used to bind vital keys that are not
+;;  to be changed by the user.
 ;;
-;;  The next mode, vip-insert-local-user-minor-mode, is used to customize
+;;  The next mode, viper-insert-local-user-minor-mode, is used to customize
 ;;  bindings in the insert state of Viper. The third mode,
-;;  vip-insert-global-user-minor-mode is like
-;;  vip-insert-local-user-minor-mode, except that its bindings are seen in 
-;;  all Viper buffers. As with vip-vi-local-user-minor-mode, its bindings
-;;  should be done via the function vip-add-local-keys. Bindings for
-;;  vip-insert-global-user-minor-mode can be set with the define-key command.
+;;  viper-insert-global-user-minor-mode is like
+;;  viper-insert-local-user-minor-mode, except that its bindings are seen in
+;;  all Viper buffers. As with viper-vi-local-user-minor-mode, its bindings
+;;  should be done via the function viper-add-local-keys. Bindings for
+;;  viper-insert-global-user-minor-mode can be set with the define-key command.
 ;;
-;;  The next minor mode, vip-insert-kbd-minor-mode,
+;;  The next minor mode, viper-insert-kbd-minor-mode,
 ;;  is used for keyboard VI-style macros defined with :map!. 
 ;;
-;;  The fifth minor mode, vip-insert-state-modifier-minor-mode, is like
-;;  vip-vi-state-modifier-minor-mode, except that it is used in the Insert
+;;  The fifth minor mode, viper-insert-state-modifier-minor-mode, is like
+;;  viper-vi-state-modifier-minor-mode, except that it is used in the Insert
 ;;  state; it can be used to modify keys in a mode-specific fashion. 
 ;;
-;;  The minor mode vip-insert-diehard-minor-mode is in effect when
+;;  The minor mode viper-insert-diehard-minor-mode is in effect when
 ;;  the user wants a high degree of Vi compatibility (a bad idea, really!).
-;;  The last minor mode, vip-insert-basic-minor-mode, is always in effect
+;;  The last minor mode, viper-insert-basic-minor-mode, is always in effect
 ;;  when Viper is in insert state. It binds a small number of keys needed for
 ;;  Viper's operation. 
 ;;
 ;;  Finally, Viper provides minor modes for overriding bindings set by Emacs
 ;;  modes when Viper is in Emacs state:
 ;;
-;; 	vip-emacs-local-user-minor-mode
-;;  	vip-emacs-global-user-minor-mode
-;;      vip-emacs-kbd-minor-mode
-;;      vip-emacs-state-modifier-minor-mode
+;; 	viper-emacs-local-user-minor-mode
+;;  	viper-emacs-global-user-minor-mode
+;;      viper-emacs-kbd-minor-mode
+;;      viper-emacs-state-modifier-minor-mode
 ;;
 ;;  These minor modes are in effect when Viper is in Emacs state. The keymap
-;;  associated with vip-emacs-global-user-minor-mode,
-;;  vip-emacs-global-user-map, overrides the global and local keymaps as
+;;  associated with viper-emacs-global-user-minor-mode,
+;;  viper-emacs-global-user-map, overrides the global and local keymaps as
 ;;  well as the minor mode keymaps set by other modes. The keymap of
-;;  vip-emacs-local-user-minor-mode, vip-emacs-local-user-map, overrides
+;;  viper-emacs-local-user-minor-mode, viper-emacs-local-user-map, overrides
 ;;  everything, but it is used on a per buffer basis.
-;;  The keymap associated with vip-emacs-state-modifier-minor-mode
+;;  The keymap associated with viper-emacs-state-modifier-minor-mode
 ;;  overrides keys on a per-major-mode basis. The mode
-;;  vip-emacs-kbd-minor-mode is used to define Vi-style macros in Emacs
+;;  viper-emacs-kbd-minor-mode is used to define Vi-style macros in Emacs
 ;;  state.
 ;;
 ;;  3. There is also one minor mode that is used when Viper is in its
 ;;     replace-state (used for commands like cw, C, etc.). This mode is
 ;;     called
 ;;
-;;       vip-replace-minor-mode
+;;       viper-replace-minor-mode
 ;;
-;;     and its keymap is vip-replace-map. Replace minor mode is always
+;;     and its keymap is viper-replace-map. Replace minor mode is always
 ;;     used in conjunction with the minor modes for insert-state, and its
 ;;     keymap overshadows the keymaps for insert minor modes.
 ;;
 ;;  4. Defining buffer-local bindings in Vi and Insert modes. 
 ;;  As mentioned before, sometimes, it is convenient to have
 ;;  buffer-specific of mode-specific key bindings in Vi and insert modes.
-;;  Viper provides a special function, vip-add-local-keys, to do precisely
+;;  Viper provides a special function, viper-add-local-keys, to do precisely
 ;;  this. For instance, is you need to add couple of mode-specific bindings
 ;;  to Insert mode, you can put 
 ;;
-;;       (vip-add-local-keys 'insert-state '((key1 . func1) (key2 .func2))) 
+;;       (viper-add-local-keys 'insert-state '((key1 . func1) (key2 .func2))) 
 ;;
 ;;  somewhere in a hook of this major mode. If you put something like this
 ;;  in your own elisp function, this will define bindings specific to the
-;;  buffer that was current at the time of the call to vip-add-local-keys.
+;;  buffer that was current at the time of the call to viper-add-local-keys.
 ;;  The only thing to make sure here is that the major mode of this buffer
 ;;  is written according to Emacs conventions, which includes a call to
-;;  (kill-all-local-variables). See vip-add-local-keys for more details.
+;;  (kill-all-local-variables). See viper-add-local-keys for more details.
 ;;
 ;;
 ;;  TO DO (volunteers?):
 ;;
 ;; 1. Some of the code that is inherited from VIP-3.5 is rather
-;;    convoluted. Instead of vip-command-argument, keymaps should bind the
+;;    convoluted. Instead of viper-command-argument, keymaps should bind the
 ;;    actual commands. E.g., "dw" should be bound to a generic command
-;;    vip-delete that will delete things based on the value of
+;;    viper-delete that will delete things based on the value of
 ;;    last-command-char. This would greatly simplify the logic and the code.
 ;;
 ;; 2. Somebody should venture to write a customization package a la
@@ -303,7 +303,7 @@
 ;; compiler pacifier
 (defvar mark-even-if-inactive)
 (defvar viper-expert-level)
-(defvar vip-expert-level)
+(defvar viper-expert-level)
 
 ;; loading happens only in non-interactive compilation
 ;; in order to spare non-viperized emacs from being viperized
@@ -320,22 +320,20 @@
 (require 'viper-init)
 
 ;; better be defined before Viper custom group.
-(defvar vip-custom-file-name (vip-convert-standard-file-name "~/.viper")
+(defvar viper-custom-file-name (convert-standard-filename "~/.viper")
   "Viper customisation file.
 If set by the user, this must be done _before_ Viper is loaded in `~/.emacs'.")
 
 (defgroup viper nil
   "Vi emulation within Emacs.
-NOTE: Viper customization should be saved in `vip-custom-file-name', which
+NOTE: Viper customization should be saved in `viper-custom-file-name', which
 defaults to `~/.viper'."
-  :prefix "vip-"
+  :prefix "viper-"
   :group 'emulations)
 
 (require 'viper-cmd)
 
-(defvar vip-always t
-  "See `viper-always'. This variable is for compatibility with older Vipers.")
-(defcustom viper-always vip-always
+(defcustom viper-always t
   "Non-nil means, arrange for vi-state to be a default when appropriate.
 This is different from `viper-mode' variable in that `viper-mode' determines
 whether to use Viper in the first place, while `viper-always', if nil, lets
@@ -363,20 +361,29 @@
   :tag "Set Viper Mode on Loading"
   :group 'viper)
 
-
-;; The following are provided for compatibility with older VIP's
-
-;;;###autoload
-(defalias 'vip-mode 'viper-mode)
-
-(defalias 'vip-change-mode-to-vi 'vip-change-state-to-vi)
-(defalias 'vip-change-mode-to-insert 'vip-change-state-to-insert)
-(defalias 'vip-change-mode-to-emacs 'vip-change-state-to-emacs)
+(defcustom viper-non-vi-major-modes
+  '(custom-mode dired-mode efs-mode internal-ange-ftp-mode tar-mode
+		mh-folder-mode gnus-group-mode gnus-summary-mode Info-mode
+		Buffer-menu-mode view-mode vm-mode vm-summary-mode)
+  "*A list of major modes that should never come up in Vi command mode.
+Viper automatically augments this list with some obvious modes, such as
+`dired-mode', `tar-mode', etc. So, don't put modes on this list, unless 
+it comes up in a wrong Viper state."
+  :type 'list
+  :group 'viper)
 
 
 
 
 ;;;###autoload
+(defun toggle-viper-mode ()
+  (interactive)
+  (if (eq viper-mode t)
+      (viper-go-away)
+    (setq viper-mode nil)
+    (viper-mode)))
+
+;;;###autoload
 (defun viper-mode ()
   "Turn on Viper emulation of Vi."
   (interactive)
@@ -385,15 +392,15 @@
 	;; if the user requested viper-mode explicitly
 	(if viper-mode
 	    ()
-	  (setq viper-mode 1)
+	  (setq viper-mode t)
 	  (load-library "viper"))
 
-	(if vip-first-time ; This check is important. Without it, startup and 
-	    (progn	   ; expert-level msgs mix up when viper-mode recurses
-	      (setq vip-first-time nil)
-	      (if (not vip-inhibit-startup-message)
+	(if viper-first-time ; Important check. Prevents mix-up of startup and 
+	    (progn	     ; expert-level msgs when viper-mode recurses
+	      (setq viper-first-time nil)
+	      (if (not viper-inhibit-startup-message)
 		  (save-window-excursion
-		    (setq vip-inhibit-startup-message t)
+		    (setq viper-inhibit-startup-message t)
 		    (delete-other-windows)
 		    (switch-to-buffer "Viper Startup Message")
 		    (erase-buffer)
@@ -444,25 +451,27 @@
 		      ))
 		    (goto-char (point-min))
 		    (if (y-or-n-p "Inhibit Viper startup message? ")
-			(vip-save-setting
-			 'vip-inhibit-startup-message
+			(viper-save-setting
+			 'viper-inhibit-startup-message
 			 "Viper startup message inhibited"
-			 vip-custom-file-name t))
+			 viper-custom-file-name t))
 		    ;;(kill-buffer (current-buffer))
 		    (message
 		     "The last message is in buffer `Viper Startup Message'")
 		    (sit-for 4)
 		    ))
 	      (viper-set-expert-level 'dont-change-unless)))
-	(vip-change-state-to-vi))))
+
+	(or (memq major-mode viper-non-vi-major-modes) ; don't switch to Vi
+	    (viper-change-state-to-vi)))))
    
 
 ;; This hook designed to enable Vi-style editing in comint-based modes."
-(defun vip-comint-mode-hook ()
+(defun viper-comint-mode-hook ()
   (setq require-final-newline nil
-	vip-ex-style-editing-in-insert nil
-	vip-ex-style-motion nil)
-  (vip-change-state-to-insert))
+	viper-ex-style-editing-in-insert nil
+	viper-ex-style-motion nil)
+  (viper-change-state-to-insert))
 
 
 ;; remove viper hooks from SYMBOL
@@ -471,9 +480,9 @@
 	((not (listp (eval symbol))) nil)
 	((string-match "-hook" (symbol-name symbol))
 	 (remove-hook symbol 'viper-mode)
-	 (remove-hook symbol 'vip-change-state-to-emacs)
-	 (remove-hook symbol 'vip-change-state-to-insert)
-	 (remove-hook symbol 'vip-change-state-to-vi)
+	 (remove-hook symbol 'viper-change-state-to-emacs)
+	 (remove-hook symbol 'viper-change-state-to-insert)
+	 (remove-hook symbol 'viper-change-state-to-vi)
 	 )))
 
 ;; Remove local value in all existing buffers
@@ -514,7 +523,7 @@
    global-mode-string
    (viper-standard-value 'global-mode-string viper-saved-non-viper-variables))
 
-  (if vip-emacs-p
+  (if viper-emacs-p
       (setq-default
        mark-even-if-inactive
        (viper-standard-value
@@ -526,76 +535,85 @@
 
   
   ;; deactivate all advices done by Viper.
-  (ad-deactivate-regexp "vip-")
+  (ad-deactivate-regexp "viper-")
 
   (setq viper-mode nil)
 
-  (viper-delocalize-var 'vip-vi-minibuffer-minor-mode)
-  (viper-delocalize-var 'vip-insert-minibuffer-minor-mode)
-  (viper-delocalize-var 'vip-vi-intercept-minor-mode)
-  (viper-delocalize-var 'vip-insert-intercept-minor-mode)
+  (viper-delocalize-var 'viper-vi-minibuffer-minor-mode)
+  (viper-delocalize-var 'viper-insert-minibuffer-minor-mode)
+  (viper-delocalize-var 'viper-vi-intercept-minor-mode)
+  (viper-delocalize-var 'viper-insert-intercept-minor-mode)
   
-  (viper-delocalize-var 'vip-vi-local-user-minor-mode)
-  (viper-delocalize-var 'vip-vi-kbd-minor-mode)
-  (viper-delocalize-var 'vip-vi-global-user-minor-mode)
-  (viper-delocalize-var 'vip-vi-state-modifier-minor-mode)
-  (viper-delocalize-var 'vip-vi-diehard-minor-mode)
-  (viper-delocalize-var 'vip-vi-basic-minor-mode)
+  (viper-delocalize-var 'viper-vi-local-user-minor-mode)
+  (viper-delocalize-var 'viper-vi-kbd-minor-mode)
+  (viper-delocalize-var 'viper-vi-global-user-minor-mode)
+  (viper-delocalize-var 'viper-vi-state-modifier-minor-mode)
+  (viper-delocalize-var 'viper-vi-diehard-minor-mode)
+  (viper-delocalize-var 'viper-vi-basic-minor-mode)
 	
-  (viper-delocalize-var 'vip-replace-minor-mode)
+  (viper-delocalize-var 'viper-replace-minor-mode)
 	
-  (viper-delocalize-var 'vip-insert-local-user-minor-mode)
-  (viper-delocalize-var 'vip-insert-kbd-minor-mode)
-  (viper-delocalize-var 'vip-insert-global-user-minor-mode)
-  (viper-delocalize-var 'vip-insert-state-modifier-minor-mode)
-  (viper-delocalize-var 'vip-insert-diehard-minor-mode)
-  (viper-delocalize-var 'vip-insert-basic-minor-mode)
+  (viper-delocalize-var 'viper-insert-local-user-minor-mode)
+  (viper-delocalize-var 'viper-insert-kbd-minor-mode)
+  (viper-delocalize-var 'viper-insert-global-user-minor-mode)
+  (viper-delocalize-var 'viper-insert-state-modifier-minor-mode)
+  (viper-delocalize-var 'viper-insert-diehard-minor-mode)
+  (viper-delocalize-var 'viper-insert-basic-minor-mode)
   
-  (viper-delocalize-var 'vip-emacs-intercept-minor-mode)
-  (viper-delocalize-var 'vip-emacs-local-user-minor-mode)
-  (viper-delocalize-var 'vip-emacs-kbd-minor-mode)
-  (viper-delocalize-var 'vip-emacs-global-user-minor-mode)
-  (viper-delocalize-var 'vip-emacs-state-modifier-minor-mode)
+  (viper-delocalize-var 'viper-emacs-intercept-minor-mode)
+  (viper-delocalize-var 'viper-emacs-local-user-minor-mode)
+  (viper-delocalize-var 'viper-emacs-kbd-minor-mode)
+  (viper-delocalize-var 'viper-emacs-global-user-minor-mode)
+  (viper-delocalize-var 'viper-emacs-state-modifier-minor-mode)
 
-  (setq-default vip-vi-minibuffer-minor-mode	   nil
-		vip-insert-minibuffer-minor-mode   nil
-		vip-vi-intercept-minor-mode	   nil
-		vip-insert-intercept-minor-mode	   nil
+  (setq-default viper-vi-minibuffer-minor-mode	       nil
+		viper-insert-minibuffer-minor-mode     nil
+		viper-vi-intercept-minor-mode	       nil
+		viper-insert-intercept-minor-mode      nil
 		
-		vip-vi-local-user-minor-mode       nil
-		vip-vi-kbd-minor-mode        	   nil
-		vip-vi-global-user-minor-mode      nil
-		vip-vi-state-modifier-minor-mode   nil
-		vip-vi-diehard-minor-mode     	   nil
-		vip-vi-basic-minor-mode       	   nil
+		viper-vi-local-user-minor-mode         nil
+		viper-vi-kbd-minor-mode        	       nil
+		viper-vi-global-user-minor-mode        nil
+		viper-vi-state-modifier-minor-mode     nil
+		viper-vi-diehard-minor-mode            nil
+		viper-vi-basic-minor-mode              nil
 		
-		vip-replace-minor-mode 	      	   nil
+		viper-replace-minor-mode 	       nil
 		
-		vip-insert-local-user-minor-mode     nil
-		vip-insert-kbd-minor-mode     	     nil
-		vip-insert-global-user-minor-mode    nil
-		vip-insert-state-modifier-minor-mode nil
-		vip-insert-diehard-minor-mode 	     nil
-		vip-insert-basic-minor-mode   	     nil
+		viper-insert-local-user-minor-mode     nil
+		viper-insert-kbd-minor-mode            nil
+		viper-insert-global-user-minor-mode    nil
+		viper-insert-state-modifier-minor-mode nil
+		viper-insert-diehard-minor-mode        nil
+		viper-insert-basic-minor-mode          nil
 
-		vip-emacs-intercept-minor-mode       nil
-		vip-emacs-local-user-minor-mode      nil
-		vip-emacs-kbd-minor-mode             nil
-		vip-emacs-global-user-minor-mode     nil
-		vip-emacs-state-modifier-minor-mode  nil
+		viper-emacs-intercept-minor-mode       nil
+		viper-emacs-local-user-minor-mode      nil
+		viper-emacs-kbd-minor-mode             nil
+		viper-emacs-global-user-minor-mode     nil
+		viper-emacs-state-modifier-minor-mode  nil
 		)
 
   ;; remove all hooks set by viper
   (mapatoms 'viper-remove-hooks)
-  (remove-hook 'comint-mode-hook 'vip-comint-mode-hook)
-  (remove-hook 'minibuffer-setup-hook 'vip-minibuffer-setup-sentinel)
-  )
+  (remove-hook 'comint-mode-hook 'viper-comint-mode-hook)
+  (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
+
+  ;; unbind Viper mouse bindings
+  (viper-unbind-mouse-search-key)
+  (viper-unbind-mouse-insert-key)
+  ;; In emacs, we have to advice handle-switch-frame
+  ;; This advice is undone earlier, when all advices matchine "viper-" are
+  ;; deactivated.
+  (if viper-xemacs-p
+      (remove-hook 'mouse-leave-frame-hook 'viper-remember-current-frame))
+  ) ; end viper-go-away
 
 
 
 
 ;; This sets major mode hooks to make them come up in vi-state.
-(defun vip-set-hooks ()
+(defun viper-set-hooks ()
   
   ;; It is of course a misnomer to call viper-mode a `major mode'.
   ;; However, this has the effect that if the user didn't specify the
@@ -604,16 +622,16 @@
   (setq default-major-mode 'viper-mode)
   
   ;; The following major modes should come up in vi-state
-  (defadvice fundamental-mode (after vip-fundamental-mode-ad activate)
-    "Run `vip-change-state-to-vi' on entry."
-    (vip-change-state-to-vi))
+  (defadvice fundamental-mode (after viper-fundamental-mode-ad activate)
+    "Run `viper-change-state-to-vi' on entry."
+    (viper-change-state-to-vi))
 
   (defvar makefile-mode-hook)
   (add-hook 'makefile-mode-hook 'viper-mode)
 
   (defvar help-mode-hook)
   (add-hook 'help-mode-hook 'viper-mode)
-  (vip-modify-major-mode 'help-mode 'vi-state vip-help-modifier-map)
+  (viper-modify-major-mode 'help-mode 'vi-state viper-help-modifier-map)
 
   (defvar awk-mode-hook)
   (add-hook 'awk-mode-hook 'viper-mode)
@@ -680,59 +698,59 @@
   (add-hook 'python-mode-hook 'viper-mode)  
   
   (defvar emerge-startup-hook)
-  (add-hook 'emerge-startup-hook 'vip-change-state-to-emacs)
+  (add-hook 'emerge-startup-hook 'viper-change-state-to-emacs)
 
   ;; Tell vc-diff to put *vc* in Vi mode
   (if (featurep 'vc)
-      (defadvice vc-diff (after vip-vc-ad activate)
+      (defadvice vc-diff (after viper-vc-ad activate)
 	"Force Vi state in VC diff buffer."
-	(vip-change-state-to-vi))
-    (vip-eval-after-load
+	(viper-change-state-to-vi))
+    (eval-after-load
      "vc"
-     '(defadvice vc-diff (after vip-vc-ad activate)
+     '(defadvice vc-diff (after viper-vc-ad activate)
 	"Force Vi state in VC diff buffer."
-	(vip-change-state-to-vi))))
+	(viper-change-state-to-vi))))
     
-  (vip-eval-after-load
+  (eval-after-load
    "emerge"
-   '(defadvice emerge-quit (after vip-emerge-advice activate)
-      "Run `vip-change-state-to-vi' after quitting emerge."
-      (vip-change-state-to-vi)))
+   '(defadvice emerge-quit (after viper-emerge-advice activate)
+      "Run `viper-change-state-to-vi' after quitting emerge."
+      (viper-change-state-to-vi)))
   ;; In case Emerge was loaded before Viper.
-  (defadvice emerge-quit (after vip-emerge-advice activate)
-    "Run `vip-change-state-to-vi' after quitting emerge."
-    (vip-change-state-to-vi))
+  (defadvice emerge-quit (after viper-emerge-advice activate)
+    "Run `viper-change-state-to-vi' after quitting emerge."
+    (viper-change-state-to-vi))
   
   ;; passwd.el sets up its own buffer, which turns up in Vi mode,
   ;; thus overriding the local map. We don't need Vi mode here.
-  (vip-eval-after-load
+  (eval-after-load
    "passwd"
-   '(defadvice read-passwd-1 (before vip-passwd-ad activate)
+   '(defadvice read-passwd-1 (before viper-passwd-ad activate)
       "Switch to emacs state while reading password."
-      (vip-change-state-to-emacs)))
+      (viper-change-state-to-emacs)))
   
   ;; Emacs shell, ange-ftp, and comint-based modes
   (defvar comint-mode-hook)
-  (vip-modify-major-mode 
-   'comint-mode 'insert-state vip-comint-mode-modifier-map)
-  (vip-modify-major-mode 
-   'comint-mode 'vi-state vip-comint-mode-modifier-map)
-  (vip-modify-major-mode 
-   'shell-mode 'insert-state vip-comint-mode-modifier-map)
-  (vip-modify-major-mode 
-   'shell-mode 'vi-state vip-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'comint-mode 'insert-state viper-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'comint-mode 'vi-state viper-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'shell-mode 'insert-state viper-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'shell-mode 'vi-state viper-comint-mode-modifier-map)
   ;; ange-ftp in XEmacs
-  (vip-modify-major-mode 
-   'ange-ftp-shell-mode 'insert-state vip-comint-mode-modifier-map)
-  (vip-modify-major-mode 
-   'ange-ftp-shell-mode 'vi-state vip-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'ange-ftp-shell-mode 'insert-state viper-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'ange-ftp-shell-mode 'vi-state viper-comint-mode-modifier-map)
   ;; ange-ftp in Emacs
-  (vip-modify-major-mode 
-   'internal-ange-ftp-mode 'insert-state vip-comint-mode-modifier-map)
-  (vip-modify-major-mode 
-   'internal-ange-ftp-mode 'vi-state vip-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'internal-ange-ftp-mode 'insert-state viper-comint-mode-modifier-map)
+  (viper-modify-major-mode 
+   'internal-ange-ftp-mode 'vi-state viper-comint-mode-modifier-map)
   ;; set hook
-  (add-hook 'comint-mode-hook 'vip-comint-mode-hook)
+  (add-hook 'comint-mode-hook 'viper-comint-mode-hook)
   
   ;; Shell scripts
   (defvar sh-mode-hook)
@@ -741,86 +759,87 @@
   (add-hook 'ksh-mode-hook 'viper-mode)
   
   ;; Dired
-  (vip-modify-major-mode 'dired-mode 'emacs-state vip-dired-modifier-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'dired-mode)
-  (add-hook 'dired-mode-hook 'vip-change-state-to-emacs)
+  (viper-modify-major-mode 'dired-mode 'emacs-state viper-dired-modifier-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'dired-mode)
+  (add-hook 'dired-mode-hook 'viper-change-state-to-emacs)
 
   ;; Tar
-  (vip-modify-major-mode 'tar-mode 'emacs-state vip-slash-and-colon-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'tar-mode)
+  (viper-modify-major-mode 'tar-mode 'emacs-state viper-slash-and-colon-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'tar-mode)
 
   ;; MH-E
-  (vip-modify-major-mode 'mh-folder-mode 'emacs-state vip-slash-and-colon-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'mh-folder-mode)
+  (viper-modify-major-mode 
+   'mh-folder-mode 'emacs-state viper-slash-and-colon-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'mh-folder-mode)
   ;; changing state to emacs is needed so the preceding will take hold
-  (add-hook 'mh-folder-mode-hook 'vip-change-state-to-emacs)
+  (add-hook 'mh-folder-mode-hook 'viper-change-state-to-emacs)
   (add-hook 'mh-show-mode-hook 'viper-mode)
 
   ;; Gnus
-  (vip-modify-major-mode 'gnus-group-mode 'emacs-state vip-slash-and-colon-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'gnus-group-mode)
-  (vip-modify-major-mode 
-   'gnus-summary-mode 'emacs-state vip-slash-and-colon-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'gnus-summary-mode)
+  (viper-modify-major-mode
+   'gnus-group-mode 'emacs-state viper-slash-and-colon-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'gnus-group-mode)
+  (viper-modify-major-mode 
+   'gnus-summary-mode 'emacs-state viper-slash-and-colon-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'gnus-summary-mode)
   ;; changing state to emacs is needed so the preceding will take hold
-  (add-hook 'gnus-group-mode-hook 'vip-change-state-to-emacs)
-  (add-hook 'gnus-summary-mode-hook 'vip-change-state-to-emacs)
+  (add-hook 'gnus-group-mode-hook 'viper-change-state-to-emacs)
+  (add-hook 'gnus-summary-mode-hook 'viper-change-state-to-emacs)
   (add-hook 'gnus-article-mode-hook 'viper-mode)
 
   ;; Info
-  (vip-modify-major-mode 'Info-mode 'emacs-state vip-slash-and-colon-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'Info-mode)
+  (viper-modify-major-mode 'Info-mode 'emacs-state viper-slash-and-colon-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'Info-mode)
   ;; Switching to emacs is needed  so the above will take hold
-  (defadvice Info-mode (after vip-Info-ad activate)
+  (defadvice Info-mode (after viper-Info-ad activate)
     "Switch to emacs mode."
-    (vip-change-state-to-emacs))
+    (viper-change-state-to-emacs))
 
   ;; Buffer menu
-  (vip-modify-major-mode 
-   'Buffer-menu-mode 'emacs-state vip-slash-and-colon-map)
-  (vip-set-emacs-state-searchstyle-macros nil 'Buffer-menu-mode)
+  (viper-modify-major-mode 
+   'Buffer-menu-mode 'emacs-state viper-slash-and-colon-map)
+  (viper-set-emacs-state-searchstyle-macros nil 'Buffer-menu-mode)
   ;; Switching to emacs is needed  so the above will take hold
-  (defadvice Buffer-menu-mode (after vip-Buffer-menu-ad activate)
+  (defadvice Buffer-menu-mode (after viper-Buffer-menu-ad activate)
     "Switch to emacs mode."
-    (vip-change-state-to-emacs))
+    (viper-change-state-to-emacs))
 
   ;; View mode
   (defvar view-mode-hook)
   (defvar view-hook)
-  (add-hook 'view-hook 'vip-change-state-to-emacs)
-  (add-hook 'view-mode-hook 'vip-change-state-to-emacs)
+  (add-hook 'view-hook 'viper-change-state-to-emacs)
+  (add-hook 'view-mode-hook 'viper-change-state-to-emacs)
   
   ;; For VM users.
   ;; Put summary and other VM buffers in Emacs state.
   (defvar vm-mode-hooks)
   (defvar vm-summary-mode-hooks)
-  (add-hook 'vm-mode-hooks   'vip-change-state-to-emacs)
-  (add-hook 'vm-summary-mode-hooks   'vip-change-state-to-emacs)
+  (add-hook 'vm-mode-hooks   'viper-change-state-to-emacs)
+  (add-hook 'vm-summary-mode-hooks   'viper-change-state-to-emacs)
   
   ;; For RMAIL users.
   ;; Put buf in Emacs state after edit.
-  (vip-eval-after-load
+  (eval-after-load
    "rmailedit"
-   '(defadvice rmail-cease-edit (after vip-rmail-advice activate)
+   '(defadvice rmail-cease-edit (after viper-rmail-advice activate)
       "Switch to emacs state when done editing message."
-      (vip-change-state-to-emacs)))
+      (viper-change-state-to-emacs)))
   ;; In case RMAIL was loaded before Viper.
-  (defadvice rmail-cease-edit (after vip-rmail-advice activate)
+  (defadvice rmail-cease-edit (after viper-rmail-advice activate)
     "Switch to emacs state when done editing message."
-    (vip-change-state-to-emacs))
-  ) ; vip-set-hooks
+    (viper-change-state-to-emacs))
+  ) ; viper-set-hooks
 
 
 ;; these are primarily advices and Vi-ish variable settings
-(defun vip-non-hook-settings ()
+(defun viper-non-hook-settings ()
 
-  ;; This var is not local in Emacs, so we make it local.
-  ;; It must be local because although the stack of minor modes can be the same
-  ;; for all buffers, the associated *keymaps* can be different. In Viper,
-  ;; vip-vi-local-user-map, vip-insert-local-user-map, and others can have
-  ;; different keymaps for different buffers.
-  ;; Also, the keymaps associated with vip-vi/insert-state-modifier-minor-mode
-  ;; can be different.
+  ;; This var is not local in Emacs, so we make it local.  It must be local
+  ;; because although the stack of minor modes can be the same for all buffers,
+  ;; the associated *keymaps* can be different. In Viper,
+  ;; viper-vi-local-user-map, viper-insert-local-user-map, and others can have
+  ;; different keymaps for different buffers.  Also, the keymaps associated
+  ;; with viper-vi/insert-state-modifier-minor-mode can be different.
   (make-variable-buffer-local 'minor-mode-map-alist)
   
   ;; Viper changes the default mode-line-buffer-identification
@@ -833,61 +852,62 @@
   (make-variable-buffer-local 'require-final-newline)
   
   ;; don't bark when mark is inactive
-  (if vip-emacs-p
+  (if viper-emacs-p
       (setq mark-even-if-inactive t))
   
   (setq scroll-step 1)
   
   ;; Variable displaying the current Viper state in the mode line.
-  (vip-deflocalvar vip-mode-string vip-emacs-state-id)
-  (or (memq 'vip-mode-string global-mode-string)
+  (viper-deflocalvar viper-mode-string viper-emacs-state-id)
+  (or (memq 'viper-mode-string global-mode-string)
       (setq global-mode-string
-	    (append '("" vip-mode-string) (cdr global-mode-string))))
+	    (append '("" viper-mode-string) (cdr global-mode-string))))
 
-  (defadvice read-key-sequence (around vip-read-keyseq-ad activate)
+  (defadvice read-key-sequence (around viper-read-keyseq-ad activate)
     "Harness to work for Viper. This advice is harmless---don't worry!"
     (let (inhibit-quit event keyseq)
       (setq keyseq ad-do-it)
-      (setq event (if vip-xemacs-p
+      (setq event (if viper-xemacs-p
 		      (elt keyseq 0) ; XEmacs returns vector of events
 		    (elt (listify-key-sequence keyseq) 0)))
-      (if (vip-ESC-event-p event)
+      (if (viper-ESC-event-p event)
 	  (let (unread-command-events)
-	    (vip-set-unread-command-events keyseq)
-	    (if (vip-fast-keysequence-p)
-		(let ((vip-vi-global-user-minor-mode  nil)
-		      (vip-vi-local-user-minor-mode  nil)
-		      (vip-replace-minor-mode nil) ; actually unnecessary
-		      (vip-insert-global-user-minor-mode  nil)
-		      (vip-insert-local-user-minor-mode  nil))
+	    (viper-set-unread-command-events keyseq)
+	    (if (viper-fast-keysequence-p)
+		(let ((viper-vi-global-user-minor-mode  nil)
+		      (viper-vi-local-user-minor-mode  nil)
+		      (viper-replace-minor-mode nil) ; actually unnecessary
+		      (viper-insert-global-user-minor-mode  nil)
+		      (viper-insert-local-user-minor-mode  nil))
 		  (setq keyseq ad-do-it)) 
 	      (setq keyseq ad-do-it))))
       keyseq))
   
-  (defadvice describe-key (before vip-read-keyseq-ad protect activate)
+  (defadvice describe-key (before viper-read-keyseq-ad protect activate)
     "Force to read key via `read-key-sequence'."
-    (interactive (list (vip-events-to-keys
+    (interactive (list (viper-events-to-keys
 			(read-key-sequence "Describe key: ")))))
   
-  (defadvice describe-key-briefly (before vip-read-keyseq-ad protect activate)
+  (defadvice describe-key-briefly
+    (before viper-read-keyseq-ad protect activate)
     "Force to read key via `read-key-sequence'."
-    (interactive (list (vip-events-to-keys
+    (interactive (list (viper-events-to-keys
 			(read-key-sequence "Describe key briefly: ")))))
   
   
   ;; Advice for use in find-file and read-file-name commands.
-  (defadvice exit-minibuffer (before vip-exit-minibuffer-advice activate)
-    "Run `vip-minibuffer-exit-hook' just before exiting the minibuffer."
-    (run-hooks 'vip-minibuffer-exit-hook))
+  (defadvice exit-minibuffer (before viper-exit-minibuffer-advice activate)
+    "Run `viper-minibuffer-exit-hook' just before exiting the minibuffer."
+    (run-hooks 'viper-minibuffer-exit-hook))
   
-  (defadvice find-file (before vip-add-suffix-advice activate)
+  (defadvice find-file (before viper-add-suffix-advice activate)
     "Use `read-file-name' for reading arguments."
     (interactive (cons (read-file-name "Find file: " nil default-directory)
 		       ;; if Mule and prefix argument, ask for coding system
-		       (cond ((and vip-emacs-p 
+		       (cond ((and viper-emacs-p 
 				   (boundp 'MULE))   ; Emacs 20 with MULE
 			      nil)
-			     ((and vip-xemacs-p
+			     ((and viper-xemacs-p
 				   (featurep 'mule)) ; XEmacs 20 with MULE
 			      (list
 			       (and current-prefix-arg
@@ -896,15 +916,15 @@
 			     )
 		       )))
   
-  (defadvice find-file-other-window (before vip-add-suffix-advice activate)
+  (defadvice find-file-other-window (before viper-add-suffix-advice activate)
     "Use `read-file-name' for reading arguments."
     (interactive (cons (read-file-name "Find file in other window: "
 				       nil default-directory)
 		       ;; if Mule and prefix argument, ask for coding system
-		       (cond ((and vip-emacs-p 
+		       (cond ((and viper-emacs-p 
 				   (boundp 'MULE)) ; Emacs 20 with MULE
 			      nil)
-			     ((and vip-xemacs-p
+			     ((and viper-xemacs-p
 				   (featurep 'mule))   ; XEmacs 20 with MULE
 			      (list
 			       (and current-prefix-arg
@@ -914,15 +934,15 @@
 		       )))
   
 
-  (defadvice find-file-other-frame (before vip-add-suffix-advice activate)
+  (defadvice find-file-other-frame (before viper-add-suffix-advice activate)
     "Use `read-file-name' for reading arguments."
     (interactive (cons (read-file-name "Find file in other frame: "
 				       nil default-directory)
 		       ;; if Mule and prefix argument, ask for coding system
-		       (cond ((and vip-emacs-p 
+		       (cond ((and viper-emacs-p 
 				   (boundp 'MULE))   ; Emacs 20 with MULE
 			      nil)
-			     ((and vip-xemacs-p
+			     ((and viper-xemacs-p
 				   (featurep 'mule)) ; XEmacs 20 with MULE
 			      (list
 			       (and current-prefix-arg
@@ -932,70 +952,38 @@
 		       )))
 
   
-  (defadvice read-file-name (around vip-suffix-advice activate)
-    "Tell `exit-minibuffer' to run `vip-file-add-suffix' as a hook."
-    (let ((vip-minibuffer-exit-hook 'vip-file-add-suffix))
+  (defadvice read-file-name (around viper-suffix-advice activate)
+    "Tell `exit-minibuffer' to run `viper-file-add-suffix' as a hook."
+    (let ((viper-minibuffer-exit-hook 'viper-file-add-suffix))
       ad-do-it))
   
-  (defadvice start-kbd-macro (after vip-kbd-advice activate)
+  (defadvice start-kbd-macro (after viper-kbd-advice activate)
     "Remove Viper's intercepting bindings for C-x ).
   This may be needed if the previous `:map' command terminated abnormally."
-    (define-key vip-vi-intercept-map "\C-x)" nil)
-    (define-key vip-insert-intercept-map "\C-x)" nil)
-    (define-key vip-emacs-intercept-map "\C-x)" nil))
-  
-  (cond ((vip-window-display-p)
-	 (let* ((search-key (if vip-xemacs-p
-				[(meta shift button1up)] [M-S-mouse-1]))
-		(search-key-catch
-		 (if vip-xemacs-p [(meta shift button1)] [M-S-down-mouse-1]))
-		(insert-key (if vip-xemacs-p
-				[(meta shift button2up)] [M-S-mouse-2]))
-		(insert-key-catch
-		 (if vip-xemacs-p [(meta shift button2)] [M-S-down-mouse-2]))
-		(search-key-unbound (and (not (key-binding search-key))
-					 (not (key-binding search-key-catch))))
-		(insert-key-unbound (and (not (key-binding insert-key))
-					 (not (key-binding insert-key-catch))))
-		)
-	   
-	   (if search-key-unbound
-	       (global-set-key search-key 'vip-mouse-click-search-word))
-	   (if insert-key-unbound
-	       (global-set-key insert-key 'vip-mouse-click-insert-word))
-	   
-	   ;; The following would be needed if you want to use the above two
-	   ;; while clicking in another frame. If you only want to use them
-	   ;; by clicking in another window, not frame, the bindings below
-	   ;; aren't necessary.
-	   
-	   ;; These must be bound to mouse-down event for the same mouse
-	   ;; buttons as 'vip-mouse-click-search-word and
-	   ;; 'vip-mouse-click-insert-word
-	   (if search-key-unbound
-	       (global-set-key search-key-catch 'vip-mouse-catch-frame-switch))
-	   (if insert-key-unbound
-	       (global-set-key insert-key-catch 'vip-mouse-catch-frame-switch))
-	   
-	   (if vip-xemacs-p
-	       (add-hook 'mouse-leave-frame-hook
-			 'vip-remember-current-frame)
-	     (defadvice handle-switch-frame (before vip-frame-advice activate)
-	       "Remember the selected frame before the switch-frame event." 
-	       (vip-remember-current-frame (selected-frame))))
-	   )))
-  ) ; end vip-non-hook-settings
+    (define-key viper-vi-intercept-map "\C-x)" nil)
+    (define-key viper-insert-intercept-map "\C-x)" nil)
+    (define-key viper-emacs-intercept-map "\C-x)" nil))
+
+  ;; catch frame switching event
+  (if (viper-window-display-p)
+      (if viper-xemacs-p
+	     (add-hook 'mouse-leave-frame-hook
+		       'viper-remember-current-frame)
+	   (defadvice handle-switch-frame (before viper-frame-advice activate)
+	     "Remember the selected frame before the switch-frame event." 
+	     (viper-remember-current-frame (selected-frame)))) )
+
+  ) ; end viper-non-hook-settings
 
 
-(if (eq viper-mode 'ask)
-    (progn
-      (save-window-excursion
-	(with-output-to-temp-buffer " *vip-info*"
-	  (princ "
+;; Ask only if this-command/last-command are nil, i.e., when loading
+(cond ((and (eq viper-mode 'ask) (null this-command) (null last-command))
+       (save-window-excursion
+	 (with-output-to-temp-buffer " *viper-info*"
+	   (princ "
 You have loaded Viper, and are about to Viperize your emacs!
 
-Viper is a Package for Emacs Rebels
-and a venomous VI PERil,
+Viper is a Package for Emacs Rebels and a venomous VI PERil,
 
 It's time to decide: to Viperize or not to Viperize...
 
@@ -1007,12 +995,27 @@
 in your .emacs file (preferably, close to the top).
 These two lines must come in the order given.
 
-Also, the startup file name has been changed from .vip to .viper"))
-	(if (y-or-n-p "Viperize? ")
-	    (setq viper-mode t)
-	  (setq viper-mode nil))
-	(message "")
-	(kill-buffer " *vip-info*"))))
+** Viper users:
+	**** The startup file name has been changed from .vip to .viper
+	**** All vip-* style names have been converted to viper-* style."))
+	 (if (y-or-n-p "Viperize? ")
+	     (setq viper-mode t)
+	   (setq viper-mode nil))
+	 (message "")
+	 (kill-buffer " *viper-info*")))
+
+      ;; If viper-mode is t, then just continue. Viper will kick in.
+      ((eq viper-mode t))
+      ;; Otherwise, it was asking mode and Viper was not loaded through .emacs
+      ;; In this case, it was either through M-x viper-mode or via something
+      ;; else, like the custom widget. If Viper was loaded through 
+      ;; M-x viper-mode, then viper will kick in anyway.
+      (t (setq viper-mode nil)))
+
+(defun viper-load-custom-file ()
+  (if (and (file-exists-p viper-custom-file-name)
+	   (not noninteractive))
+      (load viper-custom-file-name)))
 
 
 
@@ -1038,7 +1041,7 @@
 	   (cons 'mode-line-buffer-identification
 		 (list (default-value 'mode-line-buffer-identification)))
 	   (cons 'global-mode-string (list global-mode-string))
-	   (if vip-emacs-p
+	   (if viper-emacs-p
 	       (cons 'mark-even-if-inactive (list mark-even-if-inactive)))
 	   )))
        
@@ -1049,127 +1052,121 @@
 (if viper-mode
     (progn
       ;; set advices and some variables that give emacs Vi look.
-      (vip-non-hook-settings)
+      (viper-non-hook-settings)
 
       ;; repeat the 2nd previous command without rotating the command history
-      (vip-record-kbd-macro
-       (vector vip-repeat-from-history-key '\1) 'vi-state
-       [(meta x) v i p - r e p e a t - f r o m - h i s t o r y return] 't)
+      (viper-record-kbd-macro
+       (vector viper-repeat-from-history-key '\1) 'vi-state
+       [(meta x) v i p e r - r e p e a t - f r o m - h i s t o r y return] 't)
       ;; repeat the 3d previous command without rotating the command history
-      (vip-record-kbd-macro
-       (vector vip-repeat-from-history-key '\2) 'vi-state
-       [(meta x) v i p - r e p e a t - f r o m - h i s t o r y return] 't)
+      (viper-record-kbd-macro
+       (vector viper-repeat-from-history-key '\2) 'vi-state
+       [(meta x) v i p e r - r e p e a t - f r o m - h i s t o r y return] 't)
       
       ;; set macros for toggling case sensitivity and regexp search 
-      (vip-set-searchstyle-toggling-macros nil)
+      (viper-set-searchstyle-toggling-macros nil)
       ;; Make %%% toggle parsing comments for matching parentheses
-      (vip-set-parsing-style-toggling-macro nil)
+      (viper-set-parsing-style-toggling-macro nil)
+
+      ;; ~/.viper is loaded if exists
+      (viper-load-custom-file)
+  
+      ;; should be after loading custom file to avoid the pesky msg that
+      ;; mouse-search/insert keys are already bound
+      (viper-bind-mouse-search-key)
+      (viper-bind-mouse-insert-key)
       ))
  
 
-;; ~/.viper is loaded if it exists
-(if (and (file-exists-p vip-custom-file-name)
-	 viper-mode
-	 (not noninteractive))
-    (load vip-custom-file-name))
-
-;; VIP compatibility: merge whatever the user has in vip-mode-map into
-;; Viper's basic map.
-(vip-add-keymap vip-mode-map vip-vi-global-user-map)
-
-(if (boundp 'vip-expert-level)
-    (setq viper-expert-level vip-expert-level))
-
-
 
-;; Applying Viper customization -- runs after (load .vip)
+;; Applying Viper customization -- runs after (load .viper)
 
 ;; Save user settings or Viper defaults for vars controled by
 ;; viper-expert-level 
 (if (null viper-saved-user-settings)
     (setq viper-saved-user-settings 
-	  (list (cons 'vip-want-ctl-h-help (list vip-want-ctl-h-help))
+	  (list (cons 'viper-want-ctl-h-help (list viper-want-ctl-h-help))
 		(cons 'viper-always (list viper-always))
-		(cons 'vip-no-multiple-ESC (list vip-no-multiple-ESC))
-		(cons 'vip-ex-style-motion (list vip-ex-style-motion))
-		(cons 'vip-ex-style-editing-in-insert
-		      (list vip-ex-style-editing-in-insert))
-		(cons 'vip-want-emacs-keys-in-vi 
-		      (list vip-want-emacs-keys-in-vi))
-		(cons 'vip-electric-mode (list vip-electric-mode))
-		(cons 'vip-want-emacs-keys-in-insert
-		      (list vip-want-emacs-keys-in-insert))
-		(cons 'vip-re-search (list vip-re-search)))))
+		(cons 'viper-no-multiple-ESC (list viper-no-multiple-ESC))
+		(cons 'viper-ex-style-motion (list viper-ex-style-motion))
+		(cons 'viper-ex-style-editing-in-insert
+		      (list viper-ex-style-editing-in-insert))
+		(cons 'viper-want-emacs-keys-in-vi 
+		      (list viper-want-emacs-keys-in-vi))
+		(cons 'viper-electric-mode (list viper-electric-mode))
+		(cons 'viper-want-emacs-keys-in-insert
+		      (list viper-want-emacs-keys-in-insert))
+		(cons 'viper-re-search (list viper-re-search)))))
 	      
 
 (if viper-mode
     (progn
-      (vip-set-minibuffer-style)
-      (if vip-buffer-search-char
-	  (vip-buffer-search-enable))
-      (vip-update-alphanumeric-class)
+      (viper-set-minibuffer-style)
+      (if viper-buffer-search-char
+	  (viper-buffer-search-enable))
+      (viper-update-alphanumeric-class)
       ))
    
 
 ;;; Familiarize Viper with some minor modes that have their own keymaps
 (if viper-mode
     (progn
-      (vip-harness-minor-mode "compile")
-      (vip-harness-minor-mode "outline")
-      (vip-harness-minor-mode "allout")
-      (vip-harness-minor-mode "xref")
-      (vip-harness-minor-mode "lmenu")
-      (vip-harness-minor-mode "vc")
-      (vip-harness-minor-mode "ltx-math") ; LaTeX-math-mode in AUC-TeX
-      (vip-harness-minor-mode "latex")    ; which is in one of these two files
-      (vip-harness-minor-mode "cyrillic")
-      (vip-harness-minor-mode "russian")
-      (vip-harness-minor-mode "view-less")
-      (vip-harness-minor-mode "view")
+      (viper-harness-minor-mode "compile")
+      (viper-harness-minor-mode "outline")
+      (viper-harness-minor-mode "allout")
+      (viper-harness-minor-mode "xref")
+      (viper-harness-minor-mode "lmenu")
+      (viper-harness-minor-mode "vc")
+      (viper-harness-minor-mode "ltx-math") ; LaTeX-math-mode in AUC-TeX, which
+      (viper-harness-minor-mode "latex")    ; sits in one of these two files
+      (viper-harness-minor-mode "cyrillic")
+      (viper-harness-minor-mode "russian")
+      (viper-harness-minor-mode "view-less")
+      (viper-harness-minor-mode "view")
       ))
 
 
 ;; Intercept maps could go in viper-keym.el
 ;; We keep them here in case someone redefines them in ~/.viper
 
-(define-key vip-vi-intercept-map vip-ESC-key 'vip-intercept-ESC-key)
-(define-key vip-insert-intercept-map vip-ESC-key 'vip-intercept-ESC-key)
+(define-key viper-vi-intercept-map viper-ESC-key 'viper-intercept-ESC-key)
+(define-key viper-insert-intercept-map viper-ESC-key 'viper-intercept-ESC-key)
 
-;; This is taken care of by vip-insert-global-user-map.
-;;(define-key vip-replace-map vip-ESC-key 'vip-intercept-ESC-key)
+;; This is taken care of by viper-insert-global-user-map.
+;;(define-key viper-replace-map viper-ESC-key 'viper-intercept-ESC-key)
 
 
-;; The default vip-toggle-key is \C-z; for the novice, it suspends or
+;; The default viper-toggle-key is \C-z; for the novice, it suspends or
 ;; iconifies Emacs
-(define-key vip-vi-intercept-map vip-toggle-key 'vip-toggle-key-action)
-(define-key vip-emacs-intercept-map vip-toggle-key 'vip-change-state-to-vi)
+(define-key viper-vi-intercept-map viper-toggle-key 'viper-toggle-key-action)
+(define-key
+  viper-emacs-intercept-map viper-toggle-key 'viper-change-state-to-vi)
 
 
 (if (and viper-mode
 	 (or viper-always 
 	     (and (< viper-expert-level 5) (> viper-expert-level 0))))
-    (vip-set-hooks))
+    (viper-set-hooks))
     
 ;; Let all minor modes take effect after loading
 ;; this may not be enough, so we also set default minor-mode-alist.
 ;; Without setting the default, new buffers that come up in emacs mode have
-;; minor-mode-map-alist = nil, unless we call vip-change-state-*
-(if (eq vip-current-state 'emacs-state)
+;; minor-mode-map-alist = nil, unless we call viper-change-state-*
+(if (eq viper-current-state 'emacs-state)
     (progn
-      (vip-change-state-to-emacs)
+      (viper-change-state-to-emacs)
       (setq-default minor-mode-map-alist minor-mode-map-alist)
       ))
     
 
 
-(run-hooks 'vip-load-hook) ; the last chance to change something
+(run-hooks 'viper-load-hook) ; the last chance to change something
 
-(provide 'vip)
 (provide 'viper)
 
 
 ;;; Local Variables:
-;;; eval: (put 'vip-deflocalvar 'lisp-indent-hook 'defun)
+;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
 ;;; End:
 
 ;;;  viper.el ends here
--- a/lisp/vm/vm-autoload.el	Mon Aug 13 09:52:21 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3002 +0,0 @@
-(provide 'vm-autoload)
-"f-e-r-i-1:  /b/XEmacs/xemacs-20.0/src/xemacs
-""Find: /etc/xemacs
-""Find: /home/steve/.xemacs
-"
-(autoload (quote vm-delete-message) "vm-delete" "Add the `deleted' attribute to the current message.
-
-The message will be physically deleted from the current folder the next
-time the current folder is expunged.
-
-With a prefix argument COUNT, the current message and the next
-COUNT - 1 messages are deleted.  A negative argument means
-the current message and the previous |COUNT| - 1 messages are
-deleted.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-only marked messages are deleted, other messages are ignored." t nil)
-
-(autoload (quote vm-delete-message-backward) "vm-delete" "Like vm-delete-message, except the deletion direction is reversed." t nil)
-
-(autoload (quote vm-undelete-message) "vm-delete" "Remove the `deleted' attribute from the current message.
-
-With a prefix argument COUNT, the current message and the next
-COUNT - 1 messages are undeleted.  A negative argument means
-the current message and the previous |COUNT| - 1 messages are
-deleted.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-only marked messages are undeleted, other messages are ignored." t nil)
-
-(autoload (quote vm-kill-subject) "vm-delete" "Delete all messages with the same subject as the current message.
-Message subjects are compared after ignoring parts matched by
-the variables vm-subject-ignored-prefix and vm-subject-ignored-suffix.
-
-The optional prefix argument ARG specifies the direction to move
-if vm-move-after-killing is non-nil.  The default direction is
-forward.  A positive prefix argument means move forward, a
-negative arugment means move backward, a zero argument means
-don't move at all." t nil)
-
-(autoload (quote vm-expunge-folder) "vm-delete" "Expunge messages with the `deleted' attribute.
-For normal folders this means that the deleted messages are
-removed from the message list and the message contents are
-removed from the folder buffer.
-
-For virtual folders, messages are removed from the virtual
-message list.  If virtual mirroring is in effect for the virtual
-folder, the corresponding real messages are also removed from real
-message lists and the message contents are removed from real folders.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-only messages both marked and deleted are expunged, other messages are
-ignored." t nil)
-
-(autoload (quote vm-no-frills-encapsulate-message) "vm-digest" "Encapsulate a message M for forwarding, simply.
-No message encapsulation standard is used.  The message is
-inserted at point in the current buffer, surrounded by two dashed
-start/end separator lines.  Point is not moved.
-
-M should be a message struct for a real message, not a virtual message.
-This is the message that will be encapsulated.
-KEEP-LIST should be a list of regexps matching headers to keep.
-DISCARD-REGEXP should be a regexp that matches headers to be discarded.
-KEEP-LIST and DISCARD-REGEXP are used to order and trim the headers
-to be forwarded.  See the docs for vm-reorder-message-headers
-to find out how KEEP-LIST and DISCARD-REGEXP are used." nil nil)
-
-(autoload (quote vm-mime-encapsulate-messages) "vm-digest" "Encapsulate the messages in MESSAGE-LIST as per the MIME spec.
-The resulting digest is inserted at point in the current buffer.
-Point is not moved.
-
-MESSAGE-LIST should be a list of message structs (real or virtual).
-These are the messages that will be encapsulated.
-KEEP-LIST should be a list of regexps matching headers to keep.
-DISCARD-REGEXP should be a regexp that matches headers to be discarded.
-KEEP-LIST and DISCARD-REGEXP are used to order and trim the headers
-to be forwarded.  See the docs for vm-reorder-message-headers
-to find out how KEEP-LIST and DISCARD-REGEXP are used.
-
-If ALWAYS-USE-DIGEST is non-nil, always encapsulate for a multipart/digest.
-Otherwise if there are fewer than two messages to be encapsulated
-leave off the multipart boundary strings.  The caller is assumed to
-be using message/rfc822 or message/news encoding instead.
-
-If multipart/digest encapsulation is done, the function returns
-the multipart boundary parameter (string) that should be used in
-the Content-Type header.  Otherwise nil is returned." nil nil)
-
-(autoload (quote vm-mime-burst-message) "vm-digest" "Burst messages from the digest message M.
-M should be a message struct for a real message.
-MIME encoding is expected.  Somewhere within the MIME layout
-there must be at least one part of type message/news, message/rfc822 or
-multipart/digest.  If there are multiple parts matching those types,
-all of them will be burst." nil nil)
-
-(autoload (quote vm-mime-burst-layout) "vm-digest" nil nil nil)
-
-(autoload (quote vm-rfc934-char-stuff-region) "vm-digest" "Quote RFC 934 message separators between START and END.
-START and END are buffer positions in the current buffer.
-Lines beginning with `-' in the region have `- ' prepended to them." nil nil)
-
-(autoload (quote vm-rfc934-char-unstuff-region) "vm-digest" "Unquote lines in between START and END as per RFC 934.
-START and END are buffer positions in the current buffer.
-Lines beginning with `- ' in the region have that string stripped
-from them." nil nil)
-
-(autoload (quote vm-rfc934-encapsulate-messages) "vm-digest" "Encapsulate the messages in MESSAGE-LIST as per RFC 934.
-The resulting digest is inserted at point in the current buffer.
-Point is not moved.
-
-MESSAGE-LIST should be a list of message structs (real or virtual).
-These are the messages that will be encapsulated.
-KEEP-LIST should be a list of regexps matching headers to keep.
-DISCARD-REGEXP should be a regexp that matches headers to be discarded.
-KEEP-LIST and DISCARD-REGEXP are used to order and trim the headers
-to be forwarded.  See the docs for vm-reorder-message-headers
-to find out how KEEP-LIST and DISCARD-REGEXP are used." nil nil)
-
-(autoload (quote vm-rfc1153-char-stuff-region) "vm-digest" "Quote RFC 1153 message separators between START and END.
-START and END are buffer positions in the current buffer.
-Lines consisting only of 30 hyphens have the first hyphen
-converted to a space." nil nil)
-
-(autoload (quote vm-rfc1153-char-unstuff-region) "vm-digest" "Unquote lines in between START and END as per RFC 1153.
-START and END are buffer positions in the current buffer.
-Lines consisting only of a space following by 29 hyphens have the space
-converted to a hyphen." nil nil)
-
-(autoload (quote vm-rfc1153-encapsulate-messages) "vm-digest" "Encapsulate the messages in MESSAGE-LIST as per RFC 1153.
-The resulting digest is inserted at point in the current buffer.
-Point is not moved.
-
-MESSAGE-LIST should be a list of message structs (real or virtual).
-These are the messages that will be encapsulated.
-KEEP-LIST should be a list of regexps matching headers to keep.
-DISCARD-REGEXP should be a regexp that matches headers to be discarded.
-KEEP-LIST and DISCARD-REGEXP are used to order and trim the headers
-to be forwarded.  See the docs for vm-reorder-message-headers
-to find out how KEEP-LIST and DISCARD-REGEXP are used." nil nil)
-
-(autoload (quote vm-rfc1153-or-rfc934-burst-message) "vm-digest" "Burst messages from the digest message M.
-M should be a message struct for a real message.
-If RFC1153 is non-nil, assume the digest is of the form specified by
-RFC 1153.  Otherwise assume RFC 934 digests." nil nil)
-
-(autoload (quote vm-rfc934-burst-message) "vm-digest" "Burst messages from the RFC 934 digest message M.
-M should be a message struct for a real message." nil nil)
-
-(autoload (quote vm-rfc1153-burst-message) "vm-digest" "Burst messages from the RFC 1153 digest message M.
-M should be a message struct for a real message." nil nil)
-
-(autoload (quote vm-burst-digest) "vm-digest" "Burst the current message (a digest) into its individual messages.
-The digest's messages are assimilated into the folder as new mail
-would be.
-
-Optional argument DIGEST-TYPE is a string that tells VM what kind
-of digest the current message is.  If it is not given the value
-defaults to the value of vm-digest-burst-type.  When called
-interactively DIGEST-TYPE will be read from the minibuffer.
-
-If invoked on marked messages (via vm-next-command-uses-marks),
-all marked messages will be burst." t nil)
-
-(autoload (quote vm-burst-rfc934-digest) "vm-digest" "Burst an RFC 934 style digest" t nil)
-
-(autoload (quote vm-burst-rfc1153-digest) "vm-digest" "Burst an RFC 1153 style digest" t nil)
-
-(autoload (quote vm-burst-mime-digest) "vm-digest" "Burst a MIME digest" t nil)
-
-(autoload (quote vm-guess-digest-type) "vm-digest" "Guess the digest type of the message M.
-M should be the message struct of a real message.
-Returns either \"rfc934\", \"rfc1153\" or \"mime\"." nil nil)
-
-(autoload (quote vm-digest-get-header-contents) "vm-digest" nil nil nil)
-
-(autoload (quote vm-easy-menu-define) "vm-easymenu" "Define a menu bar submenu in maps MAPS, according to MENU.
-The menu keymap is stored in symbol SYMBOL, both as its value
-and as its function definition.   DOC is used as the doc string for SYMBOL.
-
-The first element of MENU must be a string.  It is the menu bar item name.
-The rest of the elements are menu items.
-
-A menu item is usually a vector of three elements:  [NAME CALLBACK ENABLE]
-
-NAME is a string--the menu item name.
-
-CALLBACK is a command to run when the item is chosen,
-or a list to evaluate when the item is chosen.
-
-ENABLE is an expression; the item is enabled for selection
-whenever this expression's value is non-nil.
-
-Alternatively, a menu item may have the form: 
-
-   [ NAME CALLBACK [ KEYWORD ARG ] ... ]
-
-Where KEYWORD is one of the symbol defined below.
-
-   :keys KEYS
-
-KEYS is a string; a complex keyboard equivalent to this menu item.
-This is normally not needed because keyboard equivalents are usually
-computed automatically.
-
-   :active ENABLE
-
-ENABLE is an expression; the item is enabled for selection
-whenever this expression's value is non-nil.
-
-   :suffix NAME
-
-NAME is a string; the name of an argument to CALLBACK.
-
-   :style 
-   
-STYLE is a symbol describing the type of menu item.  The following are
-defined:  
-
-toggle: A checkbox.  
-        Currently just prepend the name with the string \"Toggle \".
-radio: A radio button. 
-nil: An ordinary menu item.
-
-   :selected SELECTED
-
-SELECTED is an expression; the checkbox or radio button is selected
-whenever this expression's value is non-nil.
-Currently just disable radio buttons, no effect on checkboxes.
-
-A menu item can be a string.  Then that string appears in the menu as
-unselectable text.  A string consisting solely of hyphens is displayed
-as a solid horizontal line.
-
-A menu item can be a list.  It is treated as a submenu.
-The first element should be the submenu name.  That's used as the
-menu item in the top-level menu.  The cdr of the submenu list
-is a list of menu items, as above." nil t)
-
-(autoload (quote vm-easy-menu-do-define) "vm-easymenu" nil nil nil)
-
-(autoload (quote vm-easy-menu-create-keymaps) "vm-easymenu" nil nil nil)
-
-(autoload (quote vm-easy-menu-change) "vm-easymenu" "Change menu found at PATH as item NAME to contain ITEMS.
-PATH is a list of strings for locating the menu containing NAME in the
-menu bar.  ITEMS is a list of menu items, as in `vm-easy-menu-define'.
-These items entirely replace the previous items in that map.
-
-Call this from `activate-menubar-hook' to implement dynamic menus." nil nil)
-
-(autoload (quote vm-easy-menu-remove) "vm-easymenu" nil nil nil)
-
-(autoload (quote vm-easy-menu-add) "vm-easymenu" nil nil nil)
-
-(autoload (quote vm-edit-message) "vm-edit" "Edit the current message.  Prefix arg means mark as unedited instead.
-If editing, the current message is copied into a temporary buffer, and
-this buffer is selected for editing.  The major mode of this buffer is
-controlled by the variable vm-edit-message-mode.  The hooks specified
-in vm-edit-message-hook are run just prior to returning control to the user
-for editing.
-
-Use C-c ESC when you have finished editing the message.  The message
-will be inserted into its folder replacing the old version of the
-message.  If you don't want your edited version of the message to
-replace the original, use C-c C-] and the edit will be aborted." t nil)
-
-(autoload (quote vm-edit-message-other-frame) "vm-edit" "Like vm-edit-message, but run in a newly created frame." t nil)
-
-(autoload (quote vm-discard-cached-data) "vm-edit" "Discard cached information about the current message.
-When VM gathers information from the headers of a message, it stores it
-internally for future reference.  This command causes VM to forget this
-information, and VM will be forced to search the headers of the message
-again for these data.  VM will also have to decide again which headers
-should be displayed and which should not.  Therefore this command is
-useful if you change the value of vm-visible-headers or
-vm-invisible-header-regexp in the midst of a VM session.
-
-Numeric prefix argument N means to discard data from the current message
-plus the next N-1 messages.  A negative N means discard data from the
-current message and the previous N-1 messages.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-data is discarded only from the marked messages in the current folder." t nil)
-
-(autoload (quote vm-edit-message-end) "vm-edit" "End the edit of a message and copy the result to its folder." t nil)
-
-(autoload (quote vm-edit-message-abort) "vm-edit" "Abort the edit of a message, forgetting changes to the message." t nil)
-
-(autoload (quote vm-number-messages) "vm-folder" "Set the number-of and padded-number-of slots of messages
-in vm-message-list.
-
-If non-nil, START-POINT should point to a cons cell in
-vm-message-list and the numbering will begin there, else the
-numbering will begin at the head of vm-message-list.  If
-START-POINT is non-nil the reverse-link-of slot of the message in
-the cons must be valid and the message pointed to (if any) must
-have a non-nil number-of slot, because it is used to determine
-what the starting message number should be.
-
-If non-nil, END-POINT should point to a cons cell in
-vm-message-list and the numbering will end with the message just
-before this cell.  A nil value means numbering will be done until
-the end of vm-message-list is reached." nil nil)
-
-(autoload (quote vm-set-numbering-redo-start-point) "vm-folder" "Set vm-numbering-redo-start-point to START-POINT if appropriate.
-Also mark the current buffer as needing a display update.
-
-START-POINT should be a cons in vm-message-list or just t.
- (t means start from the beginning of vm-message-list.)
-If START-POINT is closer to the head of vm-message-list than
-vm-numbering-redo-start-point or is equal to t, then
-vm-numbering-redo-start-point is set to match it." nil nil)
-
-(autoload (quote vm-set-numbering-redo-end-point) "vm-folder" "Set vm-numbering-redo-end-point to END-POINT if appropriate.
-Also mark the current buffer as needing a display update.
-
-END-POINT should be a cons in vm-message-list or just t.
- (t means number all the way to the end of vm-message-list.)
-If END-POINT is closer to the end of vm-message-list or is equal
-to t, then vm-numbering-redo-start-point is set to match it.
-The number-of slot is used to determine proximity to the end of
-vm-message-list, so this slot must be valid in END-POINT's message
-and the message in the cons pointed to by vm-numbering-redo-end-point." nil nil)
-
-(autoload (quote vm-do-needed-renumbering) "vm-folder" "Number messages in vm-message-list as specified by
-vm-numbering-redo-start-point and vm-numbering-redo-end-point.
-
-vm-numbering-redo-start-point = t means start at the head
-of vm-message-list.
-vm-numbering-redo-end-point = t means number all the way to the
-end of vm-message-list.
-
-Otherwise the variables' values should be conses in vm-message-list
-or nil." nil nil)
-
-(autoload (quote vm-set-summary-redo-start-point) "vm-folder" "Set vm-summary-redo-start-point to START-POINT if appropriate.
-Also mark the current buffer as needing a display update.
-
-START-POINT should be a cons in vm-message-list or just t.
- (t means start from the beginning of vm-message-list.)
-If START-POINT is closer to the head of vm-message-list than
-vm-summary-redo-start-point or is equal to t, then
-vm-summary-redo-start-point is set to match it." nil nil)
-
-(autoload (quote vm-mark-for-summary-update) "vm-folder" "Mark message M for a summary update.
-Also mark M's buffer as needing a display update. Any virtual
-messages of M and their buffers are similarly marked for update.
-If M is a virtual message and virtual mirroring is in effect for
-M (i.e. attribute-of eq attributes-of M's real message), M's real
-message and its buffer are scheduled for an update.
-
-Optional arg DONT-KILL-CACHE non-nil means don't invalidate the
-summary-of slot for any messages marked for update.  This is
-meant to be used by functions that update message information
-that is not cached in the summary-of slot, e.g. message numbers
-and thread indentation." nil nil)
-
-(autoload (quote vm-force-mode-line-update) "vm-folder" "Force a mode line update in all frames." nil nil)
-
-(autoload (quote vm-do-needed-mode-line-update) "vm-folder" "Do a modeline update for the current folder buffer.
-This means setting up all the various vm-ml attribute variables
-in the folder buffer and copying necessary variables to the
-folder buffer's summary and presentation buffers, and then
-forcing Emacs to update all modelines.
-
-If a virtual folder being updated has no messages, then
-erase-buffer is called on its buffer.
-
-If any type of folder is empty, erase-buffer is called
-on its presentation buffer, if any." nil nil)
-
-(autoload (quote vm-update-summary-and-mode-line) "vm-folder" "Update summary and mode line for all VM folder and summary buffers.
-Really this updates all the visible status indicators.
-
-Message lists are renumbered.
-Summary entries are wiped and regenerated.
-Mode lines are updated.
-Toolbars are updated." nil nil)
-
-(autoload (quote vm-reverse-link-messages) "vm-folder" "Set reverse links for all messages in vm-message-list." nil nil)
-
-(autoload (quote vm-match-ordered-header) "vm-folder" "Try to match a header in ALIST and return the matching cell.
-This is used by header ordering code.
-
-ALIST looks like this ((\"From\") (\"To\")).  This function returns
-the alist element whose car matches the header starting at point.
-The header ordering code uses the cdr of the element
-returned to hold headers to be output later." nil nil)
-
-(autoload (quote vm-match-header) "vm-folder" "Match a header and save some state information about the matched header.
-Optional first arg HEADER-NAME means match the header only
-if it matches HEADER-NAME.  HEADER-NAME should be a string
-containing a header name.  The string should end with a colon if just
-that name should be matched.  A string that does not end in a colon
-will match all headers that begin with that string.
-
-State information is stored in vm-matched-header-vector bound to a vector
-of this form.
-
- [ header-start header-end
-   header-name-start header-name-end
-   header-contents-start header-contents-end ]
-
-Elements are integers.
-There are functions to access and use this info." nil nil)
-
-(autoload (quote vm-matched-header) "vm-folder" "Returns the header last matched by vm-match-header.
-Trailing newline is included." nil nil)
-
-(autoload (quote vm-matched-header-name) "vm-folder" "Returns the name of the header last matched by vm-match-header." nil nil)
-
-(autoload (quote vm-matched-header-contents) "vm-folder" "Returns the contents of the header last matched by vm-match-header.
-Trailing newline is not included." nil nil)
-
-(autoload (quote vm-matched-header-start) "vm-folder" "Returns the start position of the header last matched by vm-match-header." nil nil)
-
-(autoload (quote vm-matched-header-end) "vm-folder" "Returns the end position of the header last matched by vm-match-header." nil nil)
-
-(autoload (quote vm-matched-header-name-start) "vm-folder" "Returns the start position of the name of the header last matched
-by vm-match-header." nil nil)
-
-(autoload (quote vm-matched-header-name-end) "vm-folder" "Returns the end position of the name of the header last matched
-by vm-match-header." nil nil)
-
-(autoload (quote vm-matched-header-contents-start) "vm-folder" "Returns the start position of the contents of the header last matched
-by vm-match-header." nil nil)
-
-(autoload (quote vm-matched-header-contents-end) "vm-folder" "Returns the end position of the contents of the header last matched
-by vm-match-header." nil nil)
-
-(autoload (quote vm-get-folder-type) "vm-folder" "Return a symbol indicating the folder type of the current buffer.
-This function works by examining the beginning of a folder.
-If optional arg FILE is present the type of FILE is returned instead.
-If optional second and third arg START and END are provided,
-vm-get-folder-type will examine the text between those buffer
-positions.  START and END default to 1 and (buffer-size) + 1.
-
-Returns
-  nil      if folder has no type (empty)
-  unknown  if the type is not known to VM
-  mmdf     for MMDF folders
-  babyl    for BABYL folders
-  From_    for UNIX From_ folders
-
-If vm-trust-From_-with-Content-Length is non-nil,
-From_-with-Content-Length is returned if the first message in the
-folder has a Content-Length header and the folder otherwise looks
-like a From_ folder." nil nil)
-
-(autoload (quote vm-convert-folder-type) "vm-folder" "Convert buffer from OLD-TYPE to NEW-TYPE.
-OLD-TYPE and NEW-TYPE should be symbols returned from vm-get-folder-type.
-This should be called on non-live buffers like crash boxes.
-This will confuse VM if called on a folder buffer in vm-mode." nil nil)
-
-(autoload (quote vm-convert-folder-header) "vm-folder" "Convert the folder header form OLD-TYPE to NEW-TYPE.
-The folder header is the text at the beginning of a folder that
-is a legal part of the folder but is not part of the first
-message.  This is for dealing with BABYL files." nil nil)
-
-(autoload (quote vm-skip-past-folder-header) "vm-folder" "Move point past the folder header.
-The folder header is the text at the beginning of a folder that
-is a legal part of the folder but is not part of the first
-message.  This is for dealing with BABYL files." nil nil)
-
-(autoload (quote vm-convert-folder-type-headers) "vm-folder" "Convert headers in the message around point from OLD-TYPE to NEW-TYPE.
-This means to add/delete Content-Length and any other
-headers related to folder-type as needed for folder type
-conversions.  This function expects point to be at the beginning
-of the header section of a message, and it only deals with that
-message." nil nil)
-
-(autoload (quote vm-munge-message-separators) "vm-folder" "Munge message separators of FOLDER-TYPE found between START and END.
-This function is used to eliminate message separators for a particular
-folder type that happen to occur in a message.  \">\" is prepended to such
-separators." nil nil)
-
-(autoload (quote vm-compatible-folder-p) "vm-folder" "Return non-nil if FILE is a compatible folder with the current buffer.
-The current folder must have vm-folder-type initialized.
-FILE is compatible if
-  - it is empty
-  - the current folder is empty
-  - the two folder types are equal" nil nil)
-
-(autoload (quote vm-leading-message-separator) "vm-folder" "Returns a leading message separator for the current folder.
-Defaults to returning a separator for the current folder type.
-
-Optional first arg FOLDER-TYPE means return a separator for that
-folder type instead.
-
-Optional second arg MESSAGE should be a message struct.  This is used
-generating BABYL separators, because they contain message attributes
-and labels that must must be copied from the message.
-
-Optional third arg FOR-OTHER-FOLDER non-nil means that this separator will
-be used a `foreign' folder.  This means that the `deleted'
-attributes should not be copied for BABYL folders." nil nil)
-
-(autoload (quote vm-trailing-message-separator) "vm-folder" "Returns a leading message separator for the current folder.
-Defaults to returning a separator for the current folder type.
-
-Optional first arg FOLDER-TYPE means return a separator for that
-folder type instead." nil nil)
-
-(autoload (quote vm-folder-header) "vm-folder" "Returns a folder header for the current folder.
-Defaults to returning a folder header for the current folder type.
-
-Optional first arg FOLDER-TYPE means return a folder header for that
-folder type instead.
-
-Optional second arg LABEL-OBARRAY should be an obarray of labels
-that have been used in this folder.  This is used for BABYL folders." nil nil)
-
-(autoload (quote vm-find-leading-message-separator) "vm-folder" "Find the next leading message separator in a folder.
-Returns non-nil if the separator is found, nil otherwise." nil nil)
-
-(autoload (quote vm-find-trailing-message-separator) "vm-folder" "Find the next trailing message separator in a folder." nil nil)
-
-(autoload (quote vm-skip-past-leading-message-separator) "vm-folder" "Move point past a leading message separator at point." nil nil)
-
-(autoload (quote vm-skip-past-trailing-message-separator) "vm-folder" "Move point past a trailing message separator at point." nil nil)
-
-(autoload (quote vm-build-message-list) "vm-folder" "Build a chain of message structures, stored them in vm-message-list.
-Finds the start and end of each message and fills in the relevant
-fields in the message structures.
-
-Also finds the beginning of the header section and the end of the
-text section and fills in these fields in the message structures.
-
-vm-text-of and vm-vheaders-of field don't get filled until they
-are needed.
-
-If vm-message-list already contained messages, the end of the last
-known message is found and then the parsing of new messages begins
-there and the message are appended to vm-message-list.
-
-vm-folder-type is initialized here." nil nil)
-
-(autoload (quote vm-build-header-order-alist) "vm-folder" nil nil nil)
-
-(autoload (quote vm-reorder-message-headers) "vm-folder" nil nil nil)
-
-(autoload (quote vm-read-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-read-babyl-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-set-default-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-emit-totals-blurb) "vm-folder" nil nil nil)
-
-(autoload (quote vm-convert-v4-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-gobble-labels) "vm-folder" nil nil nil)
-
-(autoload (quote vm-gobble-bookmark) "vm-folder" nil nil nil)
-
-(autoload (quote vm-gobble-visible-header-variables) "vm-folder" nil nil nil)
-
-(autoload (quote vm-gobble-message-order) "vm-folder" nil nil nil)
-
-(autoload (quote vm-gobble-summary) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-folder-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-babyl-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-babyl-attributes-string) "vm-folder" nil nil nil)
-
-(autoload (quote vm-babyl-labels-string) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-virtual-attributes) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-labels) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-bookmark) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-summary) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-header-variables) "vm-folder" nil nil nil)
-
-(autoload (quote vm-stuff-message-order) "vm-folder" nil nil nil)
-
-(autoload (quote vm-remove-message-order) "vm-folder" nil nil nil)
-
-(autoload (quote vm-change-all-new-to-unread) "vm-folder" nil nil nil)
-
-(autoload (quote vm-unread-message) "vm-folder" "Set the `unread' attribute for the current message.  If the message is
-already new or unread, then it is left unchanged.
-
-Numeric prefix argument N means to unread the current message plus the
-next N-1 messages.  A negative N means unread the current message and
-the previous N-1 messages.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-all marked messages are affected, other messages are ignored." t nil)
-
-(autoload (quote vm-quit-just-bury) "vm-folder" "Bury the current VM folder and summary buffers.
-The folder is not altered and Emacs is still visiting it.  You
-can switch back to it with switch-to-buffer or by using the
-Buffer Menu." t nil)
-
-(autoload (quote vm-quit-just-iconify) "vm-folder" "Iconify the frame and bury the current VM folder and summary buffers.
-The folder is not altered and Emacs is still visiting it." t nil)
-
-(autoload (quote vm-quit-no-change) "vm-folder" "Quit visiting the current folder without saving changes made to the folder." t nil)
-
-(autoload (quote vm-quit) "vm-folder" "Quit visiting the current folder, saving changes.  Deleted messages are not expunged." t nil)
-
-(autoload (quote vm-start-itimers-if-needed) "vm-folder" nil nil nil)
-
-(autoload (quote vm-timer-using) "vm-folder" nil nil nil)
-
-(autoload (quote vm-check-mail-itimer-function) "vm-folder" nil nil nil)
-
-(autoload (quote vm-get-mail-itimer-function) "vm-folder" nil nil nil)
-
-(autoload (quote vm-flush-itimer-function) "vm-folder" nil nil nil)
-
-(autoload (quote vm-flush-cached-data) "vm-folder" nil nil nil)
-
-(autoload (quote vm-write-file-hook) "vm-folder" nil nil nil)
-
-(autoload (quote vm-save-buffer) "vm-folder" nil t nil)
-
-(autoload (quote vm-write-file) "vm-folder" nil t nil)
-
-(autoload (quote vm-save-folder) "vm-folder" "Save current folder to disk.
-Deleted messages are not expunged.
-Prefix arg is handled the same as for the command save-buffer.
-
-When applied to a virtual folder, this command runs itself on
-each of the underlying real folders associated with the virtual
-folder." t nil)
-
-(autoload (quote vm-save-and-expunge-folder) "vm-folder" "Expunge folder, then save it to disk.
-Prefix arg is handled the same as for the command save-buffer.
-Expunge won't be done if folder is read-only.
-
-When applied to a virtual folder, this command works as if you had
-run vm-expunge-folder followed by vm-save-folder." t nil)
-
-(autoload (quote vm-handle-file-recovery-or-reversion) "vm-folder" nil nil nil)
-
-(autoload (quote vm-handle-file-recovery) "vm-folder" nil nil nil)
-
-(autoload (quote vm-handle-file-reversion) "vm-folder" nil nil nil)
-
-(autoload (quote vm-after-revert-buffer-hook) "vm-folder" nil nil nil)
-
-(autoload (quote vm-help) "vm-folder" "Display help for various VM activities." t nil)
-
-(autoload (quote vm-spool-move-mail) "vm-folder" nil nil nil)
-
-(autoload (quote vm-gobble-crash-box) "vm-folder" nil nil nil)
-
-(autoload (quote vm-compute-spool-files) "vm-folder" nil nil nil)
-
-(autoload (quote vm-spool-check-mail) "vm-folder" nil nil nil)
-
-(autoload (quote vm-check-for-spooled-mail) "vm-folder" nil nil nil)
-
-(autoload (quote vm-get-spooled-mail) "vm-folder" nil nil nil)
-
-(autoload (quote vm-safe-popdrop-string) "vm-folder" nil nil nil)
-
-(autoload (quote vm-get-new-mail) "vm-folder" "Move any new mail that has arrived in any of the spool files for the
-current folder into the folder.  New mail is appended to the disk
-and buffer copies of the folder.
-
-Prefix arg means to gather mail from a user specified folder, instead of
-the usual spool files.  The file name will be read from the minibuffer.
-Unlike when getting mail from a spool file, the source file is left
-undisturbed after its messages have been copied.
-
-When applied to a virtual folder, this command runs itself on
-each of the underlying real folders associated with this virtual folder.
-A prefix argument has no effect; mail is always gathered from the
-spool files." t nil)
-
-(autoload (quote vm-assimilate-new-messages) "vm-folder" nil nil nil)
-
-(autoload (quote vm-select-marked-or-prefixed-messages) "vm-folder" nil nil nil)
-
-(autoload (quote vm-display-startup-message) "vm-folder" nil nil nil)
-
-(autoload (quote vm-load-init-file) "vm-folder" nil t nil)
-
-(autoload (quote vm-session-initialization) "vm-folder" nil nil nil)
-
-(autoload (quote vm-toggle-read-only) "vm-folder" nil t nil)
-
-(autoload (quote vm-mode-internal) "vm-folder" nil nil nil)
-
-(autoload (quote vm-link-to-virtual-buffers) "vm-folder" nil nil nil)
-
-(autoload (quote vm-change-folder-type) "vm-folder" "Change folder type to TYPE.
-TYPE may be one of the following symbol values:
-
-    From_
-    From_-with-Content-Length
-    mmdf
-    babyl
-
-Interactively TYPE will be read from the minibuffer." t nil)
-
-(autoload (quote vm-garbage-collect-folder) "vm-folder" nil nil nil)
-
-(autoload (quote vm-garbage-collect-message) "vm-folder" nil nil nil)
-
-(autoload (quote vm-show-copying-restrictions) "vm-license" nil t nil)
-
-(autoload (quote vm-show-no-warranty) "vm-license" "Display \"NO WARRANTY\" section of the GNU General Public License." t nil)
-
-(autoload (quote vm-clear-all-marks) "vm-mark" "Removes all message marks in the current folder." t nil)
-
-(autoload (quote vm-mark-all-messages) "vm-mark" "Mark all messages in the current folder." t nil)
-
-(autoload (quote vm-mark-message) "vm-mark" "Mark the current message.
-Numeric prefix argument N means mark the current message and the next
-N-1 messages.  A negative N means mark the current message and the
-previous N-1 messages." t nil)
-
-(autoload (quote vm-unmark-message) "vm-mark" "Remove the mark from the current message.
-Numeric prefix argument N means unmark the current message and the next
-N-1 messages.  A negative N means unmark the current message and the
-previous N-1 messages." t nil)
-
-(autoload (quote vm-mark-summary-region) "vm-mark" "Mark all messages with summary lines contained in the region." t nil)
-
-(autoload (quote vm-unmark-summary-region) "vm-mark" "Remove marks from messages with summary lines contained in the region." t nil)
-
-(autoload (quote vm-mark-or-unmark-summary-region) "vm-mark" nil nil nil)
-
-(autoload (quote vm-mark-or-unmark-messages-with-selector) "vm-mark" nil nil nil)
-
-(autoload (quote vm-mark-matching-messages) "vm-mark" "Mark messages matching some criterion.
-You can use any of the virtual folder selectors, except for the
-`and', `or' and `not' selectors.  See the documentation for the
-variable vm-virtual-folder-alist for more information." t nil)
-
-(autoload (quote vm-unmark-matching-messages) "vm-mark" "Unmark messages matching some criterion.
-You can use any of the virtual folder selectors, except for the
-`and', `or' and `not' selectors.  See the documentation for the
-variable vm-virtual-folder-alist for more information." t nil)
-
-(autoload (quote vm-mark-thread-subtree) "vm-mark" "Mark all messages in the thread tree rooted at the current message." t nil)
-
-(autoload (quote vm-unmark-thread-subtree) "vm-mark" "Unmark all messages in the thread tree rooted at the current message." t nil)
-
-(autoload (quote vm-mark-or-unmark-thread-subtree) "vm-mark" nil nil nil)
-
-(autoload (quote vm-mark-messages-same-subject) "vm-mark" "Mark all messages with the same subject as the current message." t nil)
-
-(autoload (quote vm-unmark-messages-same-subject) "vm-mark" "Unmark all messages with the same subject as the current message." t nil)
-
-(autoload (quote vm-mark-or-unmark-messages-same-subject) "vm-mark" nil nil nil)
-
-(autoload (quote vm-mark-messages-same-author) "vm-mark" "Mark all messages with the same author as the current message." t nil)
-
-(autoload (quote vm-unmark-messages-same-author) "vm-mark" "Unmark all messages with the same author as the current message." t nil)
-
-(autoload (quote vm-mark-or-unmark-messages-same-author) "vm-mark" nil nil nil)
-
-(autoload (quote vm-next-command-uses-marks) "vm-mark" "Does nothing except insure that the next VM command will operate only
-on the marked messages in the current folder.  This only works for
-commands bound to key, menu or button press events.  M-x vm-command will
-not work." t nil)
-
-(autoload (quote vm-marked-messages) "vm-mark" nil nil nil)
-
-(autoload (quote vm-mark-help) "vm-mark" nil t nil)
-
-(autoload (quote vm-menu-fsfemacs-menus-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-xemacs-menus-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-fsfemacs-19-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-run-command) "vm-menu" "Run COMMAND almost interactively, with ARGS.
-call-interactive can't be used unfortunately, but this-command is
-set to the command name so that window configuration will be done." nil nil)
-
-(autoload (quote vm-menu-can-revert-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-can-recover-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-can-save-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-can-get-new-mail-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-can-undo-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-can-decode-mime-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-yank-original) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-can-send-mail-p) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-create-subject-virtual-folder) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-create-author-virtual-folder) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-xemacs-global-menubar) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-fsfemacs-global-menubar) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-initialize-vm-mode-menu-map) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-make-xemacs-menubar) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-popup-mode-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-popup-context-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-goto-event) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-popup-url-browser-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-popup-mailto-url-browser-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-popup-mime-dispose-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-popup-content-disposition-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-popup-fsfemacs-menu) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-mode-menu) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-set-menubar-dirty-flag) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-toggle-menubar) "vm-menu" nil t nil)
-
-(autoload (quote vm-menu-install-menubar) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-install-menubar-item) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-install-vm-mode-menu) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-install-mail-mode-menu) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-install-menus) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-install-known-virtual-folders-menu) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-install-visited-folders-menu) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-hm-delete-folder) "vm-menu" "Query deletes a folder." t nil)
-
-(autoload (quote vm-menu-hm-rename-folder) "vm-menu" "Rename a folder." t nil)
-
-(autoload (quote vm-menu-hm-create-dir) "vm-menu" "Create a subdir in PARENT-DIR." t nil)
-
-(autoload (quote vm-menu-hm-make-folder-menu) "vm-menu" "Makes a menu with the mail folders of the directory `vm-folder-directory'." t nil)
-
-(autoload (quote vm-menu-hm-install-menu) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-hm-tree-ls-in-temp-buffer) "vm-menu" "List the directory DIR in the TEMP-BUFFER." nil nil)
-
-(autoload (quote vm-menu-hm-tree-make-file-list-1) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-hm-tree-menu-file-truename) "vm-menu" nil nil nil)
-
-(autoload (quote vm-menu-hm-tree-make-file-list) "vm-menu" "Makes a list with the files and subdirectories of DIR.
-The list looks like: ((dirname1 file1 file2) 
-                      file3
-                      (dirname2 (dirname3 file4 file5) file6))" nil nil)
-
-(autoload (quote vm-menu-hm-tree-hide-file-p) "vm-menu" "t, if one of the regexps in RE-HIDDEN-FILE-LIST matches the FILENAME." nil nil)
-
-(autoload (quote vm-menu-hm-tree-make-menu) "vm-menu" "Returns a menu list.
-Each item of the menu list has the form 
- [\"subdir\" (FUNCTION \"dir\") SELECTABLE].
-Hidden directories (with a leading point) are suppressed, 
-if NO-HIDDEN-DIRS are non nil. Also all files which are
-matching a regexp in RE-HIDDEN-FILE-LIST are suppressed.
-If INCLUDE-CURRENT-DIR non nil, then an additional command
-for the current directory (.) is inserted." nil nil)
-
-(autoload (quote vm-location-data-of) "vm-message" nil nil t)
-
-(autoload (quote vm-start-of) "vm-message" nil nil t)
-
-(autoload (quote vm-headers-of) "vm-message" nil nil t)
-
-(autoload (quote vm-vheaders-of) "vm-message" nil nil nil)
-
-(autoload (quote vm-text-of) "vm-message" nil nil nil)
-
-(autoload (quote vm-text-end-of) "vm-message" nil nil t)
-
-(autoload (quote vm-end-of) "vm-message" nil nil t)
-
-(autoload (quote vm-softdata-of) "vm-message" nil nil t)
-
-(autoload (quote vm-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-padded-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-mark-of) "vm-message" nil nil t)
-
-(autoload (quote vm-su-start-of) "vm-message" nil nil t)
-
-(autoload (quote vm-su-end-of) "vm-message" nil nil t)
-
-(autoload (quote vm-real-message-sym-of) "vm-message" nil nil t)
-
-(autoload (quote vm-real-message-of) "vm-message" nil nil t)
-
-(autoload (quote vm-reverse-link-of) "vm-message" nil nil t)
-
-(autoload (quote vm-message-type-of) "vm-message" nil nil t)
-
-(autoload (quote vm-message-id-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-buffer-of) "vm-message" nil nil t)
-
-(autoload (quote vm-thread-indentation-of) "vm-message" nil nil t)
-
-(autoload (quote vm-thread-list-of) "vm-message" nil nil t)
-
-(autoload (quote vm-babyl-frob-flag-of) "vm-message" nil nil t)
-
-(autoload (quote vm-saved-virtual-attributes-of) "vm-message" nil nil t)
-
-(autoload (quote vm-saved-virtual-mirror-data-of) "vm-message" nil nil t)
-
-(autoload (quote vm-virtual-summary-of) "vm-message" nil nil t)
-
-(autoload (quote vm-mime-layout-of) "vm-message" nil nil t)
-
-(autoload (quote vm-mime-encoded-header-flag-of) "vm-message" nil nil t)
-
-(autoload (quote vm-attributes-of) "vm-message" nil nil t)
-
-(autoload (quote vm-new-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-unread-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-deleted-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-filed-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-replied-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-written-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-forwarded-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-edited-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-redistributed-flag) "vm-message" nil nil t)
-
-(autoload (quote vm-cache-of) "vm-message" nil nil t)
-
-(autoload (quote vm-byte-count-of) "vm-message" nil nil t)
-
-(autoload (quote vm-weekday-of) "vm-message" nil nil t)
-
-(autoload (quote vm-monthday-of) "vm-message" nil nil t)
-
-(autoload (quote vm-month-of) "vm-message" nil nil t)
-
-(autoload (quote vm-year-of) "vm-message" nil nil t)
-
-(autoload (quote vm-hour-of) "vm-message" nil nil t)
-
-(autoload (quote vm-zone-of) "vm-message" nil nil t)
-
-(autoload (quote vm-full-name-of) "vm-message" nil nil t)
-
-(autoload (quote vm-from-of) "vm-message" nil nil t)
-
-(autoload (quote vm-message-id-of) "vm-message" nil nil t)
-
-(autoload (quote vm-line-count-of) "vm-message" nil nil t)
-
-(autoload (quote vm-subject-of) "vm-message" nil nil t)
-
-(autoload (quote vm-vheaders-regexp-of) "vm-message" nil nil t)
-
-(autoload (quote vm-to-of) "vm-message" nil nil t)
-
-(autoload (quote vm-to-names-of) "vm-message" nil nil t)
-
-(autoload (quote vm-month-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-sortable-datestring-of) "vm-message" nil nil t)
-
-(autoload (quote vm-sortable-subject-of) "vm-message" nil nil t)
-
-(autoload (quote vm-summary-of) "vm-message" nil nil t)
-
-(autoload (quote vm-parent-of) "vm-message" nil nil t)
-
-(autoload (quote vm-references-of) "vm-message" nil nil t)
-
-(autoload (quote vm-mirror-data-of) "vm-message" nil nil t)
-
-(autoload (quote vm-edit-buffer-of) "vm-message" nil nil t)
-
-(autoload (quote vm-virtual-messages-of) "vm-message" nil nil t)
-
-(autoload (quote vm-modflag-of) "vm-message" nil nil t)
-
-(autoload (quote vm-labels-of) "vm-message" nil nil t)
-
-(autoload (quote vm-label-string-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-location-data-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-start-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-headers-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-vheaders-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-text-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-text-end-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-end-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-softdata-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-padded-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-mark-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-su-start-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-su-end-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-real-message-sym-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-reverse-link-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-reverse-link-sym-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-message-type-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-message-id-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-buffer-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-thread-indentation-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-thread-list-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-babyl-frob-flag-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-saved-virtual-attributes-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-saved-virtual-mirror-data-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-virtual-summary-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-mime-layout-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-mime-encoded-header-flag-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-attributes-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-edited-flag-of) "vm-message" nil nil nil)
-
-(autoload (quote vm-set-cache-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-byte-count-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-weekday-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-monthday-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-month-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-year-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-hour-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-zone-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-full-name-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-from-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-message-id-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-line-count-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-subject-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-vheaders-regexp-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-to-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-to-names-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-month-number-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-sortable-datestring-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-sortable-subject-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-summary-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-parent-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-references-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-mirror-data-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-edit-buffer-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-virtual-messages-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-virtual-messages-sym-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-modflag-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-labels-of) "vm-message" nil nil t)
-
-(autoload (quote vm-set-label-string-of) "vm-message" nil nil t)
-
-(autoload (quote vm-make-message) "vm-message" nil nil nil)
-
-(autoload (quote vm-find-and-set-text-of) "vm-message" nil nil nil)
-
-(autoload (quote vm-virtual-message-p) "vm-message" nil nil nil)
-
-(autoload (quote vm-mime-error) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-type) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-qtype) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-encoding) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-id) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-description) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-disposition) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-qdisposition) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-header-start) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-body-start) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-body-end) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-parts) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-cache) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout-display-error) "vm-mime" nil nil nil)
-
-(autoload (quote vm-set-mm-layout-type) "vm-mime" nil nil nil)
-
-(autoload (quote vm-set-mm-layout-cache) "vm-mime" nil nil nil)
-
-(autoload (quote vm-set-mm-layout-display-error) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-layout) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mm-encoded-header) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-Q-decode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-Q-encode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-B-encode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-crlf-to-lf-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-lf-to-crlf-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-charset-decode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-transfer-decode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-base64-decode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-base64-encode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-qp-decode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-qp-encode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-decode-mime-message-headers) "vm-mime" nil nil nil)
-
-(autoload (quote vm-decode-mime-encoded-words) "vm-mime" nil nil nil)
-
-(autoload (quote vm-decode-mime-encoded-words-in-string) "vm-mime" nil nil nil)
-
-(autoload (quote vm-reencode-mime-encoded-words) "vm-mime" nil nil nil)
-
-(autoload (quote vm-reencode-mime-encoded-words-in-string) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-get-header-contents) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-parse-entity) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-parse-entity-safe) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-get-xxx-parameter) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-get-parameter) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-get-disposition-parameter) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-insert-mime-body) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-insert-mime-headers) "vm-mime" nil nil nil)
-
-(autoload (quote vm-make-presentation-copy) "vm-mime" nil nil nil)
-
-(autoload (quote vm-determine-proper-charset) "vm-mime" nil nil nil)
-
-(autoload (quote vm-determine-proper-content-transfer-encoding) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-types-match) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-can-display-internal) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-can-convert) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-convert-undisplayable-layout) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-should-display-button) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-should-display-internal) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-find-external-viewer) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-delete-button-maybe) "vm-mime" nil nil nil)
-
-(autoload (quote vm-decode-mime-message) "vm-mime" "Decode the MIME objects in the current message.
-
-The first time this command is run on a message, decoding is done.
-The second time, buttons for all the objects are displayed instead.
-The third time, the raw, undecoded data is displayed.
-
-If decoding, the decoded objects might be displayed immediately, or
-buttons might be displayed that you need to activate to view the
-object.  See the documentation for the variables
-
-    vm-auto-displayed-mime-content-types
-    vm-mime-internal-content-types
-    vm-mime-external-content-types-alist
-
-to see how to control whether you see buttons or objects.
-
-If the variable vm-mime-display-function is set, then its value
-is called as a function with no arguments, and none of the
-actions mentioned in the preceding paragraphs are done.  At the
-time of the call, the current buffer will be the presentation
-buffer for the folder and a copy of the current message will be
-in the buffer.  The function is expected to make the message
-`MIME presentable' to the user in whatever manner it sees fit." t nil)
-
-(autoload (quote vm-decode-mime-layout) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-text) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-text/html) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-text/plain) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-text/enriched) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-external-generic) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-application/octet-stream) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-application) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-image) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-audio) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-video) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-message) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-multipart) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-multipart/mixed) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-multipart/alternative) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-multipart/parallel) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-multipart/digest) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-message/rfc822) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-message/rfc822) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-message/partial) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-image-xxxx) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-image/gif) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-image/jpeg) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-image/png) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-image/tiff) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-internal-audio/basic) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-button-xxxx) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-run-display-function-at-point) "vm-mime" nil t nil)
-
-(autoload (quote vm-mime-set-extent-glyph-for-type) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-insert-button) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-rewrite-failed-button) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-send-body-to-file) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-pipe-body-to-command) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-pipe-body-to-queried-command) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-pipe-body-to-queried-command-discard-output) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-send-body-to-printer) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-body-as-text) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-display-body-using-external-viewer) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-scrub-description) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-layout-description) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-layout-contains-type) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-find-digests-in-layout) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-plain-message-p) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-text-type-p) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-charset-internally-displayable-p) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-find-message/partials) "vm-mime" nil nil nil)
-
-(autoload (quote vm-message-at-point) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-make-multipart-boundary) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-attach-file) "vm-mime" "Attach a file to a VM composition buffer to be sent along with the message.
-The file is not inserted into the buffer and MIME encoded until
-you execute vm-mail-send or vm-mail-send-and-exit.  A visible tag
-indicating the existence of the attachment is placed in the
-composition buffer.  You can move the attachment around or remove
-it entirely with normal text editing commands.  If you remove the
-attachment tag, the attachment will not be sent.
-
-First argument, FILE, is the name of the file to attach.  Second
-argument, TYPE, is the MIME Content-Type of the file.  Optional
-third argument CHARSET is the character set of the attached
-document.  This argument is only used for text types, and it is
-ignored for other types.  Optional fourth argument DESCRIPTION
-should be a one line description of the file.
-
-When called interactively all arguments are read from the
-minibuffer.
-
-This command is for attaching files that do not have a MIME
-header section at the top.  For files with MIME headers, you
-should use vm-mime-attach-mime-file to attach such a file.  VM
-will extract the content type information from the headers in
-this case and not prompt you for it in the minibuffer." t nil)
-
-(autoload (quote vm-mime-attach-mime-file) "vm-mime" "Attach a MIME encoded file to a VM composition buffer to be sent
-along with the message.
-
-The file is not inserted into the buffer until you execute
-vm-mail-send or vm-mail-send-and-exit.  A visible tag indicating
-the existence of the attachment is placed in the composition
-buffer.  You can move the attachment around or remove it entirely
-with normal text editing commands.  If you remove the attachment
-tag, the attachment will not be sent.
-
-The sole argument, FILE, is the name of the file to attach.
-When called interactively the FILE argument is read from the
-minibuffer.
-
-This command is for attaching files that have a MIME
-header section at the top.  For files without MIME headers, you
-should use vm-mime-attach-file to attach such a file.  VM
-will interactively query you for the file type information." t nil)
-
-(autoload (quote vm-mime-attach-object) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-attachment-disposition-at-point) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-set-attachment-disposition-at-point) "vm-mime" nil nil nil)
-
-(autoload (quote vm-disallow-overlay-endpoint-insertion) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-fake-attachment-overlays) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-default-type-from-filename) "vm-mime" nil nil nil)
-
-(autoload (quote vm-remove-mail-mode-header-separator) "vm-mime" nil nil nil)
-
-(autoload (quote vm-add-mail-mode-header-separator) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-transfer-encode-region) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-transfer-encode-layout) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-encode-composition) "vm-mime" "MIME encode the current mail composition buffer.
-Attachment tags added to the buffer with vm-mime-attach-file are expanded
-and the approriate content-type and boundary markup information is added." t nil)
-
-(autoload (quote vm-mime-xemacs-encode-composition) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-fsfemacs-encode-composition) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-fragment-composition) "vm-mime" nil nil nil)
-
-(autoload (quote vm-mime-preview-composition) "vm-mime" "Show how the current composition buffer might be displayed
-in a MIME-aware mail reader.  VM copies and encodes the current
-mail composition buffer and displays it as a mail folder.
-Type `q' to quit this temp folder and return to composing your
-message." t nil)
-
-(autoload (quote vm-mime-composite-type-p) "vm-mime" nil nil nil)
-
-(autoload (quote vm-minibuffer-complete-word) "vm-minibuf" nil t nil)
-
-(autoload (quote vm-minibuffer-complete-word-and-exit) "vm-minibuf" nil t nil)
-
-(autoload (quote vm-minibuffer-completion-message) "vm-minibuf" "Briefly display STRING to the right of the current minibuffer input.
-Optional second arg SECONDS specifies how long to keep the message visible;
-the default is 2 seconds.
-
-A keypress causes the immediate erasure of the STRING, and return of control
-to the calling program." nil nil)
-
-(autoload (quote vm-minibuffer-replace-word) "vm-minibuf" nil nil nil)
-
-(autoload (quote vm-minibuffer-show-completions) "vm-minibuf" "Display LIST in a multi-column listing in the \" *Completions*\" buffer.
-LIST should be a list of strings." nil nil)
-
-(autoload (quote vm-show-list) "vm-minibuf" "Display LIST in a multi-column listing in the current buffer at point.
-The current buffer must be displayed in some window at the time
-this function is called.
-
-LIST should be a list of strings.
-
-Optional second argument FUNCTION will be called if the mouse is
-clicked on one of the strings in the current buffer.  The string
-clicked upon will be passed to FUNCTION as its sole argument.
-
-Optional third argument KEYMAPS specifies a lists of keymaps
-where the FUNCTION should be bound to the mouse clicks.  By
-default the local keymap of the current buffer is used." nil nil)
-
-(autoload (quote vm-minibuffer-completion-help) "vm-minibuf" nil t nil)
-
-(autoload (quote vm-keyboard-read-string) "vm-minibuf" nil nil nil)
-
-(autoload (quote vm-read-string) "vm-minibuf" nil nil nil)
-
-(autoload (quote vm-read-number) "vm-minibuf" nil nil nil)
-
-(autoload (quote vm-read-password) "vm-minibuf" "Read and return a password from the minibuffer, prompting with PROMPT.
-Optional second argument CONFIRM non-nil means that the user will be asked
-  to type the password a second time for confirmation and if there is a
-  mismatch, the process is repeated.
-
-Line editing keys are:
-  C-h, DEL	rubout
-  C-u, C-x      line kill
-  C-q, C-v      literal next" nil nil)
-
-(autoload (quote vm-keyboard-read-file-name) "vm-minibuf" "Like read-file-name, except HISTORY's value is unaltered." nil nil)
-
-(autoload (quote vm-read-file-name) "vm-minibuf" "Like read-file-name, except a mouse interface is used if a mouse
-click mouse triggered the current command." nil nil)
-
-(autoload (quote vm-delete-non-matching-strings) "vm-misc" "Delete strings matching REGEXP from LIST.
-Optional third arg non-nil means to destructively alter LIST, instead of
-working on a copy.
-
-The new version of the list, minus the deleted strings, is returned." nil nil)
-
-(autoload (quote vm-parse) "vm-misc" nil nil nil)
-
-(autoload (quote vm-parse-addresses) "vm-misc" nil nil nil)
-
-(autoload (quote vm-parse-structured-header) "vm-misc" nil nil nil)
-
-(autoload (quote vm-write-string) "vm-misc" nil nil nil)
-
-(autoload (quote vm-marker) "vm-misc" nil nil t)
-
-(autoload (quote vm-increment) "vm-misc" nil nil t)
-
-(autoload (quote vm-decrement) "vm-misc" nil nil t)
-
-(autoload (quote vm-select-folder-buffer) "vm-misc" nil nil t)
-
-(autoload (quote vm-check-for-killed-summary) "vm-misc" nil nil nil)
-
-(autoload (quote vm-check-for-killed-presentation) "vm-misc" nil nil nil)
-
-(autoload (quote vm-check-for-killed-folder) "vm-misc" nil nil nil)
-
-(autoload (quote vm-error-if-folder-read-only) "vm-misc" nil nil t)
-
-(autoload (quote vm-error-if-virtual-folder) "vm-misc" nil nil t)
-
-(autoload (quote vm-build-threads-if-unbuilt) "vm-misc" nil nil t)
-
-(autoload (quote vm-abs) "vm-misc" nil nil nil)
-
-(autoload (quote vm-save-restriction) "vm-misc" nil nil t)
-
-(autoload (quote vm-save-buffer-excursion) "vm-misc" nil nil t)
-
-(autoload (quote vm-last) "vm-misc" nil nil nil)
-
-(autoload (quote vm-vector-to-list) "vm-misc" nil nil nil)
-
-(autoload (quote vm-extend-vector) "vm-misc" nil nil nil)
-
-(autoload (quote vm-obarray-to-string-list) "vm-misc" nil nil nil)
-
-(autoload (quote vm-mapcar) "vm-misc" nil nil nil)
-
-(autoload (quote vm-mapc) "vm-misc" nil nil nil)
-
-(autoload (quote vm-delete) "vm-misc" nil nil nil)
-
-(autoload (quote vm-delete-directory-file-names) "vm-misc" nil nil nil)
-
-(autoload (quote vm-delete-backup-file-names) "vm-misc" nil nil nil)
-
-(autoload (quote vm-delete-auto-save-file-names) "vm-misc" nil nil nil)
-
-(autoload (quote vm-delete-duplicates) "vm-misc" "Delete duplicate equivalent strings from the list.
-If ALL is t, then if there is more than one occurrence of a string in the list,
- then all occurrences of it are removed instead of just the subsequent ones.
-If HACK-ADDRESSES is t, then the strings are considered to be mail addresses,
- and only the address part is compared (so that \"Name <foo>\" and \"foo\"
- would be considered to be equivalent.)" nil nil)
-
-(autoload (quote vm-member-0) "vm-misc" nil nil nil)
-
-(autoload (quote vm-delqual) "vm-misc" nil nil nil)
-
-(autoload (quote vm-copy-local-variables) "vm-misc" nil nil nil)
-
-(autoload (quote vm-error-if-folder-empty) "vm-misc" nil nil nil)
-
-(autoload (quote vm-copy) "vm-misc" nil nil nil)
-
-(autoload (quote vm-multiple-frames-possible-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-mouse-support-possible-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-mouse-support-possible-here-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-menu-support-possible-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-toolbar-support-possible-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-multiple-fonts-possible-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-run-message-hook) "vm-misc" nil nil nil)
-
-(autoload (quote vm-error-free-call) "vm-misc" nil nil nil)
-
-(autoload (quote vm-trace) "vm-misc" nil nil nil)
-
-(autoload (quote vm-timezone-make-date-sortable) "vm-misc" nil nil nil)
-
-(autoload (quote vm-current-time-zone) "vm-misc" nil nil nil)
-
-(autoload (quote vm-should-generate-summary) "vm-misc" nil nil nil)
-
-(autoload (quote vm-find-composition-buffer) "vm-misc" nil nil nil)
-
-(autoload (quote vm-get-file-buffer) "vm-misc" "Like get-file-buffer, but also checks buffers against FILE's truename" nil nil)
-
-(autoload (quote vm-set-region-face) "vm-misc" nil nil nil)
-
-(autoload (quote vm-default-buffer-substring-no-properties) "vm-misc" nil nil nil)
-
-(autoload (quote vm-buffer-string-no-properties) "vm-misc" nil nil nil)
-
-(autoload (quote vm-insert-region-from-buffer) "vm-misc" nil nil nil)
-
-(autoload (quote vm-copy-extent) "vm-misc" nil nil nil)
-
-(autoload (quote vm-make-tempfile-name) "vm-misc" nil nil nil)
-
-(autoload (quote vm-insert-char) "vm-misc" nil nil nil)
-
-(autoload (quote vm-xemacs-compatible-insert-char) "vm-misc" nil nil nil)
-
-(autoload (quote vm-symbol-lists-intersect-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-set-buffer-variable) "vm-misc" nil nil nil)
-
-(autoload (quote vm-buffer-variable-value) "vm-misc" nil nil nil)
-
-(autoload (quote vm-with-virtual-selector-variables) "vm-misc" nil nil t)
-
-(autoload (quote vm-string-assoc) "vm-misc" nil nil nil)
-
-(autoload (quote vm-string-member) "vm-misc" nil nil nil)
-
-(autoload (quote vm-assert) "vm-misc" nil nil t)
-
-(autoload (quote vm-mouse-fsfemacs-mouse-p) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-xemacs-mouse-p) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-set-mouse-track-highlight) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-button-2) "vm-mouse" nil t nil)
-
-(autoload (quote vm-mouse-button-3) "vm-mouse" nil t nil)
-
-(autoload (quote vm-mouse-3-help) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-get-mouse-track-string) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-popup-or-select) "vm-mouse" nil t nil)
-
-(autoload (quote vm-mouse-send-url-at-event) "vm-mouse" nil t nil)
-
-(autoload (quote vm-mouse-send-url-at-position) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-send-url) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-send-url-to-netscape) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-send-url-to-netscape-new-window) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-send-url-to-mosaic) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-send-url-to-mosaic-new-window) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-install-mouse) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-run-background-command) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-run-command) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-run-command-on-region) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-read-file-name) "vm-mouse" "Like read-file-name, except uses a mouse driven interface.
-HISTORY argument is ignored." nil nil)
-
-(autoload (quote vm-mouse-read-file-name-event-handler) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-read-file-name-quit-handler) "vm-mouse" nil t nil)
-
-(autoload (quote vm-mouse-read-string) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-read-string-event-handler) "vm-mouse" nil nil nil)
-
-(autoload (quote vm-mouse-read-string-quit-handler) "vm-mouse" nil t nil)
-
-(autoload (quote vm-record-and-change-message-pointer) "vm-motion" nil nil nil)
-
-(autoload (quote vm-goto-message) "vm-motion" "Go to the message numbered N.
-Interactively N is the prefix argument.  If no prefix arg is provided
-N is prompted for in the minibuffer.
-
-If vm-follow-summary-cursor is non-nil this command will go to
-the message under the cursor in the summary buffer if the summary
-window is selected.  This only happens if no prefix argument is
-given." t nil)
-
-(autoload (quote vm-goto-message-last-seen) "vm-motion" "Go to the message last previewed." t nil)
-
-(autoload (quote vm-goto-parent-message) "vm-motion" "Go to the parent of the current message." t nil)
-
-(autoload (quote vm-check-count) "vm-motion" nil nil nil)
-
-(autoload (quote vm-move-message-pointer) "vm-motion" nil nil nil)
-
-(autoload (quote vm-should-skip-message) "vm-motion" nil nil nil)
-
-(autoload (quote vm-next-message) "vm-motion" "Go forward one message and preview it.
-With prefix arg (optional first argument) COUNT, go forward COUNT
-messages.  A negative COUNT means go backward.  If the absolute
-value of COUNT is greater than 1, then the values of the variables
-vm-skip-deleted-messages and vm-skip-read-messages are ignored.
-
-When invoked on marked messages (via vm-next-command-uses-marks)
-this command 'sees' marked messages as it moves." t nil)
-
-(autoload (quote vm-previous-message) "vm-motion" "Go back one message and preview it.
-With prefix arg COUNT, go backward COUNT messages.  A negative COUNT
-means go forward.  If the absolute value of COUNT > 1 the values of the
-variables vm-skip-deleted-messages and vm-skip-read-messages are
-ignored." t nil)
-
-(autoload (quote vm-next-message-no-skip) "vm-motion" "Like vm-next-message but will not skip deleted or read messages." t nil)
-
-(autoload (quote vm-previous-message-no-skip) "vm-motion" "Like vm-previous-message but will not skip deleted or read messages." t nil)
-
-(autoload (quote vm-next-unread-message) "vm-motion" "Move forward to the nearest new or unread message, if there is one." t nil)
-
-(autoload (quote vm-previous-unread-message) "vm-motion" "Move backward to the nearest new or unread message, if there is one." t nil)
-
-(autoload (quote vm-next-message-same-subject) "vm-motion" "Move forward to the nearest message with the same subject.
-vm-subject-ignored-prefix and vm-subject-ignored-suffix will apply
-to the subject comparisons." t nil)
-
-(autoload (quote vm-previous-message-same-subject) "vm-motion" "Move backward to the nearest message with the same subject.
-vm-subject-ignored-prefix and vm-subject-ignored-suffix will apply
-to the subject comparisons." t nil)
-
-(autoload (quote vm-find-first-unread-message) "vm-motion" nil nil nil)
-
-(autoload (quote vm-thoughtfully-select-message) "vm-motion" nil nil nil)
-
-(autoload (quote vm-follow-summary-cursor) "vm-motion" nil nil nil)
-
-(autoload (quote vm-scroll-forward) "vm-page" "Scroll forward a screenful of text.
-If the current message is being previewed, the message body is revealed.
-If at the end of the current message, moves to the next message iff the
-value of vm-auto-next-message is non-nil.
-Prefix argument N means scroll forward N lines." t nil)
-
-(autoload (quote vm-scroll-forward-internal) "vm-page" nil nil nil)
-
-(autoload (quote vm-howl-if-eom) "vm-page" nil nil nil)
-
-(autoload (quote vm-emit-eom-blurb) "vm-page" nil nil nil)
-
-(autoload (quote vm-scroll-backward) "vm-page" "Scroll backward a screenful of text.
-Prefix N scrolls backward N lines." t nil)
-
-(autoload (quote vm-highlight-headers) "vm-page" nil nil nil)
-
-(autoload (quote vm-energize-urls) "vm-page" nil nil nil)
-
-(autoload (quote vm-energize-headers) "vm-page" nil nil nil)
-
-(autoload (quote vm-display-xface) "vm-page" nil nil nil)
-
-(autoload (quote vm-url-help) "vm-page" nil nil nil)
-
-(autoload (quote vm-energize-urls-in-message-region) "vm-page" nil nil nil)
-
-(autoload (quote vm-highlight-headers-maybe) "vm-page" nil nil nil)
-
-(autoload (quote vm-energize-headers-and-xfaces) "vm-page" nil nil nil)
-
-(autoload (quote vm-narrow-for-preview) "vm-page" nil nil nil)
-
-(autoload (quote vm-preview-current-message) "vm-page" nil nil nil)
-
-(autoload (quote vm-show-current-message) "vm-page" nil nil nil)
-
-(autoload (quote vm-expose-hidden-headers) "vm-page" "Toggle exposing and hiding message headers that are normally not visible." t nil)
-
-(autoload (quote vm-widen-page) "vm-page" nil nil nil)
-
-(autoload (quote vm-narrow-to-page) "vm-page" nil nil nil)
-
-(autoload (quote vm-beginning-of-message) "vm-page" "Moves to the beginning of the current message." t nil)
-
-(autoload (quote vm-end-of-message) "vm-page" "Moves to the end of the current message, exposing and flagging it read
-as necessary." t nil)
-
-(autoload (quote vm-pop-move-mail) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-check-mail) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-make-session) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-end-session) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-timer) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-x-box) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-x-currmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-x-maxmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-x-got) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-x-need) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-y-box) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-y-currmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-y-maxmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-y-got) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stat-y-need) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-timer) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-x-box) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-x-currmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-x-maxmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-x-got) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-x-need) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-y-box) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-y-currmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-y-maxmsg) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-y-got) "vm-pop" nil nil nil)
-
-(autoload (quote vm-set-pop-stat-y-need) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-start-status-timer) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-stop-status-timer) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-report-retrieval-status) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-send-command) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-read-response) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-read-past-dot-sentinel-line) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-read-stat-response) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-read-list-response) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-ask-about-large-message) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-retrieve-to-crashbox) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-cleanup-region) "vm-pop" nil nil nil)
-
-(autoload (quote vm-pop-md5) "vm-pop" nil nil nil)
-
-(autoload (quote vm-do-reply) "vm-reply" nil nil nil)
-
-(autoload (quote vm-strip-ignored-addresses) "vm-reply" nil nil nil)
-
-(autoload (quote vm-ignored-reply-to) "vm-reply" nil nil nil)
-
-(autoload (quote vm-mail-yank-default) "vm-reply" nil nil nil)
-
-(autoload (quote vm-yank-message-other-folder) "vm-reply" "Like vm-yank-message except the message is yanked from a folder other
-than the one that spawned the current Mail mode buffer.  The name of the
-folder is read from the minibuffer.
-
-Don't call this function from a program." t nil)
-
-(autoload (quote vm-yank-message) "vm-reply" "Yank message number N into the current buffer at point.
-When called interactively N is always read from the minibuffer.  When
-called non-interactively the first argument is expected to be a
-message struct.
-
-This command is meant to be used in VM created Mail mode buffers; the
-yanked message comes from the mail buffer containing the message you
-are replying to, forwarding, or invoked VM's mail command from.
-
-All message headers are yanked along with the text.  Point is
-left before the inserted text, the mark after.  Any hook
-functions bound to mail-citation-hook are run, after inserting
-the text and setting point and mark.  For backward compatibility,
-if mail-citation-hook is set to nil, `mail-yank-hooks' is run
-instead.
-
-If mail-citation-hook and mail-yank-hooks are both nil, this
-default action is taken: the yanked headers are trimmed as
-specified by vm-included-text-headers and
-vm-included-text-discard-header-regexp, and the value of
-vm-included-text-prefix is prepended to every yanked line." t nil)
-
-(autoload (quote vm-mail-send-and-exit) "vm-reply" "Just like mail-send-and-exit except that VM flags the appropriate message(s)
-as having been replied to, if appropriate." t nil)
-
-(autoload (quote vm-keep-mail-buffer) "vm-reply" nil nil nil)
-
-(autoload (quote vm-help-tale) "vm-reply" nil nil nil)
-
-(autoload (quote vm-mail-send) "vm-reply" "Just like mail-send except that VM flags the appropriate message(s)
-as replied to, forwarded, etc, if appropriate." t nil)
-
-(autoload (quote vm-mail-mode-get-header-contents) "vm-reply" nil nil nil)
-
-(autoload (quote vm-rename-current-mail-buffer) "vm-reply" nil nil nil)
-
-(autoload (quote vm-mail-mark-replied) "vm-reply" nil nil nil)
-
-(autoload (quote vm-mail-mark-forwarded) "vm-reply" nil nil nil)
-
-(autoload (quote vm-mail-mark-redistributed) "vm-reply" nil nil nil)
-
-(autoload (quote vm-reply) "vm-reply" "Reply to the sender of the current message.
-Numeric prefix argument N means to reply to the current message plus the
-next N-1 messages.  A negative N means reply to the current message and
-the previous N-1 messages. 
-
-If invoked on marked messages (via vm-next-command-uses-marks),
-all marked messages will be replied to.
-
-You will be placed into a standard Emacs Mail mode buffer to compose and
-send your message.  See the documentation for the function `mail' for
-more info.
-
-Note that the normal binding of C-c C-y in the reply buffer is
-automatically changed to vm-yank-message during a reply.  This
-allows you to yank any message from the current folder into a
-reply.
-
-Normal VM commands may be accessed in the reply buffer by prefixing them
-with C-c C-v." t nil)
-
-(autoload (quote vm-reply-include-text) "vm-reply" "Reply to the sender (only) of the current message and include text
-from the message.  See the documentation for function vm-reply for details." t nil)
-
-(autoload (quote vm-followup) "vm-reply" "Reply to all recipients of the current message.
-See the documentation for the function vm-reply for details." t nil)
-
-(autoload (quote vm-followup-include-text) "vm-reply" "Reply to all recipients of the current message and include text from
-the message.  See the documentation for the function vm-reply for details." t nil)
-
-(autoload (quote vm-forward-message-all-headers) "vm-reply" "Like vm-forward-message but always forwards all the headers." t nil)
-
-(autoload (quote vm-forward-message) "vm-reply" "Forward the current message to one or more recipients.
-You will be placed in a Mail mode buffer as you would with a
-reply, but you must fill in the To: header and perhaps the
-Subject: header manually." t nil)
-
-(autoload (quote vm-resend-bounced-message) "vm-reply" "Extract the original text from a bounced message and resend it.
-You will be placed in a Mail mode buffer with the extracted message and
-you can change the recipient address before resending the message." t nil)
-
-(autoload (quote vm-resend-message) "vm-reply" "Resend the current message to someone else.
-The current message will be copied to a Mail mode buffer and you
-can edit the message and send it as usual.
-
-NOTE: since you are doing a resend, a Resent-To header is provided
-for you to fill in the new recipient list.  If you don't fill in
-this header, what happens when you send the message is undefined.
-You may also create a Resent-Cc header." t nil)
-
-(autoload (quote vm-send-digest) "vm-reply" "Send a digest of all messages in the current folder to recipients.
-The type of the digest is specified by the variable vm-digest-send-type.
-You will be placed in a Mail mode buffer as is usual with replies, but you
-must fill in the To: and Subject: headers manually.
-
-Prefix arg means to insert a list of preamble lines at the beginning of
-the digest.  One line is generated for each message being digestified.
-The variable vm-digest-preamble-format determines the format of the
-preamble lines.
-
-If invoked on marked messages (via vm-next-command-uses-marks),
-only marked messages will be put into the digest." t nil)
-
-(autoload (quote vm-send-rfc934-digest) "vm-reply" "Like vm-send-digest but always sends an RFC 934 digest." t nil)
-
-(autoload (quote vm-send-rfc1153-digest) "vm-reply" "Like vm-send-digest but always sends an RFC 1153 digest." t nil)
-
-(autoload (quote vm-send-mime-digest) "vm-reply" "Like vm-send-digest but always sends an MIME (multipart/digest) digest." t nil)
-
-(autoload (quote vm-continue-composing-message) "vm-reply" "Find and select the most recently used mail composition buffer.
-If the selected buffer is already a Mail mode buffer then it is
-buried before beginning the search.  Non Mail mode buffers and
-unmodified Mail buffers are skipped.  Prefix arg means unmodified
-Mail mode buffers are not skipped.  If no suitable buffer is
-found, the current buffer remains selected." t nil)
-
-(autoload (quote vm-mail-to-mailto-url) "vm-reply" nil nil nil)
-
-(autoload (quote vm-mail-internal) "vm-reply" nil nil nil)
-
-(autoload (quote vm-reply-other-frame) "vm-reply" "Like vm-reply, but run in a newly created frame." t nil)
-
-(autoload (quote vm-reply-include-text-other-frame) "vm-reply" "Like vm-reply-include-text, but run in a newly created frame." t nil)
-
-(autoload (quote vm-followup-other-frame) "vm-reply" "Like vm-followup, but run in a newly created frame." t nil)
-
-(autoload (quote vm-followup-include-text-other-frame) "vm-reply" "Like vm-followup-include-text, but run in a newly created frame." t nil)
-
-(autoload (quote vm-forward-message-all-headers-other-frame) "vm-reply" "Like vm-forward-message-all-headers, but run in a newly created frame." t nil)
-
-(autoload (quote vm-forward-message-other-frame) "vm-reply" "Like vm-forward-message, but run in a newly created frame." t nil)
-
-(autoload (quote vm-resend-message-other-frame) "vm-reply" "Like vm-resend-message, but run in a newly created frame." t nil)
-
-(autoload (quote vm-resend-bounced-message-other-frame) "vm-reply" "Like vm-resend-bounced-message, but run in a newly created frame." t nil)
-
-(autoload (quote vm-send-digest-other-frame) "vm-reply" "Like vm-send-digest, but run in a newly created frame." t nil)
-
-(autoload (quote vm-send-rfc934-digest-other-frame) "vm-reply" "Like vm-send-rfc934-digest, but run in a newly created frame." t nil)
-
-(autoload (quote vm-send-rfc1153-digest-other-frame) "vm-reply" "Like vm-send-rfc1153-digest, but run in a newly created frame." t nil)
-
-(autoload (quote vm-send-mime-digest-other-frame) "vm-reply" "Like vm-send-mime-digest, but run in a newly created frame." t nil)
-
-(autoload (quote vm-match-data) "vm-save" nil nil nil)
-
-(autoload (quote vm-auto-select-folder) "vm-save" nil nil nil)
-
-(autoload (quote vm-auto-archive-messages) "vm-save" "Save all unfiled messages that auto-match a folder via
-vm-auto-folder-alist to their appropriate folders.  Messages that
-are flagged for deletion are not saved.
-
-Prefix arg means to ask user for confirmation before saving each message.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-only marked messages are checked against vm-auto-folder-alist.
-
-The saved messages are flagged as `filed'." t nil)
-
-(autoload (quote vm-save-message) "vm-save" "Save the current message to a mail folder.
-If the folder already exists, the message will be appended to it.
-
-Prefix arg COUNT means save this message and the next COUNT-1
-messages.  A negative COUNT means save this message and the
-previous COUNT-1 messages.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-all marked messages in the current folder are saved; other messages are
-ignored.
-
-The saved messages are flagged as `filed'." t nil)
-
-(autoload (quote vm-save-message-sans-headers) "vm-save" "Save the current message to a file, without its header section.
-If the file already exists, the message will be appended to it.
-Prefix arg COUNT means save the next COUNT messages.  A negative COUNT means
-save the previous COUNT.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-all marked messages in the current folder are saved; other messages are
-ignored.
-
-The saved messages are flagged as `written'.
-
-This command should NOT be used to save message to mail folders; use
-vm-save-message instead (normally bound to `s')." t nil)
-
-(autoload (quote vm-pipe-message-to-command) "vm-save" "Runs a shell command with some or all of the contents of the
-current message as input.
-By default, the entire message is used.
-With one \\[universal-argument] the text portion of the message is used.
-With two \\[universal-argument]'s the header portion of the message is used.
-With three \\[universal-argument]'s the visible header portion of the message
-  plus the text portion is used.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-each marked message is successively piped to the shell command,
-one message per command invocation.
-
-Output, if any, is displayed.  The message is not altered." t nil)
-
-(autoload (quote vm-print-message) "vm-save" "Print the current message
-Prefix arg N means print the current message and the next N - 1 messages.
-Prefix arg -N means print the current message and the previous N - 1 messages.
-
-The variable `vm-print-command' controls what command is run to
-print the message, and `vm-print-command-switches' is a list of switches
-to pass to the command.
-
-When invoked on marked messages (via vm-next-command-uses-marks),
-each marked message is printed, one message per vm-print-command invocation.
-
-Output, if any, is displayed.  The message is not altered." t nil)
-
-(autoload (quote vm-isearch-forward) "vm-search" "Incrementally search forward through the current folder's messages.
-Usage is identical to the standard Emacs incremental search.
-When the search terminates the message containing point will be selected.
-
-If the variable vm-search-using-regexps is non-nil, regular expressions
-are understood; nil means the search will be for the input string taken
-literally.  Specifying a prefix ARG interactively toggles the value of
-vm-search-using-regexps for this search." t nil)
-
-(autoload (quote vm-isearch-backward) "vm-search" "Incrementally search backward through the current folder's messages.
-Usage is identical to the standard Emacs incremental search.
-When the search terminates the message containing point will be selected.
-
-If the variable vm-search-using-regexps is non-nil, regular expressions
-are understood; nil means the search will be for the input string taken
-literally.  Specifying a prefix ARG interactively toggles the value of
-vm-search-using-regexps for this search." t nil)
-
-(autoload (quote vm-isearch) "vm-search" nil nil nil)
-
-(autoload (quote vm-isearch-widen) "vm-search" nil nil nil)
-
-(autoload (quote vm-isearch-narrow) "vm-search" nil nil nil)
-
-(autoload (quote vm-isearch-update) "vm-search" nil nil nil)
-
-(autoload (quote vm-move-message-forward) "vm-sort" "Move a message forward in a VM folder.
-Prefix arg COUNT causes the current message to be moved COUNT messages forward.
-A negative COUNT causes movement to be backward instead of forward.
-COUNT defaults to 1.  The current message remains selected after being
-moved.
-
-If vm-move-messages-physically is non-nil, the physical copy of
-the message in the folder is moved.  A nil value means just
-change the presentation order and leave the physical order of
-the folder undisturbed." t nil)
-
-(autoload (quote vm-move-message-backward) "vm-sort" "Move a message backward in a VM folder.
-Prefix arg COUNT causes the current message to be moved COUNT
-messages backward.  A negative COUNT causes movement to be
-forward instead of backward.  COUNT defaults to 1.  The current
-message remains selected after being moved.
-
-If vm-move-messages-physically is non-nil, the physical copy of
-the message in the folder is moved.  A nil value means just
-change the presentation order and leave the physical order of
-the folder undisturbed." t nil)
-
-(autoload (quote vm-move-message-forward-physically) "vm-sort" "Like vm-move-message-forward but always move the message physically." t nil)
-
-(autoload (quote vm-move-message-backward-physically) "vm-sort" "Like vm-move-message-backward but always move the message physically." t nil)
-
-(autoload (quote vm-physically-move-message) "vm-sort" nil nil nil)
-
-(autoload (quote vm-so-sortable-datestring) "vm-sort" nil nil nil)
-
-(autoload (quote vm-so-sortable-subject) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-messages) "vm-sort" "Sort message in a folder by the specified KEYS.
-You may sort by more than one particular message key.  If
-messages compare equal by the first key, the second key will be
-compared and so on.  When called interactively the keys will be
-read from the minibuffer.  Valid keys are
-
-\"date\"		\"reversed-date\"
-\"author\"		\"reversed-author\"
-\"subject\"		\"reversed-subject\"
-\"recipients\"		\"reversed-recipients\"
-\"line-count\"		\"reversed-line-count\"
-\"byte-count\"		\"reversed-byte-count\"
-\"physical-order\"	\"reversed-physical-order\"
-
-Optional second arg (prefix arg interactively) means the sort
-should change the physical order of the messages in the folder.
-Normally VM changes presentation order only, leaving the
-folder in the order in which the messages arrived." t nil)
-
-(autoload (quote vm-sort-compare-xxxxxx) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-thread) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-author) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-author-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-date) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-date-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-recipients) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-recipients-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-subject) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-subject-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-line-count) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-line-count-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-byte-count) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-byte-count-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-physical-order) "vm-sort" nil nil nil)
-
-(autoload (quote vm-sort-compare-physical-order-r) "vm-sort" nil nil nil)
-
-(autoload (quote vm) "vm-startup" "Read mail under Emacs.
-Optional first arg FOLDER specifies the folder to visit.  It defaults
-to the value of vm-primary-inbox.  The folder buffer is put into VM
-mode, a major mode for reading mail.
-
-Prefix arg or optional second arg READ-ONLY non-nil indicates
-that the folder should be considered read only.  No attribute
-changes, message additions or deletions will be allowed in the
-visited folder.
-
-Visiting the primary inbox causes any contents of the system mailbox to
-be moved and appended to the resulting buffer.
-
-All the messages can be read by repeatedly pressing SPC.  Use `n'ext and
-`p'revious to move about in the folder.  Messages are marked for
-deletion with `d', and saved to another folder with `s'.  Quitting VM
-with `q' expunges deleted messages and saves the buffered folder to
-disk.
-
-See the documentation for vm-mode for more information." t nil)
-
-(autoload (quote vm-other-frame) "vm-startup" "Like vm, but run in a newly created frame." t nil)
-
-(autoload (quote vm-other-window) "vm-startup" "Like vm, but run in a different window." t nil)
-
-(autoload (quote vm-mode) "vm-startup" "Major mode for reading mail.
-
-This is VM 6.33.
-
-Commands:
-   h - summarize folder contents
- C-t - toggle threads display
-
-   n - go to next message
-   p - go to previous message
-   N - like `n' but ignores skip-variable settings
-   P - like `p' but ignores skip-variable settings
- M-n - go to next unread message
- M-p - go to previous unread message
- RET - go to numbered message (uses prefix arg or prompts in minibuffer)
- TAB - go to last message seen
-   ^ - go to parent of this message
- M-s - incremental search through the folder
-
-   t - display hidden headers
- SPC - expose message body or scroll forward a page
-   b - scroll backward a page
-   < - go to beginning of current message
-   > - go to end of current message
-
-   d - delete message, prefix arg deletes messages forward
- C-d - delete message, prefix arg deletes messages backward
-   u - undelete
-   k - flag for deletion all messages with same subject as the current message
-
-   r - reply (only to the sender of the message)
-   R - reply with included text from the current message
- M-r - extract and resend bounced message
-   f - followup (reply to all recipients of message)
-   F - followup with included text from the current message
-   z - forward the current message
-   m - send a message
-   B - resend the current message to another user.
-   c - continue composing the most recent message you were composing
-
-   @ - digestify and mail entire folder contents (the folder is not modified)
-   * - burst a digest into individual messages, and append and assimilate these
-       messages into the current folder.
-
-   G - sort messages by various keys
-
-   g - get any new mail that has arrived in the system mailbox
-       (new mail is appended to the disk and buffer copies of the
-       primary inbox.)
-   v - visit another mail folder
-
-   e - edit the current message
-   j - discard cached information about the current message
-
-   s - save current message in a folder (appends if folder already exists)
-   w - write current message to a file without its headers (appends if exists)
-   S - save entire folder to disk, does not expunge
-   A - save unfiled messages to their vm-auto-folder-alist specified folders
-   # - expunge deleted messages (without saving folder)
-   q - quit VM, deleted messages are not expunged, folder is
-       saved to disk if it is modified.  new messages are changed
-       to be flagged as just unread.
-   x - exit VM with no change to the folder
-
- M N - use marks; the next vm command will affect only marked messages
-       if it makes sense for the command to do so.  These commands
-       apply and remove marks to messages.
-
-       M M - mark the current message
-       M U - unmark the current message
-       M m - mark all messages
-       M u - unmark all messages
-       M C - mark messages matched by a virtual folder selector
-       M c - unmark messages matched by a virtual folder selector
-       M T - mark thread tree rooted at the current message
-       M t - unmark thread tree rooted at the current message
-       M S - mark messages with the same subject as the current message
-       M s - unmark messages with the same subject as the current message
-       M A - mark messages with the same author as the current message
-       M a - unmark messages with the same author as the current message
-       M R - mark messages within the point/mark region in the summary
-       M r - unmark messages within the point/mark region in the summary
-
-       M ? - partial help for mark commands
-
- W S - save the current window configuration to a name
- W D - delete a window configuration
- W W - apply a configuration
- W ? - help for the window configuration commands
-
- V V - visit a virtual folder (must be defined in vm-virtual-folder-alist)
- V C - create a virtual folder composed of a subset of the
-       current folder's messages.
- V A - apply the selectors of a named virtual folder to the
-       messages in the current folder and create a virtual folder
-       containing the selected messages.
- V M - toggle whether this virtual folder's messages mirror the
-       underlying real messages' attributes.
- V ? - help for virtual folder commands
-
- C-_ - undo, special undo that retracts the most recent
-             changes in message attributes and labels.  Expunges,
-             message edits, and saves cannot be undone.  C-x u is
-             also bound to this command.
-
-   a - set message attributes
-
- l a - add labels to message
- l d - delete labels from message
-
-   L - reload your VM init file, ~/.vm
-
-   % - change a folder to another type
-
-   ? - help
-
-   ! - run a shell command
-   | - run a shell command with the current message as input
-
- M-C - view conditions under which you may redistribute VM
- M-W - view the details of VM's lack of a warranty
-
-Use M-x vm-submit-bug-report to submit a bug report.
-
-Variables:
-   vm-arrived-message-hook
-   vm-arrived-messages-hook
-   vm-auto-center-summary
-   vm-auto-decode-mime-messages
-   vm-auto-displayed-mime-content-types
-   vm-auto-folder-alist
-   vm-auto-folder-case-fold-search
-   vm-auto-get-new-mail
-   vm-auto-next-message
-   vm-berkeley-mail-compatibility
-   vm-burst-digest-messages-inherit-labels
-   vm-check-folder-types
-   vm-circular-folders
-   vm-confirm-new-folders
-   vm-confirm-quit
-   vm-convert-folder-types
-   vm-crash-box
-   vm-crash-box-suffix
-   vm-default-folder-type
-   vm-delete-after-archiving
-   vm-delete-after-bursting
-   vm-delete-after-saving
-   vm-delete-empty-folders
-   vm-digest-burst-type
-   vm-digest-center-preamble
-   vm-digest-preamble-format
-   vm-digest-send-type
-   vm-display-buffer-hook
-   vm-display-using-mime
-   vm-edit-message-hook
-   vm-folder-directory
-   vm-folder-read-only
-   vm-follow-summary-cursor
-   vm-forward-message-hook
-   vm-forwarded-headers
-   vm-forwarding-digest-type
-   vm-forwarding-subject-format
-   vm-frame-parameter-alist
-   vm-frame-per-completion
-   vm-frame-per-composition
-   vm-frame-per-edit
-   vm-frame-per-folder
-   vm-frame-per-help
-   vm-frame-per-summary
-   vm-highlighted-header-face
-   vm-highlighted-header-regexp
-   vm-honor-page-delimiters
-   vm-image-directory
-   vm-in-reply-to-format
-   vm-included-text-attribution-format
-   vm-included-text-discard-header-regexp
-   vm-included-text-headers
-   vm-included-text-prefix
-   vm-invisible-header-regexp
-   vm-jump-to-new-messages
-   vm-jump-to-unread-messages
-   vm-keep-crash-boxes
-   vm-keep-sent-messages
-   vm-mail-check-interval
-   vm-mail-header-from
-   vm-mail-mode-hook
-   vm-make-crash-box-name
-   vm-make-spool-file-name
-   vm-mime-8bit-composition-charset
-   vm-mime-8bit-text-transfer-encoding
-   vm-mime-alternative-select-method
-   vm-mime-attachment-auto-type-alist
-   vm-mime-attachment-save-directory
-   vm-mime-avoid-folding-content-type
-   vm-mime-base64-decoder-program
-   vm-mime-base64-decoder-switches
-   vm-mime-base64-encoder-program
-   vm-mime-base64-encoder-switches
-   vm-mime-button-face
-   vm-mime-charset-font-alist
-   vm-mime-default-face-charsets
-   vm-mime-digest-discard-header-regexp
-   vm-mime-digest-headers
-   vm-mime-display-function
-   vm-mime-external-content-types-alist
-   vm-mime-ignore-mime-version
-   vm-mime-internal-content-types
-   vm-mime-max-message-size
-   vm-mode-hook
-   vm-mosaic-program
-   vm-mosaic-program-switches
-   vm-move-after-deleting
-   vm-move-after-killing
-   vm-move-after-undeleting
-   vm-move-messages-physically
-   vm-mutable-frames
-   vm-mutable-windows
-   vm-netscape-program
-   vm-netscape-program-switches
-   vm-pop-bytes-per-session
-   vm-pop-max-message-size
-   vm-pop-md5-program
-   vm-pop-messages-per-session
-   vm-popup-menu-on-mouse-3
-   vm-preferences-file
-   vm-preview-lines
-   vm-preview-read-messages
-   vm-primary-inbox
-   vm-quit-hook
-   vm-recognize-pop-maildrops
-   vm-reply-hook
-   vm-reply-ignored-addresses
-   vm-reply-ignored-reply-tos
-   vm-reply-subject-prefix
-   vm-resend-bounced-discard-header-regexp
-   vm-resend-bounced-headers
-   vm-resend-bounced-message-hook
-   vm-resend-discard-header-regexp
-   vm-resend-headers
-   vm-resend-message-hook
-   vm-retrieved-spooled-mail-hook
-   vm-rfc1153-digest-discard-header-regexp
-   vm-rfc1153-digest-headers
-   vm-rfc934-digest-discard-header-regexp
-   vm-rfc934-digest-headers
-   vm-search-using-regexps
-   vm-select-message-hook
-   vm-select-new-message-hook
-   vm-select-unread-message-hook
-   vm-send-digest-hook
-   vm-send-using-mime
-   vm-skip-deleted-messages
-   vm-skip-read-messages
-   vm-spool-file-suffixes
-   vm-spool-files
-   vm-startup-with-summary
-   vm-strip-reply-headers
-   vm-summary-arrow
-   vm-summary-format
-   vm-summary-highlight-face
-   vm-summary-mode-hook
-   vm-summary-redo-hook
-   vm-summary-show-threads
-   vm-summary-thread-indent-level
-   vm-tale-is-an-idiot
-   vm-temp-file-directory
-   vm-toolbar-pixmap-directory
-   vm-trust-From_-with-Content-Length
-   vm-undisplay-buffer-hook
-   vm-unforwarded-header-regexp
-   vm-url-browser
-   vm-url-search-limit
-   vm-use-menus
-   vm-use-toolbar
-   vm-virtual-folder-alist
-   vm-virtual-mirror
-   vm-visible-headers
-   vm-visit-folder-hook
-   vm-visit-when-saving
-   vm-warp-mouse-to-new-frame
-   vm-window-configuration-file
-" t nil)
-
-(autoload (quote vm-visit-folder) "vm-startup" "Visit a mail file.
-VM will parse and present its messages to you in the usual way.
-
-First arg FOLDER specifies the mail file to visit.  When this
-command is called interactively the file name is read from the
-minibuffer.
-
-Prefix arg or optional second arg READ-ONLY non-nil indicates
-that the folder should be considered read only.  No attribute
-changes, messages additions or deletions will be allowed in the
-visited folder." t nil)
-
-(autoload (quote vm-visit-folder-other-frame) "vm-startup" "Like vm-visit-folder, but run in a newly created frame." t nil)
-
-(autoload (quote vm-visit-folder-other-window) "vm-startup" "Like vm-visit-folder, but run in a different window." t nil)
-
-(autoload (quote vm-virtual-mode) "vm-startup" "Mode for reading multiple mail folders as one folder.
-
-The commands available are the same commands that are found in
-vm-mode, except that a few of them are not applicable to virtual
-folders.
-
-vm-virtual-mode is not a normal major mode.  If you run it, it
-will not do anything.  The entry point to vm-virtual-mode is
-vm-visit-virtual-folder." nil nil)
-
-(autoload (quote vm-visit-virtual-folder) "vm-startup" nil t nil)
-
-(autoload (quote vm-visit-virtual-folder-other-frame) "vm-startup" "Like vm-visit-virtual-folder, but run in a newly created frame." t nil)
-
-(autoload (quote vm-visit-virtual-folder-other-window) "vm-startup" "Like vm-visit-virtual-folder, but run in a different window." t nil)
-
-(autoload (quote vm-mail) "vm-startup" "Send a mail message from within VM, or from without.
-Optional argument TO is a string that should contain a comma separated
-recipient list." t nil)
-
-(autoload (quote vm-mail-other-frame) "vm-startup" "Like vm-mail, but run in a newly created frame.
-Optional argument TO is a string that should contain a comma separated
-recipient list." t nil)
-
-(autoload (quote vm-mail-other-window) "vm-startup" "Like vm-mail, but run in a different window.
-Optional argument TO is a string that should contain a comma separated
-recipient list." t nil)
-
-(autoload (quote vm-submit-bug-report) "vm-startup" "Submit a bug report, with pertinent information to the VM bug list." t nil)
-
-(autoload (quote vm-load-init-file) "vm-startup" nil t nil)
-
-(autoload (quote vm-check-emacs-version) "vm-startup" nil nil nil)
-
-(autoload (quote vm-set-debug-flags) "vm-startup" nil nil nil)
-
-(autoload (quote vm-session-initialization) "vm-startup" nil nil nil)
-
-(autoload (quote vm-summary-mode-internal) "vm-summary" nil nil nil)
-
-(autoload (quote vm-summarize) "vm-summary" "Summarize the contents of the folder in a summary buffer. 
-The format is as described by the variable vm-summary-format.  Generally
-one line per message is most pleasing to the eye but this is not
-mandatory." t nil)
-
-(autoload (quote vm-summarize-other-frame) "vm-summary" "Like vm-summarize, but run in a newly created frame." t nil)
-
-(autoload (quote vm-do-summary) "vm-summary" nil nil nil)
-
-(autoload (quote vm-do-needed-summary-rebuild) "vm-summary" nil nil nil)
-
-(autoload (quote vm-update-message-summary) "vm-summary" nil nil nil)
-
-(autoload (quote vm-set-summary-pointer) "vm-summary" nil nil nil)
-
-(autoload (quote vm-summary-highlight-region) "vm-summary" nil nil nil)
-
-(autoload (quote vm-auto-center-summary) "vm-summary" nil nil nil)
-
-(autoload (quote vm-sprintf) "vm-summary" nil nil nil)
-
-(autoload (quote vm-tokenized-summary-insert) "vm-summary" nil nil nil)
-
-(autoload (quote vm-compile-format) "vm-summary" nil nil nil)
-
-(autoload (quote vm-get-header-contents) "vm-summary" nil nil nil)
-
-(autoload (quote vm-left-justify-string) "vm-summary" nil nil nil)
-
-(autoload (quote vm-right-justify-string) "vm-summary" nil nil nil)
-
-(autoload (quote vm-truncate-string) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-attribute-indicators) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-attribute-indicators-long) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-byte-count) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-weekday) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-monthday) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-month) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-month-number) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-year) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-hour-short) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-hour) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-zone) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-mark) "vm-summary" nil nil nil)
-
-(autoload (quote vm-grok-From_-date) "vm-summary" nil nil nil)
-
-(autoload (quote vm-parse-date) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-do-date) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-do-month) "vm-summary" nil nil nil)
-
-(autoload (quote vm-run-user-summary-function) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-full-name) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-interesting-full-name) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-from) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-interesting-from) "vm-summary" nil nil nil)
-
-(autoload (quote vm-grok-From_-author) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-do-author) "vm-summary" nil nil nil)
-
-(autoload (quote vm-default-chop-full-name) "vm-summary" nil nil nil)
-
-(autoload (quote vm-choose-chop-full-name-function) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-do-recipients) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-to) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-to-names) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-message-id) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-line-count) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-subject) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-summary) "vm-summary" nil nil nil)
-
-(autoload (quote vm-fix-my-summary!!!) "vm-summary" nil t nil)
-
-(autoload (quote vm-su-thread-indent) "vm-summary" nil nil nil)
-
-(autoload (quote vm-su-labels) "vm-summary" nil nil nil)
-
-(autoload (quote vm-toggle-threads-display) "vm-thread" "Toggle the threads display on and off.
-When the threads display is on, the folder will be sorted by
-thread and thread indentation (via the %I summary format specifier)
-will be visible." t nil)
-
-(autoload (quote vm-build-threads) "vm-thread" nil nil nil)
-
-(autoload (quote vm-thread-mark-for-summary-update) "vm-thread" nil nil nil)
-
-(autoload (quote vm-thread-list) "vm-thread" nil nil nil)
-
-(autoload (quote vm-unthread-message) "vm-thread" nil nil nil)
-
-(autoload (quote vm-th-references) "vm-thread" nil nil nil)
-
-(autoload (quote vm-th-parent) "vm-thread" nil nil nil)
-
-(autoload (quote vm-th-thread-indentation) "vm-thread" nil nil nil)
-
-(autoload (quote vm-th-thread-list) "vm-thread" nil nil nil)
-
-(autoload (quote vm-toolbar-helper-command) "vm-toolbar" nil t nil)
-
-(autoload (quote vm-toolbar-any-messages-p) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-delete/undelete-message) "vm-toolbar" nil t nil)
-
-(autoload (quote vm-toolbar-can-autofile-p) "vm-toolbar" nil t nil)
-
-(autoload (quote vm-toolbar-autofile-message) "vm-toolbar" nil t nil)
-
-(autoload (quote vm-toolbar-can-recover-p) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-can-decode-mime-p) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-can-quit-p) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-mail-waiting-p) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-update-toolbar) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-install-toolbar) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-make-toolbar-spec) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-toolbar-initialize) "vm-toolbar" nil nil nil)
-
-(autoload (quote vm-set-buffer-modified-p) "vm-undo" nil nil nil)
-
-(autoload (quote vm-undo-boundary) "vm-undo" nil nil nil)
-
-(autoload (quote vm-clear-expunge-invalidated-undos) "vm-undo" nil nil nil)
-
-(autoload (quote vm-clear-virtual-quit-invalidated-undos) "vm-undo" nil nil nil)
-
-(autoload (quote vm-clear-modification-flag-undos) "vm-undo" nil nil nil)
-
-(autoload (quote vm-squeeze-consecutive-undo-boundaries) "vm-undo" nil nil nil)
-
-(autoload (quote vm-undo-record) "vm-undo" nil nil nil)
-
-(autoload (quote vm-undo-describe) "vm-undo" nil nil nil)
-
-(autoload (quote vm-undo-set-message-pointer) "vm-undo" nil nil nil)
-
-(autoload (quote vm-undo) "vm-undo" "Undo last change to message attributes in the current folder.
-Consecutive invocations of this command cause sequentially earlier
-changes to be undone.  After an intervening command between undos,
-the undos themselves become undoable." t nil)
-
-(autoload (quote vm-set-message-attributes) "vm-undo" "Set message attributes.
-Use this command to change attributes like `deleted' or
-`replied'.  Interactively you will be prompted for the attributes
-to be changed, and only the attributes you enter will be altered.
-You can use completion to expand the attribute names.  The names
-should be entered as a space separated list.
-
-A numeric prefix argument COUNT causes the current message and
-the next COUNT-1 message to have their attributes altered.  A
-negative COUNT arg causes the current message and the previous
-COUNT-1 messages to be altered.  COUNT defaults to one." t nil)
-
-(autoload (quote vm-add-message-labels) "vm-undo" "Attach some labels to a message.
-These are arbitrary user-defined labels, not to be confused with
-message attributes like `new' and `deleted'.  Interactively you
-will be prompted for the labels to be added.  You can use
-completion to expand the label names, with the completion list
-being all the labels that have ever been used in this folder.
-The names should be entered as a space separated list.  Label
-names are compared case-insensitively.
-
-A numeric prefix argument COUNT causes the current message and
-the next COUNT-1 message to have the labels added.  A
-negative COUNT arg causes the current message and the previous
-COUNT-1 messages to be altered.  COUNT defaults to one." t nil)
-
-(autoload (quote vm-delete-message-labels) "vm-undo" "Delete some labels from a message.
-These are arbitrary user-defined labels, not to be confused with
-message attributes like `new' and `deleted'.  Interactively you
-will be prompted for the labels to be deleted.  You can use
-completion to expand the label names, with the completion list
-being all the labels that have ever been used in this folder.
-The names should be entered as a space separated list.  Label
-names are compared case-insensitively.
-
-A numeric prefix argument COUNT causes the current message and
-the next COUNT-1 message to have the labels deleted.  A
-negative COUNT arg causes the current message and the previous
-COUNT-1 messages to be altered.  COUNT defaults to one." t nil)
-
-(autoload (quote vm-add-or-delete-message-labels) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-xxxx-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-labels) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-new-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-unread-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-deleted-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-filed-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-replied-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-written-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-forwarded-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-redistributed-flag) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-new-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-unread-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-deleted-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-filed-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-replied-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-written-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-forwarded-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-redistributed-flag-of) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-deleted-flag-in-vector) "vm-undo" nil nil nil)
-
-(autoload (quote vm-set-new-flag-in-vector) "vm-undo" nil nil nil)
-
-(autoload (quote vm-user-composition-folder-buffer) "vm-user" "Returns the folder buffer associated with the current buffer.
-The current buffer must be a composition buffer created by VM for
-a reply, resend or forward.
-
-Nil is returned if the current buffer is not assocaited with any
-VM folder.
-
-Note that the buffer returned might be a virtual folder buffer,
-which might have several underlying real folders associated with
-it.  To get the list of real folder buffers associated with a
-composition buffer, use vm-user-composition-real-folder-buffers
-instead." nil nil)
-
-(autoload (quote vm-user-composition-real-folder-buffers) "vm-user" "Returns a list of the real folder buffers associated with the current
-buffer.  The current buffer must be a composition buffer created
-by VM for a reply, resend or forward." nil nil)
-
-(autoload (quote vm-spool-files) "vm-vars" nil nil nil)
-
-(autoload (quote vm-xemacs-p) "vm-vars" nil nil nil)
-
-(autoload (quote vm-xemacs-mule-p) "vm-vars" nil nil nil)
-
-(autoload (quote vm-fsfemacs-19-p) "vm-vars" nil nil nil)
-
-(autoload (quote vm-note-emacs-version) "vm-vars" nil nil nil)
-
-(autoload (quote vm-version) "vm-version" "Returns the value of the variable vm-version." nil nil)
-
-(autoload (quote vm-build-virtual-message-list) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-create-virtual-folder) "vm-virtual" "Create a new virtual folder from messages in the current folder.
-The messages will be chosen by applying the selector you specify,
-which is normally read from the minibuffer.
-
-Prefix arg means the new virtual folder should be visited read only." t nil)
-
-(autoload (quote vm-apply-virtual-folder) "vm-virtual" "Apply the selectors of a named virtual folder to the current folder
-and create a virtual folder containing the selected messages.
-
-Prefix arg means the new virtual folder should be visited read only." t nil)
-
-(autoload (quote vm-toggle-virtual-mirror) "vm-virtual" nil t nil)
-
-(autoload (quote vm-virtual-help) "vm-virtual" nil t nil)
-
-(autoload (quote vm-vs-or) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-and) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-not) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-any) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-author) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-recipient) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-subject) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-sent-before) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-sent-after) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-header) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-label) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-text) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-more-chars-than) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-less-chars-than) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-more-lines-than) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-less-lines-than) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-new) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-unread) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-read) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-deleted) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-replied) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-forwarded) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-filed) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-written) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-marked) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-vs-edited) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-read-virtual-selector) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-virtual-quit) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-virtual-save-folder) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-virtual-get-new-mail) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-make-virtual-copy) "vm-virtual" nil nil nil)
-
-(autoload (quote vm-display) "vm-window" nil nil nil)
-
-(autoload (quote vm-display-buffer) "vm-window" nil nil nil)
-
-(autoload (quote vm-undisplay-buffer) "vm-window" nil nil nil)
-
-(autoload (quote vm-load-window-configurations) "vm-window" nil nil nil)
-
-(autoload (quote vm-store-window-configurations) "vm-window" nil nil nil)
-
-(autoload (quote vm-set-window-configuration) "vm-window" nil nil nil)
-
-(autoload (quote vm-save-window-configuration) "vm-window" "Name and save the current window configuration.
-With this command you associate the current window setup with an
-action.  Each time you perform this action VM will duplicate this
-window setup.
-
-Nearly every VM command can have a window configuration
-associated with it.  VM also allows some category configurations,
-`startup', `reading-message', `composing-message', `editing-message',
-`marking-message' and `searching-message' for the commands that
-do these things.  There is also a `default' configuration that VM
-will use if no other configuration is applicable.  Command
-specific configurations are searched for first, then the category
-configurations and then the default configuration.  The first
-configuration found is the one that is applied.
-
-The value of vm-mutable-windows must be non-nil for VM to use
-window configurations." t nil)
-
-(autoload (quote vm-buffer-to-label) "vm-window" nil nil nil)
-
-(autoload (quote vm-delete-window-configuration) "vm-window" "Delete the configuration saved for a particular action.
-This action will no longer have an associated window configuration.
-The action will be read from the minibuffer." t nil)
-
-(autoload (quote vm-apply-window-configuration) "vm-window" "Change the current window configuration to be one
-associated with a particular action.  The action will be read
-from the minibuffer." t nil)
-
-(autoload (quote vm-window-help) "vm-window" nil t nil)
-
-(autoload (quote vm-iconify-frame) "vm-window" "Iconify the current frame.
-Run the hooks in vm-iconify-frame-hook before doing so." t nil)
-
-(autoload (quote vm-window-loop) "vm-window" nil nil nil)
-
-(autoload (quote vm-frame-loop) "vm-window" nil nil nil)
-
-(autoload (quote vm-maybe-delete-windows-or-frames-on) "vm-window" nil nil nil)
-
-(autoload (quote vm-replace-buffer-in-windows) "vm-window" nil nil nil)
-
-(autoload (quote vm-bury-buffer) "vm-window" nil nil nil)
-
-(autoload (quote vm-unbury-buffer) "vm-window" nil nil nil)
-
-(autoload (quote vm-get-buffer-window) "vm-window" nil nil nil)
-
-(autoload (quote vm-get-visible-buffer-window) "vm-window" nil nil nil)
-
-(autoload (quote vm-set-hooks-for-frame-deletion) "vm-window" nil nil nil)
-
-(autoload (quote vm-created-this-frame-p) "vm-window" nil nil nil)
-
-(autoload (quote vm-delete-buffer-frame) "vm-window" nil nil nil)
-
-(autoload (quote vm-register-frame) "vm-window" nil nil nil)
-
-(autoload (quote vm-goto-new-frame) "vm-window" nil nil nil)
-
-(autoload (quote vm-goto-new-summary-frame-maybe) "vm-window" nil nil nil)
-
-(autoload (quote vm-goto-new-folder-frame-maybe) "vm-window" nil nil nil)
-
-(autoload (quote vm-warp-mouse-to-frame-maybe) "vm-window" nil nil nil)
-
-(autoload (quote vm-iconify-frame-xxx) "vm-window" nil nil nil)
--- a/lisp/w3/custom-load.el	Mon Aug 13 09:52:21 2007 +0200
+++ b/lisp/w3/custom-load.el	Mon Aug 13 09:53:19 2007 +0200
@@ -1,19 +1,19 @@
-(custom-put 'url-news 'custom-loads '("url-news"))
-(custom-put 'w3-scripting 'custom-loads '("w3-script"))
-(custom-put 'w3-hooks 'custom-loads '("w3-cus"))
-(custom-put 'w3-display 'custom-loads '("w3-cus"))
-(custom-put 'w3-parsing 'custom-loads '("w3-cus"))
-(custom-put 'w3-menus 'custom-loads '("w3-cus" "w3-menu"))
-(custom-put 'w3-printing 'custom-loads '("w3-cus"))
-(custom-put 'w3-images 'custom-loads '("w3-cus"))
-(custom-put 'w3-files 'custom-loads '("w3-cus"))
+(custom-put 'ssl 'custom-loads '("ssl"))
+(custom-put 'url-gateway 'custom-loads '("url-gw"))
+(custom-put 'url 'custom-loads '("url-gw" "url-irc" "url-vars" "url" "url-news"))
+(custom-put 'url-file 'custom-loads '("url-cache" "url-vars"))
+(custom-put 'url-cache 'custom-loads '("url-cache" "url-vars"))
+(custom-put 'url-history 'custom-loads '("url-vars"))
+(custom-put 'url-cookie 'custom-loads '("url-cookie" "url-vars"))
+(custom-put 'url-mime 'custom-loads '("url-vars"))
+(custom-put 'url-hairy 'custom-loads '("url-vars"))
 (custom-put 'w3 'custom-loads '("w3-cus" "w3-script"))
-(custom-put 'url-hairy 'custom-loads '("url-vars"))
-(custom-put 'url-mime 'custom-loads '("url-vars"))
-(custom-put 'url-cookie 'custom-loads '("url-cookie" "url-vars"))
-(custom-put 'url-history 'custom-loads '("url-vars"))
-(custom-put 'url-cache 'custom-loads '("url-cache" "url-vars"))
-(custom-put 'url-file 'custom-loads '("url-cache" "url-vars"))
-(custom-put 'url 'custom-loads '("url-gw" "url-irc" "url-vars" "url" "url-news"))
-(custom-put 'url-gateway 'custom-loads '("url-gw"))
-(custom-put 'ssl 'custom-loads '("ssl"))
+(custom-put 'w3-files 'custom-loads '("w3-cus"))
+(custom-put 'w3-images 'custom-loads '("w3-cus"))
+(custom-put 'w3-printing 'custom-loads '("w3-cus"))
+(custom-put 'w3-menus 'custom-loads '("w3-cus" "w3-menu"))
+(custom-put 'w3-parsing 'custom-loads '("w3-cus"))
+(custom-put 'w3-display 'custom-loads '("w3-cus"))
+(custom-put 'w3-hooks 'custom-loads '("w3-cus"))
+(custom-put 'w3-scripting 'custom-loads '("w3-script"))
+(custom-put 'url-news 'custom-loads '("url-news"))
--- a/lwlib/xlwmenu.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/lwlib/xlwmenu.c	Mon Aug 13 09:53:19 2007 +0200
@@ -401,6 +401,11 @@
   XmStringExtent (mw->menu.font_list, s, &width, &height);
   return width;
 #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;
@@ -417,6 +422,7 @@
 	  w += xcs.width;
   }
   return w;
+# endif /* USE_XFONTSET */
 #endif
 }
 
--- a/man/ChangeLog	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/ChangeLog	Mon Aug 13 09:53:19 2007 +0200
@@ -1,3 +1,17 @@
+Tue Aug  5 21:56:02 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode.texi:
+	In FAQ section, document use of c-mode-base-map instead of c-mode-map.
+
+Fri Aug  1 22:44:49 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode.texi: Removed the description of c-enable-//-in-c-mode.
+
+Wed Jul 30 00:01:45 1997  Barry A. Warsaw  <cc-mode-help@python.org>
+
+	* cc-mode.texi:
+	Added description of template-args-cont syntactic symbol
+
 1997-07-25  Barry A. Warsaw  <cc-mode-help@python.org>
 
 	* cc-mode.texi: Describe support for idl-mode
--- a/man/cc-mode.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/cc-mode.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -46,7 +46,7 @@
 @comment The title is printed in a large font.
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-@center @titlefont{CC Mode 5.14}
+@center @titlefont{CC Mode 5.15}
 @sp 2
 @center @subtitlefont{A GNU Emacs mode for editing C and C-like languages}
 @sp 2
@@ -180,70 +180,37 @@
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-If you got this version of @ccmode{} with Emacs, it should work just
-fine right out of the box, and you can safely skip to the next chapter.
-Note however that you may not have the latest @ccmode{} release and may
-want to upgrade your copy.  See the @file{README} file, or the @ccmode{}
-Web pages latest information on Emacs version compatibility,
-@ref{Getting the latest CC Mode release}.
+If you got this version of @ccmode{} with Emacs or XEmacs, it should
+work just fine right out of the box.  Note however that you may not have
+the latest @ccmode{} release and may want to upgrade your copy.
+
+If you are upgrading an existing @ccmode{} installation, please see the
+@file{README} file for installation details.  @ccmode{} may not work
+with older versions of Emacs or XEmacs.  See the @ccmode{} release notes
+Web pages for the latest information on Emacs version and package
+compatibility, etc.  The Web page locations are outlined in @ref{Getting
+the latest CC Mode release}.
 
 @cindex @file{cc-mode-18.el} file
-@emph{@ccmode{} no longer works with Emacs 18!}  The
+@emph{Note that @ccmode{} no longer works with Emacs 18!}  The
 @file{cc-mode-18.el} file is no longer distributed with @ccmode{}.  If
-you haven't upgraded from Emacs 18 by now, you are out of luck.  The
-rest of these installation instructions assume you are using one of the
-new Emacs or XEmacs releases, that already come with @ccmode{}.  These
-instructions explain how to upgrade to use the latest @ccmode{}
-release.
-
-@cindex .emacs file
-
-The first thing you will want to do is put the @ccmode{} source files in
-a subdirectory somewhere on your @code{load-path} so Emacs can find it.
-The distribution tarball unpacks into its own subdirectory,
-e.g. @file{cc-mode/}.  Assuming you unpacked the distribution in your
-home directory, you should add the following to your @file{.emacs} file
-in order to pick up the latest version of @ccmode{} over the one
-distributed with your Emacs:
-
-@example
-
-(setq load-path (cons "~/cc-mode" load-path))
-
-@end example
-
-@cindex byte compile
-
-Next you want to @dfn{byte compile} all the @ccmode{} source files.
-@ccmode{} uses a lot of macros so if you don't byte compile it,
-things will be unbearably slow.  @emph{You can ignore all byte-compiler
-warnings!}  They are the result of the supporting different versions of
-Emacs, and none of the warnings have any effect on operation. Let me say
-this again: @strong{You really can ignore all byte-compiler warnings!}
-
-To byte-compile the source files, first @code{cd} to the directory you
-unpacked the tarball into.  Then run the following command at your shell 
-prompt:
-
-@example
-
-% $EMACS -batch -no-site-file -q -l cc-make.el cc-*.el
-
-@end example
-
-@noindent
-where $EMACS is either @code{emacs} or @code{xemacs} depending on the
-version you use.
-
-Next time you start up Emacs you should be using the latest @ccmode{}.
-You can test this by visiting a C file and hitting @kbd{M-x c-version
-RET}; you should see this message in the echo area:
+you haven't upgraded from Emacs 18 by now, you are out of luck.
+
+@findex c-version
+@findex version (c-)
+You can find out what version of @ccmode{} you are using by visiting a C
+file and entering @kbd{M-x c-version RET}.  You should see this message in
+the echo area:
 @example
 
 Using CC Mode version 5.XX
 
 @end example
 
+@noindent
+where @samp{XX} is the minor release number.
+
+
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @node     New Indentation Engine, Minor Modes, Getting Connected, Top
 @comment  node-name,              next,        previous,          up
@@ -590,6 +557,7 @@
 @menu
 * Auto-newline insertion::
 * Hungry-deletion of whitespace::
+* Auto-fill mode interaction::
 @end menu
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -628,18 +596,6 @@
 
 @end itemize
 
-@findex c-enable-//-in-c-mode
-@findex enable-//-in-c-mode (c-)
-Some characters are electric in some languages, and not in others.  For
-example, the second slash (@kbd{/}) of a C++ style line comment is
-electric in @code{c++-mode}, @code{objc-mode}, @code{java-mode}, and
-@code{idl-mode}, but not in @code{c-mode}@footnote{Ordinarily, @samp{//}
-does not introduce a comment in @code{c-mode}.  However, if you call the
-function @code{c-enable-//-in-c-mode}, @code{c-mode} will recognize C++
-style line comments.  Note however that this is a global change which
-will affect all your @code{c-mode} buffers.}.
-
-
 @menu
 * Hanging Braces::
 * Hanging Colons::
@@ -1028,7 +984,7 @@
 
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node  Hungry-deletion of whitespace, , Auto-newline insertion, Minor Modes
+@node  Hungry-deletion of whitespace, Auto-fill mode interaction, Auto-newline insertion, Minor Modes
 @comment  node-name,              next,                    previous,up
 
 @section  Hungry-deletion of whitespace
@@ -1101,6 +1057,42 @@
 
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Auto-fill mode interaction, , Hungry-deletion of whitespace, Minor Modes
+@comment  node-name,              next,                    previous,up
+
+@section  Auto-fill mode interaction
+@cindex   Auto-fill mode interaction
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+One other note about minor modes is worth mentioning here.  CC Mode now
+works much better with auto-fill mode (a standard Emacs minor mode) by
+correctly auto-filling both line (e.g. C++ style) and block (e.g. C
+style) oriented comments.  When @code{auto-fill-mode} is enabled, line
+oriented comments will also be auto-filled by inserting a newline at the 
+line break, and inserting @samp{//} at the start of the next line.
+
+@vindex c-comment-continuation-stars
+@vindex comment-continuation-stars (c-)
+@vindex comment-line-break-function
+When auto-filling block oriented comments, the behavior is dependent on
+the value of the variable @code{c-comment-continuation-stars}.  When
+this variable is @code{nil}, the old behavior for auto-filling C
+comments is in effect.  In this case, the line is broken by closing the
+comment and starting a new comment on the next line.
+
+If you set @code{c-comment-continuation-stars} to a string, then a long
+C block comment line is broken by inserting a newline at the line break
+position, and inserting this string at the beginning of the next comment
+line.  The default value for @code{c-comment-continuation-stars} is
+@samp{* } (a star followed by a single space)@footnote{To get block
+comment continuation lines indented under the block comment starter
+(e.g. the @samp{/*}), it is not enough to set
+@code{c-comment-continuation-stars} to the empty string.  You need to do
+this, but you also need to set the offset for the @code{c} syntactic
+symbol to be zero.}.
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @node  Commands, Customizing Indentation, Minor Modes, Top
 @comment  node-name,              next,                    previous,up
 
@@ -1866,10 +1858,10 @@
 the file.  So far, you've only seen a functional interface to @ccmode{}
 customization, which is highly inconvenient for use in a Local Variable
 block.  @ccmode{} provides two variables that make it easier for you to
-customize your style on a per-file basis@footnote{Note that file styles
-don't work with Emacs versions before XEmacs 19.12 and Emacs 19.29.
-File styles work via the standard Emacs hook variable
-@code{hack-local-variables-hook}.}.
+customize your style on a per-file basis@footnote{Note that this feature
+doesn't work with Emacs versions before XEmacs 19.12 and Emacs 19.29.
+It works via the standard Emacs hook variable
+@code{hack-local-variables-hook}.}
 
 @vindex c-file-style
 @vindex file-style (c-)
@@ -2323,7 +2315,7 @@
 @vindex comment-column
 
 Normally, the standard Emacs command @kbd{M-;}
-(@code{indent-for-comment}) will indent comment-only lines to
+(@code{indent-for-comment}) will indent comment only lines to
 @code{comment-column}.  Some users however, prefer that @kbd{M-;} act
 just like @kbd{TAB} for purposes of indenting comment-only lines;
 i.e. they want the comments to always indent as they would for normal
@@ -2462,6 +2454,8 @@
 @item
 @code{inextern-lang} --- analogous to `inclass' syntactic symbol, but
 for @code{extern} blocks.
+@item
+@code{template-args-cont} --- C++ template argument list continuations
 @end itemize
 
 @cindex -open syntactic symbols
@@ -2671,6 +2665,21 @@
 The @code{friend} syntactic symbol is a modifier that typically does not
 have a relative buffer position.
 
+Template definitions introduce yet another syntactic symbol:
+
+@example
+@group
+
+   1: ThingManager <int,
+   2:    Framework::Callback *,
+   3:    Mutex> framework_callbacks;
+
+@end group
+@end example
+
+Here, line 1 is analyzed as a @code{topmost-intro}, but lines 2 and 3
+are both analyzed as @code{template-args-cont} lines.
+
 Here is another (totally contrived) example which illustrates how syntax
 is assigned to various conditional constructs:
 @example
@@ -3125,7 +3134,7 @@
 @ref{Sample .emacs File}):
 @example
 
-(define-key c-mode-map "\C-m" 'newline-and-indent)
+(define-key c-mode-base-map "\C-m" 'newline-and-indent)
 
 @end example
 
@@ -3387,6 +3396,9 @@
 @unnumbered Variable Index
 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
+@ifinfo
+
+@end ifinfo
 Since all @ccmode{} variables are prepended with the string
 @samp{c-}, each appears under its @code{c-@var{<thing>}} name and its
 @code{@var{<thing>} (c-)} name.
@@ -3394,6 +3406,7 @@
 @sp 2
 @end iftex
 @printindex vr
+@page
 @summarycontents
 @contents
 @bye
--- a/man/ediff.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/ediff.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -7,7 +7,7 @@
 @comment Using ediff.info instead of ediff in setfilename breaks DOS.
 @comment @setfilename ediff
 @comment @setfilename ediff.info
-@setfilename ediff
+@setfilename ../info/ediff
 
 @settitle Ediff User's Manual
 @synindex vr cp
@@ -40,9 +40,9 @@
 @titlepage
 @title Ediff User's Manual
 @sp 4
-@subtitle Ediff version 2.66
+@subtitle Ediff version 2.67
 @sp 1
-@subtitle July 1997
+@subtitle August 1997
 @sp 5
 @author Michael Kifer
 @page
@@ -62,7 +62,7 @@
 
 
 @menu
-* Introduction::                About Ediff 2.66.
+* Introduction::                About Ediff 2.67.
 * Major Entry Points::          How to use Ediff.
 * Session Commands::            Ediff commands used within a session.
 * Registry of Ediff Sessions::  Keeping track of multiple Ediff sessions.
@@ -1460,21 +1460,6 @@
 displays, because without colors options are limited.
 So, Ediff uses italics to highlight non-current differences.
 
-@item ediff-even-diff-pixmap
-@itemx ediff-odd-diff-pixmap
-@itemx ediff-fine-diff-pixmap
-@vindex ediff-even-diff-pixmap
-@vindex ediff-odd-diff-pixmap
-@vindex ediff-fine-diff-pixmap
-On monochrome graphical displays, Ediff attempts to provide additional
-hues using background pixmaps. The above variables specify pixmaps (which
-are strings representing filenames of bitmaps) for even-numbered background
-difference regions, odd-numbered regions, and fine differences.  If Ediff's
-default pixmaps don't exist on your machine, check the bitmap directory at
-your installation to find an appropriate bitmap. The bitmap directory can
-be found by checking the value of the Emacs variable
-@code{x-bitmap-file-path}.
-
 @item ediff-force-faces
 @vindex ediff-force-faces
 Ediff generally can detect when Emacs is running on a device where it can
@@ -1502,18 +1487,20 @@
 @end table
 
 @noindent
-If you want to change the above variables, you must do it
-@strong{before} Ediff is loaded. 
-
-There are two ways to change the default setting
-for highlighting faces: either change the variables, as shown here,
+If you want to change the default settings for @code{ediff-force-faces} and
+@code{ediff-highlight-all-diffs}, you must do it @strong{before} Ediff is
+loaded.
 
-@example
-(setq ediff-current-diff-face-A 'bold-italic)
-@end example
+You can also change the defaults for the faces used to highlight the
+difference regions.  There are two ways to do this.  The simplest and the
+preferred way is to use the customization widget accessible from the
+menubar. Ediff's customization group is located under "Tools", which in
+turn is under "Programming". The faces that are used to highlight
+difference regions are located in the "Highlighting" subgroup of the Ediff
+customization group.
 
-@noindent
-or here,
+The second, much more arcane, method to change default faces is to include
+some Lisp code in @file{~/.emacs}. For instance,
 
 @example
 (setq ediff-current-diff-face-A
@@ -1521,7 +1508,12 @@
 @end example
 
 @noindent
-or modify the defaults selectively:
+would use the pre-defined fase @code{bold-italic} to highlight the current
+difference region in buffer A (this face is not a good choice, by the way).
+
+If you are unhappy with just @emph{some} of the aspects of the default
+faces, you can modify them when Ediff is being loaded using
+@code{ediff-load-hook}. For instance:
 
 @smallexample
 (add-hook 'ediff-load-hook
@@ -1534,9 +1526,6 @@
                         ediff-current-diff-face-B))))
 @end smallexample
 
-You may also want to take a look at how the above faces are defined in the
-source code of Ediff. 
-
 @strong{Note:} it is not recommended to use @code{internal-get-face} (or
 @code{get-face} in XEmacs) when defining Ediff's faces, since this may
 cause problems when there are several frames with different font sizes.
--- a/man/texinfo.tex	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/texinfo.tex	Mon Aug 13 09:53:19 2007 +0200
@@ -1,5 +1,5 @@
 %% TeX macros to handle Texinfo files.
-%% $Id: texinfo.tex,v 1.3 1997/07/19 22:11:48 steve Exp $
+%% $Id: texinfo.tex,v 1.4 1997/08/10 04:40:34 steve Exp $
 
 %  Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
 %                94, 95, 96, 97 Free Software Foundation, Inc.
@@ -36,7 +36,7 @@
 
 % This automatically updates the version number based on RCS.
 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 1.3 $
+\deftexinfoversion$Revision: 1.4 $
 \message{Loading texinfo package [Version \texinfoversion]:}
 
 % If in a .fmt file, print the version number
@@ -1402,14 +1402,12 @@
 \else{\tclose{\kbdfont\look}}\fi
 \else{\tclose{\kbdfont\look}}\fi}
 
-% @url, @email.  Quotes do not seem necessary.
-\let\url=\code % perhaps include a hypertex \special eventually
-% rms does not like the angle brackets --karl, 17may97.
-%\def\email#1{$\langle${\tt #1}$\rangle$}
-\let\email=\code
+% @url.  Quotes do not seem necessary, so use \code.
+\let\url=\code
 
 % @uref (abbreviation for `urlref') takes an optional second argument
 % specifying the text to display.  First (mandatory) arg is the url.
+% Perhaps eventually put in a hypertex \special here.
 % 
 \def\uref#1{\urefxxx #1,,\finish}
 \def\urefxxx#1,#2,#3\finish{%
@@ -1421,6 +1419,11 @@
   \fi
 }
 
+% rms does not like the angle brackets --karl, 17may97.
+% So now @email is just like @uref.
+%\def\email#1{$\langle${\tt #1}$\rangle$}
+\let\email=\uref
+
 % Check if we are currently using a typewriter font.  Since all the
 % Computer Modern typewriter fonts have zero interword stretch (and
 % shrink), and it is reasonable to expect all typewriter fonts to have
--- a/man/texinfo.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/texinfo.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -1,12 +1,14 @@
 \input texinfo.tex    @c -*-texinfo-*-
-@comment $Id: texinfo.texi,v 1.4 1997/07/19 22:11:50 steve Exp $
-@comment %**start of header
+@c $Id: texinfo.texi,v 1.5 1997/08/10 04:40:35 steve Exp $
+@c %**start of header
+
+@c All text is ignored before the setfilename.
+@setfilename texinfo
+@settitle Texinfo @value{edition}
+
 @set edition 2.24
 @set update-month July 1997
-@set update-date 15 @value{update-month}
-
-@setfilename texinfo
-@settitle Texinfo @value{edition}
+@set update-date 25 @value{update-month}
 
 @c Define a new index for options.
 @defcodeindex op
@@ -30,14 +32,15 @@
 * install-info: (texinfo)Invoking install-info. Updating info/dir entries.
 * texi2dvi: (texinfo)Format with texi2dvi.      Printing Texinfo documentation.
 * texindex: (texinfo)Format with tex/texindex.  Sorting Texinfo index files.
-* makeinfo: (texinfo)makeinfo preferred.        Translate Texinfo source.
+* makeinfo: (texinfo)makeinfo Preferred.        Translate Texinfo source.
 @end direntry
 
 @c Set smallbook if printing in smallbook format so the example of the
 @c smallbook font is actually written using smallbook; in bigbook, a kludge
-@c is used for TeX output.
-@smallbook
-@set smallbook
+@c is used for TeX output.  Do this through the -t option to texi2dvi,
+@c so this same source can be used for other paper sizes as well.
+@c smallbook
+@c set smallbook
 @c @@clear smallbook
 
 @c Currently undocumented command, 5 December 1993:
@@ -635,7 +638,7 @@
 
 Formatting Mistakes
 
-* makeinfo preferred::          @code{makeinfo} finds errors.
+* makeinfo Preferred::          @code{makeinfo} finds errors.
 * Debugging with Info::         How to catch errors with Info formatting.
 * Debugging with TeX::          How to catch errors with @TeX{} formatting.
 * Using texinfo-show-structure::  How to use @code{texinfo-show-structure}.
@@ -2707,9 +2710,10 @@
 some systems; so the Info file name for this document is @file{texinfo}
 rather than @file{texinfo.info}.
 
+@cindex Ignored before @code{@@setfilename}
 The Info formatting commands ignore everything written before the
 @code{@@setfilename} line, which is why the very first line of
-the file (the @code{\input} line) does not need to be commented out.
+the file (the @code{\input} line) does not show up in the output.
 
 @pindex texinfo.cnf
 The @code{@@setfilename} line produces no output when you typeset a
@@ -6131,6 +6135,7 @@
 refer to printed works for which no Info form exists.  @xref{cite, ,
 @code{@@cite}}.@refill
 
+
 @node uref,  , inforef, Cross References
 @section @code{@@uref@{@var{url}[, @var{displayed-text}]@}}
 @findex uref
@@ -6270,7 +6275,7 @@
 @item @@file@{@var{file-name}@}
 Indicate the name of a file.@refill
 
-@item @@email@{@var{email-address}@}
+@item @@email@{@var{email-address}[, @var{displayed-text}]@}
 Indicate an electronic mail address.
 
 @item @@dfn@{@var{term}@}
@@ -6768,6 +6773,7 @@
 @var{ch}.@refill
 @end ignore
 
+
 @node url, email, cite, Indicating
 @subsection @code{@@url}@{@var{uniform-resource-locator}@}
 @findex url
@@ -6789,20 +6795,29 @@
 
 
 @node email,  , url, Indicating
-@subsection @code{@@email}@{@var{email-address}@}
+@subsection @code{@@email}@{@var{email-address}[, @var{displayed-text}]@}
 @findex email
 
 Use the @code{@@email} command to indicate an electronic mail address.
+It takes one mandatory argument, the address, and one optional argument, the
+text to display (the default is the address itself).
+
+@cindex mailto link
+In Info and @TeX{}, the address is shown in angle brackets, preceded by
+the text to display if any.  In HTML output, @code{@@email} produces a
+@samp{mailto} link that usually brings up a mail composition window.
 For example:
 
 @example
-Send bug reports to @@email@{bug-texinfo@@prep.ai.mit.edu@}.
-@end example
-
-In Info and @TeX{}, this acts like @code{@@key} (it puts the argument in
-angle brackets).  When we have support for converting Texinfo to HTML,
-this will produce a link you can follow to bring up a mail composition
-window initialized with @var{email-address}.
+Send bug reports to @@email@{bug-texinfo@@@@prep.ai.mit.edu@}.
+Send suggestions to the @@email@{bug-texinfo@@@@prep.ai.mit.edu, same place@}.
+@end example
+@noindent produces
+@example
+Send bug reports to @email{bug-texinfo@@prep.ai.mit.edu}.
+Send suggestions to the @email{bug-texinfo@@prep.ai.mit.edu, same place}.
+@end example
+
 
 @node Emphasis,  , Indicating, Marking Text
 @comment node-name,  next,  previous,  up
@@ -9636,8 +9651,8 @@
 @cindex Millimeters
 millimeter (10mm = 1cm)
 @item dd
-@cindex Did\^ot points
-did\^ot point (1157dd = 1238pt)
+@cindex Did@^ot points
+did@^ot point (1157dd = 1238pt)
 @item cc
 @cindex Ciceros
 cicero (1cc = 12dd)
@@ -13907,14 +13922,15 @@
 Insert an ellipsis: @samp{@dots{}}.
 @xref{dots, , @code{@@dots}}.@refill
 
-@item @@email@{@var{address}@}
+@item @@email@{@var{address}[, @var{displayed-text}]@}
 Indicate an electronic mail address.
 @xref{email, , @code{@@email}}.@refill
 
 @need 100
 @item @@emph@{@var{text}@}
 Highlight @var{text}; text is displayed in @emph{italics} in printed
-output, and surrounded by asterisks in Info.  @xref{Emphasis, , Emphasizing Text}.@refill
+output, and surrounded by asterisks in Info.  @xref{Emphasis, ,
+Emphasizing Text}.
 
 @item @@end @var{environment}
 Ends @var{environment}, as in @samp{@@end example}.  @xref{Formatting
@@ -15890,7 +15906,7 @@
 command and you can use the @kbd{M-x Info-validate} command.@refill
 
 @menu
-* makeinfo preferred::          @code{makeinfo} finds errors.
+* makeinfo Preferred::          @code{makeinfo} finds errors.
 * Debugging with Info::         How to catch errors with Info formatting.
 * Debugging with TeX::          How to catch errors with @TeX{} formatting.
 * Using texinfo-show-structure::  How to use @code{texinfo-show-structure}.
@@ -15898,7 +15914,7 @@
 * Running Info-Validate::       How to find badly referenced nodes.
 @end menu
 
-@node makeinfo preferred, Debugging with Info, Catching Mistakes, Catching Mistakes
+@node makeinfo Preferred, Debugging with Info, Catching Mistakes, Catching Mistakes
 @ifinfo
 @heading @code{makeinfo} Find Errors
 @end ifinfo
@@ -15917,7 +15933,7 @@
 cannot use @code{makeinfo}, or your problem is very puzzling, then you
 may want to use the tools described in this appendix.@refill
 
-@node Debugging with Info, Debugging with TeX, makeinfo preferred, Catching Mistakes
+@node Debugging with Info, Debugging with TeX, makeinfo Preferred, Catching Mistakes
 @comment  node-name,  next,  previous,  up
 @appendixsec Catching Errors with Info Formatting
 @cindex Catching errors with Info formatting
--- a/man/viper.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/viper.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -14,12 +14,12 @@
 
 @titlepage
 @title Viper Is a Package for Emacs Rebels
-@subtitle a Vi emulator for GNU Emacs 19 and XEmacs 19
-@subtitle July 1997, Viper Version 2.95
-
+@subtitle a Vi emulator for GNU Emacs 20 and XEmacs 20
+@subtitle August 1997, Viper Version 2.96
+
+@author Michael Kifer (Viper)
+@author Aamod Sane (VIP 4.4)
 @author Masahiko Sato (VIP 3.5)
-@author Aamod Sane (VIP 4.4)
-@author Michael Kifer (Viper)
 
 @page
 @vskip 0pt plus 1fill
@@ -63,13 +63,17 @@
 and/or a venomous VI PERil.
 @end example
 
-Technically speaking, Viper is a Vi emulation package for GNU Emacs 19 and
-XEmacs 19. Because of its reliance on minor mode keymaps, Viper will not
-work under Emacs 18. Viper implements most Vi and Ex commands. It gives you
-the best of both worlds: Vi keystrokes for editing combined with the GNU
-Emacs environment. Viper also fixes some common complaints with Vi
-commands.  This manual describes Viper, concentrating on the differences
-from Vi and new features of Viper.
+Technically speaking, Viper is a Vi emulation package for GNU Emacs and
+XEmacs. It implements all Vi and Ex commands, occasionally improving on
+them and adding many new features. It gives the user the best of both
+worlds: Vi keystrokes for editing combined with the power of Emacs environment.
+
+Viper emulates Vi at several levels, from the one that closely follows Vi
+conventions to the one that departs from many of them. It has many
+customizable options, which can be used to tailor Viper to the work habits
+of various users.
+This manual describes Viper, concentrating on the differences from Vi and
+new features of Viper.
 
 Viper, formerly known as VIP-19, was written by Michael Kifer.  It is based
 on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by Aamod Sane.
@@ -119,13 +123,12 @@
 and/or a venomous VI PERil.
 @end example
 
-Viper is a Vi emulation package for GNU Emacs 19 and XEmacs 19. Because of
-its reliance on minor mode keymaps, it will not work under Emacs 18. Viper
-contains virtually all of Vi and Ex functionality and much more. It gives
-you the best of both worlds: Vi keystrokes for editing combined with the
-GNU Emacs environment. Viper also fixes some common complaints with Vi
-commands.  This manual describes Viper, concentrating on the differences
-from Vi and on the new features of Viper.
+Viper is a Vi emulation package for GNU Emacs 20 and XEmacs 20.  Viper
+contains virtually all of Vi and Ex functionality and much more. It
+gives you the best of both worlds: Vi keystrokes for editing combined
+with the GNU Emacs environment. Viper also fixes some common complaints
+with Vi commands.  This manual describes Viper, concentrating on the
+differences from Vi and on the new features of Viper.
 
 Viper was written by Michael Kifer.  It is based on VIP version 3.5 by
 Masahiko Sato and VIP version 4.4 by Aamod Sane.  Viper tries to be
@@ -264,12 +267,13 @@
 will be executed. @xref{Major Modes,Major Modes,Major Modes,emacs,The
 GNU Emacs Manual}, for more information.@refill
 
-A buffer can also have a @dfn{minor mode}. Minor modes are options that you
-can use or not. A buffer in @code{text-mode} can have @code{auto-fill-mode}
-as minor mode, which can be turned off or on at any time. In Emacs 19, a
-minor mode may have it own keymap, which overrides the local keymap when
-the minor mode is turned on.  For more information, @pxref{Minor
-Modes,Minor Modes,Minor Modes,emacs,The GNU Emacs Manual} @refill
+A buffer can also have a @dfn{minor mode}. Minor modes are options that
+you can use or not. A buffer in @code{text-mode} can have
+@code{auto-fill-mode} as minor mode, which can be turned off or on at
+any time. In Emacs, a minor mode may have it own keymap,
+which overrides the local keymap when the minor mode is turned on.  For
+more information, @pxref{Minor Modes,Minor Modes,Minor Modes,emacs,The
+GNU Emacs Manual} @refill
 
 @cindex Viper as minor mode
 @cindex Control keys
@@ -323,7 +327,7 @@
 (@xref{Vi State}, for the explanation of Vi command state.)
 
 The location of Viper customization file can be changed by setting the
-variable @code{vip-custom-file-name} in @file{.emacs} @emph{prior} to loading
+variable @code{viper-custom-file-name} in @file{.emacs} @emph{prior} to loading
 Viper.
 
 Once invoked, Viper will arrange to bring up Emacs buffers in Vi state
@@ -349,7 +353,8 @@
 
 Finally, if at some point you would want to get de-Viperize your running
 copy of Emacs after Viper has been loaded, the command @kbd{M-x
-viper-go-away} will do it for you.
+viper-go-away} will do it for you. The function @code{toggle-viper-mode}
+toggles Viperization of Emacs on and off.
 
 @node States in Viper, The Minibuffer, Loading Viper,Overview
 @section States in Viper
@@ -363,6 +368,7 @@
 @cindex Replace state
 @cindex Ex commands
 @findex @code{viper-go-away}
+@findex @code{toggle-viper-mode}
 
 Viper has four states, Emacs, Vi, Insert, and Replace.
 
@@ -519,7 +525,7 @@
 @samp{[]} brackets framing the modes on the mode line.
 @xref{Recursive Edit,Recursive
 Edit,Recursive Edit,emacs,The GNU Emacs Manual}.
-At user level 1, @kbd{C-g} is bound to @code{vip-info-on-file}
+At user level 1, @kbd{C-g} is bound to @code{viper-info-on-file}
 function instead.
 @refill
 @item C-\
@@ -546,7 +552,7 @@
 @kbd{u} will undo. Undo can be repeated by the @kbd{.} key. Undo itself
 can be undone. Another @kbd{u} will change the direction. The presence
 of repeatable undo means that @kbd{U}, undoing lines, is not very
-important. Therefore, @kbd{U} also calls @code{vip-undo}.
+important. Therefore, @kbd{U} also calls @code{viper-undo}.
 @cindex multiple undo
 @cindex undo
 
@@ -563,7 +569,7 @@
 GNU Emacs Manual}, for details.
 Files specified to @kbd{:e} use @code{csh} regular expressions
 (globbing, wildcards, what have you).
-However, the function @code{vip-toggle-search-style}, bound to @kbd{C-c /},
+However, the function @code{viper-toggle-search-style}, bound to @kbd{C-c /},
 lets the user switch from search with regular expressions to plain vanilla
 search and vice versa. It also lets one switch from case-sensitive search
 to case-insensitive and back.
@@ -760,7 +766,7 @@
 Initially, the Minibuffer comes up in Insert state.
 
 Some users prefer plain Emacs bindings in the Minibuffer. To this end, set
-@code{vip-vi-style-in-minibuffer} to @code{nil} in @file{.viper}.
+@code{viper-vi-style-in-minibuffer} to @code{nil} in @file{.viper}.
 @xref{Customization}, to learn how to do this.
 
 When the Minibuffer changes Viper states, you will notice that the appearance
@@ -1101,20 +1107,20 @@
 under the cursor. You have to turn this on in @file{.viper} either by calling
 
 @example
-(vip-buffer-search-enable)
+(viper-buffer-search-enable)
 @end example
 
 @noindent
-or by setting @code{vip-buffer-search-char} to, say, @kbd{f3}:
+or by setting @code{viper-buffer-search-char} to, say, @kbd{f3}:
 @example
-(setq vip-buffer-search-char [f3])
+(setq viper-buffer-search-char [f3])
 @end example
 
 @noindent
-If the user calls @code{vip-buffer-search-enable} explicitly (the first
-method), then @code{vip-buffer-search-char} will be set to @kbd{g}.
+If the user calls @code{viper-buffer-search-enable} explicitly (the first
+method), then @code{viper-buffer-search-char} will be set to @kbd{g}.
 Regardless of how this feature is enabled, the key
-@code{vip-buffer-search-char} will take movement commands, like
+@code{viper-buffer-search-char} will take movement commands, like
 @kbd{w,/,e}, to find a region and then search for the contents of that
 region. This command is very useful for searching for variable names, etc.,
 in a program. The search can be repeated by @kbd{n} or reversed by @kbd{N}.
@@ -1142,18 +1148,21 @@
 Finally, on a window display, Viper highlights search patterns as it finds
 them. This is done through what is known as @emph{faces} in Emacs. The
 variable that controls how search patterns are highlighted is
-@code{vip-search-face}. 
-If you don't want any highlighting at all, put
+@code{viper-search-face}.  If you don't want any highlighting at all, put
 @example
-(setq vip-search-face 'default)
+(copy-face 'default 'viper-search-face)
 @end example
-@vindex @code{vip-search-face}
+@vindex @code{viper-search-face}
 @noindent
 in @file{~/.viper}. If you want to change how patterns are highlighted, you
-will have to set the variable @code{vip-search-face} to some other face,
-such as @code{highlight}. If none of the existing faces fits the bill, you
-would have to create your own. Further details on faces can be found
-in the Emacs Lisp Manual.
+will have to change @code{viper-search-face} to your liking.  The easiest
+way to do this is to use Emacs customization widget, which is accessible
+from the menubar.  Viper customization group is located under the
+@emph{Emulations} customization group, which in turn is under the
+@emph{Editing} group.  All Viper faces are grouped together under Viper's
+@emph{Highlighting} group.
+
+Try it: it is really simple!
 
 @node Abbreviation Facilities,Movement and Markers,Improved Search,Improvements over Vi
 @section Abbreviation Facilities
@@ -1191,7 +1200,7 @@
 contains
 
 @example
-@code{(setq vip-ex-style-motion nil)}
+@code{(setq viper-ex-style-motion nil)}
 @end example
 
 @noindent
@@ -1200,13 +1209,13 @@
 The keys @kbd{x} and @kbd{%} will still work correctly, i.e., as if they
 were on the last character.
 
-@vindex @code{vip-syntax-preference}
+@vindex @code{viper-syntax-preference}
 @cindex syntax table
 
 The word-movement commands @kbd{w}, @kbd{e}, etc., and the associated
 deletion/yanking commands, @kbd{dw}, @kbd{yw}, etc., can be made to
 understand Emacs syntax tables. If the variable
-@code{vip-syntax-preference} is set to @code{strict-vi} (the default) then
+@code{viper-syntax-preference} is set to @code{strict-vi} (the default) then
 the meaning of @emph{word} is the same as in
 Vi. However, if the value is @code{reformed-vi} then the alphanumeric
 symbols will be those specified by the current Emacs syntax table (which
@@ -1214,27 +1223,27 @@
 @kbd{_}. The user can also specify the value @code{emacs}, which would
 make Viper use exactly the Emacs notion of word. In particular, the
 underscore may not be part of a word. Finally, if
-@code{vip-syntax-preference} is set to @code{extended}, Viper words would
+@code{viper-syntax-preference} is set to @code{extended}, Viper words would
 consist of characters that are classified as alphanumeric @emph{or} as
 parts of symbols. This is convenient for writing programs and in many other
 situations.
 
-@code{vip-syntax-preference} is a local variable, so it can have different
+@code{viper-syntax-preference} is a local variable, so it can have different
 values for different major modes. For instance, in programming modes it can
 have the value @code{extended}. In text modes where words contain special
 characters, such as European (non-English) letters, Cyrillic letters, etc.,
 the value can be @code{reformed-vi} or @code{emacs}.
 
-Changes to @code{vip-syntax-preference} should be done in the hooks to
+Changes to @code{viper-syntax-preference} should be done in the hooks to
 various major modes. Furthermore, for these changes to take effect, you
-should execute @code{(vip-update-alphanumeric-class)} right after changing
-the value of @code{vip-syntax-preference}.
+should execute @code{(viper-update-alphanumeric-class)} right after changing
+the value of @code{viper-syntax-preference}.
 
 The above discussion of the meaning of Viper's words concerns only Viper's
 movement commands. In regular expressions, words remain the same as in
 Emacs.  That is, the expressions @code{\w}, @code{\>}, @code{\<}, etc., use
 Emacs' idea of what is a word, and they don't look into the value of
-variable @code{vip-syntax-preference}. This is because Viper doesn't change
+variable @code{viper-syntax-preference}. This is because Viper doesn't change
 syntax tables in fear of upsetting the various major modes that set these
 tables.
 
@@ -1262,7 +1271,7 @@
 to temporarily escape to Emacs and execute a command from the current
 major mode.
 @key{ESC} will do the same, if
-you configure @key{ESC} as Meta by setting @code{vip-no-multiple-ESC} to nil
+you configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to nil
 in @file{.viper}. @xref{Customization}. @kbd{C-\}
 in Insert or Vi states will make Emacs think @kbd{Meta} has been hit.@refill
 @item \
@@ -1274,7 +1283,7 @@
 @cindex query replace
 @kbd{Q} is for query replace.  By default,
 each string to be replaced is treated as a regular expression. You can use
-@code{(setq vip-re-query-replace nil)} in your @file{.emacs} file to
+@code{(setq viper-re-query-replace nil)} in your @file{.emacs} file to
 turn this off. (For normal searches, @kbd{:se nomagic} will work. Note
 that @kbd{:se nomagic} turns Regexps off completely, unlike Vi).
 @item v
@@ -1311,17 +1320,17 @@
 @item # g
 @kindex @kbd{#g<move>}
 Execute last keyboard macro for each line in the region
-(@code{vip-global-execute}).@refill
+(@code{viper-global-execute}).@refill
 @item # q
 @kindex @kbd{#q<move>}
 Insert specified string at the beginning of each line in the region
-(@code{vip-quote-region}).
+(@code{viper-quote-region}).
 @item # s
 @kindex @kbd{#s<move>}
 Check spelling of words in the region (@code{spell-region}).
 The function used for spelling is determined from the variable
-@code{vip-spell-function}.
-@vindex @code{vip-spell-function}
+@code{viper-spell-function}.
+@vindex @code{viper-spell-function}
 @item *
 @kindex @kbd{*}
 Call last keyboard macro.
@@ -1467,7 +1476,7 @@
 @end table
 
 The packages, below, represents a drop in the sea of special-purpose
-packages that come with standard distribution of Emacs 19.
+packages that come with standard distribution of Emacs.
 
 @table @samp
 @item Transparent FTP
@@ -1486,8 +1495,6 @@
 @code{dired.el} for editing contents of directories and for navigating in
 the file system.
 @item Syntactic Highlighting
-@cindex hilit19
-@pindex hilit19.el
 @cindex font-lock
 @pindex font-lock.el
 @code{font-lock.el} for automatic highlighting various parts of a buffer 
@@ -1532,7 +1539,7 @@
 Elisp code in your @file{.emacs} file before and after the @code{(require
 'viper)} line. This method is not recommended, unless you know what you are
 doing. Only two variables, @code{viper-mode} and
-@code{vip-custom-file-name} are supposed to be customized in @file{.emacs},
+@code{viper-custom-file-name} are supposed to be customized in @file{.emacs},
 prior to loading Viper.@refill
 @end itemize
 
@@ -1542,7 +1549,7 @@
 "Emulations". The customization widget is self-explanatory.  Once you are
 satisfied with your changes, save them into a file and then include the
 contents of that file in the Viper customization repository, @file{.viper}
-(except for @code{viper-mode} and @code{vip-custom-file-name}, which are
+(except for @code{viper-mode} and @code{viper-custom-file-name}, which are
 supposed to go into @code{.emacs}).
 
 Some advanced customization cannot be accomplished this way, however, and
@@ -1584,21 +1591,21 @@
 To get the full list of Vi variables, type @kbd{:se @key{SPC} @key{TAB}}.
 
 @table @code
-@item vip-auto-indent nil
+@item viper-auto-indent nil
 @itemx :se ai (:se autoindent)
 @itemx :se ai-g (:se autoindent-global)
 If @code{t}, enable auto indentation.
 by @key{RET}, @kbd{o} or @kbd{O} command.
 
-@code{vip-auto-indent} is a local variable. To change the value globally, use
+@code{viper-auto-indent} is a local variable. To change the value globally, use
 @code{setq-default}. It may be useful for certain major modes to have their
-own values of @code{vip-auto-indent}. This can be achieved by using
+own values of @code{viper-auto-indent}. This can be achieved by using
 @code{setq} to change the local value of this variable in the hooks to the
 appropriate major modes.
 
-@kbd{:se ai} changes the value of @code{vip-auto-indent} in the current
+@kbd{:se ai} changes the value of @code{viper-auto-indent} in the current
 buffer only; @kbd{:se ai-g} does the same globally.
-@item vip-electric-mode t
+@item viper-electric-mode t
 If not @code{nil}, auto-indentation becomes electric, which means that
 @key{RET}, @kbd{O}, and @kbd{o} indent cursor according to the current
 major mode. In the future, this variable may control additional electric
@@ -1607,11 +1614,11 @@
 This is a local variable: @code{setq} changes the value of this variable
 in the current buffer only. Use @code{setq-default} to change the value in
 all buffers.
-@item vip-case-fold-search nil
+@item viper-case-fold-search nil
 @itemx :se ic (:se ignorecase)
 If not @code{nil}, search ignores cases.
 This can also be toggled by quickly hitting @kbd{/} twice.
-@item vip-re-search nil
+@item viper-re-search nil
 @itemx :se magic
 If not @code{nil}, search will use regular expressions; if @code{nil} then
 use vanilla search.
@@ -1642,40 +1649,40 @@
 doesn't insert the tab, since this key is usually bound to 
 a text-formatting function, @code{indent-for-tab-command} (which facilitates
 programming and document writing). Instead, the tab is inserted via the
-command @code{vip-insert-tab}, which is bound to @kbd{S-tab} (shift + tab).
+command @code{viper-insert-tab}, which is bound to @kbd{S-tab} (shift + tab).
 
 On some non-windowing terminals, Shift doesn't modify the @key{TAB} key, so
 @kbd{S-tab} behaves as if it were @key{TAB}. In such a case, you will have
-to bind @code{vip-insert-tab} to some other convenient key.
-
-@item vip-shift-width 8
+to bind @code{viper-insert-tab} to some other convenient key.
+
+@item viper-shift-width 8
 @itemx :se sw=value  (:se shiftwidth=value)
 The number of columns shifted by @kbd{>} and @kbd{<} commands.
-@item vip-search-wrap-around t
+@item viper-search-wrap-around t
 @itemx :se ws (:se wrapscan)
 If not @code{nil}, search wraps around the end/beginning of buffer.
-@item vip-search-scroll-threshold 2
+@item viper-search-scroll-threshold 2
 If search lands within this many lines of the window top or bottom, the
 window will be scrolled up or down by about 1/7-th of its size, to reveal
 the context. If the value is negative---don't scroll.
-@item vip-tags-file-name "TAGS"
+@item viper-tags-file-name "TAGS"
 The name of the file used as the tag table.
-@item vip-re-query-replace nil
+@item viper-re-query-replace nil
 If not @code{nil}, use reg-exp replace in query replace.
-@item vip-want-ctl-h-help nil
+@item viper-want-ctl-h-help nil
 If not @code{nil}, @kbd{C-h} is bound to @code{help-command};
 if @code{nil}, it is bound to @code{delete-backward-char}.
-@item vip-vi-style-in-minibuffer t
+@item viper-vi-style-in-minibuffer t
 If not @code{nil}, Viper provides a high degree of compatibility with Vi
 insert mode when you type text in the Minibuffer; if @code{nil}, typing in
 the Minibuffer feels like plain Emacs.
-@item vip-no-multiple-ESC t
+@item viper-no-multiple-ESC t
 If you set this to @code{nil}, you can use @key{ESC} as Meta in Vi state.
 Normally, this is not necessary, since graphical displays have separate
 Meta keys (usually on each side of the space bar). On a dumb terminal, Viper
 sets this variable to @code{twice}, which is almost like @code{nil}, except
 that double @key{ESC} beeps. This, too, lets @key{ESC} to be used as a Meta.
-@item vip-ESC-keyseq-timeout 200 on tty, 0 on windowing display
+@item viper-ESC-keyseq-timeout 200 on tty, 0 on windowing display
 Escape key sequences separated by this much delay (in miliseconds) are
 interpreted as command, ignoring the special meaning of @key{ESC} in
 VI. The default is suitable for most terminals. However, if your terminal
@@ -1684,21 +1691,21 @@
 arrow keys are interpreted as separately typed characters (and thus the
 arrow keys won't work).  Making this value too large will slow you down, so
 exercise restraint.
-@item vip-fast-keyseq-timeout 200
+@item viper-fast-keyseq-timeout 200
 Key sequences separated by this many miliseconds are treated as Vi-style
 keyboard macros. If the key sequence is defined as such a macro, it will be
 executed. Otherwise, it is processed as an ordinary sequence of typed keys.
 
 Setting this variable too high may slow down your typing. Setting it too
 low may make it hard to type macros quickly enough.
-@item vip-ex-style-motion t
+@item viper-ex-style-motion t
 Set this to @code{nil}, if you want @kbd{l,h} to cross
 lines, etc. @xref{Movement and Markers}, for more info.
-@item vip-ex-style-editing-in-insert t
+@item viper-ex-style-editing-in-insert t
 Set this to to @code{nil}, if you want 
 @kbd{C-h} and @key{DEL} to not stop
 at the beginning of a line in Insert state.
-@item vip-ESC-moves-cursor-back t
+@item viper-ESC-moves-cursor-back t
 It t, cursor moves back 1 character when switching from insert state to vi
 state. If nil, the cursor stays where it was before the switch.
 @item viper-always t
@@ -1707,51 +1714,51 @@
 Insert state, or Emacs state. This heuristics works well in virtually all
 cases. @code{nil} means you either has to invoke @code{viper-mode} manually
 for each buffer (or you can add @code{viper-mode} to the appropriate major mode
-hooks using @code{vip-load-hook}).
+hooks using @code{viper-load-hook}).
 
 This option must be set in the file @file{~/.viper}.
-@item vip-custom-file-name "~/.viper"
+@item viper-custom-file-name "~/.viper"
 File used for Viper-specific customization.
 Change this setting, if you want. Must be set in @file{.emacs} (not @file{.viper}!)
 before Viper is loaded. Note that you 
 have to set it as a string inside double quotes.
-@item vip-spell-function 'ispell-region
+@item viper-spell-function 'ispell-region
 Function used by the command @kbd{#c<move>} to spell.
 @item ex-nontrivial-find-file-function
 The value of this variable is the function used to find all files that
 match a wildcard. This is usually done when the user types @kbd{:e} and
 specifies a wildcard in the file name (or if the file name contains unusual
 symbols (e.g., a space). Viper provides two functions for this: one for
-Unix-like systems (@code{vip-ex-nontrivial-find-file-unix}) and one for
-DOS, W95, and NT (@code{vip-ex-nontrivial-find-file-ms}). If the default
+Unix-like systems (@code{viper-ex-nontrivial-find-file-unix}) and one for
+DOS, W95, and NT (@code{viper-ex-nontrivial-find-file-ms}). If the default
 function doesn't quite do what you expect or if you prefer to use ``fancy''
 shells, you may have to write your own version of this function and make it
 into the value of @code{ex-nontrivial-find-file-function}.  Use
-@code{vip-ex-nontrivial-find-file-unix} and
-@code{vip-ex-nontrivial-find-file-ms} as examples.
+@code{viper-ex-nontrivial-find-file-unix} and
+@code{viper-ex-nontrivial-find-file-ms} as examples.
 @vindex @code{ex-nontrivial-find-file-function}.
-@findex @code{vip-ex-nontrivial-find-file-ms}
-@findex @code{vip-ex-nontrivial-find-file-unix}
+@findex @code{viper-ex-nontrivial-find-file-ms}
+@findex @code{viper-ex-nontrivial-find-file-unix}
 @item ex-cycle-other-window t
 If not @code{nil}, @kbd{:n} and @kbd{:b} will cycle through files in another
 window, if one exists.
 @item ex-cycle-through-non-files nil
 @kbd{:n} does not normally cycle through buffers. Set this to get
 buffers also.
-@item vip-automatic-iso-accents nil
+@item viper-automatic-iso-accents nil
 If @kbd{t}, ISO accents will be turned on in insert/replace Viper states
 and turned off in Vi state. This is useful for editing text in European
 languages. This variable is buffer-local. If used, it should be set in the
 hooks to the appropriate major modes (usually setting it in
 @code{text-mode-hook} is enough).
-@item vip-want-emacs-keys-in-insert 
+@item viper-want-emacs-keys-in-insert 
 This is set to @code{nil} for user levels 1 and 2 and to @code{t} for user
 levels 3 and 4. Users who specify level 5 are allowed to set this variable
 as they please (the default for this level is @code{t}). If set to
 @code{nil}, complete Vi compatibility is provided in Insert state. This is
 really not recommended, as this precludes you from using language-specific
 features provided by the major modes.
-@item vip-want-emacs-keys-in-vi
+@item viper-want-emacs-keys-in-vi
 This is set to @code{nil} for user
 level 1 and to @code{t} for user levels 2--4.
 At level 5, users are allowed to set this variable as they please (the
@@ -1760,85 +1767,78 @@
 in Vi command state. Setting this to @code{nil} is really a bad idea,
 unless you are a novice, as this precludes the use
 of language-specific features provided by the major modes.
-@item vip-keep-point-on-repeat t
+@item viper-keep-point-on-repeat t
 If not @code{nil}, point is not moved when the user repeats the previous
 command by typing `.'  This is very useful for doing repeated changes with
 the @kbd{.} key.
-@item vip-repeat-from-history-key 'f12
+@item viper-repeat-from-history-key 'f12
 Prefix key used to invoke the macros @kbd{f12 1} and @kbd{f12 2} that repeat
 the second-last and the third-last destructive command.
 Both these macros are bound (as Viper macros) to
-@code{vip-repeat-from-history},
+@code{viper-repeat-from-history},
 which checks the second key by which it is invoked to see which of the
 previous commands to invoke. Viper binds @kbd{f12 1} and @kbd{f12 2} only,
 but the user can bind more in @file{~/.viper}. @xref{Vi Macros}, for how to do
 this.
-@item vip-keep-point-on-undo nil
+@item viper-keep-point-on-undo nil
 If not @code{nil}, Viper tries to not move point when undoing commands.
 Instead, it will briefly move the cursor to the place where change has
 taken place. However, if the undone piece of text is not seen in window,
 then point will be moved to the place where the change took place.
 Set it to @code{t} and see if you like it better.
-@item vip-delete-backwards-in-replace nil
+@item viper-delete-backwards-in-replace nil
 If not @code{nil}, @key{DEL} key will delete characters while moving the cursor
 backwards.  If @code{nil}, the cursor will move backwards without deleting
 anything.
-@item vip-replace-overlay-face 'vip-replace-overlay-face
-@itemx vip-replace-overlay-pixmap "grey3"
+@item viper-replace-overlay-face 'viper-replace-overlay-face
 On a graphical display, Viper highlights replacement regions instead of
 putting a @samp{$} at the end. This variable controls the so called
 @dfn{face} used to highlight the region. 
 
-By default, @code{vip-replace-overlay-face} underlines the replacement on
-monochrome displays and also lays a pixmap over them (as specified in the
-variable @code{vip-replace-overlay-pixmap}.  On color displays, replacement
-regions are highlighted with color.
+By default, @code{viper-replace-overlay-face} underlines the replacement on
+monochrome displays and also lays a stipple over them.  On color displays,
+replacement regions are highlighted with color.
 
 If you know something about Emacs faces and don't like how Viper highlights
-replacement regions, you can change @code{vip-replace-overlay-face} by
+replacement regions, you can change @code{viper-replace-overlay-face} by
 specifying a new face. (Emacs faces are described in the Emacs Lisp
 reference.)  On a color display, the following customization method is
 usually most effective:
 @example
-(set-face-foreground vip-replace-overlay-face "DarkSlateBlue")
-(set-face-background vip-replace-overlay-face "yellow")
+(set-face-foreground viper-replace-overlay-face "DarkSlateBlue")
+(set-face-background viper-replace-overlay-face "yellow")
 @end example
 For a complete list of colors available to you, evaluate the expression
 @code{(x-defined-colors)}. (Type it in the buffer @code{*scratch*} and then
 hit the @kbd{C-j} key.
 
-On a monochrome display, you can change the value of the variable
-@code{vip-replace-overlay-pixmap} to specify the pixmap of your choice
-(which should be a string denoting the file name of the pixmap).  Emacs
-takes pixmaps from the directory specified in the variable
-@code{x-bitmap-file-path}.
-@item vip-replace-overlay-cursor-color  "Red"
-@vindex @code{vip-replace-overlay-cursor-color}
+@item viper-replace-overlay-cursor-color  "Red"
+@vindex @code{viper-replace-overlay-cursor-color}
 Cursor color when it is inside the replacement region.
 This has effect only on color displays and only when Emacs runs as an X
 application.
-@item vip-insert-state-cursor-color nil
-@vindex @code{vip-insert-state-cursor-color}
+@item viper-insert-state-cursor-color nil
+@vindex @code{viper-insert-state-cursor-color}
 If set to a valid color, this will be the cursor color when Viper is in
 insert state.
-@item vip-replace-region-end-delimiter "$"
+@item viper-replace-region-end-delimiter "$"
 A string used to mark the end of replacement regions.  It is used only on
-TTYs or if @code{vip-use-replace-region-delimiters} is non-nil.
-@item vip-replace-region-start-delimiter  ""
+TTYs or if @code{viper-use-replace-region-delimiters} is non-nil.
+@item viper-replace-region-start-delimiter  ""
 A string used to mark the beginning of replacement regions.  It is used
-only on TTYs or if @code{vip-use-replace-region-delimiters} is non-nil.
-@item vip-use-replace-region-delimiters
-If non-nil, Viper will always use @code{vip-replace-region-end-delimiter} and
-@code{vip-replace-region-start-delimiter} to delimit replacement regions,
+only on TTYs or if @code{viper-use-replace-region-delimiters} is non-nil.
+@item viper-use-replace-region-delimiters
+If non-nil, Viper will always use @code{viper-replace-region-end-delimiter} and
+@code{viper-replace-region-start-delimiter} to delimit replacement regions,
 even on color displays (where this is unnecessary). By default, this
 variable is non-nil only on TTYs or monochrome displays.
-@item vip-allow-multiline-replace-regions t
+@item viper-allow-multiline-replace-regions t
 If non-nil, multi-line text replacement regions, such as those produced by
 commands @kbd{c55w}, @kbd{3C}, etc., will stay around until the user exits
 the replacement mode. In this variable is set to @code{nil}, Viper will
 emulate the standard Vi behavior, which supports only intra-line
 replacement regions (and multi-line replacement regions are deleted).
-@item vip-toggle-key "\C-z"
+@item viper-toggle-key "\C-z"
 Specifies the key used to switch from Emacs to Vi and back.
 Must be set in @file{.viper}. This variable can't be
 changed interactively after Viper is loaded.
@@ -1846,31 +1846,31 @@
 In Insert state, this key acts as a temporary escape to Vi state, i.e., it
 will set Viper up so that the very next command will be executed as if it
 were typed in Vi state.
-@item vip-ESC-key "\e"
+@item viper-ESC-key "\e"
 Specifies the key used to escape from Insert/Replace states to Vi.
 Must be set in @file{.viper}. This variable cannot be
 changed interactively after Viper is loaded.
-@item vip-buffer-search-char nil
+@item viper-buffer-search-char nil
 Key used for buffer search. @xref{Viper Specials}, for details.
-@item vip-surrounding-word-function 'vip-surrounding-word
+@item viper-surrounding-word-function 'viper-surrounding-word
 The value of this variable is a function name that is used to determine
 what constitutes a word clicked upon by the mouse. This is used by mouse
 search and insert.
-@item vip-search-face 'vip-search-face
+@item viper-search-face 'viper-search-face
 Variable that controls how search patterns are highlighted when they are
 found.
-@item vip-vi-state-hook nil
+@item viper-vi-state-hook nil
 List of parameterless functions to be run just after entering the Vi
 command state.
-@item vip-insert-state-hook nil
+@item viper-insert-state-hook nil
 Same for Insert state. This hook is also run after entering Replace state.
-@item vip-replace-state-hook  nil
+@item viper-replace-state-hook  nil
 List of (parameterless) functions called just after entering Replace state
-(and after all @code{vip-insert-state-hook}).
-@item vip-emacs-state-hook nil
+(and after all @code{viper-insert-state-hook}).
+@item viper-emacs-state-hook nil
 List of (parameterless) functions called just after switching from Vi state
 to Emacs state.
-@item vip-load-hook nil
+@item viper-load-hook nil
 List of (parameterless) functions called just after loading Viper. This is
 the last chance to do customization before Viper is up and running.
 @end table
@@ -1879,51 +1879,50 @@
 (when so indicated in the table).  Or you
 can include a line like this in your @file{.viper} file:
 @example
-(setq vip-case-fold-search t)
+(setq viper-case-fold-search t)
 @end example
-@vindex @code{vip-auto-indent}
-@vindex @code{vip-electric-mode}
-@vindex @code{vip-case-fold-search}
-@vindex @code{vip-re-search}
-@vindex @code{vip-shift-width}
+@vindex @code{viper-auto-indent}
+@vindex @code{viper-electric-mode}
+@vindex @code{viper-case-fold-search}
+@vindex @code{viper-re-search}
+@vindex @code{viper-shift-width}
 @vindex @code{buffer-read-only}
-@vindex @code{vip-search-wrap-around}
-@vindex @code{vip-search-scroll-threshold}
-@vindex @code{vip-search-face}
-@vindex @code{vip-tags-file-name}
-@vindex @code{vip-re-query-replace}
-@vindex @code{vip-want-ctl-h-help}
-@vindex @code{vip-vi-style-in-minibuffer}
-@vindex @code{vip-no-multiple-ESC}
+@vindex @code{viper-search-wrap-around}
+@vindex @code{viper-search-scroll-threshold}
+@vindex @code{viper-search-face}
+@vindex @code{viper-tags-file-name}
+@vindex @code{viper-re-query-replace}
+@vindex @code{viper-want-ctl-h-help}
+@vindex @code{viper-vi-style-in-minibuffer}
+@vindex @code{viper-no-multiple-ESC}
 @vindex @code{viper-always}
-@vindex @code{vip-ESC-keyseq-timeout}
-@vindex @code{vip-fast-keyseq-timeout}
-@vindex @code{vip-ex-style-motion}
-@vindex @code{vip-ex-style-editing-in-insert}
-@vindex @code{vip-ESC-moves-cursor-back}
-@vindex @code{vip-custom-file-name}
-@vindex @code{vip-spell-function}
+@vindex @code{viper-ESC-keyseq-timeout}
+@vindex @code{viper-fast-keyseq-timeout}
+@vindex @code{viper-ex-style-motion}
+@vindex @code{viper-ex-style-editing-in-insert}
+@vindex @code{viper-ESC-moves-cursor-back}
+@vindex @code{viper-custom-file-name}
+@vindex @code{viper-spell-function}
 @vindex @code{ex-cycle-other-window}
 @vindex @code{ex-cycle-through-non-files}
-@vindex @code{vip-automatic-iso-accents}
-@vindex @code{vip-want-emacs-keys-in-insert}
-@vindex @code{vip-want-emacs-keys-in-vi}
-@vindex @code{vip-keep-point-on-repeat}
-@vindex @code{vip-keep-point-on-undo}
-@vindex @code{vip-delete-backwards-in-replace}
-@vindex @code{vip-replace-overlay-face}
-@vindex @code{vip-replace-overlay-pixmap}
-@vindex @code{vip-replace-region-end-symbol}
-@vindex @code{vip-replace-region-start-symbol}
-@vindex @code{vip-allow-multiline-replace-regions}
-@vindex @code{vip-toggle-key}
-@vindex @code{vip-ESC-key}
-@vindex @code{vip-buffer-search-char}
-@vindex @code{vip-surrounding-word-function}
-@vindex @code{vip-vi-state-hook}
-@vindex @code{vip-insert-state-hook}
-@vindex @code{vip-replace-state-hook}
-@vindex @code{vip-emacs-state-hook}
+@vindex @code{viper-automatic-iso-accents}
+@vindex @code{viper-want-emacs-keys-in-insert}
+@vindex @code{viper-want-emacs-keys-in-vi}
+@vindex @code{viper-keep-point-on-repeat}
+@vindex @code{viper-keep-point-on-undo}
+@vindex @code{viper-delete-backwards-in-replace}
+@vindex @code{viper-replace-overlay-face}
+@vindex @code{viper-replace-region-end-symbol}
+@vindex @code{viper-replace-region-start-symbol}
+@vindex @code{viper-allow-multiline-replace-regions}
+@vindex @code{viper-toggle-key}
+@vindex @code{viper-ESC-key}
+@vindex @code{viper-buffer-search-char}
+@vindex @code{viper-surrounding-word-function}
+@vindex @code{viper-vi-state-hook}
+@vindex @code{viper-insert-state-hook}
+@vindex @code{viper-replace-state-hook}
+@vindex @code{viper-emacs-state-hook}
 
 @node Keybindings, Packages that Change Keymaps, Rudimentary Changes,Customization
 @section Keybindings
@@ -1974,19 +1973,19 @@
 
 Viper users who wish to specify their own key bindings should be concerned
 only with the following three keymaps:
-@code{vip-vi-global-user-map} for Vi state commands,
-@code{vip-insert-global-user-map} for Insert state commands,
-and @code{vip-emacs-global-user-map} for Emacs state commands (note:
-customized bindings for Emacs state made to @code{vip-emacs-global-user-map}
+@code{viper-vi-global-user-map} for Vi state commands,
+@code{viper-insert-global-user-map} for Insert state commands,
+and @code{viper-emacs-global-user-map} for Emacs state commands (note:
+customized bindings for Emacs state made to @code{viper-emacs-global-user-map}
 are @emph{not} inherited by Insert state).
 
 For more information on Viper keymaps, see the header of the file
 @file{viper.el}.
 If you wish to change a Viper binding, you can use the
-@code{define-key} command, to modify @code{vip-vi-global-user-map},
-@code{vip-insert-global-user-map}, and @code{vip-emacs-global-user-map}, as
+@code{define-key} command, to modify @code{viper-vi-global-user-map},
+@code{viper-insert-global-user-map}, and @code{viper-emacs-global-user-map}, as
 explained below. Each of these key maps affects the corresponding Viper state. 
-The keymap @code{vip-vi-global-user-map} also affects Viper's Replace state.
+The keymap @code{viper-vi-global-user-map} also affects Viper's Replace state.
 
 @noindent
 If you want to
@@ -1994,13 +1993,13 @@
 page down and to make @kbd{0} display information on the current buffer,
 putting this in @file{.viper} will do the trick in Vi state:
 @example
-(define-key vip-vi-global-user-map "\C-v" 'scroll-down)
+(define-key viper-vi-global-user-map "\C-v" 'scroll-down)
 @end example
 @noindent
 To set a key globally, 
 @example
-(define-key vip-emacs-global-user-map "\C-c m" 'smail)
-(define-key vip-vi-global-user-map "0" 'vip-info-on-file)
+(define-key viper-emacs-global-user-map "\C-c m" 'smail)
+(define-key viper-vi-global-user-map "0" 'viper-info-on-file)
 @end example
 @noindent
 Note, however, that this binding may be overwritten by other keymaps, since
@@ -2008,12 +2007,12 @@
 To make sure that nothing will override a binding in Emacs state, you
 can write this:
 @example
-(define-key vip-emacs-global-user-map "\C-c m" 'smail)
+(define-key viper-emacs-global-user-map "\C-c m" 'smail)
 @end example
 @noindent
 To customize the binding for @kbd{C-h} in Insert state:
 @example
-(define-key vip-insert-global-user-map "\C-h" 'my-del-backwards-function)
+(define-key viper-insert-global-user-map "\C-h" 'my-del-backwards-function)
 @end example
 @noindent
 
@@ -2028,15 +2027,15 @@
 Viper users can also change bindings on a per major mode basis.  As with
 global bindings, this can be done separately for each of the three main Viper
 states.  To this end, Viper provides the function
-@code{vip-modify-major-mode}.
-@findex @code{vip-modify-major-mode}
+@code{viper-modify-major-mode}.
+@findex @code{viper-modify-major-mode}
 
 To modify keys in Emacs state for @code{my-favorite-major-mode}, the user
 needs to create a sparse keymap, say, @code{my-fancy-map}, bind whatever
 keys necessary in that keymap, and put
 
 @example
-(vip-modify-major-mode 'dired-mode 'emacs-state my-fancy-map)
+(viper-modify-major-mode 'dired-mode 'emacs-state my-fancy-map)
 @end example
 
 @noindent
@@ -2050,7 +2049,7 @@
 (setq my-dired-modifier-map (make-sparse-keymap))
 (define-key my-dired-modifier-map "dd" 'dired-flag-file-deletion)
 (define-key my-dired-modifier-map "u" 'dired-unmark)
-(vip-modify-major-mode 'dired-mode 'vi-state my-dired-modifier-map)
+(viper-modify-major-mode 'dired-mode 'vi-state my-dired-modifier-map)
 @end example
 
 A Vi purist may want to modify Emacs state under Dired mode so that
@@ -2060,9 +2059,9 @@
 
 @example
 (setq my-dired-vi-purist-map (make-sparse-keymap))
-(define-key my-dired-vi-purist-map "k" 'vip-previous-line)
-(define-key my-dired-vi-purist-map "l" 'vip-forward-char)
-(vip-modify-major-mode 'dired-mode 'emacs-state my-dired-vi-purist-map)
+(define-key my-dired-vi-purist-map "k" 'viper-previous-line)
+(define-key my-dired-vi-purist-map "l" 'viper-forward-char)
+(viper-modify-major-mode 'dired-mode 'emacs-state my-dired-vi-purist-map)
 @end example
 
 Similar effect can be achieved by defining Vi keyboard macros using the
@@ -2077,9 +2076,9 @@
 Note: in major modes that come up in @emph{Emacs state} by default, the
 aforesaid modifications may not take place immediately (but only after the
 buffer switches to some other Viper state and then back to Emacs state).  To
-avoid this, one should add @code{vip-change-state-to-emacs} to an
+avoid this, one should add @code{viper-change-state-to-emacs} to an
 appropriate hook of that major mode. (Check the function
-@code{vip-set-hooks} in @file{viper.el} for examples.)  However, if you
+@code{viper-set-hooks} in @file{viper.el} for examples.)  However, if you
 have set @code{viper-always} to @code{t}, chances are that you won't need to
 perform the above procedure, because Viper will take care of most useful
 defaults.
@@ -2089,12 +2088,12 @@
 bindings, i.e., bindings that are in effect in some specific buffers
 only. Unlike per-mode bindings described above, per-buffer bindings can be
 defined based on considerations other than the major mode.  This is done
-via the function @code{vip-add-local-keys}, which lets one specify bindings
+via the function @code{viper-add-local-keys}, which lets one specify bindings
 that should be in effect in the current buffer only and for a specific Viper
 state. For instance,
 @lisp
-(vip-add-local-keys 'vi-state '(("ZZ" . TeX-command-master) 
-                                ("ZQ" . vip-save-kill-buffer)))
+(viper-add-local-keys 'vi-state '(("ZZ" . TeX-command-master) 
+                                ("ZQ" . viper-save-kill-buffer)))
 @end lisp
 @noindent
 redefines @kbd{ZZ} to invoke @code{TeX-command-master} in @code{vi-state}
@@ -2121,11 +2120,11 @@
 @lisp
 (defun mh-add-vi-keys ()
   "Set up ZZ for MH-e and XMH."
-  (vip-add-local-keys 'vi-state '(("ZZ" . mh-send-letter))))
+  (viper-add-local-keys 'vi-state '(("ZZ" . mh-send-letter))))
 (add-hook 'mh-letter-mode-hook 'mh-add-vi-keys)
 @end lisp
 
-You can also use @code{vip-add-local-keys} to set per buffer
+You can also use @code{viper-add-local-keys} to set per buffer
 bindings in Insert state and Emacs state by passing as a parameter the
 symbols @code{insert-state} and @code{emacs-state}, respectively.
 As with global bindings, customized local bindings done to Emacs state
@@ -2136,7 +2135,7 @@
 @code{shell-mode} redefines @key{RET}). In such a case, exiting the wrong
 major mode won't rid you from unwanted local keys, since these keys are
 local to Viper state and the current buffer, not to the major mode.
-In such situations, the remedy is to type @kbd{M-x vip-zap-local-keys}.
+In such situations, the remedy is to type @kbd{M-x viper-zap-local-keys}.
 
 So much about Viper-specific bindings.
 @xref{Customization,,Customization,emacs,The GNU Emacs
@@ -2144,11 +2143,11 @@
 bindings in Emacs.
 
 @vindex @code{function-key-map}
-@vindex @code{vip-vi-global-user-map}
-@vindex @code{vip-insert-global-user-map}
-@vindex @code{vip-emacs-global-user-map}
-@findex @code{vip-add-local-keys}
-@findex @code{vip-zap-local-keys}
+@vindex @code{viper-vi-global-user-map}
+@vindex @code{viper-insert-global-user-map}
+@vindex @code{viper-emacs-global-user-map}
+@findex @code{viper-add-local-keys}
+@findex @code{viper-zap-local-keys}
 
 @node Packages that Change Keymaps,Viper Specials,Keybindings,Customization
 @subsection Packages that Change Keymaps
@@ -2158,7 +2157,7 @@
 Viper is designed to coexist with all major and minor modes of Emacs. This
 means that bindings set by those modes are generally available with Viper
 (unless you explicitly prohibit them by setting
-@code{vip-want-emacs-keys-in-vi} and @code{vip-want-emacs-keys-in-insert} to 
+@code{viper-want-emacs-keys-in-vi} and @code{viper-want-emacs-keys-in-insert} to 
 @code{nil}). 
 If @code{viper-always} is set to @code{t}, Viper will try to bring each buffer
 in the Viper state that is most appropriate for that buffer.
@@ -2193,7 +2192,7 @@
 
 We should note that on some non-windowing terminals, Shift doesn't modify
 the @key{TAB} key, so @kbd{S-tab} behaves as if it were @key{TAB}. In such
-a case, you will have to bind @code{vip-insert-tab} to some other
+a case, you will have to bind @code{viper-insert-tab} to some other
 convenient key.
 
 Some packages, notably Dired, Gnus, Info, etc., attach special meaning to
@@ -2212,24 +2211,30 @@
 @kbd{C-c \}. (In some of these modes, @kbd{/} and @kbd{:} are bound
 Vi-style, unless these keys perform essential duties.)
 
+If you would like certain major modes to come up in Emacs state rather than
+Vi state (but Viper thinks otherwise), you should put these major modes
+on the @code{viper-non-vi-major-modes} list and also add
+@code{viper-change-state-to-emacs} to these modes' hooks.
+@vindex @code{viper-non-vi-major-modes}
+
 It is also possible to harness some major modes, even though they may bind
 common keys to specialized commands. Harnessing can make sense for modes
 that bind only a small number of common keys.  For instance, if
 @code{viper-always} is set to @code{t} in your @file{~/.viper} file, Viper will
 harness Shell mode by changing the bindings for @kbd{C-m} and @kbd{C-d}
-using @code{vip-add-local-keys} described in section on customization
+using @code{viper-add-local-keys} described in section on customization
 (@xref{Customization}). In general, there is no single recipe for
 harnessing modes. It can be as simple as adding the function
 @code{viper-mode} to a hook associated with the mode, or it can be more
 complex, as in the case of Shell mode and Emerge. Take a look at
-@code{vip-set-hooks} function for some examples.
+@code{viper-set-hooks} function for some examples.
 
 Conversely, it may be the case that most of the major modes harnessed 
-by @code{vip-set-hooks} function fit your working style, except one or two
+by @code{viper-set-hooks} function fit your working style, except one or two
 cases. In this case, you may still be able to set @code{viper-always} to
 @code{t} and then remove a hook that forces Vi command state. For instance,
 to unharness @code{lisp-interaction-mode}, you can execute the following line
-in @code{vip-load-hook}:
+in @code{viper-load-hook}:
 @lisp
 (remove-hook 'lisp-interaction-mode-hook 'viper-mode)
 @end lisp
@@ -2244,10 +2249,10 @@
 @code{nasty-mode.el} interferes with Viper, putting the following in
 @file{.viper} should fix the problem:
 @lisp
-(vip-harness-minor-mode "nasty-mode")
+(viper-harness-minor-mode "nasty-mode")
 @end lisp
 @noindent
-The argument to @code{vip-harness-minor-mode} is the name of the file for the
+The argument to @code{viper-harness-minor-mode} is the name of the file for the
 offending minor mode with the suffixes @file{.el} and @file{.elc} removed.
 
 It may be tricky, however, to find out which minor mode is at fault. The
@@ -2263,12 +2268,12 @@
 suspicion is wrong, no harm is done if you harness a minor mode that
 doesn't need to be harnessed.
 
-@vindex @code{vip-want-emacs-keys-in-vi}
-@vindex @code{vip-want-emacs-keys-in-insert}
+@vindex @code{viper-want-emacs-keys-in-vi}
+@vindex @code{viper-want-emacs-keys-in-insert}
 @vindex @code{viper-always}
-@findex @code{vip-set-hooks}
+@findex @code{viper-set-hooks}
 @findex @code{viper-mode}
-@findex @code{vip-harness-minor-mode}
+@findex @code{viper-harness-minor-mode}
 @findex @code{remove-hook}
 @findex @code{add-hook}
 
@@ -2283,16 +2288,16 @@
 document. Other features are explained here.
 
 @table @code
-@item (vip-buffer-search-enable)
-@item vip-buffer-search-char nil
-Enable buffer search. Explicit call to @code{vip-buffer-search-enable}
-sets @code{vip-buffer-search-char} to @kbd{g}. Alternatively, the user can
-set @code{vip-buffer-search-char} in @file{.viper} to a key sequence
+@item (viper-buffer-search-enable)
+@item viper-buffer-search-char nil
+Enable buffer search. Explicit call to @code{viper-buffer-search-enable}
+sets @code{viper-buffer-search-char} to @kbd{g}. Alternatively, the user can
+set @code{viper-buffer-search-char} in @file{.viper} to a key sequence
 to be used for buffer search. There is no need to call
-@code{vip-buffer-search-enable} in that case.
-@findex @code{vip-buffer-search-enable}
-@vindex @code{vip-buffer-search-char}
-@item vip-toggle-search-style
+@code{viper-buffer-search-enable} in that case.
+@findex @code{viper-buffer-search-enable}
+@vindex @code{viper-buffer-search-char}
+@item viper-toggle-search-style
 This function, bound to @kbd{C-c /}, lets one toggle case-sensitive and
 case-insensitive search, and also switch between plain vanilla search and
 search via regular expressions. Without the prefix argument, the user is
@@ -2314,9 +2319,9 @@
 @file{~/.viper} file. For instance, if you don't like the above feature, put
 this in @file{~/.viper}:
 @example
-(vip-set-searchstyle-toggling-macros 'undefine)
+(viper-set-searchstyle-toggling-macros 'undefine)
 @end example
-@findex @code{vip-set-searchstyle-toggling-macros}
+@findex @code{viper-set-searchstyle-toggling-macros}
 
 @item Vi-isms in Emacs state
 Some people find it useful to use the Vi-style search key, `/', to invoke
@@ -2330,24 +2335,24 @@
 case-insensitivity and regexp-search.
 
 If you don't like these features---which I don't really understand---you
-can unbind `/' and `:' in @code{vip-dired-modifier-map} (for Dired) or in
-@code{vip-slash-and-colon-map}, for other modes.
-@vindex @code{vip-slash-and-colon-map}
-@vindex @code{vip-dired-modifier-map}
+can unbind `/' and `:' in @code{viper-dired-modifier-map} (for Dired) or in
+@code{viper-slash-and-colon-map}, for other modes.
+@vindex @code{viper-slash-and-colon-map}
+@vindex @code{viper-dired-modifier-map}
 
 To unbind the macros `//' and `///' for a major mode where you feel they
-are undesirable, execute @code{vip-set-emacs-state-searchstyle-macros} with a
+are undesirable, execute @code{viper-set-emacs-state-searchstyle-macros} with a
 non-nil argument.  This can be done either interactively, by supplying a
 prefix argument, or by placing
 @example
-(vip-set-emacs-state-searchstyle-macros 'undefine)
+(viper-set-emacs-state-searchstyle-macros 'undefine)
 @end example
-@findex @code{vip-set-emacs-state-searchstyle-macros}
+@findex @code{viper-set-emacs-state-searchstyle-macros}
 in the hook to the major mode (e.g., @code{dired-mode-hook}).
 @xref{Vi Macros}, for more information on Vi macros.
 
-@item vip-heading-start 
-@item vip-heading-end
+@item viper-heading-start 
+@item viper-heading-end
 @cindex headings
 @cindex sections
 @cindex paragraphs
@@ -2358,8 +2363,8 @@
 @item M-x viper-set-expert-level
 @findex @code{viper-set-expert-level}
 Change your user level interactively.
-@item vip-smart-suffix-list  '("" "tex" "c" "cc" "el" "p")
-@vindex @code{vip-smart-suffix-list}
+@item viper-smart-suffix-list  '("" "tex" "c" "cc" "el" "p")
+@vindex @code{viper-smart-suffix-list}
 Viper supports Emacs-style file completion when it prompts the user for a
 file name. However, in many cases, the same directory may contain files
 with identical prefix but different suffixes, e.g., prog.c, prog.o,
@@ -2377,12 +2382,12 @@
 
 To turn this feature off, set the above variable to @code{nil}.
 
-@item vip-insertion-ring-size  14
-@vindex @code{vip-insertion-ring-size}
+@item viper-insertion-ring-size  14
+@vindex @code{viper-insertion-ring-size}
 @cindex Insertion ring
 Viper remembers what was previously inserted in Insert and Replace states.
 Several such recent insertions are kept in a special ring of strings of size
-@code{vip-insertion-ring-size}.
+@code{viper-insertion-ring-size}.
 If you enter Insert or Replace state you can reinsert strings from this
 ring by typing @kbd{C-c M-p} or @kbd{C-c M-n}. The former will search the
 ring in 
@@ -2396,22 +2401,22 @@
 Since typing these sequences of keys may be tedious, it is suggested that the
 user should bind a function key, such as @kbd{f31}, as follows:
 @example
-(define-key vip-insert-global-user-map [f31]
-            'vip-insert-prev-from-insertion-ring)
+(define-key viper-insert-global-user-map [f31]
+            'viper-insert-prev-from-insertion-ring)
 @end example
 This binds @kbd{f31} (which is usually @kbd{R11} on a Sun workstation)
 to the function that inserts the previous string in the insertion history.
 To rotate the history in the opposite
 direction, you can either bind an unused key to
-@code{vip-insert-next-from-insertion-ring} or hit any digit (1 to 9) then
+@code{viper-insert-next-from-insertion-ring} or hit any digit (1 to 9) then
 @kbd{f31}.
 
 One should not bind the above functions to @kbd{M-p} or @kbd{M-n}, since
 this will interfere with the Minibuffer histories and, possibly, other
 major modes.
 
-@item vip-command-ring-size  14
-@vindex @code{vip-command-ring-size}
+@item viper-command-ring-size  14
+@vindex @code{viper-command-ring-size}
 @cindex Destructive command ring
 @cindex Destructive command history
 Viper keeps track of the recent history of destructive
@@ -2427,34 +2432,30 @@
 appropriate function to an unused function key on the keyboard and use that
 key. For instance, the following
 @example
-(define-key vip-vi-global-user-map [f31]
-            'vip-prev-destructive-command)
+(define-key viper-vi-global-user-map [f31]
+            'viper-prev-destructive-command)
 @end example
 binds the key @kbd{f31} (which is usually @kbd{R11} on a Sun workstation)
 to the function that searches the command history in the direction of older
 commands. To search in the opposite
 direction, you can either bind an unused key to
-@code{vip-next-destructive-command} or hit any digit (1 to 9) then @kbd{f31}.
+@code{viper-next-destructive-command} or hit any digit (1 to 9) then @kbd{f31}.
 
 One should not bind the above functions to @kbd{M-p} or @kbd{M-n}, since
 this will interfere with the Minibuffer histories and, possibly, other
 major modes.
 
-@item vip-minibuffer-vi-face  'vip-minibuffer-vi-face
-@item vip-minibuffer-insert-face  'vip-minibuffer-insert-face
-@item vip-minibuffer-emacs-face  'vip-minibuffer-emacs-face
+@item viper-minibuffer-vi-face  'viper-minibuffer-vi-face
+@item viper-minibuffer-insert-face  'viper-minibuffer-insert-face
+@item viper-minibuffer-emacs-face  'viper-minibuffer-emacs-face
 These faces control the appearance of the minibuffer text in the
-corresponding Viper states. For heavy-duty customization, consult
-the Lisp Reference to Emacs. You can also take a look how these faces are
-defined in @file{viper.el}.
-
-However, on a color workstation, the following method usually suffices:
-@example
-(set-face-foreground vip-minibuffer-vi-face "blue")
-(set-face-background vip-minibuffer-emacs-face "orchid")
-@end example
-This will make a blue foreground in the Minibuffer when it is in Vi
-state; its background will turn to orchid when it switches to Emacs state.
+corresponding Viper states. You can change the appearance of these faces
+through Emacs' customization widget, which is accessible through the
+menubar.
+
+Viper is located in this widget under the @emph{Emulations} customization
+subgroup of the @emph{Editing} group.  All Viper faces are grouped together
+in Viper's @emph{Highlighting} customization subgroup.
 
 Note that only the text you type in is affected by the above faces.
 Prompts and Minibuffer messages are not affected.
@@ -2462,11 +2463,12 @@
 Purists who do not like adornments in the minibuffer can always zap them by
 putting
 @example
-(copy-face 'default 'vip-minibuffer-vi-face)
-(copy-face 'default 'vip-minibuffer-insert-face)
-(copy-face 'default 'vip-minibuffer-emacs-face)
+(copy-face 'default 'viper-minibuffer-vi-face)
+(copy-face 'default 'viper-minibuffer-insert-face)
+(copy-face 'default 'viper-minibuffer-emacs-face)
 @end example
-in the @file{~/.viper} file. However, in that case, the user will not have any
+in the @file{~/.viper} file or through the customization widget, as
+described above. However, in that case, the user will not have any
 indication of the current Viper state in the minibuffer. (This is important
 if the user accidentally switches to another Viper state by typing @key{ESC} or
 @kbd{C-z}).
@@ -2474,6 +2476,9 @@
 @findex @code{viper-go-away}
 Make Viper disappear from the face of your running Emacs instance.  If your
 fingers start aching again, @kbd{M-x viper-mode} might save your day.
+@item M-x toggle-viper-mode
+@findex @code{toggle-viper-mode}
+Toggle Viperization of Emacs on and off.
 @end table
 
 @cindex Multifile documents and programs
@@ -2483,13 +2488,13 @@
 master and put the following at the end of that file:
 @lisp
 ;;; Local Variables:
-;;; eval: (vip-setup-master-buffer "file1" "file2" "file3" "file5" "file5")
+;;; eval: (viper-setup-master-buffer "file1" "file2" "file3" "file5" "file5")
 ;;; End:
 @end lisp
 @noindent
 where @code{file1} to @code{file5} are names of files related to the master
 file. Next time, when the master file is visited, the command
-@code{vip-setup-master-buffer} will be evaluated and the above files will
+@code{viper-setup-master-buffer} will be evaluated and the above files will
 be associated with the master file. Then, the new Ex command
 @kbd{:RelatedFile} (abbr. @kbd{:R}) will display files 1 to 5 one after
 another, so you can edit them. If a file is not in any Emacs buffer, it
@@ -2514,49 +2519,47 @@
 
 The following two commands are normally bound to a mouse click and are part
 of Viper. They work only if Emacs runs as an application under X
-Windows (or under some other window system for which a port of GNU Emacs 19
+Windows (or under some other window system for which a port of GNU Emacs 20
 is available). Clicking the mouse when Emacs is invoked in an Xterm window
 (using @code{emacs -nw}) will do no good.
 
 @table @code
 @cindex mouse
-@item M-S-mouse-1 (Emacs)
-@item meta shift button1up (XEmacs)
-Holding Meta and Shift while clicking mouse button 1
-will initiate search for a region under the
-mouse pointer (defined below).  This command can take a prefix argument,
-which indicates the occurrence of the pattern to search for.
-
-Note: Viper binds this mouse action only if it is not already bound to
-something else. If you want to use this feature and @kbd{M-S-mouse-1}
-is already used for something else, you can rebind mouse-search as, for
-example, in the following example:
+@cindex mouse-search
+@item viper-mouse-search-key  (meta shift 1)
+@vindex @code{viper-mouse-insert-key}
+This variable controls the @emph{mouse-search} feature of Viper. The
+default value 
+states that holding Meta and Shift keys while clicking mouse button 1
+should initiate search for a region under the mouse pointer (defined
+below).  This command can take a prefix argument, which indicates the
+occurrence of the pattern to search for.
+
+Note: while loading initially, Viper binds this mouse action only if it is
+not already bound to something else. If you want to use the mouse-seatch
+feature and the Meta-Shift-button-1 mouse action is already bound to
+something else you can rebind the mouse-search feature by setting
+@code{viper-mouse-search-key} to something else in your @code{~/.viper}
+file:
 @lisp
-(global-set-key [M-mouse-1] 'vip-mouse-click-search-word)
-(global-set-key [M-down-mouse-1] 'vip-mouse-catch-frame-switch)
+(setq viper-mouse-search-key '(meta 1))
 @end lisp
 This would bind mouse search to the action invoked by pressing the
-Meta key and clicking mouse button 1. Note: if
-@code{vip-mouse-click-search-word} is bound to an action, then
-@code{vip-mouse-catch-frame-switch} must be bound to a down-action, as
-shown in the above example.
-
-In XEmacs, you can change bindings as follows:
+Meta key and clicking mouse button 1. The allowed values of
+@code{viper-mouse-search-key} are lists that contain a mouse-button number
+(1,2, or 3) and any combination of the words `control', `meta', and
+`shift'.
+
+If the requested mouse action (e.g., (meta 1)) is already taken for other
+purposes then you have to confirm your intention by placing the following
+command in @code{~/.viper} after setting @code{viper-mouse-search-key}:
 @lisp
-(global-set-key [(meta control button1up)]
-                'vip-mouse-click-search-word)
-(global-set-key [(meta control button1)]
-                'vip-mouse-catch-frame-switch)
+(viper-bind-mouse-search-key 'force)
 @end lisp
-if, say, you prefer to hold both meta and control while clicking.
-
-Like in Emacs, there are special rules for binding these functions: the
-first must be bound to a button-up event while the second must be bound to
-a button-event (which is XEmacs' equivalent of a down-mouse event).  Also,
-in Emacs, the double-click and triple-click actions for the same button
-(@code{double-S-mouse-1}, etc., if the above default binding is used)
-should not be bound (or it should be bound to the same function,
-@code{vip-mouse-click-search-word}).
+
+You can also change this setting interactively, through the customization
+widget of Emacs (choose option "Customize.Customize Group" from the
+menubar).
 
 The region that is chosen as a pattern to search for is determined as
 follows. If search is invoked via a single click, Viper chooses the region
@@ -2577,31 +2580,36 @@
 On a triple-click, the region consists of the entire line where the click
 occurred with all leading and trailing spaces and tabs removed.
 
-@item M-S-mouse-2 (Emacs)
-@item meta shift button2up (XEmacs)
-Holding Meta and Shift while clicking mouse button 2
-will insert the region surrounding the
+@cindex mouse-insert
+@item viper-mouse-insert-key (meta shift 2)
+@vindex @code{viper-mouse-insert-key}
+This variable controls the @emph{mouse-insert} feature of Viper.
+The above default value states that
+holding Meta and Shift keys while clicking mouse button 2
+should insert the region surrounding the
 mouse pointer.  The rules defining this region are the same as for
 mouse-search.  This command takes an optional prefix argument, which
 indicates how many such regions to snarf from the buffer and insert.  (In
 case of a triple-click, the prefix argument is ignored.)
 
-Note: Viper binds this mouse action only if it not already bound to
-something else. If you want to use this feature and @kbd{S-mouse-2}
-is already used for something else, you can rebind mouse-insert as follows:
+Note: while loading initially, Viper binds this mouse action only if it not
+already bound to something else. If you want to use this feature and the
+default mouse action is already bound, you can rebind mouse-insert by
+placing this command in @code{~/.viper}:
 @lisp
-(global-set-key [M-mouse-2] 'vip-mouse-click-insert-word)
-(global-set-key [M-down-mouse-2] 'vip-mouse-catch-frame-switch)
+(setq viper-mouse-insert-key '(meta 2))
 @end lisp
-In XEmacs, you can change the bindings as follows:
+If you want to bind mouse-insert to an action even if this action is
+already taked for other purposes in Emacs, then you should add this command
+to @code{~/.viper}, after setting @code{viper-mouse-insert-key}:
 @lisp
-(global-set-key [(meta control button2up)]
-                'vip-mouse-click-insert-word)
-(global-set-key [(meta control button2)]
-                'vip-mouse-catch-frame-switch)
+(viper-bind-mouse-insert-key 'force)
 @end lisp
 
-@item vip-multiclick-timeout
+This value can also be changed via the Emacs customization widget at the
+menubar.
+
+@item viper-multiclick-timeout
 This variable controls the rate at which double-clicking must occur for the
 purpose of mouse search and mouse insert. By default, this is set to
 @code{double-click-time} in Emacs and to
@@ -2611,9 +2619,9 @@
 @kindex @kbd{S-mouse-2}
 @kindex @kbd{meta shift button1up}
 @kindex @kbd{meta shift button2up}
-@vindex @code{vip-multiclick-timeout}
-@findex @code{vip-mouse-click-insert-word}
-@findex @code{vip-mouse-click-search-word}
+@vindex @code{viper-multiclick-timeout}
+@findex @code{viper-mouse-click-insert-word}
+@findex @code{viper-mouse-click-search-word}
 
 Note: The above functions search and insert in the selected window of
 the latest active frame. This means that you can click in another window or
@@ -2630,23 +2638,23 @@
 
 If you decide that you don't like the above feature and always want
 search/insertion be performed in the frame where the click occurs, don't
-bind (and unbind, if necessary) @code{vip-mouse-catch-frame-switch} from
+bind (and unbind, if necessary) @code{viper-mouse-catch-frame-switch} from
 the mouse event it is bound to.
 
 Mouse search is integrated with Vi-style search, so you can
 repeat it with @kbd{n} and @kbd{N}. It should be also noted that, while
 case-sensitivity of search in Viper is controlled by the variable
-@code{vip-case-fold-search}, the case of mouse search is
+@code{viper-case-fold-search}, the case of mouse search is
 controlled by the Emacs variable @code{case-fold-search}, which may be set
-differently from @code{vip-case-fold-search}. Therefore, case-sensitivity
+differently from @code{viper-case-fold-search}. Therefore, case-sensitivity
 of mouse search may be different from that of the usual Vi-style search.
 
 Finally, if the way Viper determines the word to be searched for or to be
 inserted is not what you want, there is a variable,
-@code{vip-surrounding-word-function}, which can be changed to indicate
+@code{viper-surrounding-word-function}, which can be changed to indicate
 another function for snarfing words out of the buffer. The catch is that
 you will then have to write such a function and make it known to your
-Emacs. The function @code{vip-surrounding-word} in @file{viper.el} can be
+Emacs. The function @code{viper-surrounding-word} in @file{viper.el} can be
 used as a guiding example.
 
 @node Vi Macros, ,Viper Specials,Customization
@@ -2738,7 +2746,7 @@
 only: 
 
 @example
- (vip-record-kbd-macro "gg" 'insert-state 
+ (viper-record-kbd-macro "gg" 'insert-state 
         [l up (meta x) n e x t - l i n e return]
         "my-buf")
 @end example
@@ -2748,7 +2756,7 @@
 @code{cc-mode}, use:
 
 @example
- (vip-record-kbd-macro "gg" 'vi-state 
+ (viper-record-kbd-macro "gg" 'vi-state 
         [l up (meta x) n e x t - l i n e return]
         'cc-mode)
 @end example
@@ -2764,7 +2772,7 @@
 strings:
 
 @example
- (vip-record-kbd-macro "aa" 'vi-state  "aaa\e"  "my-buffer")
+ (viper-record-kbd-macro "aa" 'vi-state  "aaa\e"  "my-buffer")
 @end example
 
 @noindent
@@ -2772,7 +2780,7 @@
 (due to the first @kbd{a}), insert @kbd{aa}, and then it will switch back to Vi
 state. All this will take effect only in the buffer named @code{my-buffer}.
 
-Note that the last argument to @code{vip-record-kbd-macro} must be either a
+Note that the last argument to @code{viper-record-kbd-macro} must be either a
 string (a buffer name), a symbol representing a major mode, or @code{t};
 the latter says that the macro is to be defined for all buffers
 (which is how macros are defined in original Vi).
@@ -2780,25 +2788,25 @@
 For convenience, Viper also lets you define Vi-style macros in its Emacs
 state. There is no Ex command, like @kbd{:map} and @kbd{:map!} for doing
 this, but the user can include such a macro in the @file{~/.viper} file. The
-only thing is that the @code{vip-record-kbd-macro} command should specify
+only thing is that the @code{viper-record-kbd-macro} command should specify
 @code{emacs-state} instead of @code{vi-state} or @code{insert-state}.
 
 The user can get rid of a macro either by using the Ex commands @kbd{:unmap}
-and @kbd{:unmap!} or by issuing a call to @code{vip-unrecord-kbd-macro}.
+and @kbd{:unmap!} or by issuing a call to @code{viper-unrecord-kbd-macro}.
 The latter is more powerful, since it can delete macros even in
-@code{emacs-state}. However, @code{vip-unrecord-kbd-macro} is usually
+@code{emacs-state}. However, @code{viper-unrecord-kbd-macro} is usually
 needed only when the user needs to get rid of the macros that are already
 predefined in Viper.
 The syntax is:
-@findex @code{vip-unrecord-kbd-macro}
+@findex @code{viper-unrecord-kbd-macro}
 @example
-(vip-unrecord-kbd-macro macro state)
+(viper-unrecord-kbd-macro macro state)
 @end example
 @noindent
 The second argument must be @code{vi-state}, @code{insert-state}, or
 @code{emacs-state}. The first argument is a name of a macro.  To avoid
 mistakes in specifying names of existing macros, type @kbd{M-x
-vip-describe-kbd-macros} and use a name from the list displayed by this
+viper-describe-kbd-macros} and use a name from the list displayed by this
 command.
 
 If an error occurs during macro definition, Emacs
@@ -2848,7 +2856,7 @@
 for future uses, the following will be inserted in that file:
 
 @example
-(vip-record-kbd-macro [f16 f16] 'vi-state
+(viper-record-kbd-macro [f16 f16] 'vi-state
          [(meta x) e v a l - l a s t - s e x p]
          'lisp-interaction-mode)
 @end example
@@ -2865,7 +2873,7 @@
 say, @kbd{f12 \3} like this:
 
 @example
-(vip-record-kbd-macro [f12 \3] 'vi-state
+(viper-record-kbd-macro [f12 \3] 'vi-state
                       [(meta x) r e p e a t - f r o m - h i s t o r y]
                       t)
 @end example
@@ -2913,7 +2921,7 @@
 
 The rate at which the user must type keys in order for them to be
 recognized as a timeout macro is controlled by the variable
-@code{vip-fast-keyseq-timeout}, which defaults to 200 milliseconds.
+@code{viper-fast-keyseq-timeout}, which defaults to 200 milliseconds.
 
 For the most part, Viper macros defined in @file{~/.viper} can be shared
 between Emacs, XEmacs, and X and TTY modes.  However, macros defined via
@@ -2930,10 +2938,10 @@
 may be using). To do this, start Emacs on an appropriate TTY device and
 define the macro using @kbd{:map}, as usual.
 
-@findex @code{vip-describe-kbd-macros}
+@findex @code{viper-describe-kbd-macros}
 Finally, Viper provides a function that conveniently displays all macros
 currently defined. To see all macros along with their definitions, type
-@kbd{M-x vip-describe-kbd-macros}.
+@kbd{M-x viper-describe-kbd-macros}.
 
 @node Commands,,Customization,Top,Top
 @chapter Commands
@@ -3091,7 +3099,7 @@
 Cyrillic, etc., letters.
 
 Second, Viper lets you depart from Vi's idea of a word by changing the
-value of @code{vip-syntax-preference}. By default, this variable is set to
+value of @code{viper-syntax-preference}. By default, this variable is set to
 @code{strict-vi}, which means that alphanumeric symbols are exactly as
 in Vi.
 However, if the value is @code{reformed-vi} then alphanumeric
@@ -3100,30 +3108,30 @@
 @kbd{_}. The user can also specify the value @code{emacs}, which would
 make Viper use exactly the Emacs notion of word. In particular, the
 underscore may not be part of a word. Finally, if
-@code{vip-syntax-preference} is set to @code{extended}, Viper words would
+@code{viper-syntax-preference} is set to @code{extended}, Viper words would
 consist of characters that are classified as alphanumeric @emph{or} as
 parts of symbols. This is convenient for writing programs and in many other
 situations.
 
-@vindex @code{vip-syntax-preference}
+@vindex @code{viper-syntax-preference}
 @cindex syntax table
 
-@code{vip-syntax-preference} is a local variable, so it can have different
+@code{viper-syntax-preference} is a local variable, so it can have different
 values for different major modes. For instance, in programming modes it can
 have the value @code{extended}. In text modes where words contain special
 characters, such as European (non-English) letters, Cyrillic letters, etc.,
 the value can be @code{reformed-vi} or @code{emacs}.
 
-Changes to @code{vip-syntax-preference} should be done in the hooks to
+Changes to @code{viper-syntax-preference} should be done in the hooks to
 various major modes. Furthermore, for these changes to take effect, you
-should execute @code{(vip-update-alphanumeric-class)} right after changing
-the value of @code{vip-syntax-preference}.
+should execute @code{(viper-update-alphanumeric-class)} right after changing
+the value of @code{viper-syntax-preference}.
 
 The above discussion concerns only the movement commands. In regular
 expressions, words remain the same as in Emacs.  That is, the expressions
 @code{\w}, @code{\>}, @code{\<}, etc., use Emacs' idea of what is a word,
 and they don't look into the value of variable
-@code{vip-syntax-preference}. This is because Viper doesn't change syntax
+@code{viper-syntax-preference}. This is because Viper doesn't change syntax
 tables in order to not thwart the various major modes that set these
 tables.
 
@@ -3273,16 +3281,16 @@
 Find the next bracket/parenthesis/brace and go to its match.
 By default, Viper ignores brackets/parentheses/braces that occur inside
 parentheses. You can change this by setting
-@code{vip-parse-sexp-ignore-comments} to nil in your @file{.viper} fipe.
+@code{viper-parse-sexp-ignore-comments} to nil in your @file{.viper} fipe.
 This option can also be toggled interactively if you quickly hit @kbd{%%%}.
 
 This latter feature is implemented as a vi-style keyboard macro. If you
 don't want this macro, put
 
 @example
-(vip-set-parsing-style-toggling-macro 'undefine)
+(viper-set-parsing-style-toggling-macro 'undefine)
 @end example
-@findex @code{vip-set-parsing-style-toggling-macro}
+@findex @code{viper-set-parsing-style-toggling-macro}
 
 in your @file{~/.viper} file.
 
@@ -3341,7 +3349,7 @@
 @kindex @kbd{j}
 @kindex @kbd{k}
 @kindex @kbd{l}
-@vindex @code{vip-parse-sexp-ignore-comments}
+@vindex @code{viper-parse-sexp-ignore-comments}
 
 @node Marking,Appending Text,Move Commands,Text Handling
 @subsection Marking
@@ -3477,7 +3485,7 @@
 Minibuffer can be edited similarly to Insert state, and you can switch
 between Insert/Replace/Vi states at will.
 Some users prefer plain Emacs feel in the Minibuffer. To this end, set
-@var{vip-vi-style-in-minibuffer} to @code{nil}.
+@var{viper-vi-style-in-minibuffer} to @code{nil}.
 
 @cindex Insert state
 
@@ -3579,6 +3587,10 @@
 substitution, else @samp{n} ).  Instead of @kbd{/} any
 punctuation CHAR unequal to <space> <tab> and <lf> can be used as
 delimiter.
+
+In Emacs, @samp{\&} stands for the last matched expression, so
+@kbd{s/[ab]+/\&\&/} will double the string matched by @kbd{[ab]}.
+Viper doesn't treat @samp{&} specially, unlike Vi: use @samp{\&} instead.
 @item  :[x,y]copy [z]
  Copy text between @kbd{x} and @kbd{y} to the position after @kbd{z}.
 @item  :[x,y]t [z]
@@ -3587,7 +3599,7 @@
  Move text between @kbd{x} and @kbd{y} to the position after @kbd{z}.
 @item  &
 Repeat latest Ex substitute command, e.g.
-@kbd{:s/wrong/good}.
+@kbd{:s/wrong/right}.
 @item C-c /
 Toggle case-sensitive search. With prefix argument, toggle vanilla/regular
 expression search.
@@ -3615,6 +3627,7 @@
 @kindex @kbd{#C<move>}
 @kindex @kbd{#c<move>}
 @kindex @kbd{&}
+@kindex @kbd{\&}
 @findex @kbd{:substitute/<p>/<r>/<f>}
 @findex @kbd{:s/<p>/<r>/<f>}
 @findex @kbd{:copy [z]}
@@ -3674,7 +3687,7 @@
 punctuation character other than <space> <tab> and <lf> can be used as
 delimiter. 
 @item  &
- Repeat latest Ex substitute command, e.g. @kbd{:s/wrong/good}.
+ Repeat latest Ex substitute command, e.g. @kbd{:s/wrong/right}.
 @item :global /<pattern>/<ex-command>
 @itemx :g /<pattern>/<ex-command>
 Execute <ex-command> on all lines that match <pattern>.
@@ -4335,7 +4348,8 @@
 sudish@@MindSpring.COM (Sudish Joseph),
 paulk@@summit.esg.apertus.com (Paul Keusemann),
 roderick@@argon.org (Roderick Schertler),
-johnw@@borland.com (John Wiegley)
+johnw@@borland.com (John Wiegley),
+zapman@@cc.gatech.edu (Jason Zapman II)
 @end example
 
 
--- a/man/widget.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/widget.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -13,7 +13,7 @@
 @comment  node-name,  next,  previous,  up
 @top The Emacs Widget Library
 
-Version: 1.9953
+Version: 1.9954
 
 @menu
 * Introduction::                
--- a/man/xemacs/text.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/xemacs/text.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -30,7 +30,7 @@
 * Text Mode::   The major modes for editing text files.
 * Nroff Mode::  The major mode for editing input to the formatter nroff.
 * TeX Mode::    The major modes for editing input to the formatter TeX.
-* Outline Mode::The major mode for editing outlines.
+* Outline Mode:: The major mode for editing outlines.
 * Words::       Moving over and killing words.
 * Sentences::   Moving over and killing sentences.
 * Paragraphs::	Moving over paragraphs.
@@ -87,7 +87,7 @@
 level structure more visible.
 
 
-* Outline Mode::The major mode for editing outlines.
+* Outline Mode:: The major mode for editing outlines.
 @end menu
 
 @node Nroff Mode, TeX Mode, Text Mode, Text Mode
--- a/man/xemacs/xemacs.texi	Mon Aug 13 09:52:21 2007 +0200
+++ b/man/xemacs/xemacs.texi	Mon Aug 13 09:53:19 2007 +0200
@@ -166,8 +166,8 @@
                  the number of characters you must type.
 * Picture::     Editing pictures made up of characters
                  using the quarter-plane screen model.
-* Sending Mail::Sending mail in XEmacs.
-* Reading Mail::Reading mail in XEmacs.
+* Sending Mail:: Sending mail in XEmacs.
+* Reading Mail:: Reading mail in XEmacs.
 * Calendar/Diary:: A Calendar and diary facility in XEmacs.
 * Sorting::	Sorting lines, paragraphs or pages within XEmacs.
 * Shell::       Executing shell commands from XEmacs.
@@ -399,7 +399,7 @@
 * Text Mode::   The major modes for editing text files.
 * Nroff Mode::  The major mode for editing input to the formatter nroff.
 * TeX Mode::    The major modes for editing input to the formatter TeX.
-* Outline Mode::The major mode for editing outlines.
+* Outline Mode:: The major mode for editing outlines.
 * Words::       Moving over and killing words.
 * Sentences::   Moving over and killing sentences.
 * Paragraphs::	Moving over paragraphs.
--- a/src/ChangeLog	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 09:53:19 2007 +0200
@@ -1,3 +1,15 @@
+1997-08-05  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+
+	* eval.c (vars_of_eval): Updated docstring for `debug_on_error' to 
+	mention `debug-ignored-errors'.
+
+1997-08-01  SL Baur  <steve@altair.xemacs.org>
+
+	* emacsfns.h: Fix declaration.
+
+	* event-stream.c (syms_of_event_stream): HAVE_MENUBARS not
+	HAVE_MENUBAR.
+
 1997-07-31  SL Baur  <steve@altair.xemacs.org>
 
 	* frame-x.c (x_offix_drop_event_handler): Use stderr_out instead
--- a/src/Makefile.in.in	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/Makefile.in.in	Mon Aug 13 09:53:19 2007 +0200
@@ -97,8 +97,8 @@
 RM = rm -f
 PURIFY_PROG=purify
 PURIFY_FLAGS=-chain-length=16 -ignore-signals=SIGPOLL -log-file=puremacs.log \
-             -messages=batch -show-directory=yes -windows=yes \
-             -cache-dir=. -always-use-cache-dir=yes
+             -messages=batch -show-directory=yes -windows=yes -threads=yes \
+             -cache-dir=. -always-use-cache-dir=yes -pointer-mask=0x0fffffff
 PURECOV_PROG=purecov
 #ifdef  QUANTIFY
 quantify_prog  = quantify
@@ -412,7 +412,11 @@
 	run' rtcmacs
 
 puremacs: $(temacs_deps)
-	$(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args)
+	$(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) -lpthread
+
+.PHONY : run-puremacs
+run-puremacs: puremacs
+	./puremacs -batch -l loadup.el run-temacs
 
 quantmacs: $(temacs_deps)
 	$(quantify_prog) $(quantify_flags) $(LD) $(temacs_link_args)
--- a/src/buffer.h	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/buffer.h	Mon Aug 13 09:53:19 2007 +0200
@@ -1444,7 +1444,7 @@
 #define NUM_LEADING_BYTES 1
 #define MIN_LEADING_BYTE 0x80
 #define CHARSETP(cs) 1
-#define CHARSET_BY_LEADING_BYTE(cs) Vcharset_ascii
+#define CHARSET_BY_LEADING_BYTE(lb) Vcharset_ascii
 #define XCHARSET_LEADING_BYTE(cs) LEADING_BYTE_ASCII
 #define XCHARSET_GRAPHIC(cs) -1
 #define XCHARSET_COLUMNS(cs) 1
--- a/src/chartab.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/chartab.c	Mon Aug 13 09:53:19 2007 +0200
@@ -467,7 +467,7 @@
 */
        (object))
 {
-  return (CHAR_TABLEP (object) ? Qt : Qnil);
+  return CHAR_TABLEP (object) ? Qt : Qnil;
 }
 
 DEFUN ("char-table-type-list", Fchar_table_type_list, 0, 0, 0, /*
@@ -513,16 +513,13 @@
 */
        (type))
 {
-  if (EQ (type, Qchar)
+  return (EQ (type, Qchar)     ||
 #ifdef MULE
-      || EQ (type, Qcategory)
+	  EQ (type, Qcategory) ||
 #endif
-      || EQ (type, Qdisplay)
-      || EQ (type, Qgeneric)
-      || EQ (type, Qsyntax))
-    return Qt;
-
-  return Qnil;
+	  EQ (type, Qdisplay)  ||
+	  EQ (type, Qgeneric)  ||
+	  EQ (type, Qsyntax)) ? Qt : Qnil;
 }
 
 DEFUN ("char-table-type", Fchar_table_type, 1, 1, 0, /*
@@ -842,7 +839,7 @@
   CHECK_CHAR_COERCE_INT (ch);
   chr = XCHAR(ch);
   
-  return (get_char_table (chr, ct));
+  return get_char_table (chr, ct);
 }
 
 DEFUN ("get-range-char-table", Fget_range_char_table, 2, 3, 0, /*
@@ -1274,15 +1271,14 @@
 				   Lisp_Object val, void *arg),
 			void *arg)
 {
-  Lisp_Object charset;
-  Lisp_Object val;
-
-  val = ct->level1[lb - MIN_LEADING_BYTE];
-
-  charset = CHARSET_BY_LEADING_BYTE (lb);
-  if (!CHARSETP (charset) || lb == LEADING_BYTE_ASCII
+  Lisp_Object val = ct->level1[lb - MIN_LEADING_BYTE];
+  Lisp_Object charset = CHARSET_BY_LEADING_BYTE (lb);
+  
+  if (!CHARSETP (charset)
+      || lb == LEADING_BYTE_ASCII
       || lb == LEADING_BYTE_CONTROL_1)
     return 0;
+  
   if (!CHAR_TABLE_ENTRYP (val))
     {
       struct chartab_range rainj;
@@ -1291,26 +1287,17 @@
       rainj.charset = charset;
       return (fn) (&rainj, val, arg);
     }
-  else if (XCHARSET_DIMENSION (charset) == 1)
-    {
-      int i;
-      struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
-      int start, stop;
-      
-      if (XCHARSET_CHARS (charset) == 94)
-	{
-	  start = 33;
-	  stop = 127;
-	}
-      else
-	{
-	  start = 32;
-	  stop = 128;
-	}
-
+  
+  {
+    struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
+    int charset94_p = (XCHARSET_CHARS (charset) == 94);
+    int start = charset94_p ?  33 :  32;
+    int stop  = charset94_p ? 127 : 128;
+    int i, retval;
+  
+    if (XCHARSET_DIMENSION (charset) == 1)
       for (i = start; i < stop; i++)
 	{
-	  int retval;
 	  struct chartab_range rainj;
 
 	  rainj.type = CHARTAB_RANGE_CHAR;
@@ -1319,32 +1306,14 @@
 	  if (retval)
 	    return retval;
 	}
-    }
-  else
-    {
-      int i;
-      struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
-      int start, stop;
-      
-      if (XCHARSET_CHARS (charset) == 94)
-	{
-	  start = 33;
-	  stop = 127;
-	}
-      else
-	{
-	  start = 32;
-	  stop = 128;
-	}
-
+    else
       for (i = start; i < stop; i++)
 	{
-	  int retval =
-	    map_over_charset_row (cte, charset, i, fn, arg);
+	  retval = map_over_charset_row (cte, charset, i, fn, arg);
 	  if (retval)
 	    return retval;
 	}
-    }
+  }
 
   return 0;
 }
@@ -1385,7 +1354,7 @@
 		return retval;
 	    }
 	}
-#endif
+#endif /* MULE */
       }
       break;
 
@@ -1661,7 +1630,7 @@
   if (EQ (temp, Qnil)) return not;
   
   designator -= ' ';
-  return (bit_vector_bit(XBIT_VECTOR (temp), designator) ? !not : not);
+  return bit_vector_bit(XBIT_VECTOR (temp), designator) ? !not : not;
 }
 
 DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /*
@@ -1682,8 +1651,7 @@
   des = XREALINT(designator);
   ctbl = check_category_table (category_table, Vstandard_category_table);
   ch = BUF_FETCH_CHAR (buf, XINT(pos));
-  return (check_category_char(ch, ctbl, des, 0)
-	  ? Qt : Qnil);
+  return check_category_char(ch, ctbl, des, 0) ? Qt : Qnil;
 }
 
 DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /*
@@ -1703,8 +1671,7 @@
   CHECK_CHAR(chr);
   ch = XCHAR(chr);
   ctbl = check_category_table (category_table, Vstandard_category_table);
-  return (check_category_char(ch, ctbl, des, 0)
-	  ? Qt : Qnil);
+  return check_category_char(ch, ctbl, des, 0) ? Qt : Qnil;
 }
 
 DEFUN ("category-table", Fcategory_table, 0, 1, 0, /*
@@ -1759,9 +1726,7 @@
 */
        (obj))
 {
-  if (CATEGORY_DESIGNATORP (obj))
-    return Qt;
-  return Qnil;
+  return CATEGORY_DESIGNATORP (obj) ? Qt : Qnil;
 }
 
 DEFUN ("category-table-value-p", Fcategory_table_value_p, 1, 1, 0, /*
@@ -1770,9 +1735,7 @@
 */
        (obj))
 {
-  if (CATEGORY_TABLE_VALUEP (obj))
-    return Qt;
-  return Qnil;
+  return CATEGORY_TABLE_VALUEP (obj) ? Qt : Qnil;
 }
 
 #endif /* MULE */
--- a/src/console-x.h	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/console-x.h	Mon Aug 13 09:53:19 2007 +0200
@@ -423,7 +423,6 @@
 
 void x_redraw_exposed_area (struct frame *f, int x, int y,
 			    int width, int height);
-struct Lisp_Image_Instance;
 void x_output_string (struct window *w, struct display_line *dl,
 		      emchar_dynarr *buf, int xpos, int xoffset,
 		      int start_pixpos, int width, face_index findex,
--- a/src/emacsfns.h	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/emacsfns.h	Mon Aug 13 09:53:19 2007 +0200
@@ -691,7 +691,7 @@
 				   Lisp_Object object1,
 				   Lisp_Object object2);
 Lisp_Object call_with_suspended_errors (lisp_fn_t fun,
-					Lisp_Object retval,
+					volatile Lisp_Object retval,
 					Lisp_Object class,
 					Error_behavior errb,
 					int nargs, ...);
--- a/src/eval.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/eval.c	Mon Aug 13 09:53:19 2007 +0200
@@ -5209,6 +5209,7 @@
 a `condition-case'.
 If the value is a list, an error only means to enter the debugger
 if one of its condition symbols appears in the list.
+This variable is overridden by `debug-ignored-errors'.
 See also variables `debug-on-quit' and `debug-on-signal'.
 */ );
   Vdebug_on_error = Qnil;
--- a/src/event-stream.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/event-stream.c	Mon Aug 13 09:53:19 2007 +0200
@@ -4864,7 +4864,7 @@
   DEFSUBR (Fthis_command_keys);
   DEFSUBR (Freset_this_command_lengths);
   DEFSUBR (Fopen_dribble_file);
-#if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBAR)
+#if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBARS)
   DEFSUBR (Faccelerate_menu);
 #endif
 
--- a/src/faces.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/faces.c	Mon Aug 13 09:53:19 2007 +0200
@@ -1139,9 +1139,7 @@
   for (i = 0; i < NUM_LEADING_BYTES; i++)
     if (charsets[i])
       {
-	Lisp_Object charset;
-
-	charset = CHARSET_BY_LEADING_BYTE (i + MIN_LEADING_BYTE);
+	Lisp_Object charset = CHARSET_BY_LEADING_BYTE (i + MIN_LEADING_BYTE);
 	assert (CHARSETP (charset));
 	ensure_face_cachel_contains_charset (cachel, domain, charset);
       }
--- a/src/lread.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/lread.c	Mon Aug 13 09:53:19 2007 +0200
@@ -1174,10 +1174,10 @@
 -- byte-compilation of a .el file into a .elc file.
 
 `locate-file' will primarily get confused if you add a file that shadows
-(i.e. has the same name as) another file further down in the directory list.
+\(i.e. has the same name as) another file further down in the directory list.
 In this case, you must call `locate-file-clear-hashing'.
 */
-(path))
+       (path))
 {
   Lisp_Object pathtail;
 
@@ -2731,10 +2731,7 @@
   s.terminator = terminator;
   GCPRO2 (s.head, s.tail);
 
-  (void) sequence_reader (readcharfun,
-                          terminator,
-                          &s,
-                          read_list_conser);
+  sequence_reader (readcharfun, terminator, &s, read_list_conser);
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
   Vcurrent_compiled_function_annotation = old_compiled_function_annotation;
 #endif
@@ -2819,17 +2816,14 @@
   struct read_list_state s;
   struct gcpro gcpro1, gcpro2;
 
-
   s.head = Qnil;
   s.tail = Qnil;
   s.length = 0;
   s.allow_dotted_lists = 0;
   GCPRO2 (s.head, s.tail);
 
-  (void) sequence_reader (readcharfun,
-                          terminator,
-                          &s,
-                          read_list_conser);
+  sequence_reader (readcharfun, terminator, &s, read_list_conser);
+  
   UNGCPRO;
   tem = s.head;
   len = XINT (Flength (tem));
--- a/src/mule-coding.c	Mon Aug 13 09:52:21 2007 +0200
+++ b/src/mule-coding.c	Mon Aug 13 09:53:19 2007 +0200
@@ -225,7 +225,6 @@
 mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Coding_System *codesys = XCODING_SYSTEM (obj);
-  int i;
 
   (markobj) (CODING_SYSTEM_NAME (codesys));
   (markobj) (CODING_SYSTEM_DOC_STRING (codesys));
@@ -233,8 +232,10 @@
   (markobj) (CODING_SYSTEM_EOL_LF (codesys));
   (markobj) (CODING_SYSTEM_EOL_CRLF (codesys));
   (markobj) (CODING_SYSTEM_EOL_CR (codesys));
+  
   switch (CODING_SYSTEM_TYPE (codesys))
     {
+      int i;
     case CODESYS_ISO2022:
       for (i = 0; i < 4; i++)
 	(markobj) (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i));
@@ -1539,33 +1540,34 @@
    stream, the stream that is at the other end, and data that
    needs to be persistent across the lifetime of the stream. */
 
-/* Handle the EOL stuff related to just-read-in character C.  EOL is
-   the EOL type of the coding stream.  FLAGS is the current value of
-   FLAGS in the coding stream, and may be modified by this macro.
-   (The macro only looks at the CODING_STATE_CR flag.) DST is the
-   Dynarr to which the decoded bytes are to be written.  You need to
-   also define a local goto label "label_continue_loop" that is at the
-   end of the main character-reading loop.
+/* Handle the EOL stuff related to just-read-in character C.
+   EOL_TYPE is the EOL type of the coding stream.
+   FLAGS is the current value of FLAGS in the coding stream, and may
+   be modified by this macro.  (The macro only looks at the
+   CODING_STATE_CR flag.)  DST is the Dynarr to which the decoded
+   bytes are to be written.  You need to also define a local goto
+   label "label_continue_loop" that is at the end of the main
+   character-reading loop.
 
    If C is a CR character, then this macro handles it entirely and
    jumps to label_continue_loop.  Otherwise, this macro does not add
    anything to DST, and continues normally.  You should continue
    processing C normally after this macro. */
 
-#define DECODE_HANDLE_EOL_TYPE(eol, c, flags, dst)		\
+#define DECODE_HANDLE_EOL_TYPE(eol_type, c, flags, dst)		\
 do {								\
   if (c == '\r')						\
     {								\
-      if (eol == EOL_CR)					\
+      if (eol_type == EOL_CR)					\
 	Dynarr_add (dst, '\n');					\
-      else if (eol != EOL_CRLF || flags & CODING_STATE_CR)	\
+      else if (eol_type != EOL_CRLF || flags & CODING_STATE_CR)	\
 	Dynarr_add (dst, c);					\
       else							\
 	flags |= CODING_STATE_CR;				\
       goto label_continue_loop;					\
     }								\
   else if (flags & CODING_STATE_CR)				\
-    {	/* eol == CODING_SYSTEM_EOL_CRLF */			\
+    {	/* eol_type == CODING_SYSTEM_EOL_CRLF */		\
       if (c != '\n')						\
 	Dynarr_add (dst, '\r');					\
       flags &= ~CODING_STATE_CR;				\
@@ -1885,7 +1887,7 @@
   return make_decoding_stream_1 (stream, codesys, "w");
 }
 
-/* Note: the decode_coding_? functions all take the same
+/* Note: the decode_coding_* functions all take the same
    arguments as mule_decode(), which is to say some SRC data of
    size N, which is to be stored into dynamic array DST.
    DECODING is the stream within which the decoding is
@@ -2189,7 +2191,7 @@
       mule_encode (stream, data, str->runoff, read_size);
     }
 
-  if (data - orig_data == 0)
+  if (data == orig_data)
     return error_occurred ? -1 : 0;
   else
     return data - orig_data;
@@ -2218,26 +2220,33 @@
 static void
 reset_encoding_stream (struct encoding_stream *str)
 {
-  if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_ISO2022)
+  switch (CODING_SYSTEM_TYPE (str->codesys))
     {
-      int i;
-
-      for (i = 0; i < 4; i++)
-	str->iso2022.charset[i] =
-	  CODING_SYSTEM_ISO2022_INITIAL_CHARSET (str->codesys, i);
-      for (i = 0; i < 4; i++)
-	str->iso2022.force_charset_on_output[i] =
-	  CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (str->codesys, i);
-      str->iso2022.register_left = 0;
-      str->iso2022.register_right = 1;
-      str->iso2022.current_charset = Qnil;
-      str->iso2022.current_half = 0;
-      str->iso2022.current_char_boundary = 1;
+    case CODESYS_ISO2022:
+      {
+	int i;
+
+	for (i = 0; i < 4; i++)
+	  {
+	    str->iso2022.charset[i] =
+	      CODING_SYSTEM_ISO2022_INITIAL_CHARSET (str->codesys, i);
+	    str->iso2022.force_charset_on_output[i] =
+	      CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (str->codesys, i);
+	  }
+	str->iso2022.register_left = 0;
+	str->iso2022.register_right = 1;
+	str->iso2022.current_charset = Qnil;
+	str->iso2022.current_half = 0;
+	str->iso2022.current_char_boundary = 1;
+	break;
+      }
+    case CODESYS_CCL:
+      set_ccl_program (&str->ccl, CODING_SYSTEM_CCL_ENCODE (str->codesys), 0, 0, 0);
+      break;
+    default:
+      break;
     }
-  else if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_CCL)
-    {
-      set_ccl_program (&str->ccl, CODING_SYSTEM_CCL_ENCODE (str->codesys), 0, 0, 0);
-    }
+  
   str->flags = str->ch = 0;
 }
 
@@ -2530,11 +2539,11 @@
 {
   unsigned char c;
   unsigned int flags, ch;
-  int eol;
+  enum eol_type eol_type;
   struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = str->eol_type;
+  eol_type = str->eol_type;
 
   while (n--)
     {
@@ -2561,7 +2570,7 @@
 	}
       else
 	{
-	  DECODE_HANDLE_EOL_TYPE (eol, c, flags, dst);
+	  DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
 	  if (BYTE_SJIS_TWO_BYTE_1_P (c))
 	    ch = c;
 	  else if (BYTE_SJIS_KATAKANA_P (c))
@@ -2589,19 +2598,19 @@
   unsigned char c;
   struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
   unsigned int flags, ch;
-  int eol;
+  enum eol_type eol_type;
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = CODING_SYSTEM_EOL_TYPE (str->codesys);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
 
   while (n--)
     {
       c = *src++;
       if (c == '\n')
 	{
-	  if (eol != EOL_LF && eol != EOL_AUTODETECT)
+	  if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
 	    Dynarr_add (dst, '\r');
-	  if (eol != EOL_CR)
+	  if (eol_type != EOL_CR)
 	    Dynarr_add (dst, '\n');
 	  ch = 0;
 	}
@@ -2818,11 +2827,12 @@
 		    unsigned_char_dynarr *dst, unsigned int n)
 {
   unsigned char c;
-  unsigned int flags, ch, eol;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
   struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = str->eol_type;
+  eol_type = str->eol_type;
 
   while (n--)
     {
@@ -2847,7 +2857,7 @@
 	}
       else
 	{
-	  DECODE_HANDLE_EOL_TYPE (eol, c, flags, dst);
+	  DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
 	  if (BYTE_BIG5_TWO_BYTE_1_P (c))
 	    ch = c;
 	  else
@@ -2869,19 +2879,20 @@
 {
   unsigned char c;
   struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
-  unsigned int flags, ch, eol;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = CODING_SYSTEM_EOL_TYPE (str->codesys);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
 
   while (n--)
     {
       c = *src++;
       if (c == '\n')
 	{	
-	  if (eol != EOL_LF && eol != EOL_AUTODETECT)
+	  if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
 	    Dynarr_add (dst, '\r');
-	  if (eol != EOL_CR)
+	  if (eol_type != EOL_CR)
 	    Dynarr_add (dst, '\n');
 	}
       else if (BYTE_ASCII_P (c))
@@ -3732,13 +3743,13 @@
 {
   unsigned char c;
   unsigned int flags, ch;
-  int eol;
+  enum eol_type eol_type;
   struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
   Lisp_Object coding_system = Qnil;
   unsigned_char_dynarr *real_dst = dst;
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = CODING_SYSTEM_EOL_TYPE (str->codesys);
+  eol_type = str->eol_type;
   XSETCODING_SYSTEM (coding_system, str->codesys);
 
   if (flags & CODING_STATE_COMPOSITE)
@@ -3749,10 +3760,8 @@
       c = *src++;
       if (flags & CODING_STATE_ESCAPE)
 	{	/* Within ESC sequence */
-	  int retval;
-
-	  retval = parse_iso2022_esc (coding_system, &str->iso2022,
-				      c, &flags, 1);
+	  int retval = parse_iso2022_esc (coding_system, &str->iso2022,
+					  c, &flags, 1);
 
 	  if (retval)
 	    {
@@ -3840,7 +3849,7 @@
 	  /***** Now handle the control characters. *****/
 
 	  /* Handle CR/LF */
-	  DECODE_HANDLE_EOL_TYPE (eol, c, flags, dst);
+	  DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
 
 	  flags &= CODING_STATE_ISO2022_LOCK;
 
@@ -3853,7 +3862,7 @@
 	  int lb;
 	  int reg;
 
-	  DECODE_HANDLE_EOL_TYPE (eol, c, flags, dst);
+	  DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
 
 	  /* Now determine the charset. */
 	  reg = ((flags & CODING_STATE_SS2) ? 2
@@ -4052,7 +4061,8 @@
 		       unsigned_char_dynarr *dst, unsigned int n)
 {
   unsigned char charmask, c;
-  unsigned int flags, ch, eol;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
   unsigned char char_boundary;
   struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
   struct Lisp_Coding_System *codesys = str->codesys;
@@ -4067,7 +4077,7 @@
   int in_composite = 0;
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = CODING_SYSTEM_EOL_TYPE (str->codesys);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
   char_boundary = str->iso2022.current_char_boundary;
   charset = str->iso2022.current_charset;
   half = str->iso2022.current_half;
@@ -4109,9 +4119,9 @@
 	    }
 	  if (c == '\n')
 	    {
-	      if (eol != EOL_LF && eol != EOL_AUTODETECT)
+	      if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
 		Dynarr_add (dst, '\r');
-	      if (eol != EOL_CR)
+	      if (eol_type != EOL_CR)
 		Dynarr_add (dst, c);
 	    }
 	  else
@@ -4351,17 +4361,17 @@
 {
   unsigned char c;
   unsigned int flags, ch;
-  int eol;
+  enum eol_type eol_type;
   struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = str->eol_type;
+  eol_type = str->eol_type;
 
   while (n--)
     {
       c = *src++;
       
-      DECODE_HANDLE_EOL_TYPE (eol, c, flags, dst);
+      DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
       DECODE_ADD_BINARY_CHAR (c, dst);
     label_continue_loop:;
     }
@@ -4377,19 +4387,20 @@
 {
   unsigned char c;
   struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
-  unsigned int flags, ch, eol;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
 
   CODING_STREAM_DECOMPOSE (str, flags, ch);
-  eol = CODING_SYSTEM_EOL_TYPE (str->codesys);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
 
   while (n--)
     {
       c = *src++;
       if (c == '\n')
 	{
-	  if (eol != EOL_LF && eol != EOL_AUTODETECT)
+	  if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
 	    Dynarr_add (dst, '\r');
-	  if (eol != EOL_CR)
+	  if (eol_type != EOL_CR)
 	    Dynarr_add (dst, '\n');
 	  ch = 0;
 	}
--- a/version.sh	Mon Aug 13 09:52:21 2007 +0200
+++ b/version.sh	Mon Aug 13 09:53:19 2007 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
 emacs_major_version=20
 emacs_minor_version=3
-emacs_beta_version=16
-xemacs_codename="Budapest"
+emacs_beta_version=17
+xemacs_codename="Bucharest"