changeset 72:b9518feda344 r20-0b31

Import from CVS: tag r20-0b31
author cvs
date Mon, 13 Aug 2007 09:03:46 +0200
parents bae944334fa4
children e2d7a37b7c8d
files CHANGES-beta ChangeLog Installation configure configure.in etc/edt-user.doc info/dir lib-src/ChangeLog lib-src/update-elc.sh lib-src/update-elc.sh-STEVE lisp/ChangeLog lisp/comint/background.el lisp/comint/dbx.el lisp/comint/gdb.el lisp/comint/history.el lisp/edebug/advise-eval-region.el lisp/edebug/cl-read.el lisp/edebug/cl-specs.el lisp/edebug/cust-print.el lisp/edebug/edebug-cl-read.el lisp/edebug/edebug.el lisp/edebug/eval-reg.el lisp/electric/ebuff-menu.el lisp/electric/echistory.el lisp/electric/ehelp.el lisp/electric/electric.el lisp/electric/helper.el lisp/emulators/crisp.el lisp/emulators/edt-lk201.el lisp/emulators/edt-mapper.el lisp/emulators/edt-pc.el lisp/emulators/edt-vt100.el lisp/emulators/edt.el lisp/emulators/mlconvert.el lisp/emulators/mlsupport.el lisp/emulators/scroll-lock.el lisp/emulators/teco.el lisp/emulators/tpu-edt.el lisp/emulators/tpu-extras.el lisp/emulators/tpu-mapper.el lisp/emulators/ws-mode.el lisp/games/NeXTify.el lisp/games/blackbox.el lisp/games/conx.el lisp/games/cookie1.el lisp/games/dissociate.el lisp/games/doctor.el lisp/games/dunnet.el lisp/games/flame.el lisp/games/hanoi.el lisp/games/life.el lisp/games/mpuz.el lisp/games/spook.el lisp/games/studly.el lisp/games/yow.el lisp/modes/vhdl-mode.el lisp/packages/apropos.el lisp/packages/autoinsert.el lisp/packages/buff-menu.el lisp/packages/column.el lisp/packages/hexl.el lisp/packages/icomplete.el lisp/packages/man-xref.el lisp/packages/man.el lisp/packages/mic-paren.el lisp/packages/time-stamp.el lisp/prim/buffer.el lisp/prim/debug.el lisp/prim/files-nomule.el lisp/prim/files.el lisp/prim/format.el lisp/prim/help.el lisp/prim/indent.el lisp/prim/loaddefs.el lisp/prim/novice.el lisp/prim/options.el lisp/prim/page.el lisp/prim/paragraphs.el lisp/prim/rect.el lisp/prim/register.el lisp/prim/replace.el lisp/prim/reposition.el lisp/prim/simple.el lisp/prim/sort.el lisp/prim/startup.el lisp/prim/subr.el lisp/prim/userlock.el lisp/rmail/rmail-kill.el lisp/rmail/rmail-xemacs.el lisp/tl/emu-e19.el lisp/utils/bench.el lisp/utils/flow-ctrl.el lisp/utils/forms.el lisp/utils/id-select.el lisp/utils/pretty-print.el lisp/utils/smtpmail.el lisp/version.el man/ChangeLog man/vhdl-mode.texi src/ChangeLog src/config.h.in src/event-stream.c src/puresize.h src/redisplay.c src/s/hpux10-shr.h src/s/hpux10.h src/s/hpux10shr.h src/s/hpux8-shr.h src/s/hpux8shr.h src/s/hpux9-shr.h src/s/hpux9shr.h src/s/hpux9shxr4.h src/s/sunos4-0-shr.h src/s/sunos4-0shr.h src/s/sunos4-1-2-shr.h src/s/sunos4-1-2shr.h src/s/sunos4-1-3-shr.h src/s/sunos4-1-3shr.h src/s/sunos4-1-shr.h src/s/sunos4-1shr.h
diffstat 120 files changed, 19423 insertions(+), 5636 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 09:03:07 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 09:03:46 2007 +0200
@@ -1,4 +1,20 @@
 							-*- indented-text -*-
+to 20.0 beta31
+
+-- EDT/TPU modes synched from GNU Emacs, should actually work for the first
+   first time.
+-- Lots of files synched with GNU Emacs 19.34.
+-- Apropos mode enhancements.
+-- locate-library is now silent when called non-interactively.
+-- Non aggressive keyboard focus throwing is supported.
+-- Various enhancements from Lars Magne Ingebrigtsen.
+-- smtpmail.el added from GNU Emacs 19.34.
+-- man.el & man-xref.el added from GNU Emacs 19.35.
+-- crisp/brief emulation courtesy of Gary D. Foster.
+-- id-select.el courtesy of Bob Weiner.
+-- pretty-print.el courtesy of Guido Bosch
+-- vhdl-mode.el Version 2.73 courtesy of Rod Whitby.
+
 to 20.0 beta30
 
 -- Syntax entry specification "e" has been removed.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ChangeLog	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,28 @@
+Tue Dec 10 18:33:19 1996  Rod Whitby  <rwhitby@asc.sps.mot.com>
+
+	* info/vhdl-mode.info: New file.
+
+	* info/dir (Packages): Add vhdl-mode documentation.
+
+Tue Dec 10 18:27:02 1996  Martin Buchholz  <mrb@Eng.Sun.COM>
+
+	* configure: Make shared/dynamic flags work much more logically.
+
+Tue Dec 10 09:17:22 1996  David Worenklein  <dcw@gcm.com>
+
+	* configure.in (machine): Patch to make newly renamed shared
+	link include files work.
+
+Sat Dec  7 16:28:10 1996  Martin Buchholz  <mrb@Eng.Sun.COM>
+
+	* configure.in: Configure for POSIX getcwd if available.
+
+Thu Dec  5 20:42:35 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* etc/edt-user.doc (File): New file from Emacs 19.34.
+
+Thu Dec  5 11:56:05 1996  Joseph J Nuspl <nuspl@nvwls.cc.purdue.edu>
+
+	* configure.in (LIBS): Fix typo in dialog box test.
+
+
--- a/Installation	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-Configured for `i586-unknown-linux2.0.26'.
-
-  Where should the build process find the source code?    /usr/local/xemacs/xemacs-20.0-b30
-  What installation prefix should install use?            /usr/local
-  What operating system and machine description files should XEmacs use?
-        `s/linux.h' and `m/intel386.h'
-  What compiler should XEmacs be built with?              gcc -g -O4 -malign-loops=2 -malign-jumps=2
-  Should XEmacs use the GNU version of malloc?            yes
-  Should XEmacs use the relocating allocator for buffers? yes
-  What window system should XEmacs use?                   x11
-  Where do we find X Windows header files?                /usr/X11R6/include
-  Where do we find X Windows libraries?                   /usr/X11R6/lib
-  Compiling in support for XAUTH.
-  Compiling in support for XPM.
-  Compiling in support for X-Face headers.
-  Compiling in support for GIF image conversion.
-  Compiling in support for JPEG image conversion.
-  Compiling in native sound support.
-  Compiling in support for Berkeley DB.
-  Compiling in support for GNU DBM.
-  Compiling in Mule (multi-lingual) support.
-  Compiling in support for OffiX.
-  Using the Lucid menubar.
-  Using the Lucid scrollbar.
-  Using the Athena dialog boxes.
-  Compiling in extra code for debugging.
-  Compiling in code for checking XEmacs memory usage.
--- a/configure	Mon Aug 13 09:03:07 2007 +0200
+++ b/configure	Mon Aug 13 09:03:46 2007 +0200
@@ -1124,11 +1124,8 @@
 
     case "${canonical}" in
       *-hp-hpux7*     )  opsys=hpux      ;;
-      *-hp-hpux8shr*  )  opsys=hpux8shr  ;;
       *-hp-hpux8*     )  opsys=hpux8     ;;
-      *-hp-hpux9shr*  )  opsys=hpux9shr  ;;
       *-hp-hpux9*     )  opsys=hpux9     ;;
-      *-hp-hpux10shr* )  opsys=hpux10shr ;;
       *-hp-hpux10*    )  opsys=hpux10    ;;
       * )
         case "`uname -r`" in
@@ -1142,6 +1139,8 @@
         esac
       ;;
     esac
+
+    case "${canonical}" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
   ;;
 
   hppa-*-nextstep* ) machine=hp800 opsys=nextstep ;;
@@ -1333,12 +1332,7 @@
     
     case "${canonical}" in
       ## The Sun386 didn't get past 4.0.
-      i[3-9]86-*-sunos4	   ) opsys=sunos4-0      ;;
-      *-sunos4shr*	   ) opsys=sunos4-0shr   ;;
-      *-sunos4-0shr*	   ) opsys=sunos4-0shr   ;;
-      *-sunos4-1shr*	   ) opsys=sunos4-1shr   ;;
-      *-sunos4-1-2shr*	   ) opsys=sunos4-1-2shr ;;
-      *-sunos4-1-[3-9]shr* ) opsys=sunos4-1-3shr ;;
+      i[3-9]86-*-sunos4*   ) opsys=sunos4-0      ;;
       *-sunos4.0*	   ) opsys=sunos4-0      ;;
       *-sunos4.1.2*        ) opsys=sunos4-1-2    ;;
       *-sunos4.1.[3-9]*	   ) opsys=sunos4-1-3    ;;
@@ -1353,6 +1347,8 @@
       *			   ) opsys=bsd4-2	 ;;
     esac
 
+    case "${canonical}" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
+
     ## Watch out for a compiler that is guaranteed not to work.
     case "${canonical}" in
       *-solaris* ) test "$CC" = "/usr/ucb/cc" && unset CC ;;
@@ -1499,13 +1495,11 @@
 
 if test "${dynamic}" = "yes" ; then
   case "${opsys}" in
-    hpux8 | hpux9 | hpux10 | sunos4-0 | sunos4-1 | sunos4-1-2 | sunos4-1-3 | sco5 ) 
-    opsys="${opsys}-shr" ;;
+    hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
   esac
 elif test "${dynamic}" = "no" ; then
   case "${opsys}" in
-    sol2 | sol2-3 | sol2-4 | decosf1-3 | decosf3-1 | decosf3-2 | linux )
-    opsys="${opsys}-static" ;;
+    sol2* | decosf1-3 | decosf3-* | linux ) opsys="${opsys}-static" ;;
   esac
 fi
 
@@ -2723,7 +2717,7 @@
   esac
 fi
 
-if test "${opsys}" = "hpux9shr"; then
+if test "${opsys}" = "hpux-9shr"; then
   case "${x_libraries}" in
     *X11R4* ) opsysfile="s/hpux9shxr4.h" ;;
   esac
--- a/configure.in	Mon Aug 13 09:03:07 2007 +0200
+++ b/configure.in	Mon Aug 13 09:03:46 2007 +0200
@@ -1130,11 +1130,11 @@
 
     case "${canonical}" in
       *-hp-hpux7*     )  opsys=hpux      ;;
-      *-hp-hpux8shr*  )  opsys=hpux8shr  ;;
+      *-hp-hpux8shr*  )  opsys=hpux8-shr  ;;
       *-hp-hpux8*     )  opsys=hpux8     ;;
-      *-hp-hpux9shr*  )  opsys=hpux9shr  ;;
+      *-hp-hpux9shr*  )  opsys=hpux9-shr  ;;
       *-hp-hpux9*     )  opsys=hpux9     ;;
-      *-hp-hpux10shr* )  opsys=hpux10shr ;;
+      *-hp-hpux10shr* )  opsys=hpux10-shr ;;
       *-hp-hpux10*    )  opsys=hpux10    ;;
       * )
         case "`uname -r`" in
@@ -2554,7 +2554,7 @@
 
 test "${with_menubars}"   != "no"    && AC_DEFINE(HAVE_MENUBARS)
 test "${with_scrollbars}" != "no"    && AC_DEFINE(HAVE_SCROLLBARS)
-test "${with_scrollbars}" != "no"    && AC_DEFINE(HAVE_DIALOGS)
+test "${with_dialogs}"    != "no"    && AC_DEFINE(HAVE_DIALOGS)
 
 test "${with_menubars}"   = "lucid"  && AC_DEFINE(LWLIB_MENUBARS_LUCID)
 test "${with_menubars}"   = "motif"  && AC_DEFINE(LWLIB_MENUBARS_MOTIF)
@@ -2714,7 +2714,7 @@
 # # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
 # A C_CHECK_LIB(m, sqrt)
 
-AC_HAVE_FUNCS(acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getwd logb lrand48 matherr mkdir mktime perror poll random realpath rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset utimes waitpid)
+AC_HAVE_FUNCS(acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random realpath rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset utimes waitpid)
 
 # Check for mmap.
 found_mmap=true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/edt-user.doc	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,782 @@
+File:  edt-user.doc  ---  EDT Emulation User Instructions
+
+                                For GNU Emacs 19
+
+Copyright (C) 1986, 1992, 1994, 1995 Free Software Foundation, Inc.
+
+Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+Keywords: emulations
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+============================================================================
+
+I.    OVERVIEW:
+
+This version of the EDT emulation package for GNU Emacs is a substantially
+enhanced version of the original.  A large part of the original can still be
+found here, of course, but much of it has been modified and quite a bit is
+new.  Many of the ideas found here are borrowed from others.  In particular,
+some of the code found here was drawn from an earlier re-write of the EDT
+package done at DSC in 1989 by Matthew Frohman.
+   
+Send bug fixes, suggestions for enhancements, and corrections to this
+documentation to Kevin Gallagher (kgallagh@spd.dsccc.com).
+
+The EDT emulation consists of the following files:
+
+edt-user.doc          - User instructions (which you are reading now)
+edt.el                - EDT Emulation Functions and Default Configuration
+edt-lk201.el          - Support for DEC LK-201 Keyboards
+edt-vt100.el          - Support for DEC VT-100 (and above) terminals
+edt-mapper.el         - Support for Keyboards used under X Windows
+edt-pc.el             - Support for the PC AT Keyboard under MS-DOS
+
+Several goals were kept in mind when making this version:
+     
+        1.  Emulate EDT Keypad Mode commands closely so that current
+            EDT users will find that it easy and comfortable to use
+            GNU Emacs with a small learning curve;
+   
+        2.  Make it easy for a user to customize EDT emulation key
+            bindings without knowing much about Emacs Lisp;
+
+        3.  Make it easy to switch between the original EDT default bindings
+            and the user's customized bindings, without having to exit Emacs.
+
+        4.  Provide support for some TPU/EVE functions not supported in
+            EDT. 
+
+        5.  Provide an easy way to restore ALL original Emacs key bindings,
+            just as they existed before the EDT emulation was first invoked.
+   
+        6.  Support GNU Emacs 19.  (Support for GNU Emacs 18 has been dropped.
+            Also, although there is some code designed to support Xemacs 19
+            (formerly Lucid Emacs), this is not fully implemented at this
+            time. 
+
+        7.  When running under X, support highlighting of marked text.
+
+        8.  Handle terminal configuration under X interactively when the
+            emulation is invoked for the first time.
+
+        9.  Support a PC AT keyboard under MS-DOS.
+
+II.   TERMINALS/KEYBOARDS SUPPORTED:
+
+Keyboards used under X Windows are supported via the edt-mapper function.  The
+first time you invoke the emulation under X, the edt-mapper function is run
+automatically and the user is prompted to identify which keys the emulation is
+to use for the standard keypad and function keys EDT expects (e.g., PF1, PF2,
+etc.).  This configuration is saved to disk read each time the emulation is
+invoked.
+
+In character oriented connections not running a window manager, the following
+terminals/keyboards are supported.  (1) DEC VT-100 series and higher.  This
+includes well behaved VT clones and emulators.  If you are using a VT series
+terminal, be sure that the term environment variable is set properly before
+invoking emacs. (2) PC AT keyboard under MS-DOS.
+
+Be sure to read the SPECIAL NOTES FOR SOME PLATFORMS sections to see if those
+notes apply to you.
+
+
+III.  STARTING THE EDT EMULATION:
+
+Start up GNU Emacs and enter "M-x edt-emulation-on" to begin the emulation.
+After initialization is complete, the following message will appear below the
+status line informing you that the emulation has been enabled:
+
+                         Default EDT keymap active
+
+You can have the EDT Emulation start up automatically, each time you initiate
+a GNU Emacs session, by adding the following line to your .emacs file:
+
+                  (setq term-setup-hook 'edt-emulation-on)
+
+A reference sheet is included (later on) listing the default EDT Emulation key
+bindings.  This sheet is also accessible on line from within Emacs by pressing
+PF2, GOLD H, or HELP (when in the EDT Default Mode).
+
+It is easy to customize key bindings in the EDT Emulation.  (See CUSTOMIZING
+section, below.)  Customizations are placed in a file called edt-user.el.  (A
+sample edt-user.el file can be found in the CUSTOMIZING section.)  If
+edt-user.el is found in your GNU Emacs load path during EDT Emulation
+initialization, then the following message will appear below the status line
+indicating that the emulation has been enabled, enhanced by your own
+customizations:
+
+                       User EDT custom keymap active
+
+Once enabled, it is easy to switch back and forth between your customized EDT
+Emulation key bindings and the default EDT Emulation key bindings.  It is also
+easy to turn off the emulation.  Doing so completely restores the original key
+bindings in effect just prior to invoking the emulation.
+
+Where EDT key bindings and GNU Emacs key bindings conflict, the default GNU
+Emacs key bindings are retained by the EDT emulation by default.  If you are a
+diehard EDT user you may not like this.  The CUSTOMIZING section explains how
+to change this default.
+
+
+IV.   SPECIAL NOTES FOR SOME PLATFORMS:
+
+  Sun Workstations running X:
+
+     Some earlier Sun keyboards do not have arrow keys separate from the
+     keypad keys.  It is difficult to emulate the full EDT keypad and still
+     retain use of the arrow keys on such keyboards.  
+
+     The Sun Type 5 keyboard, however, does have separate arrow keys.  This
+     makes it a candidate for setting up a reasonable EDT keypad emulation.
+     Unfortunately, Sun's default X keynames for the keypad keys don't permit
+     GNU Emacs to interpret the keypad 2, 4, 6, and 8 keys as something other
+     than arrow keys, nor use all the top row of keys for PF1 thru PF4 keys.
+     Here's the contents of an .xmodmaprc file which corrects this problem for
+     Sun Type 5 keyboards:
+
+         ! File:  .xmodmaprc
+         !
+         ! Set up Sun Type 5 keypad for use with the GNU Emacs EDT Emulation
+         !
+         keycode  53 = KP_Divide
+         keycode  54 = KP_Multiply
+         keycode  57 = KP_Decimal
+         keycode  75 = KP_7
+         keycode  76 = KP_8
+         keycode  77 = KP_9
+         keycode  78 = KP_Subtract
+         keycode  97 = KP_Enter
+         keycode  98 = KP_4
+         keycode  99 = KP_5
+         keycode 100 = KP_6
+         keycode 101 = KP_0
+         keycode 105 = F24
+         keycode 119 = KP_1
+         keycode 120 = KP_2
+         keycode 121 = KP_3
+         keycode 132 = KP_Add
+
+     Feed .xmodmaprc to the xmodmap command and all the Sun Type 5 keypad keys
+     will now be configurable for the emulation of an LK-201 keypad (less the
+     comma key).  The line
+
+         keycode 105 = F24
+
+     modifies the NumLock key to be the F24 key which can then be configured
+     to behave as the PF1 key.  In doing so, you will no longer have a NumLock
+     key.  If you are using other software under X which requires a NumLock
+     key, then examine your keyboard and look for one you don't use and
+     redefine it to be the NumLock key.  (See the man page on xmodmap for for
+     further help on how to do this.)
+
+  PC users running MS-DOS:
+
+     By default, F1 is configured to emulate the PF1 (GOLD) key.  But NumLock
+     can be used instead if you load a freeware TSR distributed with
+     MS-Kermit, call gold.com.  It is distributed in a file called gold22.zip
+     and comes with the source code as well as a loadable binary image. 
+     (See edt-pc.el for more information.)
+
+  PC users running Linux:
+
+     The default X server configuration of three keys PC AT keyboard keys
+     needs to be modified to permit the PC keyboard to emulate an LK-201
+     keyboard properly.  Here's the contents of an .xmodmaprc file which makes
+     these changes for your:
+
+         ! File:  .xmodmaprc
+         !
+         ! Set up PC keypad under Linux for the GNU Emacs EDT Emulation 
+         !
+         keycode  22 = BackSpace
+         keycode  77 = F12
+         keycode  96 = Num_Lock
+
+     Feed the file to the xmodmap command and all the PC keypad keys will now
+     be configurable for the emulation of an LK-201 keypad (less the comma
+     key), the standard keyboard supplied with DEC terminals VT-200 and above.
+     This file switches the role of the F12 and NumLock keys.  It also
+     modifies the definition of the Delete key above the arrow keys so that it
+     can be assigned a keybinding independently of the the BackSpace key.
+
+     NOTE: It is necessary to have NumLock ON for the PC keypad to emulate the
+     LK-201 keypad properly.
+
+
+V.    HOW DOES THIS EDT EMULATION DIFFER FROM REAL EDT?:
+
+In general, you will find that this emulation of EDT replicates most, but not
+all, of EDT's most used Keypad Mode editing functions and behavior.  It is not
+perfect, but most EDT users who have tried the emulation agree that it is
+quite good enough to make it easy for die-hard EDT users to move over to using
+GNU Emacs.  
+
+Here's a list of the most important differences between EDT and this GNU Emacs
+EDT Emulation.  The list is short but you must be aware of these differences
+if you are to use the EDT Emulation effectively.
+
+1.  Entering repeat counts works a little differently than in EDT.
+
+    EDT allows users to enter a repeat count before entering a command that
+    accepts repeat counts.  For example, when in EDT, pressing these three
+    keys in sequence, GOLD 5 KP1, will move the cursor in the current
+    direction 5 words.
+
+    Emacs provides two ways to enter repeat counts, though neither involves
+    using the GOLD key.  In Emacs, repeat counts can be entered by using the 
+    ESC key.  For example, pressing these keys in sequence, ESC 1 0 KP1, will
+    move the cursor in the current direction 10 words. 
+
+    Emacs provides another command called universal-argument that can do the
+    same thing, plus a few other things.  Normally, Emacs has this bound to
+    C-u.  
+
+2.  The EDT SUBS command, bound to GOLD ENTER, is NOT supported.  The built-in
+    Emacs query-replace command has been bound to GOLD ENTER, instead.  It is
+    much more convenient to use than SUBS.
+
+3.  EDT's line mode commands and nokeypad mode commands are NOT supported
+    (with one important exception; see item 8 in the Highlights section
+    below).  Although, at first, this may seem like a big omission, the set of
+    built-in Emacs commands provides a much richer set of capabilities which
+    more than make up for this omission.
+
+    To enter Emacs commands not bound to keys, you can press GOLD KP7 or the
+    DO key.  Emacs will display it's own command prompt called Meta-x (M-x).
+    You can also invoke this prompt the normal Emacs way by entering ESC x.
+
+4.  Selected text is highlighted ONLY when running under X Windows.  Gnu Emacs
+    19 does not support highlighting of text on VT series terminals, at this
+    time. 
+
+5.  Just like TPU/EVE, The ENTER key is NOT used to terminate input when the
+    editor prompts you for input.  The RETURN key is used, instead.  (KP4 and
+    KP5 do terminate input for the FIND command, just like in EDT, however.)
+
+
+
+
+VI.   SOME HIGHLIGHTS IN THIS EDT EMULATION, AND SOME COMPARISONS TO THE
+      ORIGINAL GNU EMACS EDT EMULATION:
+
+1.  The EDT define key command is supported (edt-define-key) and is bound to
+    C-k in the default EDT mode when EDT control sequence bindings are enabled
+    or one of the sample edt-user.el customization files is used.  The TPU/EVE
+    learn command is supported but not bound to a key in the default EDT mode
+    but is bound in the sample edt-user.el files.
+
+    Unlike the TPU/EVE learn command, which uses one key to begin the learn
+    sequence, C-l, and another command to remember the sequence, C-r, this
+    version of the learn command (edt-learn) serves as a toggle to both begin
+    and to remember the learn sequence.
+
+    Many users who change the meaning of a key with the define key and the
+    learn commands, would like to be able to restore the original key binding
+    without having to quit and restart emacs.  So a restore key command is
+    provided to do just that.  When invoked, it prompts you to press the key
+    to which you wish the last replaced key definition restored.  It is bound
+    to GOLD C-k in the default EDT mode when EDT control sequence bindings are
+    enabled or one of the sample edt-user.el customization files is used.
+
+2.  Direction support is fully supported.  It is no longer accomplished by
+    re-defining keys each time the direction is changed.  Thus, commands
+    sensitive to the current direction setting may be bound easily to any key.
+
+3.  All original emacs bindings are fully restored when EDT emulation is
+    turned off.
+
+4.  User custom EDT bindings are kept separate from the default EDT bindings.
+    One can toggle back and forth between the custom EDT bindings and default
+    EDT bindings.
+
+5.  The Emacs functions in edt.el attempt to emulate, where practical, the
+    exact behavior of the corresponding EDT keypad mode commands.  In a few
+    cases, the emulation is not exact, but we hope you will agree it is close
+    enough.  In a very few cases, we chose to use the Emacs way of handling
+    things.  As mentioned earlier, we do not emulate the EDT SUBS command.
+    Instead, we chose to use the Emacs query-replace function, which we find
+    to be easier to use.
+
+6.  Emacs uses the regexp assigned to page-delimiter to determine what marks a
+    page break.  This is normally "^\f", which causes the edt-page command to
+    ignore form feeds not located at the beginning of a line.  To emulate the
+    EDT PAGE command exactly, page-delimiter is set to "\f" when EDT emulation
+    is turned on, and restored to "^\f" when EDT emulation is turned off.
+    But, since some users prefer the Emacs definition of a page break, or may
+    wish to preserve a customized definition of page break, one can override
+    the EDT definition by placing
+
+            (setq edt-keep-current-page-delimiter t)
+
+    in your .emacs file.
+
+7.  The EDT definition of a section of a terminal window is hardwired to be 16
+    lines of its one-and-only 24-line window (the EDT SECT command bound to
+    KP8).  That's two-thirds of the window at a time.  Since Emacs, like
+    TPU/EVE, can handle multiple windows of sizes of other than 24 lines, the
+    definition of section used here has been modified to two-thirds of the
+    current window.  (There is also an edt-scroll-window function which you
+    may prefer over the SECT emulation.)
+
+8.  Cursor movement and deletion involving word entities is identical to EDT.
+    This, above all else, gives the die-hard EDT user a sense of being at
+    home.  Also, an emulation of EDT's SET ENTITY WORD command is provided,
+    for those users who like to customize movement by a word at a time to
+    their own liking.
+
+9.  EDT's FIND and FNDNXT are supported.
+
+10. EDT's APPEND and REPLACE commands are supported.
+
+11. CHNGCASE is supported.  It works on individual characters or selected
+    text, if SELECT is active.  In addition, two new commands are provided:
+    edt-lowercase and edt-uppercase.  They work on individual WORDS or
+    selected text, if SELECT is active.
+
+12. Form feed and tab insert commands are supported.
+
+13. A new command, edt-duplicate-word, is provided.  If you experiment with
+    it, you might find it to be surprisingly useful and may wonder how you
+    ever got along without it!  It is assigned to C-j in the sample
+    edt-user.el customization files.
+
+14. TPU/EVE's Rectangular Cut and Paste functions (originally from the EVE-Plus
+    package) are supported.  But unlike the TPU/EVE versions, these here
+    support both insert and overwrite modes.  The seven rectangular functions
+    are bound to F7, F8, GOLD-F8, F9, GOLD-F9, F10, and GOLD-F10 in the
+    default EDT mode.
+
+15. The original EDT emulation package set up many default regular and GOLD
+    bindings.  We tried to preserve most (but not all!) of these, so users of
+    the original emulation package will feel more at home.  
+
+    Nevertheless, there are still many GOLD key sequences which are not bound
+    to any functions.  These are prime candidates to use for your own 
+    customizations.  
+    
+    Also, there are several commands in edt.el not bound to any key.  So, you
+    will find it worthwhile to look through edt.el for functions you may wish
+    to add to your personal customized bindings.
+
+16. The VT200/VT300 series terminals steal the function keys F1 to F5 for
+    their own use.  These do not generate signals which are sent to the host.
+    So, edt.el does not assign any default bindings to F1 through F5.
+
+    In addition, our VT220 terminals generate an interrupt when the F6 key is
+    pressed (^C or ^Y, can't remember which) and not the character sequence
+    documented in the manual.  So, binding emacs commands to F6 will not work
+    if your terminal behaves the same way.
+
+17. The VT220 terminal has no ESC, BS, nor LF keys, as does a VT100.  So the
+    default EDT bindings adopt the standard DEC convention of having the F11,
+    F12, and F13 keys, on a VT200 series (and above) terminal, assigned to the
+    same EDT functions that are bound to ESC, BS, and LF on a VT100 terminal.
+
+18. Each user, through the use of a private edt-user.el file, can customize,
+    very easily, personal EDT emulation bindings.
+
+19. The EDT SELECT and RESET functions are supported.  However, unlike EDT,
+    pressing RESET to cancel text selection does NOT reset the existing
+    setting of the current direction.
+
+    We also provide a TPU/EVE like version of the single SELECT/RESET
+    function, called edt-toggle-select, which makes the EDT SELECT function
+    into a toggle on/off switch.  That is, if selection is ON, pressing SELECT
+    again turns selection off (cancels selection).  This function is used in
+    the sample edt-user.el customization files.
+
+
+VII.  CUSTOMIZING:
+
+Most EDT users, at one time or another, make some custom key bindings, or
+use someone else's custom key bindings, which they come to depend upon just as
+if they were built-in bindings.  This EDT Emulation for GNU Emacs is designed
+to make it easy to customize bindings.
+
+If you wish to customize the EDT Emulation to use some of your own key
+bindings, you need to make a private version of edt-user.el in your own
+private lisp directory.  There are two sample files edt-user.el1 and
+edt-user.el2 for you to use as templates and for ideas.  Look at
+edt-user.el1 first.  Unless you will be using two or more very different
+types of terminals on the same system, you need not look at edt-user.el2.
+
+First, you need to have your own private lisp directory, say ~/lisp, and
+you should add it to the GNU Emacs load path.
+
+NOTE:  A few sites have different load-path requirements, so the above
+       directions may need some modification if your site has such special
+       needs. 
+
+
+Creating your own edt-user.el file:
+
+A sample edt-user.el file is attached to the end of this user documentation.
+You should use it as a guide to learn how you can customize EDT emulation
+bindings to your own liking.  Names used to identify the set of LK-201
+keypad and function keys are:
+
+Keypad Keys:   
+                PF1 PF2 PF3 PF4
+                KP7 KP8 KP9 KP-
+                KP4 KP5 KP6 KP,
+                KP1 KP2 KP3 
+                KP0     KPP KPE
+
+Arrow Keys:
+                LEFT RIGHT DOWN UP
+
+Function Keys:
+                F1 F2 F3 F4 F5  F6 F7 F8 F9 F10  F11 F12 F13 F14
+                HELP DO  F17 F18 F19 F20
+
+                FIND   INSERT   REMOVE 
+                SELECT PREVIOUS NEXT
+
+Note:
+                Many VT-200 terminals, and above, steal function keys F1 thru
+                F5 for terminal setup control and don't send anything to the
+                host if pressed.  So customizing bindings to these keys may
+                not work for you.
+
+There are three basic functions that do the EDT emulation bindings:
+edt-bind-standard-key, edt-bind-gold-key, and edt-bind-function-key.
+
+The first two are for binding functions to keys which are standard across most
+keyboards.  This makes them keyboard independent, making it possible to define
+these key bindings for all terminals in the file edt.el.
+
+The first, edt-bind-standard-key, is used typically to bind emacs commands to
+control keys, although some people use it to bind commands to other keys, as
+well.  (For example, some people use it to bind the VT200 seldom used
+back-tick key (`) to the function "ESC-prefix" so it will behave like an ESC
+key.)  The second function, edt-bind-gold-key, is used to bind emacs commands
+to gold key sequences involving alpha-numeric keys, special character keys,
+and control keys.
+
+The third function, edt-bind-function-key, is terminal dependent and is
+defined in a terminal specific file (see edt-vt100.el for example).  It is
+used to bind emacs commands to function keys, to keypad keys, and to gold
+sequences of those keys.
+
+WARNING: Each of the three functions, edt-bind-function-key,
+         edt-bind-gold-key, and edt-bind-standard-key, has an optional
+         last argument.  The optional argument should NOT be used in
+         edt-user.el!  When the optional argument is missing, each
+         function knows to make the key binding part of the user's EDT
+         custom bindings, which is what you want to do in edt-user.el!
+
+         The EDT default bindings are set up in edt.el by calling these
+         same functions with the optional last argument set to "t".  So, if
+         you decide to copy such function calls from edt.el to edt-user.el
+         for subsequent modification, BE SURE TO DELETE THE "t" AT THE END
+         OF EACH PARAMETER LIST!
+
+
+SPECIFYING WORD ENTITIES:
+
+The variable edt-word-entities is used to emulate EDT's SET ENTITY WORD
+command.  It contains a list of characters to be treated as words in
+themselves.  If the user does not define edt-word-entities in his/her .emacs
+file, then it is set up with the EDT default containing only TAB.
+
+The characters are stored in the list by their numerical values, not as
+strings.  Emacs supports several ways to specify the numerical value of a
+character.  One method is to use the question mark: ?A means the numerical
+value for A, ?/ means the numerical value for /, and so on.  Several
+unprintable characters have special representations:
+
+            ?\b  specifies  BS, C-h
+            ?\t  specifies  TAB, C-i
+            ?\n  specifies  LFD, C-j
+            ?\v  specifies  VTAB, C-k
+            ?\f  specifies  FF, C-l
+            ?\r  specifies  CR, C-m
+            ?\e  specifies  ESC, C-[
+            ?\\  specifies  \
+
+Here are some examples:
+
+     (setq edt-word-entities '(?\t ?- ?/)) ;; Specifies TAB, - , and /
+     (setq edt-word-entities '(?\t)        ;; Specifies TAB, the default
+
+You can also specify characters by their decimal ascii values:
+
+     (setq edt-word-entities '(9 45 47))   ;; Specifies TAB, - , and /
+
+
+ENABLING EDT CONTROL KEY SEQUENCE BINDINGS:
+
+Where EDT key bindings and GNU Emacs key bindings conflict, the default GNU
+Emacs key bindings are retained by default.  Some diehard EDT users may not
+like this.  So, if the variable edt-use-EDT-control-key-bindings is set to
+true in a user's .emacs file, then the default EDT Emulation mode will enable
+most of the original EDT control key sequence bindings.  If you wish to do
+this, add the following line to your .emacs file:
+
+        (setq edt-use-EDT-control-key-bindings t)
+
+
+                              DEFAULT EDT Keypad
+
+   F7: Copy Rectangle             +----------+----------+----------+----------+
+   F8: Cut Rect Overstrike        |Prev Line |Next Line |Bkwd Char |Frwd Char |
+ G-F8: Paste Rect Overstrike      |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
+   F9: Cut Rect Insert            |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
+ G-F9: Paste Rect Insert          +----------+----------+----------+----------+
+  F10: Cut Rectangle
+G-F10: Paste Rectangle
+  F11: ESC                       
+  F12: Begining of Line           +----------+----------+----------+----------+
+G-F12: Delete Other Windows       |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
+  F13: Delete to Begin of Word    |   (PF1)  |   (PF2)  |   (PF3)  |  (PF4)   |
+ HELP: Keypad Help                |Mark Wisel|Desc Funct|   FIND   |  UND L   |
+   DO: Execute extended command   +----------+----------+----------+----------+
+                                  |   PAGE   |   SECT   |  APPEND  |  DEL W   |
+  C-g: Keyboard Quit              |    (7)   |    (8)   |    (9)   |   (-)    |
+G-C-g: Keyboard Quit              |Ex Ext Cmd|Fill Regio| REPLACE  |  UND W   |
+  C-h: Beginning of Line          +----------+----------+----------+----------+
+G-C-h: Emacs Help                 |  ADVANCE |  BACKUP  |   CUT    |  DEL C   |
+  C-i: Tab Insert                 |    (4)   |    (5)   |    (6)   |   (,)    |
+  C-j: Delete to Begin of Word    |   BOTTOM |    TOP   |   Yank   |  UND C   |
+  C-k: Define Key                 +----------+----------+----------+----------+
+G-C-k: Restore Key                |   WORD   |    EOL   |   CHAR   |   Next   |
+  C-l: Form Feed Insert           |    (1)   |    (2)   |    (3)   |  Window  |
+  C-n: Set Screen Width 80        | CHNGCASE |  DEL EOL |Quoted Ins|          !
+  C-r: Isearch Backward           +---------------------+----------+  (ENTER) |
+  C-s: Isearch Forward            |         LINE        |  SELECT  |          !
+  C-t: Display the Time           |         (0)         |    (.)   |   Query  |
+  C-u: Delete to Begin of Line    |      Open Line      |  RESET   |  Replace |
+  C-v: Redraw Display             +---------------------+----------+----------+
+  C-w: Set Screen Width 132       
+  C-z: Suspend Emacs                    +----------+----------+----------+
+G-C-\: Split Window                     |  FNDNXT  |   Yank   |   CUT    |
+                                        |  (FIND)  | (INSERT) | (REMOVE) |
+  G-b: Buffer Menu                      |   FIND   |          |   COPY   |
+  G-c: Compile                          +----------+----------+----------+
+  G-d: Delete Window                    |SELECT/RES|SECT BACKW|SECT FORWA|
+  G-e: Exit                             | (SELECT) |(PREVIOUS)|  (NEXT)  |
+  G-f: Find File                        |          |          |          |
+  G-g: Find File Other Window           +----------+----------+----------+
+  G-h: Keypad Help
+  G-i: Insert File
+  G-k: Toggle Capitalization Word
+  G-l: Lowercase Word or Region
+  G-m: Save Some Buffers
+  G-n: Next Error
+  G-o: Switch to Next Window
+  G-q: Quit
+  G-r: Revert File
+  G-s: Save Buffer
+  G-u: Uppercase Word or Region
+  G-v: Find File Other Window
+  G-w: Write file
+  G-y: EDT Emulation OFF
+  G-z: Switch to User EDT Key Bindings
+  G-1: Delete Other Windows
+  G-2: Split Window
+  G-%: Go to Percentage
+  G- : Undo  (GOLD Spacebar)
+  G-=: Go to Line
+  G-`: What line
+
+;;; File:  edt-user.el   ---  Sample User Customizations for the Enhanced 
+;;;                             EDT Keypad Mode Emulation 
+;;;                             
+;;;                          For GNU Emacs 19
+;;;
+;; Copyright (C) 1986, 1992, 1993 Free Software Foundation, Inc.
+
+;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Keywords: emulations
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This file contains GNU Emacs User Custom EDT bindings and functions.  In
+;; this example file, there is no special test for the type of terminal being
+;; used.  The assumption is that all key bindings here apply to all terminals
+;; that may be used.  (In fact, it was written by an individual who uses only
+;; VT series terminals when logging into a VAX.)
+;;
+;; WARNING: Each of the three functions, edt-bind-function-key,
+;;          edt-bind-gold-key, and edt-bind-standard-key, has an optional
+;;          last argument.  The optional argument should NOT be used in
+;;          edt-user.el!  When the optional argument is missing, each
+;;          function knows to make the key binding part of the user's EDT
+;;          custom bindings, which is what you want to do in edt-user.el!
+;;
+;;          The EDT default bindings are set up in edt.el by calling these
+;;          same functions with the optional last argument set to "t".  So, if
+;;          you decide to copy such function calls from edt.el to edt-user.el
+;;          for subsequent modification, BE SURE TO DELETE THE "t" AT THE END
+;;          OF EACH PARAMETER LIST!
+;;
+
+;;; Usage:
+
+;;  See edt-user.doc in the emacs etc directory.
+
+;; ====================================================================
+
+;;;;
+;;;; Setup user custom EDT key bindings.
+;;;;
+
+(defun edt-setup-user-bindings ()
+  "Assigns user custom EDT Emulation keyboard bindings."
+
+  ;; PF1 (GOLD), PF2, PF3, PF4
+  ;;
+  ;; This file MUST contain a binding of PF1 to edt-user-gold-map.  So
+  ;; DON'T CHANGE OR DELETE THE REGULAR KEY BINDING OF PF1 BELOW!
+  ;; (However, you may change the GOLD-PF1 binding, if you wish.)
+  (edt-bind-function-key "PF1" 'edt-user-gold-map 'edt-mark-section-wisely)
+  (edt-bind-function-key "PF2" 'query-replace 'other-window)
+  (edt-bind-function-key "PF4" 'edt-delete-entire-line 'edt-undelete-line)
+
+  ;; EDT Keypad Keys
+  (edt-bind-function-key "KP1" 'edt-word-forward 'edt-change-case)
+  (edt-bind-function-key "KP3" 'edt-word-backward 'edt-copy)
+  (edt-bind-function-key "KP6" 'edt-cut-or-copy 'yank)
+  (edt-bind-function-key "KP8" 'edt-scroll-window 'fill-paragraph)
+  (edt-bind-function-key "KP9" 'open-line 'edt-eliminate-all-tabs)
+  (edt-bind-function-key "KPP" 
+			 'edt-toggle-select 'edt-line-to-middle-of-window)
+  (edt-bind-function-key "KPE" 'edt-change-direction 'overwrite-mode)
+
+  ;; GOLD bindings for regular keys.
+  (edt-bind-gold-key "a" 'edt-append)
+  (edt-bind-gold-key "A" 'edt-append)
+  (edt-bind-gold-key "h" 'edt-electric-user-keypad-help)
+  (edt-bind-gold-key "H" 'edt-electric-user-keypad-help)
+
+  ;; Control bindings for regular keys.
+  ;;; Leave binding of C-c as original prefix key.
+  (edt-bind-standard-key "\C-j" 'edt-duplicate-word)
+  (edt-bind-standard-key "\C-k" 'edt-define-key)
+  (edt-bind-gold-key  "\C-k" 'edt-restore-key)
+  (edt-bind-standard-key "\C-l" 'edt-learn)
+  ;;; Leave binding of C-m to newline.
+  (edt-bind-standard-key "\C-n" 'edt-set-screen-width-80)
+  (edt-bind-standard-key "\C-o" 'open-line)
+  (edt-bind-standard-key "\C-p" 'fill-paragraph)
+  ;;; Leave binding of C-r to isearch-backward.
+  ;;; Leave binding of C-s to isearch-forward.
+  (edt-bind-standard-key "\C-t" 'edt-display-the-time)
+  (edt-bind-standard-key "\C-v" 'redraw-display)
+  (edt-bind-standard-key "\C-w" 'edt-set-screen-width-132)
+  ;;; Leave binding of C-x as original prefix key.
+)
+
+;;;
+;;; LK-201 KEYBOARD USER EDT KEYPAD HELP
+;;;
+
+(defun edt-user-keypad-help ()
+  "
+                                USER EDT Keypad Active
+
+                                  +----------+----------+----------+----------+
+   F7: Copy Rectangle             |Prev Line |Next Line |Bkwd Char |Frwd Char |
+   F8: Cut Rect Overstrike        |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
+ G-F8: Paste Rect Overstrike      |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
+   F9: Cut Rect Insert            +----------+----------+----------+----------+
+ G-F9: Paste Rect Insert         
+  F10: Cut Rectangle
+G-F10: Paste Rectangle
+  F11: ESC                        +----------+----------+----------+----------+
+  F12: Begining of Line           |   GOLD   |Query Repl|  FNDNXT  |Del Ent L |
+G-F12: Delete Other Windows       |   (PF1)  |   (PF2)  |   (PF3)  |   (PF4)  |
+  F13: Delete to Begin of Word    |Mark Wisel|Other Wind|   FIND   |  UND L   |
+ HELP: Keypad Help                +----------+----------+----------+----------+
+   DO: Execute extended command   |   PAGE   |Scroll Win|Open Line |  DEL W   |
+                                  |    (7)   |    (8)   |    (9)   |   (-)    |
+  C-a: Beginning of Line          |Ex Ext Cmd|Fill Parag|Elim Tabs |  UND W   |
+  C-b: Switch to Buffer           +----------+----------+----------+----------+
+  C-d: Delete Character           |  ADVANCE |  BACKUP  | CUT/COPY |  DEL C   |
+  C-e: End of Line                |    (4)   |    (5)   |    (6)   |   (,)    |
+  C-f: Forward Character          |   BOTTOM |    TOP   |   Yank   |  UND C   |
+  C-g: Keyboard Quit              +----------+----------+----------+----------+
+G-C-g: Keyboard Quit              | Fwd Word |    EOL   | Bwd Word |  Change  |
+  C-h: Electric Emacs Help        |    (1)   |    (2)   |    (3)   | Direction|
+G-C-h: Emacs Help                 | CHNGCASE |  DEL EOL |   COPY   |          |
+  C-i: Indent for Tab             +---------------------+----------+  (ENTER) |
+  C-j: Duplicate Word             |         LINE        |SELECT/RES|          |
+  C-k: Define Key                 |         (0)         |    (.)   |  Toggle  |
+G-C-k: Restore Key                |      Open Line      |Center Lin|Insrt/Over|
+  C-l: Learn                      +---------------------+----------+----------+
+  C-n: Set Screen Width 80       
+  C-o: Open Line                       +----------+----------+----------+
+  C-p: Fill Paragraph                  |  FNDNXT  |   Yank   |    CUT   |
+  C-q: Quoted Insert                   |  (FIND)) | (INSERT) | (REMOVE) |
+  C-r: Isearch Backward                |   FIND   |          |   COPY   |
+  C-s: Isearch Forward                 +----------+----------+----------+
+  C-t: Display the Time                |SELECT/RES|SECT BACKW|SECT FORWA|
+  C-u: Universal Argument              | (SELECT) |(PREVIOUS)|  (NEXT)  |
+  C-v: Redraw Display                  |          |          |          |
+  C-w: Set Screen Width 132            +----------+----------+----------+
+  C-z: Suspend Emacs
+G-C-\\: Split Window
+
+  G-a: Append to Kill Buffer
+  G-b: Buffer Menu
+  G-c: Compile
+  G-d: Delete Window
+  G-e: Exit
+  G-f: Find File
+  G-g: Find File Other Window
+  G-h: Keypad Help
+  G-i: Insert File
+  G-k: Toggle Capitalization Word
+  G-l: Lowercase Word or Region
+  G-m: Save Some Buffers
+  G-n: Next Error
+  G-o: Switch Windows
+  G-q: Quit
+  G-r: Revert File
+  G-s: Save Buffer
+  G-u: Uppercase Word or Region
+  G-v: Find File Other Window
+  G-w: Write file
+  G-y: EDT Emulation OFF
+  G-z: Switch to Default EDT Key Bindings
+  G-2: Split Window
+  G-%: Go to Percentage
+  G- : Undo  (GOLD Spacebar)
+  G-=: Go to Line
+  G-`: What line"
+
+  (interactive)
+  (describe-function 'edt-user-keypad-help))
--- a/info/dir	Mon Aug 13 09:03:07 2007 +0200
+++ b/info/dir	Mon Aug 13 09:03:46 2007 +0200
@@ -74,6 +74,7 @@
 * Texinfo::	With one source file, make either a printed manual (through
 		TeX) or an Info file (through texinfo).
 * Viper::	A VI Plan for Emacs Rescue and a venomous VI PERil.
+* Vhdl-mode::	A major mode for editing VHDL files.
 * VM::		View Mail, a replacement for Rmail.
 * W3::		A browser for the World Wide Web global hypertext system.
 * tm_en::	Tools for Mime (English version)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/ChangeLog	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,4 @@
+Thu Dec  5 15:41:53 1996  Martin Buchholz  <mrb@Eng.Sun.COM>
+
+	* update-elc.sh: Corrections to protect against too smart /bin/sh'es.
+
--- a/lib-src/update-elc.sh	Mon Aug 13 09:03:07 2007 +0200
+++ b/lib-src/update-elc.sh	Mon Aug 13 09:03:46 2007 +0200
@@ -21,7 +21,7 @@
 done
 
 if test ! -d lisp/. ; then
-  echo "$0: Can't find the `lisp' directory."
+  echo "$0: Can't find the \`lisp' directory."
   exit 1
 fi
 
@@ -52,11 +52,8 @@
 
 # Only use Mule XEmacs to compile Mule-specific elisp dirs
 echo "Checking for Mule support..."
-# You cannot just use 'test -n' here because it will fail on a null
-# return value (null != null string)
-mule_check=`$REAL -batch -no-site-file \
- -eval "(when (featurep 'mule) (message \"yes\"))" 2>&1`
-if [ -z "$mule_check" ]; then
+lisp_prog='(when (featurep (quote mule)) (message "yes"))'
+if test -z `$REAL -batch -no-site-file -eval "$lisp_prog" 2>&1` ; then
   ignore_dirs="$ignore_dirs mule"
 fi
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/update-elc.sh-STEVE	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,130 @@
+#!/bin/sh
+# update-elc.sh --- recompile all missing or out-or-date .elc files
+
+# Author:	Jamie Zawinski, Ben Wing, Martin Buchholz
+# Maintainer:	Martin Buchholz
+# Keywords:	recompile .el .elc
+
+### Commentary:
+##  Recompile all .elc files that need recompilation.  Requires a
+##  working version of 'xemacs'.  Correctly handles the case where the
+##  .elc files are missing; thus you can execute 'rm lisp/*/*.elc'
+##  before running this script.  Run this from the parent of the
+##  `lisp' directory, or another nearby directory.
+
+set -eu
+
+# Try to find the lisp directory in several places.
+# (Sun workspaces have an `editor' directory)
+for dir in  .  ..  ../..  editor  ../editor  ; do
+  if test -d $dir ; then cd $dir ; break ; fi
+done
+
+if test ! -d lisp/. ; then
+  echo "$0: Can't find the \`lisp' directory."
+  exit 1
+fi
+
+
+EMACS=${XEMACS:-./src/xemacs}; export EMACS
+REAL=`cd \`dirname $EMACS\` ; pwd | sed 's:^/tmp_mnt::'`/`basename $EMACS`
+echo "Recompiling in `pwd|sed 's:^/tmp_mnt::'`"
+echo "    with $REAL..."
+
+
+# $els  is a list of all .el  files
+# $elcs is a list of all .elc files
+els=/tmp/rcl1.$$ ; elcs=/tmp/rcl2.$$
+rm -f $els $elcs
+trap "rm -f $els $elcs" 0 1 2 3 15
+find lisp/. -name SCCS -prune -o -name '*.el'  -print                    | sort > $els
+find lisp/. -name SCCS -prune -o -name '*.elc' -print | sed 's/elc$/el/' | sort > $elcs
+
+
+echo "Deleting .elc files without .el files..."
+comm -13 $els $elcs | sed -e '\!/vm.el!d' -e '\!/w3.el!d' -e 's/el$/elc/' | \
+ while read file ; do echo rm "$file" ; rm "$file" ; done
+echo "Deleting .elc files without .el files... Done"
+
+
+# Compute patterns to ignore when searching for files
+ignore_dirs="egg its quail"	# ### Not ported yet...
+
+# Only use Mule XEmacs to compile Mule-specific elisp dirs
+echo "Checking for Mule support..."
+# You cannot just use 'test -n' here because it will fail on a null
+# return value (null != null string)
+mule_check=`$REAL -batch -no-site-file \
+ -eval \(when\ \(featurep\ \'mule\)\ \(message\ \"yes\"\)\) 2>&1`
+if [ -z "$mule_check" ]; then
+  ignore_dirs="$ignore_dirs mule"
+fi
+
+# first recompile the byte-compiler, so that the other compiles take place
+# with the latest version (assuming we're compiling the lisp dir of the emacs
+# we're running, which might not be the case, but often is.)
+echo "Checking the byte compiler... "
+$REAL -batch -q -no-site-file -f batch-byte-recompile-directory lisp/bytecomp
+
+# Prepare for byte-compiling directories with directory-specific instructions
+make_special_commands=''
+make_special () {
+  dir="$1"; shift;
+  ignore_dirs="$ignore_dirs $dir"
+  make_special_commands="$make_special_commands \
+echo \"Compiling in lisp/$dir\"; \
+(cd \"lisp/$dir\"; \
+${MAKE:-make} EMACS=$REAL ${1+$*}); \
+echo \"lisp/$dir done.\";"
+}
+
+make_special vm
+make_special ediff elc
+make_special viper elc
+make_special gnus  some
+make_special w3
+make_special url		# really part of w3
+make_special hyperbole elc
+make_special oobr HYPB_ELC= elc
+make_special eos -k		# not stricly necessary...
+make_special ilisp compile -f Makefile
+
+ignore_pattern=''
+for dir in $ignore_dirs ; do
+  ignore_pattern="${ignore_pattern}/\\/$dir\\//d
+/\\/$dir\$/d
+"
+done
+
+# Other special-case filenames that don't get byte-compiled
+ignore_pattern="$ignore_pattern"'
+\!/,!d
+\!/edebug/edebug-test.el$!d
+\!/emulators/edt.el$!d
+\!/energize/energize-load.el$!d
+\!/energize/write-file.el$!d
+\!/paths.el$!d
+\!/prim/loadup.el$!d
+\!/prim/loadup-el.el$!d
+\!/prim/update-elc.el$!d
+\!/site-start.el$!d
+\!/site-load.el$!d
+\!/site-init.el$!d
+\!/version.el$!d
+\!/sunpro/sunpro-load.el$!d
+'
+
+echo "Compiling files without .elc..."
+NUMTOCOMPILE=20			# compile this many files with each invocation
+comm -23 $els $elcs | sed "$ignore_pattern" | \
+ xargs -t -n$NUMTOCOMPILE $REAL -batch -q -no-site-file -f batch-byte-compile
+echo "Compiling files without .elc... Done"
+
+
+echo "Compiling files with out-of-date .elc..."
+find lisp/. -name SCCS -prune -o -type d -print | sed "$ignore_pattern" | \
+ xargs -t $REAL -batch -q -no-site-file -f batch-byte-recompile-directory
+echo "Compiling files with out-of-date .elc... Done"
+
+
+eval "$make_special_commands"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/ChangeLog	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,196 @@
+Tue Dec 10 18:30:01 1996  Rod Whitby  <rwhitby@asc.sps.mot.com>
+
+	* modes/vhdl-mode.el: New File.
+
+Tue Dec 10 17:59:35 1996  Shane Holder  <holder@rsn.hp.com>
+
+	* utils/bench.el: New file.  Utility for benchmarking emacs
+	performance.
+
+Tue Dec 10 10:11:55 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* electric/ebuff-menu.el (electric-buffer-menu-mode-map): Correct
+	bad 19.34 synch patch.
+	
+	* utils/pretty-print.el: New File.
+
+Sun Dec  8 13:59:40 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/files-nomule.el: Documentation corrections.
+
+	* prim/files.el: Synch to 19.15/Emacs 19.34.
+
+Sat Dec  7 18:48:34 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* packages/hexl.el (hexl-mode-map): Corrected obsolescent key
+	names introduced in 19.15-b2.
+
+Fri Dec  6 20:17:47 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* games/yow.el: Sync to GNU Emacs 19.34.
+
+	* games/studly.el: Documentation fixes.
+
+	* games/spook.el: Sync to GNU Emacs 19.34.
+
+	* games/mpuz.el: Sync to GNU Emacs 19.34.
+
+	* games/life.el: Sync to GNU Emacs 19.34.
+
+	* games/hanoi.el: Sync to GNU Emacs 19.34.
+
+	* games/flame.el: Documentation fixes.
+
+	* games/dunnet.el: Sync to GNU Emacs 19.34.
+
+	* games/doctor.el: Sync to GNU Emacs 19.34.
+
+	* games/dissociate.el: Sync to GNU Emacs 19.34.
+
+	* games/cookie1.el: Sync to GNU Emacs 19.34.
+
+	* games/conx.el: Documentation fixes.
+
+	* games/blackbox.el: Sync to GNU Emacs 19.34.
+
+	* games/NeXTify.el: Documentation fixes.
+
+	* packages/man.el: New file/replacement from Emacs 19.34.
+
+	* packages/man-xref.el: New file from Emacs 19.35.
+
+	* utils/smtpmail.el: New file from Emacs 19.34.
+
+Fri Dec  6 09:28:04 1996  MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+	* prim/startup.el (set-default-load-path): Set default-load-path
+	dynamically since file-detect.el is dumped with XEmacs.
+
+Thu Dec  5 20:37:32 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* emulators/tpu-mapper.el: Total replacement with version in GNU
+	Emacs 19.34.
+
+	* emulators/tpu-extras.el: Total replacement with version in GNU
+	Emacs 19.34.
+
+	* emulators/tpu-edt.el: Total replacement with version in GNU Emacs
+	19.34.
+
+	* comint/history.el: Documentation fixes.
+
+	* comint/gdb.el: Documentation fixes.
+
+	* comint/dbx.el: Documentation fixes.
+
+	* comint/background.el: Documentation fixes.
+
+	* rmail/rmail-xemacs.el: Documentation fixes.
+
+	* rmail/rmail-kill.el: Documentation fixes.
+
+	* emulators/ws-mode.el: Synch up to Emacs 19.34.
+
+	* emulators/teco.el: Documentation cleanup.
+
+	* emulators/mlsupport.el: Synch up to Emacs 19.34.
+
+	* emulators/mlconvert.el: Synch up to Emacs 19.34.
+
+	* emulators/edt-vt100.el: New file from Emacs 19.34.
+
+	* emulators/edt-pc.el: New file from Emacs 19.34.
+
+	* emulators/edt-mapper.el: New file from Emacs 19.34.
+
+	* emulators/edt-lk201.el: New file from Emacs 19.34.
+
+	* emulators/edt.el: Synched up to Emacs 19.34.
+
+Thu Dec  5 12:09:19 1996  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* prim/replace.el (match-string): Use a function instead of a
+ 	macro to be compatible with .elc files compiled under Emacs.
+
+Thu Dec  5 09:50:12 1996  Bob Weiner <weiner@infodock.com>
+
+	* utils/id-select.el: New file -- Version 1.4.3.
+
+Thu Dec  5 09:17:53 1996  Gary D. Foster  <Gary.Foster@corp.sun.com>
+
+	* emulators/crisp.el: New file.
+
+	* emulators/scroll-lock.el: New file.
+
+Thu Dec  5 00:15:59 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/help.el: A callable library-type function should not
+ 	contain an unprotected print statement.  This change implements my
+ 	version of Erik Naggum's statement about locate-library being less
+ 	chatty in Emacs 19.35.
+
+Wed Dec  4 22:00:49 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* utils/flow-ctrl.el: Synch up to Emacs 19.34.
+
+	* utils/forms.el: Synch up to Emacs 19.34.
+
+	* packages/column.el: Allow column numbers to start at one.
+
+	* prim/userlock.el: Synch up to Emacs 19.34.
+
+	* prim/paragraphs.el: Synch up to Emacs 19.34.
+
+	* prim/page.el: Synch up to Emacs 19.34.
+
+	* prim/options.el: Synch up to Emacs 19.34.
+
+	* prim/novice.el: Synch up to Emacs 19.34.
+
+	* prim/rect.el: Sync up to Emacs 19.34.
+
+	* prim/reposition.el: Synch up to Emacs 19.34.
+
+	* prim/replace.el: Synch up to Emacs 19.34.
+
+	* prim/register.el: Synch up to Emacs 19.34.
+
+	* prim/indent.el: Synch up to Emacs 19.34.
+
+	* prim/subr.el: Synch up to Emacs 19.34.
+
+	* prim/simple.el: Synch up to Emacs 19.34.
+
+	* prim/debug.el: Synch up to Emacs 19.34.
+
+	* edebug/cl-specs.el: Comment formatting changes.
+
+	* edebug/cl-read.el: Protect advisement of eval-region from being
+ 	evaluated more than once.
+
+	Comment formatting changes.
+	
+	* edebug/advise-eval-region.el: New File.  Separate out advise for
+	eval-region so it is only evaluated once.
+
+	* packages/icomplete.el: Fix a bug in locating command bound to key.
+
+	icomplete-exhibit needs to be called in the setup-hook.
+
+	* packages/apropos.el: Correct a typo in button binding. 
+
+	Fixes the bug where if apropos-label-face is actually defined as
+ 	face, apropos bombs with an error
+
+	Do a (provide 'apropos), like all packages should.
+
+	Provides an apropos-mode-hook for Apropos Mode buffers (otherwise
+ 	customization is unnecessarily painful).
+
+	Redefines the default faces for the various apropos faces so they
+ 	come out in color by default (defaults are based on various
+ 	standard font-lock faces).
+	
+	* version.el: Bumped up to b31.
+	
+
--- a/lisp/comint/background.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/comint/background.el	Mon Aug 13 09:03:46 2007 +0200
@@ -4,20 +4,25 @@
 ;; Keywords: processes
 
 ;; 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 of the License, 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; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
 
 ;; - Adapted to use comint and cleaned up somewhat. Olin Shivers 5/90
 ;; - Background failed to set the process buffer's working directory
@@ -38,6 +43,8 @@
 ;;   arg to shell-command --> BUFFER-NAME arg to background) from
 ;;   FSF 19.30.  Ben Wing
 
+;;; Code:
+
 (provide 'background)
 (require 'comint)
 
@@ -116,3 +123,5 @@
 		       (if at-end (goto-char (point-max))))
 		     (set-buffer-modified-p nil)))))
       (store-match-data ms))))
+
+;;; background.el ends here
--- a/lisp/comint/dbx.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/comint/dbx.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,8 @@
 ;;; dbx.el --- run dbx under Emacs
+
 ;; Copyright (C) 1988 Free Software Foundation, Inc.
-;; Main author Masanobu UMEDA (umerin@flab.fujitsu.junet)
+
+;; Author: Masanobu UMEDA (umerin@flab.fujitsu.junet)
 ;; Keywords: c, unix, tools, debugging
 
 ;; This file is part of XEmacs.
@@ -16,9 +18,13 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Code:
 
 (require 'comint)
 
@@ -161,3 +167,7 @@
 		(1+ (count-lines 1 (point))))))
     (process-send-string dbx-process
 			 (concat "stop at \"" file-name "\":" line "\n"))))
+
+(provide 'dbx)
+
+;;; dbx.el ends here
--- a/lisp/comint/gdb.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/comint/gdb.el	Mon Aug 13 09:03:46 2007 +0200
@@ -20,9 +20,13 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
 
 ;; Description of GDB interface:
 
@@ -58,6 +62,8 @@
 ;; gdb-display-frame is invoked automatically when a filename-and-line-number
 ;; appears in the output.
 
+;;; Code:
+
 (require 'comint)
 (require 'shell)
 
@@ -665,3 +671,5 @@
     (gdb-clear)))
 
 (provide 'gdb)
+
+;;; gdb.el ends here
--- a/lisp/comint/history.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/comint/history.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,3 +1,5 @@
+;;; history.el --- Generic history stuff
+
 ;; Copyright (C) 1989 Free Software Foundation, Inc.
 
 ;; This file is part of XEmacs.
@@ -13,9 +15,12 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
 
 ;; suggested generic history stuff  -- tale
 
@@ -69,6 +74,8 @@
 
 ;; ToDo: history-isearch
 
+;;; Code:
+
 (provide 'history)
 
 (defvar history-last-search ""
@@ -164,3 +171,5 @@
 	  (insert menu)
 	  (display-buffer buffer))
       (with-output-to-temp-buffer buffer (princ menu)))))
+
+;;; history.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/edebug/advise-eval-region.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,46 @@
+;;; advise-eval-region.el --- Wrap advice around eval-region
+;; Copyright (C) 1996 Miranova Systems, Inc.
+
+;; Original-Author: Unknown
+;; Adapted-By: Steven L Baur <steve@miranova.com>
+;; Keywords: extensions lisp
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF.
+
+;;; Commentary:
+
+;; This file splits out advice to eval-region formerly done in cl-read.el.
+;; Due to the way cl-read.el reads itself in twice during bytecompilation,
+;; and the fact that functions shouldn't be advised twice, I split this out
+;; into its own file.
+
+;;; Code:
+
+(require 'advice)
+
+;; Advise the redefined eval-region
+(defadvice eval-region (around cl-read activate)
+  "Use the reader::read instead of the original read if cl-read-active."
+  (with-elisp-eval-region (not cl-read-active)
+    ad-do-it))
+
+(provide 'advise-eval-region)
+
+;;; advise-eval-region.el ends here
--- a/lisp/edebug/cl-read.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/edebug/cl-read.el	Mon Aug 13 09:03:46 2007 +0200
@@ -2,23 +2,27 @@
 ;; 
 ;; Copyright (C) 1993 by Guido Bosch <Guido.Bosch@loria.fr>
 
-;; This file is written in GNU Emacs Lisp, but not (yet) part of GNU Emacs.
+;; This file is part of XEmacs
 
-;; The software contained in this file 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 free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
+;; 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.
 
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-;; 
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
 ;; Please send bugs and comments to the author.
 ;;
 ;; <DISCLAIMER>
@@ -204,8 +208,8 @@
 ; Change History
 ; 
 ; $Log: cl-read.el,v $
-; Revision 1.1.1.1  1996/12/18 22:43:07  steve
-; XEmacs 20.0 -- Beta 30
+; Revision 1.1.1.2  1996/12/18 22:51:45  steve
+; XEmacs 20.0 -- Beta 31
 ;
 ; Revision 1.19  94/03/21  19:59:24  liberte
 ; Add invalid-cl-read-syntax error symbol.
@@ -302,11 +306,15 @@
 ;
 ;
 
-;; 
-(require 'cl)
+;;; Code:
 
+(require 'cl)
+;; Thou shalt evaluate a defadvice only once, or thou shalt surely lose. -sb
+(require 'advise-eval-region)
+
+;; load before compiling
+;; This is ugly, but apparently the only way to do it :-(  -sb
 (provide 'cl-read)
-;; load before compiling
 (require 'cl-read)
 
 ;; bootstrapping with cl-packages
@@ -1315,7 +1323,7 @@
   (prin1 (car values) t))
 
 (require 'eval-reg "eval-reg")
-(require 'advice)
+; (require 'advice)
 
 
 ;; installing/uninstalling the cl reader
@@ -1345,14 +1353,6 @@
 (cl-reader-install)
 (cl-reader-uninstall)
 
-;; Advise the redefined eval-region
-(defadvice eval-region (around cl-read activate)
-  "Use the reader::read instead of the original read if cl-read-active."
-  (with-elisp-eval-region (not cl-read-active)
-    (ad-do-it)))
-;;(ad-unadvise 'eval-region)
-
-
 (add-hook 'emacs-lisp-mode-hook 'cl-reader-autoinstall-function)
 
 '(defvar read-syntax)
@@ -1397,4 +1397,5 @@
 
 
 (run-hooks 'cl-read-load-hooks)
-;; end cl-read.el
+
+;; cl-read.el ends here
--- a/lisp/edebug/cl-specs.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/edebug/cl-specs.el	Mon Aug 13 09:03:46 2007 +0200
@@ -4,33 +4,38 @@
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 ;; Keywords: lisp, tools, maint
 
-;; LCD Archive Entry:
-;; cl-specs.el|Daniel LaLiberte|liberte@cs.uiuc.edu
-;; |Edebug specs for cl.el
-;; |$Date: 1996/12/18 22:43:07 $|$Revision: 1.1.1.1 $|~/modes/cl-specs.el|
+;; This file is part of XEmacs.
 
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
 
-;;;; Commentary:
+;;; Commentary:
+
+;; LCD Archive Entry:
+;; cl-specs.el|Daniel LaLiberte|liberte@cs.uiuc.edu
+;; |Edebug specs for cl.el
+;; |$Date: 1996/12/18 22:51:45 $|$Revision: 1.1.1.2 $|~/modes/cl-specs.el|
 
 ;; These specs are to be used with edebug.el version 3.3 or later and
 ;; cl.el version 2.03 or later, by Dave Gillespie <daveg@synaptics.com>.
 
-;; This file need not be byte-compiled, but it shouldnt hurt.
+;; This file need not be byte-compiled, but it shouldn't hurt.
+
+;;; Code:
 
 (provide 'cl-specs)
 ;; Do the above provide before the following require.
@@ -469,3 +474,4 @@
 (def-edebug-spec loop-d-type-spec
   (&or (loop-d-type-spec . [&or nil loop-d-type-spec]) cl-type-spec))
 
+;; cl-specs.el ends here
--- a/lisp/edebug/cust-print.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/edebug/cust-print.el	Mon Aug 13 09:03:46 2007 +0200
@@ -6,66 +6,69 @@
 ;; Adapted-By: ESR
 ;; Keywords: extensions
 
-;; LCD Archive Entry:
-;; cust-print|Daniel LaLiberte|liberte@cs.uiuc.edu
-;; |Handle print-level, print-circle and more.
-;; |$Date: 1996/12/18 22:43:07 $|$Revision: 1.1.1.1 $|
+;; This file is part of XEmacs.
 
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
+;; 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;; LCD Archive Entry:
+;; cust-print|Daniel LaLiberte|liberte@cs.uiuc.edu
+;; |Handle print-level, print-circle and more.
+;; |$Date: 1996/12/18 22:51:45 $|$Revision: 1.1.1.2 $|
 
-;;; ===============================
-;;; $Header: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/edebug/Attic/cust-print.el,v 1.1.1.1 1996/12/18 22:43:07 steve Exp $
-;;; $Log: cust-print.el,v $
-;;; Revision 1.1.1.1  1996/12/18 22:43:07  steve
-;;; XEmacs 20.0 -- Beta 30
-;;;
-;;; Revision 1.4  1994/03/23  20:34:29  liberte
-;;; * Change "emacs" to "original" - I just can't decide. 
-;;;
-;;; Revision 1.3  1994/02/21  21:25:36  liberte
-;;; * Make custom-prin1-to-string more robust when errors occur.
-;;; * Change "internal" to "emacs".
-;;;
-;;; Revision 1.2  1993/11/22  22:36:36  liberte
-;;; * Simplified and generalized printer customization.
-;;;     custom-printers is an alist of (PREDICATE . PRINTER) pairs
-;;;     for any data types.  The PRINTER function should print to
-;;;     `standard-output'  add-custom-printer and delete-custom-printer
-;;;     change custom-printers.
-;;;
-;;; * Installation function now called install-custom-print.  The
-;;;     old name is still around for now.
-;;;
-;;; * New macro with-custom-print (added earlier) - executes like
-;;;     progn but with custom-print activated temporarily.
-;;;
-;;; * Cleaned up comments for replacements of standardard printers.
-;;;
-;;; * Changed custom-prin1-to-string to use a temporary buffer.
-;;;
-;;; * Internal symbols are prefixed with CP::.
-;;;
-;;; * Option custom-print-vectors (added earlier) - controls whether
-;;;     vectors should be printed according to print-length and
-;;;     print-length.  Emacs doesnt do this, but cust-print would
-;;;     otherwise do it only if custom printing is required.
-;;;
-;;; * Uninterned symbols are treated as non-read-equivalent.
-;;;
+;; ===============================
+;; $Header: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/edebug/Attic/cust-print.el,v 1.1.1.2 1996/12/18 22:51:45 steve Exp $
+;; $Log: cust-print.el,v $
+;; Revision 1.1.1.2  1996/12/18 22:51:45  steve
+;; XEmacs 20.0 -- Beta 31
+;;
+;; Revision 1.4  1994/03/23  20:34:29  liberte
+;; * Change "emacs" to "original" - I just can't decide. 
+;;
+;; Revision 1.3  1994/02/21  21:25:36  liberte
+;; * Make custom-prin1-to-string more robust when errors occur.
+;; * Change "internal" to "emacs".
+;;
+;; Revision 1.2  1993/11/22  22:36:36  liberte
+;; * Simplified and generalized printer customization.
+;;     custom-printers is an alist of (PREDICATE . PRINTER) pairs
+;;     for any data types.  The PRINTER function should print to
+;;     `standard-output'  add-custom-printer and delete-custom-printer
+;;     change custom-printers.
+;;
+;; * Installation function now called install-custom-print.  The
+;;     old name is still around for now.
+;;
+;; * New macro with-custom-print (added earlier) - executes like
+;;     progn but with custom-print activated temporarily.
+;;
+;; * Cleaned up comments for replacements of standardard printers.
+;;
+;; * Changed custom-prin1-to-string to use a temporary buffer.
+;;
+;; * Internal symbols are prefixed with CP::.
+;;
+;; * Option custom-print-vectors (added earlier) - controls whether
+;;     vectors should be printed according to print-length and
+;;     print-length.  Emacs doesnt do this, but cust-print would
+;;     otherwise do it only if custom printing is required.
+;;
+;; * Uninterned symbols are treated as non-read-equivalent.
+;;
 
 
 ;;; Commentary:
--- a/lisp/edebug/edebug-cl-read.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/edebug/edebug-cl-read.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,31 +1,34 @@
-;; edebug-cl-read.el  - Edebug reader macros for use with cl-read.
+;;; edebug-cl-read.el --- Edebug reader macros for use with cl-read.
 
 ;; Copyright (C) 1993 Daniel LaLiberte
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 ;; Keywords: lisp, tools, maint
 
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
 ;; LCD Archive Entry:
 ;; edebug-cl-read.el|Daniel LaLiberte|liberte@cs.uiuc.edu
 ;; |Edebug reader macros for cl-read.el
-;; |$Date: 1996/12/18 22:43:07 $|$Revision: 1.1.1.1 $|~/modes/edebug-cl-read.el|
-
-;; This file is not yet part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;;; Commentary:
+;; |$Date: 1996/12/18 22:51:45 $|$Revision: 1.1.1.2 $|~/modes/edebug-cl-read.el|
 
 ;; If you use cl-read.el and want to use edebug with any code
 ;; in a file written with CL read syntax, then you need to use this
@@ -41,6 +44,8 @@
 ;; Need to mangle all local variable names that might be visible to
 ;; eval, e.g. stream, char.  Alternatively, packages could hide them.
 
+;;; Code:
+
 (require 'cl)
 ;; For byte compiling cl-read is needed.
 ;; But edebug-cl-read should not even be loaded unless cl-read already is.
--- a/lisp/edebug/edebug.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/edebug/edebug.el	Mon Aug 13 09:03:46 2007 +0200
@@ -5,85 +5,90 @@
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 ;; Keywords: lisp, tools, maint
 
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
 ;; LCD Archive Entry:
 ;; edebug|Daniel LaLiberte|liberte@cs.uiuc.edu
 ;; |A source level debugger for Emacs Lisp.
-;; |$Date: 1996/12/18 22:43:07 $|$Revision: 1.1.1.1 $|~/modes/edebug.el|
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;;; Commentary:
-
-;;; This minor mode allows programmers to step through Emacs Lisp
-;;; source code while executing functions.  You can also set
-;;; breakpoints, trace (stopping at each expression), evaluate
-;;; expressions as if outside Edebug, reevaluate and display a list of
-;;; expressions, trap errors normally caught by debug, and display a
-;;; debug style backtrace.
-
-;;;; Installation
-;;; =============
-
-;;; Put edebug.el in some directory in your load-path and
-;;; byte-compile it.  Also read the beginning of edebug-epoch.el, 
-;;; cl-specs.el, and edebug-cl-read.el if they apply to you.
-
-;;; Unless you are using Emacs 19 which is already set up to use Edebug,
-;;; put the following forms in your .emacs file.
-;;; (define-key emacs-lisp-mode-map "\C-xx" 'edebug-eval-top-level-form)
-;;; (autoload 'edebug-eval-top-level-form "edebug")
-
-;;; If you wish to change the default edebug global command prefix, change:
-;;; (setq edebug-global-prefix "\C-xX")
-
-;;; Other options, are described in the manual.
-
-;;; In previous versions of Edebug, users were directed to set
-;;; `debugger' to `edebug-debug'.  This is no longer necessary
-;;; since Edebug automatically sets it whenever Edebug is active.
-
-;;;; Minimal Instructions
-;;; =====================
-
-;;; First evaluate a defun with C-xx, then run the function.  Step
-;;; through the code with SPC, mark breakpoints with b, go until a
-;;; breakpoint is reached with g, and quit execution with q.  Use the
-;;; "?" command in edebug to describe other commands.  See edebug.tex
-;;; or the Emacs 19 Lisp Reference Manual for more instructions.
-
-;;; Send me your enhancements, ideas, bugs, or fixes.
-;;; For bugs, you can call edebug-submit-bug-report if you have reporter.el.
-;;; There is an edebug mailing list if you want to keep up
-;;; with the latest developments. Requests to: edebug-request@cs.uiuc.edu
-
-;;; Daniel LaLiberte   217-398-4114
-;;; University of Illinois, Urbana-Champaign
-;;; Department of Computer Science
-;;; 1304 W Springfield
-;;; Urbana, IL  61801
-
-;;; uiucdcs!liberte
-;;; liberte@cs.uiuc.edu
-
-;;; ===============================
-;;; For the early revision history, see edebug-history.
+;; |$Date: 1996/12/18 22:51:47 $|$Revision: 1.1.1.2 $|~/modes/edebug.el|
+
+;; This minor mode allows programmers to step through Emacs Lisp
+;; source code while executing functions.  You can also set
+;; breakpoints, trace (stopping at each expression), evaluate
+;; expressions as if outside Edebug, reevaluate and display a list of
+;; expressions, trap errors normally caught by debug, and display a
+;; debug style backtrace.
+
+;; Installation
+;; =============
+
+;; Put edebug.el in some directory in your load-path and
+;; byte-compile it.  Also read the beginning of edebug-epoch.el, 
+;; cl-specs.el, and edebug-cl-read.el if they apply to you.
+
+;; Unless you are using Emacs 19 which is already set up to use Edebug,
+;; put the following forms in your .emacs file.
+;; (define-key emacs-lisp-mode-map "\C-xx" 'edebug-eval-top-level-form)
+;; (autoload 'edebug-eval-top-level-form "edebug")
+
+;; If you wish to change the default edebug global command prefix, change:
+;; (setq edebug-global-prefix "\C-xX")
+
+;; Other options, are described in the manual.
+
+;; In previous versions of Edebug, users were directed to set
+;; `debugger' to `edebug-debug'.  This is no longer necessary
+;; since Edebug automatically sets it whenever Edebug is active.
+
+;; Minimal Instructions
+;; =====================
+
+;; First evaluate a defun with C-xx, then run the function.  Step
+;; through the code with SPC, mark breakpoints with b, go until a
+;; breakpoint is reached with g, and quit execution with q.  Use the
+;; "?" command in edebug to describe other commands.  See edebug.tex
+;; or the Emacs 19 Lisp Reference Manual for more instructions.
+
+;; Send me your enhancements, ideas, bugs, or fixes.
+;; For bugs, you can call edebug-submit-bug-report if you have reporter.el.
+;; There is an edebug mailing list if you want to keep up
+;; with the latest developments. Requests to: edebug-request@cs.uiuc.edu
+
+;; Daniel LaLiberte   217-398-4114
+;; University of Illinois, Urbana-Champaign
+;; Department of Computer Science
+;; 1304 W Springfield
+;; Urbana, IL  61801
+
+;; uiucdcs!liberte
+;; liberte@cs.uiuc.edu
+
+;; ===============================
+;; For the early revision history, see edebug-history.
+
+;;; Code:
 
 (defconst edebug-version
-  (let ((raw-version "$Revision: 1.1.1.1 $"))
+  (let ((raw-version "$Revision: 1.1.1.2 $"))
     (substring raw-version (string-match "[0-9.]*" raw-version)
 	       (match-end 0))))
      
@@ -94,8 +99,8 @@
   (or (fboundp 'defalias) (fset 'defalias 'fset)))
 
 
-;;;; Bug reporting
-;;; ==============
+;; Bug reporting
+;; ==============
 
 (defconst edebug-maintainer-address "liberte@cs.uiuc.edu")
 
@@ -124,8 +129,8 @@
 	       ))))
 
 
-;;;; Options
-;;; ===============================
+;; Options
+;; ===============================
 
 (defvar edebug-setup-hook nil
   "*Functions to call before edebug is used.
@@ -248,8 +253,8 @@
 If the result is non-nil, then break.  Errors are ignored.")
 
 
-;;;; Form spec utilities.
-;;; ===============================
+;; Form spec utilities.
+;; ===============================
 
 ;;;###autoload
 (defmacro def-edebug-spec (symbol spec)
@@ -275,8 +280,8 @@
     ))
 
 
-;;;; Utilities
-;;; ===============================
+;; Utilities
+;; ===============================
 
 ;; Define edebug-gensym - from old cl.el
 (defvar edebug-gensym-index 0
@@ -367,7 +372,7 @@
   "Returns the function named by OBJECT, or nil if it is not a function."
   (setq object (edebug-lookup-function object))
   (if (or (subrp object)
-	  (byte-code-function-p object)
+	  (compiled-function-p object)
 	  (and (listp object)
 	       (eq (car object) 'lambda)
 	       (listp (car (cdr object)))))
@@ -398,8 +403,8 @@
 	   (set-buffer (marker-buffer edebug:s-r-beg))
 	   (narrow-to-region edebug:s-r-beg edebug:s-r-end))))))
 
-;;;; Display
-;;; ============
+;; Display
+;; ============
 
 (defconst edebug-trace-buffer "*edebug-trace*"
   "Name of the buffer to put trace info in.")
@@ -493,12 +498,12 @@
 (defalias 'edebug-input-pending-p 'input-pending-p)
 
 
-;;;; Redefine read and eval functions
-;;; =================================
-;;; read is redefined to maybe instrument forms.
-;;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs.
-
-;;; Use the Lisp version of eval-region.
+;; Redefine read and eval functions
+;; =================================
+;; read is redefined to maybe instrument forms.
+;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs.
+
+;; Use the Lisp version of eval-region.
 (require 'eval-reg "eval-reg")
 
 ;; Save the original read function
@@ -611,11 +616,11 @@
   (defalias 'eval-defun (symbol-function 'edebug-original-eval-defun)))
 
 
-;;;; Edebug internal data
-;;; ===============================
-
-;;; The internal data that is needed for edebugging is kept in the
-;;; buffer-local variable `edebug-form-data'. 
+;; Edebug internal data
+;; ===============================
+
+;; The internal data that is needed for edebugging is kept in the
+;; buffer-local variable `edebug-form-data'. 
 
 ;; XEmacs change?
 (defconst edebug-form-data nil)
@@ -698,8 +703,8 @@
 	(setq edebug-form-data (delq entry edebug-form-data)))))
 
 
-;;;; Parser utilities
-;;; ===============================
+;; Parser utilities
+;; ===============================
 
 
 (defun edebug-syntax-error (&rest args)
@@ -771,8 +776,8 @@
       (edebug-original-read (current-buffer))))))
 
 
-;;;; Offsets for reader
-;;; ==============================
+;; Offsets for reader
+;; ==============================
 
 ;; Define a structure to represent offset positions of expressions.
 ;; Each offset structure looks like: (before . after) for constituents,
@@ -847,8 +852,8 @@
        (edebug-store-after-offset (point)))))
 
 
-;;;; Reader for Emacs Lisp.
-;;; ==========================================
+;; Reader for Emacs Lisp.
+;; ==========================================
 ;; Uses edebug-next-token-class (and edebug-skip-whitespace) above.
 
 (defconst edebug-read-alist
@@ -934,8 +939,8 @@
 
 
 
-;;;; Cursors for traversal of list and vector elements with offsets.
-;;;====================================================================
+;; Cursors for traversal of list and vector elements with offsets.
+;;====================================================================
 
 (defvar edebug-dotted-spec nil)
 
@@ -1012,29 +1017,29 @@
       (setq offset (cdr offset)))
     offset))
 
-;;;; The Parser
-;;; ===============================
-
-;;; The top level function for parsing forms is
-;;; edebug-read-and-maybe-wrap-form; it calls all the rest.  It checks the
-;;; syntax a bit and leaves point at any error it finds, but otherwise
-;;; should appear to work like eval-defun.
-
-;;; The basic plan is to surround each expression with a call to
-;;; the edebug debugger together with indexes into a table of positions of
-;;; all expressions.  Thus an expression "exp" becomes:
-
-;;; (edebug-after (edebug-before 1) 2 exp)
-
-;;; When this is evaluated, first point is moved to the beginning of
-;;; exp at offset 1 of the current function.  The expression is
-;;; evaluated, which may cause more edebug calls, and then point is
-;;; moved to offset 2 after the end of exp.
-
-;;; The highest level expressions of the function are wrapped in a call to
-;;; edebug-enter, which supplies the function name and the actual
-;;; arguments to the function.  See functions edebug-enter, edebug-before,
-;;; and edebug-after for more details.
+;; The Parser
+;; ===============================
+
+;; The top level function for parsing forms is
+;; edebug-read-and-maybe-wrap-form; it calls all the rest.  It checks the
+;; syntax a bit and leaves point at any error it finds, but otherwise
+;; should appear to work like eval-defun.
+
+;; The basic plan is to surround each expression with a call to
+;; the edebug debugger together with indexes into a table of positions of
+;; all expressions.  Thus an expression "exp" becomes:
+
+;; (edebug-after (edebug-before 1) 2 exp)
+
+;; When this is evaluated, first point is moved to the beginning of
+;; exp at offset 1 of the current function.  The expression is
+;; evaluated, which may cause more edebug calls, and then point is
+;; moved to offset 2 after the end of exp.
+
+;; The highest level expressions of the function are wrapped in a call to
+;; edebug-enter, which supplies the function name and the actual
+;; arguments to the function.  See functions edebug-enter, edebug-before,
+;; and edebug-after for more details.
 
 ;; Dynamically bound vars, left unbound, but globally declared.
 ;; This is to quiet the byte compiler.
@@ -1108,7 +1113,7 @@
 				  (eq 'name (car (cdr spec)))
 				  (eq 'symbol (edebug-next-token-class)))
 			     (edebug-original-read (current-buffer))))))
-;;;(message "all defs: %s   all forms: %s"  edebug-all-defs edebug-all-forms)
+;;(message "all defs: %s   all forms: %s"  edebug-all-defs edebug-all-forms)
     (cond
      (defining-form-p
        (if (or edebug-all-defs edebug-all-forms)
@@ -1491,8 +1496,8 @@
       ))
 
 
-;;;; Matching of specs.
-;;; ===================
+;; Matching of specs.
+;; ===================
 
 (defvar edebug-after-dotted-spec nil)
 
@@ -1500,8 +1505,8 @@
 (defconst edebug-max-depth 150)  ;; maximum number of matching recursions.
 
 
-;;;; Failure to match 
-;;; ==================
+;; Failure to match 
+;; ==================
 ;; This throws to no-match, if there are higher alternatives.
 ;; Otherwise it signals an error.  The place of the error is found
 ;; with the two before- and after-offset functions.
@@ -1927,12 +1932,12 @@
     (list (edebug-wrap-def-body (edebug-forms cursor)))))
 
 
-;;;; Edebug Form Specs
-;;; ==========================================================
-;;; See cl-specs.el for common lisp specs.
-
-;;;;* Spec for def-edebug-spec
-;;; Out of date.
+;; Edebug Form Specs
+;; ==========================================================
+;; See cl-specs.el for common lisp specs.
+
+;;* Spec for def-edebug-spec
+;; Out of date.
 
 (defun edebug-spec-p (object)
   "Return non-nil if OBJECT is a symbol with an edebug-form-spec property."
@@ -1962,7 +1967,7 @@
    ))
 
 
-;;;;* Emacs special forms and some functions.
+;;* Emacs special forms and some functions.
 
 ;; quote expects only one argument, although it allows any number.
 (def-edebug-spec quote sexp)
@@ -2099,12 +2104,12 @@
 	   def-body))
 
 
-;;;; The debugger itself
-;;; ===============================
+;; The debugger itself
+;; ===============================
 
 (defvar edebug-active nil)  ;; Non-nil when edebug is active
 
-;;; add minor-mode-alist entry
+;; add minor-mode-alist entry
 (or (assq 'edebug-active minor-mode-alist)
     (setq minor-mode-alist (cons (list 'edebug-active " *Debugging*")
 				 minor-mode-alist)))
@@ -2166,8 +2171,8 @@
 
 (defvar cl-lexical-debug)  ;; Defined in cl.el
 
-;;; Handling signals
-;;; =================
+;; Handling signals
+;; =================
 
 (if (not (fboundp 'edebug-original-signal))
     (defalias 'edebug-original-signal (symbol-function 'signal)))
@@ -2195,8 +2200,8 @@
   (edebug-original-signal edebug-signal-name edebug-signal-data))
   
 
-;;; Entering Edebug
-;;; ==================
+;; Entering Edebug
+;; ==================
 
 (defun edebug-enter (edebug-function edebug-args edebug-body)
   ;; Entering FUNC.  The arguments are ARGS, and the body is BODY.
@@ -2227,7 +2232,7 @@
 	    (cl-lexical-debug t)
 
 	    ;; Save the outside value of executing macro.  (here??)
-	    (edebug-outside-executing-macro executing-macro)
+	    (edebug-outside-executing-macro executing-kbd-macro)
 	    (edebug-outside-pre-command-hook pre-command-hook)
 	    (edebug-outside-post-command-hook post-command-hook)
 	    (edebug-outside-post-command-idle-hook post-command-idle-hook))
@@ -2235,8 +2240,8 @@
 	    (let (;; Don't keep reading from an executing kbd macro
 		  ;; within edebug unless edebug-continue-kbd-macro is
 		  ;; non-nil.  Again, local binding may not be best.
-		  (executing-macro 
-		   (if edebug-continue-kbd-macro executing-macro))
+		  (executing-kbd-macro 
+		   (if edebug-continue-kbd-macro executing-kbd-macro))
 
 		  ;; Disable command hooks.  This is essential when
 		  ;; a hook function is instrumented - to avoid infinite loop.
@@ -2254,7 +2259,7 @@
 		  (edebug-enter edebug-function edebug-args edebug-body)
 		(fset 'signal (symbol-function 'edebug-original-signal))))
 	  ;; Reset global variables in case outside value was changed.
-	  (setq executing-macro edebug-outside-executing-macro
+	  (setq executing-kbd-macro edebug-outside-executing-macro
 		pre-command-hook edebug-outside-pre-command-hook
 		post-command-hook edebug-outside-post-command-hook
 		post-command-idle-hook edebug-outside-post-command-idle-hook
@@ -2899,13 +2904,13 @@
     ))
 
 
-;;; Display related functions
-;;; ===============================
+;; Display related functions
+;; ===============================
 
 (defun edebug-adjust-window (old-start)
   ;; If pos is not visible, adjust current window to fit following context.
-;;;  (message "window: %s old-start: %s window-start: %s pos: %s" 
-;;;	   (selected-window) old-start (window-start) (point)) (sit-for 5)
+;;  (message "window: %s old-start: %s window-start: %s pos: %s" 
+;;	   (selected-window) old-start (window-start) (point)) (sit-for 5)
   (if (not (pos-visible-in-window-p))
       (progn
 	;; First try old-start
@@ -3074,8 +3079,8 @@
 	     (if already-displaying "off" "on"))))
 
 
-;;; Breakpoint related functions
-;;; ===============================
+;; Breakpoint related functions
+;; ===============================
 
 (defun edebug-find-stop-point ()
   ;; Return (function . index) of the nearest edebug stop point.
@@ -3233,8 +3238,8 @@
   (setq edebug-global-break-condition expression))
 
 
-;;; Mode switching functions
-;;; ===============================
+;; Mode switching functions
+;; ===============================
 
 (defun edebug-set-mode (mode shortmsg msg)
   ;; Set the edebug mode to MODE.
@@ -3459,8 +3464,8 @@
 ;;  (edebug-set-mode 'exiting "Exit..."))
 
 
-;;; -----------------------------------------------------------------
-;;; The following initial mode setting definitions are not used yet.
+;; -----------------------------------------------------------------
+;; The following initial mode setting definitions are not used yet.
 
 '(defconst edebug-initial-mode-alist
   '((edebug-Continue-fast . Continue-fast)
@@ -3506,8 +3511,8 @@
       )))
 
 
-;;; Evaluation of expressions
-;;; ===============================
+;; Evaluation of expressions
+;; ===============================
 
 (def-edebug-spec edebug-outside-excursion t)
 
@@ -3544,7 +3549,7 @@
 	     (standard-output edebug-outside-standard-output)
 	     (standard-input edebug-outside-standard-input)
 
-	     (executing-macro edebug-outside-executing-macro)
+	     (executing-kbd-macro edebug-outside-executing-macro)
 	     (defining-kbd-macro edebug-outside-defining-kbd-macro)
 	     (pre-command-hook edebug-outside-pre-command-hook)
 	     (post-command-hook edebug-outside-post-command-hook)
@@ -3586,7 +3591,7 @@
 	    edebug-outside-standard-output standard-output
 	    edebug-outside-standard-input standard-input
 
-	    edebug-outside-executing-macro executing-macro
+	    edebug-outside-executing-macro executing-kbd-macro
 	    edebug-outside-defining-kbd-macro defining-kbd-macro
 	    edebug-outside-pre-command-hook pre-command-hook
 	    edebug-outside-post-command-hook post-command-hook
@@ -3615,8 +3620,8 @@
 			  (get (car edebug-err) 'error-message)
 			  (car (cdr edebug-err))))))
 
-;;;; Printing
-;;; =========
+;; Printing
+;; =========
 ;; Replace printing functions.
 
 ;; obsolete names
@@ -3698,8 +3703,8 @@
   (interactive)
   (message "%s" edebug-previous-result))
 
-;;;; Read, Eval and Print
-;;; =====================
+;; Read, Eval and Print
+;; =====================
 
 (defun edebug-eval-expression (edebug-expr)
   "Evaluate an expression in the outside environment.  
@@ -3733,8 +3738,8 @@
     ))
 
 
-;;;; Edebug Minor Mode 
-;;; ===============================
+;; Edebug Minor Mode 
+;; ===============================
 
 ;; Global GUD bindings for all emacs-lisp-mode buffers.
 (define-key emacs-lisp-mode-map "\C-x\C-a\C-s" 'edebug-step-mode)
@@ -3898,8 +3903,8 @@
   (use-local-map edebug-mode-map))
 
 
-;;;; edebug eval list mode
-;;; ===============================================
+;; edebug eval list mode
+;; ===============================================
 ;; A list of expressions and their evaluations is displayed in *edebug*.
 
 (defun edebug-eval-result-list ()
@@ -4035,8 +4040,8 @@
   (use-local-map edebug-eval-mode-map))
 
 
-;;;; Interface with standard debugger.
-;;; ========================================
+;; Interface with standard debugger.
+;; ========================================
 
 ;; (setq debugger 'edebug) ; to use the edebug debugger
 ;; (setq debugger 'debug)  ; use the standard debugger
@@ -4115,7 +4120,7 @@
       )))))
 
 
-;;;; Trace display
+;; Trace display
 ;; ===============================
 
 (defun edebug-trace-display (buf-name fmt &rest args)
@@ -4151,8 +4156,8 @@
   (apply 'edebug-trace-display edebug-trace-buffer fmt args))
 
 
-;;;; Frequency count and coverage
-;;; ==============================
+;; Frequency count and coverage
+;; ==============================
 
 (defun edebug-display-freq-count ()
   "Display the frequency count data for each line of the current
@@ -4235,8 +4240,8 @@
     (undo)))
 
 
-;;;; Menus
-;;;=========
+;; Menus
+;;=========
 
 (defun edebug-toggle (variable)
   (set variable (not (eval variable)))
@@ -4303,11 +4308,11 @@
   "XEmacs style menus for Edebug.")
 
 
-;;;; Emacs version specific code
-;;;=============================
-;;; The default for all above is Emacs 18, because it is easier to compile
-;;; Emacs 18 code in Emacs 19 than vice versa.  This default will
-;;; change once most people are using Emacs 19 or derivatives.
+;; Emacs version specific code
+;;=============================
+;; The default for all above is Emacs 18, because it is easier to compile
+;; Emacs 18 code in Emacs 19 than vice versa.  This default will
+;; change once most people are using Emacs 19 or derivatives.
 
 ;; Epoch specific code is in a separate file: edebug-epoch.el.
 
@@ -4370,7 +4375,7 @@
       (edebug-safe-prin1-to-string (car values)))))
 
   (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus)
-  (if window-system
+  (if (eq (console-type) 'x)
       (x-popup-menu nil (lookup-key edebug-mode-map [menu-bar Edebug])))
   )
 
@@ -4414,8 +4419,8 @@
 (edebug-emacs-version-specific)
 
 
-;;;; Byte-compiler
-;;; ====================
+;; Byte-compiler
+;; ====================
 ;; Extension for bytecomp to resolve undefined function references.
 ;; Requires new byte compiler.
 
@@ -4499,8 +4504,8 @@
   )))
 
 
-;;;; Autoloading of Edebug accessories
-;;;===================================
+;; Autoloading of Edebug accessories
+;;===================================
 
 (if (featurep 'cl)
     (add-hook 'edebug-setup-hook
@@ -4518,11 +4523,11 @@
 	    (function (lambda () (require 'edebug-cl-read)))))
 
 
-;;;; Finalize Loading
-;;;===================
-
-;;; Finally, hook edebug into the rest of Emacs.
-;;; There are probably some other things that could go here.
+;; Finalize Loading
+;;===================
+
+;; Finally, hook edebug into the rest of Emacs.
+;; There are probably some other things that could go here.
 
 ;; Install edebug read and eval functions.
 (edebug-install-read-eval-functions)
@@ -4530,5 +4535,3 @@
 (provide 'edebug)
 
 ;;; edebug.el ends here
-
-
--- a/lisp/edebug/eval-reg.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/edebug/eval-reg.el	Mon Aug 13 09:03:46 2007 +0200
@@ -5,42 +5,47 @@
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 ;; Keywords: lisp
 
-;; This file is part of GNU Emacs.
+;; This file is part of XEmacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
+;; 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;;; Commentary:
+;; 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.
 
-;;; eval-region, eval-buffer, and eval-current-buffer are redefined in
-;;; Lisp to allow customizations by Lisp code.  eval-region calls
-;;; `read', `eval', and `prin1', so Lisp replacements of these
-;;; functions will affect eval-region and anything else that calls it.
-;;; eval-buffer and eval-current-buffer are redefined in Lisp to call
-;;; eval-region on the buffer.  
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
 
-;;; Because of dynamic binding, all local variables are protected from
-;;; being seen by eval by giving them funky names.  But variables in
-;;; routines that call eval-region are similarly exposed.
+;; eval-region, eval-buffer, and eval-current-buffer are redefined in
+;; Lisp to allow customizations by Lisp code.  eval-region calls
+;; `read', `eval', and `prin1', so Lisp replacements of these
+;; functions will affect eval-region and anything else that calls it.
+;; eval-buffer and eval-current-buffer are redefined in Lisp to call
+;; eval-region on the buffer.  
 
-;;; Perhaps this should be one of several files in an `elisp' package
-;;; that replaces Emacs Lisp subroutines with Lisp versions of the
-;;; same.
+;; Because of dynamic binding, all local variables are protected from
+;; being seen by eval by giving them funky names.  But variables in
+;; routines that call eval-region are similarly exposed.
 
-;;; Eval-region may be installed, after loading, by calling:
-;;; (elisp-eval-region-install).  Installation can be undone with:
-;;; (elisp-eval-region-uninstall).
+;; Perhaps this should be one of several files in an `elisp' package
+;; that replaces Emacs Lisp subroutines with Lisp versions of the
+;; same.
+
+;; Eval-region may be installed, after loading, by calling:
+;; (elisp-eval-region-install).  Installation can be undone with:
+;; (elisp-eval-region-uninstall).
+
+;;; Code:
 
 '(defpackage "elisp-eval-region"
    (:nicknames "elisp")
@@ -210,7 +215,6 @@
 		    (error "No such buffer: %s" elisp-bufname)))
     (eval-region (point-min) (point-max) elisp-printflag)))
 
-
 (provide 'eval-reg)
 
 ;;; eval-reg.el ends here
--- a/lisp/electric/ebuff-menu.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/electric/ebuff-menu.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,8 +1,9 @@
 ;;; ebuff-menu.el --- electric-buffer-list mode
 
-;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1994 Free Software Foundation, Inc.
 
 ;; Author: Richard Mlynarik <mly@ai.mit.edu>
+;; Keywords: frames
 
 ;; This file is part of XEmacs.
 
@@ -18,9 +19,10 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -31,6 +33,7 @@
 ;;; Code:
 
 (require 'electric)
+;; XEmacs change
 (require 'buff-menu)
 
 ;; this depends on the format of list-buffers (from src/buffer.c) and
@@ -39,79 +42,71 @@
 (defvar electric-buffer-menu-mode-map nil)
 
 ;;;###autoload
-(defun electric-buffer-list (&optional files-only)
+(defun electric-buffer-list (arg)
   "Pops up a buffer describing the set of Emacs buffers.
 Vaguely like ITS lunar select buffer; combining typeoutoid buffer
 listing with menuoid buffer selection.
 
 If the very next character typed is a space then the buffer list
-window disappears.  Otherwise, one may move around in the
-buffer list window, marking buffers to be selected, saved or deleted.
+window disappears.  Otherwise, one may move around in the buffer list
+window, marking buffers to be selected, saved or deleted.
 
-To exit and select a new buffer, type a space when the cursor is on the
-appropriate line of the buffer-list window.
-
-Other commands are much like those of buffer-menu-mode.
+To exit and select a new buffer, type a space when the cursor is on
+the appropriate line of the buffer-list window.  Other commands are
+much like those of buffer-menu-mode.
 
 Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil.
 
-Non-null optional arg FILES-ONLY means mention only file buffers.
-When called from Lisp code, FILES-ONLY may be a regular expression,
-in which case only buffers whose names match that expression are listed,
-or an arbitrary predicate function.
-
 \\{electric-buffer-menu-mode-map}" 
-  (interactive (list (if current-prefix-arg t nil)))
+  (interactive "P")
   (let (select buffer)
     (save-window-excursion
-      (save-excursion
-	(save-window-excursion
-          (let ((temp-buffer-show-function 'ignore))
-	    (list-buffers files-only)))
-	(setq buffer (window-buffer (Electric-pop-up-window "*Buffer List*")))
-	(unwind-protect
-	    (progn
-	      (set-buffer buffer)
-	      (Electric-buffer-menu-mode)
-	      (setq select
-		    (catch 'electric-buffer-menu-select
-		      (message "<<< Press Return to bury the buffer list >>>")
-		      (let ((start-point (point))
-			    (first (progn (goto-char (point-min))
-					  (forward-line 2)
-					  (point)))
-			    (last (progn (goto-char (point-max))
-					 (forward-line -1)
-					 (point)))
-			    (goal-column 0))
-			;; Use start-point if it is meaningful.
-			(goto-char (if (or (< start-point first)
-					   (> start-point last))
-				       first
-				     start-point))
-			(Electric-command-loop 'electric-buffer-menu-select
-					       nil
-					       t
-					       'electric-buffer-menu-looper
-					       (cons first last))))))
-	  (save-excursion
+      (save-window-excursion (list-buffers arg))
+      (setq buffer (window-buffer (Electric-pop-up-window "*Buffer List*")))
+      (unwind-protect
+	  (progn
 	    (set-buffer buffer)
-	    (Buffer-menu-mode))
-	  (bury-buffer buffer)
-	  (message nil))))
+	    (Electric-buffer-menu-mode)
+	    (setq select
+		  (catch 'electric-buffer-menu-select
+		    (message "<<< Press Return to bury the buffer list >>>")
+		    ;; XEmacs change
+		    (if (eq (setq unread-command-events
+				  (list (next-command-event)))
+			    ?\ )
+			(progn (setq unread-command-events nil)
+			       (throw 'electric-buffer-menu-select nil)))
+		    (let ((start-point (point))
+			  (first (progn (goto-char (point-min))
+					(forward-line 2)
+					(point)))
+			  (last (progn (goto-char (point-max))
+				       (forward-line -1)
+				       (point)))
+			  (goal-column 0))
+		      ;; Use start-point if it is meaningful.
+		      (goto-char (if (or (< start-point first)
+					 (> start-point last))
+				     first
+				   start-point))
+		      (Electric-command-loop 'electric-buffer-menu-select
+					     nil
+					     t
+					     'electric-buffer-menu-looper
+					     (cons first last))))))
+	(set-buffer buffer)
+	(Buffer-menu-mode)
+	(bury-buffer buffer)
+	(message "")))
     (if select
-	(progn
-	  (set-buffer buffer)
-	  (let ((opoint (point-marker)))
-	    (Buffer-menu-execute)
-	    (goto-char (point-min))
-	    (cond ((prog1 (search-forward "\n>" nil t)
-		     (goto-char opoint) (set-marker opoint nil))
-		   (Buffer-menu-select))
-		  ((bufferp select)
-		   (switch-to-buffer select))
-		  (t
-		   (switch-to-buffer (Buffer-menu-buffer t)))))))))
+	(progn (set-buffer buffer)
+	       (let ((opoint (point-marker)))
+		 (Buffer-menu-execute)
+		 (goto-char (point-min))
+		 (if (prog1 (search-forward "\n>" nil t)
+		       (goto-char opoint) (set-marker opoint nil))
+		     (Buffer-menu-select)
+		   (switch-to-buffer (Buffer-menu-buffer t))))))))
 
 (defun electric-buffer-menu-looper (state condition)
   (cond ((and condition
@@ -156,15 +151,18 @@
   (use-local-map electric-buffer-menu-mode-map)
   (setq mode-name "Electric Buffer Menu")
   (setq mode-line-buffer-identification "Electric Buffer List")
+  ;; XEmacs
   (if (memq 'mode-name mode-line-format)
       (progn (setq mode-line-format (copy-sequence mode-line-format))
 	     (setcar (memq 'mode-name mode-line-format) "Buffers")))
   (make-local-variable 'Helper-return-blurb)
   (setq Helper-return-blurb "return to buffer editing")
   (setq truncate-lines t)
+  ;; XEmacs
   (setq buffer-scrollbar-height 0)
   (setq buffer-read-only t)
   (setq major-mode 'Electric-buffer-menu-mode)
+  ;; XEmacs
   (setq mode-motion-hook 'mode-motion-highlight-line)
   (goto-char (point-min))
   (if (search-forward "\n." nil t) (forward-char -1))
@@ -175,30 +173,29 @@
 (put 'Electric-buffer-menu-undefined 'suppress-keymap t)
 (if electric-buffer-menu-mode-map
     nil
-  (let ((map (make-keymap)))
-    (set-keymap-name map 'electric-buffer-menu-mode-map)
-    ;;#### Urk! There must be a buffer way in Lucid Emacs.
+  (let ((map (make-keymap)) (submap (make-keymap)))
+    ;(fillarray (car (cdr map)) 'Electric-buffer-menu-undefined) ; FSF
     (let ((i 0))
       (while (< i 128)
 	(define-key map (make-string 1 i) 'Electric-buffer-menu-undefined)
 	(setq i (1+ i))))
-    (define-key map "\e" (make-keymap))
+    (define-key map "\e" submap)
+    ;(fillarray (car (cdr submap)) 'Electric-buffer-menu-undefined) ; FSF
     (let ((map2 (lookup-key map "\e"))
-	  (i 0))
+	   (i 0))
       (while (< i 128)
 	(define-key map2 (make-string 1 i) 'Electric-buffer-menu-undefined)
 	(setq i (1+ i))))
-;;  (define-key map "\C-z" 'suspend-emacs)
+    (define-key map "\C-z" 'suspend-emacs)
     (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
-;;  (define-key map "\C-h" 'Helper-help)
-    (define-key map '(control h) 'Helper-help)
+    (define-key map (char-to-string help-char) 'Helper-help)
     (define-key map "?" 'Helper-describe-bindings)
     (define-key map "\C-c" nil)
     (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
     (define-key map "\C-]" 'Electric-buffer-menu-quit)
     (define-key map "q" 'Electric-buffer-menu-quit)
-    (define-key map " " 'Electric-buffer-menu-select)  
-    (define-key map "\r" 'Electric-buffer-menu-select) ;; XEmacs change
+    (define-key map " " 'Electric-buffer-menu-select)
+    (define-key map "\C-m" 'Electric-buffer-menu-select)
     (define-key map "\C-l" 'recenter)
     (define-key map "s" 'Buffer-menu-save)
     (define-key map "d" 'Buffer-menu-delete)
@@ -206,6 +203,7 @@
     (define-key map "\C-d" 'Buffer-menu-delete-backwards)
     ;(define-key map "\C-k" 'Buffer-menu-delete)
     (define-key map "\177" 'Buffer-menu-backup-unmark)
+    ;; XEmacs
     (define-key map 'backspace 'Buffer-menu-backup-unmark)
     (define-key map "~" 'Buffer-menu-not-modified)
     (define-key map "u" 'Buffer-menu-unmark)
@@ -232,6 +230,7 @@
     (define-key map "\e<" 'beginning-of-buffer)
     (define-key map "\e\e" nil)
     (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
+    ;; XEmacs
     (define-key map [home] 'beginning-of-buffer)
     (define-key map [down] 'next-line)
     (define-key map [up] 'previous-line)
@@ -243,6 +242,7 @@
  
 (defun Electric-buffer-menu-exit ()
   (interactive)
+  ;; XEmacs
   (setq unread-command-event last-input-event)
   ;; for robustness
   (condition-case ()
@@ -253,13 +253,13 @@
 (defun Electric-buffer-menu-select ()
   "Leave Electric Buffer Menu, selecting buffers and executing changes.
 Saves buffers marked \"S\".  Deletes buffers marked \"K\".
-Selects buffer at point and displays buffers marked \">\" in other
-windows."
+Selects buffer at point and displays buffers marked \">\" in other windows."
   (interactive)
   (throw 'electric-buffer-menu-select (point)))
 
 (defun Electric-buffer-menu-mouse-select (event)
   (interactive "e")
+  ;; XEmacs is simpler
   (mouse-set-point event)
   (Electric-buffer-menu-select))
 
@@ -272,10 +272,15 @@
 (defun Electric-buffer-menu-undefined ()
   (interactive)
   (ding)
-  (message (substitute-command-keys "\
+  (message "%s"
+	   (if (and (eq (key-binding "\C-c\C-c") 'Electric-buffer-menu-quit)
+		    (eq (key-binding " ") 'Electric-buffer-menu-select)
+		    (eq (key-binding (char-to-string help-char)) 'Helper-help)
+		    (eq (key-binding "?") 'Helper-describe-bindings))
+	       (substitute-command-keys "Type C-c C-c to exit, Space to select,
 Type \\[Electric-buffer-menu-quit] to exit, \
 \\[Electric-buffer-menu-select] to select, \
-\\[Helper-help] for help, \\[Helper-describe-bindings] for commands."))
+\\[Helper-help] for help, \\[Helper-describe-bindings] for commands.")))
   (sit-for 4))
 
 (defun Electric-buffer-menu-mode-view-buffer ()
--- a/lisp/electric/echistory.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/electric/echistory.el	Mon Aug 13 09:03:46 2007 +0200
@@ -4,6 +4,7 @@
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: FSF
+;; Keywords: extensions
 
 ;; This file is part of XEmacs.
 
@@ -19,9 +20,10 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Code:
 
@@ -31,7 +33,7 @@
 ;;;###autoload
 (defun Electric-command-history-redo-expression (&optional noconfirm)
   "Edit current history line in minibuffer and execute result.
-With prefix argument NOCONFIRM, execute current line as-is without editing."
+With prefix arg NOCONFIRM, execute current line as-is without editing."
   (interactive "P")
   (let (todo)
     (save-excursion
@@ -44,6 +46,7 @@
 (defvar electric-history-map ())
 (if electric-history-map
     ()
+  ;; XEmacs
   (setq electric-history-map (make-keymap))
   (set-keymap-name electric-history-map 'electric-history-map)
   (set-keymap-default-binding electric-history-map 'Electric-history-undefined)
@@ -64,8 +67,8 @@
   (define-key electric-history-map "\C-c\C-c" 'Electric-history-quit)
   (define-key electric-history-map "\C-]" 'Electric-history-quit)
   (define-key electric-history-map "\C-z" 'suspend-emacs)
-;;  (define-key electric-history-map "\C-h" 'Helper-help)
-  (define-key electric-history-map '(control h) 'Helper-help)
+  (define-key electric-history-map (char-to-string help-char) 'Helper-help)
+  ;; XEmacs
   (define-key electric-history-map 'backspace 'previous-line)
   (define-key electric-history-map "?" 'Helper-describe-bindings)
   (define-key electric-history-map "\e>" 'end-of-buffer)
@@ -99,12 +102,6 @@
 
 The history displayed is filtered by `list-command-history-filter' if non-nil.
 
-This pops up a window with the Command History listing.  If the very
-next character typed is Space, the listing is killed and the previous
-window configuration is restored.  Otherwise, you can browse in the
-Command History with  Return  moving down and  Delete  moving up, possibly
-selecting an expression to be redone with Space or quitting with `Q'.
-
 Like Emacs-Lisp mode except that characters do not insert themselves and
 Tab and Linefeed do not indent.  Instead these commands are provided:
 \\{electric-history-map}
@@ -153,7 +150,7 @@
   "Quit Electric Command History, restoring previous window configuration."
   (interactive)
   (if (boundp 'electric-history-in-progress)
-      (progn (message nil)
+      (progn (message "")
 	     (throw 'electric-history-quit nil))))
 
 ;;; echistory.el ends here
--- a/lisp/electric/ehelp.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/electric/ehelp.el	Mon Aug 13 09:03:46 2007 +0200
@@ -3,7 +3,6 @@
 ;; Copyright (C) 1986, 1995 Free Software Foundation, Inc.
 
 ;; Author: Richard Mlynarik <mly@ai.mit.edu>
-
 ;; Maintainer: FSF
 ;; Keywords: help, extensions
 
@@ -21,9 +20,10 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -42,15 +42,15 @@
 ;;; Code:
 
 (require 'electric)
+(defvar electric-help-map ()
+  "Keymap defining commands available in `electric-help-mode'.")
 
-(defvar electric-help-map nil
-  "Keymap defining commands available in `electric-help-mode'.")
+(defvar electric-help-form-to-execute nil)
 
 (put 'electric-help-undefined 'suppress-keymap t)
 (if electric-help-map
     ()
   (let ((map (make-keymap)))
-    (set-keymap-name map 'electric-help-map)
     ;; allow all non-self-inserting keys - search, scroll, etc, but
     ;; let M-x and C-x exit ehelp mode and retain buffer:
     (suppress-keymap map)
@@ -67,6 +67,7 @@
     (define-key map [(control ?9)] 'electric-help-undefined)
     (define-key map (char-to-string help-char) 'electric-help-help)
     (define-key map "?" 'electric-help-help)
+    ;; XEmacs addition
     (define-key map 'help 'electric-help-help)
     (define-key map " " 'scroll-up)
     (define-key map "\^?" 'scroll-down)
@@ -86,13 +87,14 @@
 
 (defun electric-help-mode ()
   "`with-electric-help' temporarily places its buffer in this mode.
-\(On exit from `with-electric-help', the buffer is put in `default-major-mode'.\)"
+\(On exit from `with-electric-help', the buffer is put in `default-major-mode'.)"
   (setq buffer-read-only t)
   (setq mode-name "Help")
   (setq major-mode 'help)
   (setq modeline-buffer-identification '(" Help:  %b"))
   (use-local-map electric-help-map)
-  (setq mouse-leave-buffer-hook '(electric-help-retain))
+  (add-hook 'mouse-leave-buffer-hook 'electric-help-retain)
+  (view-mode -1)
   ;; this is done below in with-electric-help
   ;(run-hooks 'electric-help-mode-hook)
   )
@@ -126,7 +128,7 @@
   (let ((one (one-window-p t))
 	(config (current-window-configuration))
         (bury nil)
-        (to-be-executed nil))
+        (electric-help-form-to-execute nil))
     (unwind-protect
 	(save-excursion
 	  (if one (goto-char (window-start (selected-window))))
@@ -138,7 +140,8 @@
 		(enlarge-window (- minheight (window-height))))
 	    (electric-help-mode)
 	    (setq buffer-read-only nil)
-	    (or noerase (erase-buffer)))
+	    (or noerase
+		(erase-buffer)))
 	  (let ((standard-output buffer))
 	    (if (not (funcall thunk))
 		(progn
@@ -148,14 +151,15 @@
 		  (if one (shrink-window-if-larger-than-buffer (selected-window))))))
 	  (set-buffer buffer)
 	  (run-hooks 'electric-help-mode-hook)
+	  (setq buffer-read-only t)
 	  (if (eq (car-safe
-		   ;; Don't be screwed by minor-modes (view-minor-mode)
+		   ;; XEmacs: Don't be screwed by minor-modes (view-minor-mode)
 		   (let ((overriding-local-map electric-help-map))
 		     (electric-help-command-loop)))
 		  'retain)
 	      (setq config (current-window-configuration))
 	    (setq bury t)))
-      (message nil)
+      (message "")
       (set-buffer buffer)
       (setq buffer-read-only nil)
       (condition-case ()
@@ -169,12 +173,13 @@
             (replace-buffer-in-windows buffer)
             ;; must do this outside of save-window-excursion
             (bury-buffer buffer)))
-      (eval to-be-executed))))
+      (eval electric-help-form-to-execute))))
 
 (defun electric-help-command-loop ()
   (catch 'exit
     (if (pos-visible-in-window-p (point-max))
-	(progn (message (substitute-command-keys "<<< Press Space to bury the help buffer, Press \\[electric-help-retain] to retain it >>>"))
+	(progn (message "%s" (substitute-command-keys "<<< Press Space to bury the help buffer, Press \\[electric-help-retain] to retain it >>>"))
+	       ;; XEmacs change
 	       (if (equal (setq unread-command-events
 				(list (next-command-event)))
 			  '(?\ ))
@@ -219,14 +224,14 @@
 
 
 ;(defun electric-help-scroll-up (arg)
-;  "####Doc"
+;  ">>>Doc"
 ;  (interactive "P")
 ;  (if (and (null arg) (pos-visible-in-window-p (point-max)))
 ;      (electric-help-exit)
 ;    (scroll-up arg)))
 
 (defun electric-help-exit ()
-  "####Doc"
+  ">>>Doc"
   (interactive)
   (throw 'exit t))
 
@@ -237,27 +242,11 @@
   (interactive)
   ;; Make sure that we don't throw twice, even if two events cause
   ;; calling this function:
-  (if mouse-leave-buffer-hook
-    (progn
-      (setq mouse-leave-buffer-hook nil)
-      (throw 'exit '(retain)))))
-
+  (if (memq 'electric-help-retain mouse-leave-buffer-hook)
+      (progn
+	(remove-hook 'mouse-leave-buffer-hook 'electric-help-retain)
+	(throw 'exit '(retain)))))
 
-;(defun electric-help-undefined ()
-;  (interactive)
-;  (let* ((keys (this-command-keys))
-;	 (n (length keys)))
-;    (if (or (= n 1)
-;	    (and (= n 2)
-;		 meta-flag
-;		 (eq (aref keys 0) meta-prefix-char)))
-;	(setq unread-command-char last-input-char
-;	      current-prefix-arg prefix-arg)
-;      ;;#### I don't care.
-;      ;;#### The emacs command-loop is too much pure pain to
-;      ;;#### duplicate
-;      ))
-;  (throw 'exit t))
 
 (defun electric-help-undefined ()
   (interactive)
@@ -268,7 +257,7 @@
 	   (substitute-command-keys "\\[electric-help-exit]"))))
 
 
-;#### this needs to be hairified (recursive help, anybody?)
+;>>> this needs to be hairified (recursive help, anybody?)
 (defun electric-help-help ()
   (interactive)
   (if (and (eq (key-binding "q") 'electric-help-exit)
@@ -281,35 +270,56 @@
 
 
 ;;;###autoload
-(defun electric-helpify (fun &optional buffer-name)
-  (or buffer-name (setq buffer-name "*Help*"))
-  (let* ((p (symbol-function 'print-help-return-message))
-         (b (get-buffer buffer-name))
-         (tick (and b (buffer-modified-tick b))))
-    (and b (not (get-buffer-window b))
-         (setq b nil))
-    (if (unwind-protect
-             (save-window-excursion
-               (message "%s..." (capitalize (symbol-name fun)))
-               ;; kludge-o-rama
-               (fset 'print-help-return-message 'ignore)
-               (let ((a (call-interactively fun 'lambda)))
-                 (let ((temp-buffer-show-function 'ignore))
-                   (apply fun a)))
-               (message nil)
-               ;; Was a non-empty help buffer created/modified?
-               (let ((r (get-buffer buffer-name)))
-                 (and r
-                      ;(get-buffer-window r)
-                      (or (not b)
-                          (not (eq b r))
-                          (not (eql tick (buffer-modified-tick b))))
-                      (save-excursion
-                        (set-buffer r)
-                        (> (buffer-size) 0)))))
-	  (fset 'print-help-return-message p)
-	  )
-        (with-electric-help 'ignore buffer-name t))))
+(defun electric-helpify (fun &optional name)
+  (let ((name (or name "*Help*")))
+    (if (save-window-excursion
+	  ;; kludge-o-rama
+	  (let* ((p (symbol-function 'print-help-return-message))
+		 (b (get-buffer name))
+		 (m (buffer-modified-p b)))
+	    (and b (not (get-buffer-window b))
+		 (setq b nil))
+	    (unwind-protect
+		(progn
+		  (message "%s..." (capitalize (symbol-name fun)))
+		  ;; with-output-to-temp-buffer marks the buffer as unmodified.
+		  ;; kludging excessively and relying on that as some sort
+		  ;;  of indication leads to the following abomination...
+		  ;;>> This would be doable without such icky kludges if either
+		  ;;>> (a) there were a function to read the interactive
+		  ;;>>     args for a command and return a list of those args.
+		  ;;>>     (To which one would then just apply the command)
+		  ;;>>     (The only problem with this is that interactive-p
+		  ;;>>      would break, but that is such a misfeature in
+		  ;;>>      any case that I don't care)
+		  ;;>>     It is easy to do this for emacs-lisp functions;
+		  ;;>>     the only problem is getting the interactive spec
+		  ;;>>     for subrs
+		  ;;>> (b) there were a function which returned a
+		  ;;>>     modification-tick for a buffer.  One could tell
+		  ;;>>     whether a buffer had changed by whether the
+		  ;;>>     modification-tick were different.
+		  ;;>>     (Presumably there would have to be a way to either
+		  ;;>>      restore the tick to some previous value, or to
+		  ;;>>      suspend updating of the tick in order to allow
+		  ;;>>      things like momentary-string-display)
+		  (and b
+		       (save-excursion
+			 (set-buffer b)
+			 (set-buffer-modified-p t)))
+		  (fset 'print-help-return-message 'ignore)
+		  (call-interactively fun)
+		  (and (get-buffer name)
+		       (get-buffer-window (get-buffer name))
+		       (or (not b)
+			   (not (eq b (get-buffer name)))
+			   (not (buffer-modified-p b)))))
+	      (fset 'print-help-return-message p)
+	      (and b (buffer-name b)
+		   (save-excursion
+		     (set-buffer b)
+		     (set-buffer-modified-p m))))))
+	(with-electric-help 'ignore name t))))
 
 
 
@@ -317,14 +327,14 @@
 ;; continues with execute-extended-command.
 (defun electric-help-execute-extended (prefixarg)
   (interactive "p")
-  (setq to-be-executed '(execute-extended-command nil))
+  (setq electric-help-form-to-execute '(execute-extended-command nil))
   (electric-help-retain))
 
 ;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then
 ;; continues with ctrl-x prefix.
 (defun electric-help-ctrl-x-prefix (prefixarg)
   (interactive "p")
-  (setq to-be-executed '(progn (message nil) (setq unread-command-char ?\C-x)))
+  (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x)))
   (electric-help-retain))
 
 
@@ -363,7 +373,7 @@
 
 (defun electric-command-apropos ()
   (interactive)
-  (electric-helpify 'command-apropos))
+  (electric-helpify 'command-apropos "*Apropos*"))
 
 ;(define-key help-map "a" 'electric-command-apropos)
 
@@ -371,11 +381,10 @@
   (interactive)
   (electric-helpify 'apropos))
 
-
 
 ;;;; ehelp-map
 
-(defvar ehelp-map nil)
+(defvar ehelp-map ())
 (if ehelp-map
     nil
   ;; #### WTF?  Why don't we just use substitute-key-definition
--- a/lisp/electric/electric.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/electric/electric.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,6 @@
 ;;; electric.el --- window maker and Command loop for `electric' modes.
 
-;; Copyright (C) 1985, 1986, 1992, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: FSF
@@ -20,9 +20,10 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.97.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -68,6 +69,7 @@
               (setq prompt-string nil)
             (setq prompt-string "->")))
       (setq cmd (read-key-sequence prompt-string))
+      ;; XEmacs
       (or prefix-arg (setq last-command this-command))
       (setq last-command-event (aref cmd (1- (length cmd)))
 	    current-mouse-event
@@ -82,6 +84,7 @@
       ;; This makes universal-argument-other-key work.
       (setq universal-argument-num-events 0)
       (if (or (prog1 quit-flag (setq quit-flag nil))
+	      ;; XEmacs
 	      (eq (event-to-character last-input-event) (quit-char)))
 	  (progn (setq unread-command-events nil
 		       prefix-arg nil)
@@ -95,6 +98,7 @@
       (setq current-prefix-arg prefix-arg)
       (if cmd
 	  (condition-case conditions
+	      ;; XEmacs
 	      (progn (if (eventp cmd)
 			 (progn
 			   (let ((b (current-buffer)))
@@ -104,27 +108,43 @@
 		       (command-execute cmd))
 		     (setq last-command this-command)
 		     (if (or (prog1 quit-flag (setq quit-flag nil))
+			     ;; XEmacs
 			     (eq (event-to-character last-input-event)
 				 (quit-char)))
 			 (progn (setq unread-command-events nil)
 				(if (not inhibit-quit)
+				    ;; XEmacs
 				    (progn (ding nil 'quit)
 					   (message "Quit")
 					   (throw return-tag nil))
 				  (message "Quit inhibited")
 				  (ding)))))
-	    (error (command-error conditions) ; XEmacs
-		   (sit-for 2)))
-	(ding nil 'undefined-key))
-            (and (not (eq (current-buffer) electrified-buffer)) ; XEmacs -
-	   (not (eq (selected-window) (minibuffer-window)))
-	   (progn (ding nil 'quit)
-		  (message "Leaving electric command loop %s."
-			   "because buffer has changed")
-		  (sit-for 2)
-		  (throw return-tag nil)))
+	    (buffer-read-only (if loop-function
+				  (setq err conditions)
+				(ding)
+				(message "Buffer is read-only")
+				(sit-for 2)))
+	    (beginning-of-buffer (if loop-function
+				     (setq err conditions)
+				   (ding)
+				   (message "Beginning of Buffer")
+				   (sit-for 2)))
+	    (end-of-buffer (if loop-function
+			       (setq err conditions)
+			     (ding)
+			     (message "End of Buffer")
+			     (sit-for 2)))
+	    (error (if loop-function
+		       (setq err conditions)
+		     (ding)
+		     (message "Error: %s"
+			      (if (eq (car conditions) 'error)
+				  (car (cdr conditions))
+				(prin1-to-string conditions)))
+		     (sit-for 2))))
+	(ding))
       (if loop-function (funcall loop-function loop-state err))))
-  ;; ####> - huh?  It should be impossible to ever get here...
+  ;; XEmacs - huh?  It should be impossible to ever get here...
   (ding nil 'alarm)
   (throw return-tag nil))
 
@@ -178,6 +198,6 @@
       (goto-char (point-min))
       win)))
 
-(provide 'electric)                           ; zaaaaaaap
+(provide 'electric)
 
 ;;; electric.el ends here
--- a/lisp/electric/helper.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/electric/helper.el	Mon Aug 13 09:03:46 2007 +0200
@@ -20,14 +20,15 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Code:
 
-; hey, here's a helping hand.
-  
+;; hey, here's a helping hand.
+
 ;; Bind this to a string for <blank> in "... Other keys <blank>".
 ;; Helper-help uses this to construct help string when scrolling.
 ;; Defaults to "return"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/emulators/crisp.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,209 @@
+;; @(#) crisp.el -- Crisp/Brief Emacs emulator
+
+;; Author: Gary D. Foster <Gary.Foster@corp.sun.com>
+;; $Revision: 1.1.1.1 $
+;; Keywords: emulations brief crisp
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Keybindings and minor functions to duplicate the functionality and
+;; finger-feel of the Crisp/Brief editor.  This package is designed to
+;; facilitate transitioning from Brief to (XE|E)macs with a minimum
+;; amount of hassles.
+
+;; Enable this package by putting the following in your .emacs
+;; (require 'crisp)
+;; and use M-x crisp-mode to toggle it on or off.
+
+;; This package will automatically default to loading the scroll-lock.el
+;; package unless you put (setq crisp-load-scroll-lock nil) in your
+;; .emacs.  If this feature is enabled, it will bind meta-f1 to the
+;; scroll-lock mode toggle.
+
+;; Also, the default keybindings for brief override the meta-x key to
+;; exit the editor.  If you don't like this functionality, you can
+;; prevent this key from being rebound with
+;; (setq crisp-override-meta-x nil) in your .emacs.
+
+;; Finally, if you want to change the string displayed in the modeline
+;; when this mode is in effect, override the definition of
+;; `crisp-mode-modeline-string' in your .emacs.  The default value is
+;; " *Crisp*" which may be a bit lengthy if you have a lot of things
+;; being displayed there.
+
+;; All these overrides should go *before* the (require 'crisp) statement.
+
+;; local variables
+
+(defvar crisp-mode-map (copy-keymap (current-global-map))
+  "Local keymap for Crisp mode.
+All the bindings are done here instead of globally to try and be
+nice to the world.")
+
+(defvar crisp-mode-modeline-string " *Crisp*"
+  "String to display in the modeline when Crisp mode is enabled.")
+
+(defvar crisp-mode-original-keymap (copy-keymap (current-global-map))
+  "The original keymap before Crisp mode remaps anything.
+This keymap is restored when Crisp mode is disabled.")
+
+(defvar crisp-mode-enabled 'nil
+  "Track status of Crisp mode.
+A value of nil means Crisp mode is not enabled.  A value of t
+indicates Crisp mode is enabled.")
+
+(defvar crisp-override-meta-x 't
+  "Controls overriding the normal Emacs M-x key binding.
+The normal binding for M-x is `execute-extended-command', however
+the normal Crisp keybinding for M-x is to exit the editor, while
+the F10 key is used to execute extended commands.  If you don't
+want M-x to dump you out of emacs, set this to nil before loading
+the package.")
+
+(defvar crisp-load-scroll-lock 't
+  "Controls loading of the Scroll Lock minor mode package.
+Default behavior is to load the scroll lock minor mode
+package when Crisp mode is enabled.  Set to nil prior
+to loading this package to prevent it.")
+
+(defvar crisp-load-hook nil
+  "Hooks to run after Crisp mode is enabled.")
+
+(defvar crisp-mode-running-xemacs (string-match "XEmacs\\Lucid" emacs-version))
+
+(if crisp-mode-running-xemacs
+    (add-minor-mode 'crisp-mode-enabled crisp-mode-modeline-string)
+  (or (assq 'crisp-mode-enabled minor-mode-alist)
+      (setq minor-mode-alist
+	    (cons '(crisp-mode-enabled crisp-mode-modeline-string) minor-mode-alist))))
+
+;; and now the keymap defines
+
+(define-key crisp-mode-map [(f1)]           'other-window)
+
+(define-key crisp-mode-map [(f2) (down)]    'enlarge-window)
+(define-key crisp-mode-map [(f2) (left)]    'shrink-window-horizontally)
+(define-key crisp-mode-map [(f2) (right)]   'enlarge-window-horizontally)
+(define-key crisp-mode-map [(f2) (up)]      'shrink-window)
+(define-key crisp-mode-map [(f3) (down)]    'split-window-vertically)
+(define-key crisp-mode-map [(f3) (right)]   'split-window-horizontally)
+
+(define-key crisp-mode-map [(f4)]           'delete-window)
+(define-key crisp-mode-map [(control f4)]   'delete-other-windows)
+
+(define-key crisp-mode-map [(f5)]           'search-forward-regexp)
+(define-key crisp-mode-map [(f19)]          'search-forward-regexp)
+(define-key crisp-mode-map [(meta f5)]       'search-backward-regexp)
+
+(define-key crisp-mode-map [(f6)]           'query-replace)
+
+(define-key crisp-mode-map [(f7)]           'start-kbd-macro)
+(define-key crisp-mode-map [(meta f7)]       'end-kbd-macro)
+
+(define-key crisp-mode-map [(f8)]           'call-last-kbd-macro)
+(define-key crisp-mode-map [(meta f8)]      'save-kbd-macro)
+
+(define-key crisp-mode-map [(f9)]           'find-file)
+(define-key crisp-mode-map [(meta f9)]       'load-library)
+
+(define-key crisp-mode-map [(f10)]          'execute-extended-command)
+(define-key crisp-mode-map [(meta f10)]      'compile)
+
+(define-key crisp-mode-map [(SunF37)]          'kill-buffer)
+(define-key crisp-mode-map [(kp_add)]       'x-copy-primary-selection)
+(define-key crisp-mode-map [(kp_subtract)]  'x-kill-primary-selection)
+(define-key crisp-mode-map [(insert)]       'x-yank-clipboard-selection)
+(define-key crisp-mode-map [(f16)]          'x-copy-primary-selection) ; copy on Sun5 kbd
+(define-key crisp-mode-map [(f20)]          'x-kill-primary-selection) ; cut on Sun5 kbd 
+(define-key crisp-mode-map [(f18)]          'x-yank-clipboard-selection) ; paste on Sun5 kbd
+
+(define-key crisp-mode-map [(meta d)]       (lambda () (interactive) (beginning-of-line) (kill-line)))
+(define-key crisp-mode-map [(meta e)]       'find-file)
+(define-key crisp-mode-map [(meta g)]       'goto-line)
+(define-key crisp-mode-map [(meta h)]       'help)
+(define-key crisp-mode-map [(meta i)]       'overwrite-mode)
+(define-key crisp-mode-map [(meta u)]       'advertised-undo)
+(define-key crisp-mode-map [(f14)]          'advertised-undo)
+(define-key crisp-mode-map [(meta w)]       'save-buffer)
+(if
+ (eq crisp-override-meta-x 't)
+  (define-key crisp-mode-map [(meta x)]       'save-buffers-kill-emacs))
+
+(define-key crisp-mode-map [(shift right)]  'fkey-forward-word)
+(define-key crisp-mode-map [(shift left)]   'fkey-backward-word)
+(define-key crisp-mode-map [(shift delete)] 'kill-word)
+(define-key crisp-mode-map [(shift backspace)] 'backward-kill-word)
+(define-key crisp-mode-map [(control left)] 'backward-word)
+(define-key crisp-mode-map [(control right)] 'forward-word)
+
+(define-key crisp-mode-map [(home)] 'crisp-home)
+(define-key crisp-mode-map [(end)] 'crisp-end)
+
+(defun crisp-home ()
+  "Home the point according to Crisp conventions.
+First call to this moves point to beginning of the line.  Second
+consecutive call moves point to beginning of the screen.  Third
+consecutive call moves the point to the beginning of the buffer."
+  (interactive nil)
+  (cond
+    ((and (eq last-command 'crisp-home) (eq last-last-command 'crisp-home))
+     (goto-char (point-min)))
+    ((eq last-command 'crisp-home)
+     (move-to-window-line 0))
+    (t
+     (beginning-of-line)))
+  (setq last-last-command last-command))
+
+(defun crisp-end ()
+  "End the point according to Crisp conventions.
+First call to this moves point to end of the line.  Second
+consecutive call moves point to the end of the screen.  Third
+consecutive call moves point to the end of the buffer."
+  (interactive nil)
+  (cond
+    ((and (eq last-command 'crisp-end) (eq last-last-command 'crisp-end))
+     (goto-char (point-max)))
+    ((eq last-command 'crisp-end)
+     (move-to-window-line -1)
+     (end-of-line))
+    (t
+     (end-of-line)))
+  (setq last-last-command last-command))
+
+;; Now enable the mode
+
+(defun crisp-mode ()
+  "Toggle Crisp minor mode."
+  (interactive nil)
+  (setq crisp-mode-enabled (not crisp-mode-enabled))
+  (cond
+   ((eq crisp-mode-enabled 't)
+    (use-global-map crisp-mode-map)
+    (if crisp-load-scroll-lock
+	(require 'scroll-lock))
+    (if (featurep 'scroll-lock)
+	(define-key crisp-mode-map [(meta f1)] 'scroll-lock-mode))
+    (run-hooks 'crisp-load-hook))
+   ((eq crisp-mode-enabled 'nil)
+    (use-global-map crisp-mode-original-keymap))))
+
+(provide 'crisp)
+
+;;; crisp.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/emulators/edt-lk201.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,57 @@
+;;; edt-lk201.el --- Enhanced EDT Keypad Mode Emulation for LK-201 Keyboards
+
+;; Copyright (C) 1986, 1992, 1993, 1995 Free Software Foundation, Inc.
+
+;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Keywords: emulations
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
+
+;;; Usage:
+
+;;  See edt-user.doc in the Emacs etc directory.
+
+;; ====================================================================
+
+;;;;
+;;;; KEY TRANSLATIONS
+;;;;
+
+;; Associate EDT keynames with Emacs terminal function vector names.
+;; (Function key vector names for LK-201 are found in lisp/term/lk201.el.)
+;;
+;; F1 - F5 are not available on many DEC VT series terminals.
+;; However, this is not always the case.  So support for F1 - F5 is
+;; provided here and in lisp/term/lk201.el.
+(defconst *EDT-keys*
+  '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3]) 
+    ("KP4" . [kp-4]) ("KP5" . [kp-5]) ("KP6" . [kp-6]) ("KP7" . [kp-7])
+    ("KP8" . [kp-8]) ("KP9" . [kp-9]) ("KP," . [kp-separator])
+    ("KP-" . [kp-subtract]) ("KPP" . [kp-decimal]) ("KPE" . [kp-enter])
+    ("PF1" . [kp-f1]) ("PF2" . [kp-f2]) ("PF3" . [kp-f3]) ("PF4" . [kp-f4])
+    ("UP" . [up]) ("DOWN" . [down]) ("RIGHT" . [right]) ("LEFT" . [left])
+    ("FIND" . [find]) ("INSERT" . [insert]) ("REMOVE" . [delete])
+    ("SELECT" . [select]) ("PREVIOUS" . [prior]) ("NEXT" . [next])
+    ("F1" . [f1]) ("F2" . [f2]) ("F3" . [f3]) ("F4" . [f4]) ("F5" . [f5])
+    ("F6" . [f6]) ("F7" . [f7]) ("F8" . [f8]) ("F9" . [f9]) ("F10" . [f10])
+    ("F11" . [f11]) ("F12" . [f12]) ("F13" . [f13]) ("F14" . [f14])
+    ("HELP" . [help]) ("DO" . [menu]) ("F17" . [f17]) ("F18" . [f18])
+    ("F19" . [f19]) ("F20" . [f20])))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/emulators/edt-mapper.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,407 @@
+;;; edt-mapper.el --- Create an EDT LK-201 Map File for X-Windows Emacs
+
+;; Copyright (C) 1994, 1995  Free Software Foundation, Inc.
+
+;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Keywords: emulations
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
+
+;;; Commentary:
+
+;;  This emacs lisp program can be used to create an emacs lisp file
+;;  that defines the mapping of the user's keyboard under X-Windows to
+;;  the LK-201 keyboard function keys and keypad keys (around which
+;;  EDT has been designed).  Please read the "Usage" AND "Known
+;;  Problems" sections before attempting to run this program.  (The
+;;  design of this file, edt-mapper.el, was heavily influenced by
+;;  tpu-mapper.el.) 
+
+;;; Usage:
+
+;;  Simply load this file into the X-Windows version of emacs (version 19)
+;;  using the following command.
+
+;;    emacs -q -l edt-mapper.el
+
+;;  The "-q" option prevents loading of your .emacs file (commands therein
+;;  might confuse this program).
+
+;;  An instruction screen showing the typical LK-201 terminal functions keys
+;;  will be displayed, and you will be prompted to press the keys on your
+;;  keyboard which you want to emulate the corresponding LK-201 keys.
+
+;;  Finally, you will be prompted for the name of the file to store
+;;  the key definitions.  If you chose the default, it will be found
+;;  and loaded automatically when the EDT emulation is started.  If
+;;  you specify a different file name, you will need to set the
+;;  variable "edt-xkeys-file" before starting the EDT emulation.
+;;  Here's how you might go about doing that in your .emacs file.
+
+;;    (setq edt-xkeys-file (expand-file-name "~/.my-emacs-x-keys"))
+
+;;; Known Problems:
+
+;;  Sometimes, edt-mapper will ignore a key you press, and just continue to
+;;  prompt for the same key.  This can happen when your window manager sucks
+;;  up the key and doesn't pass it on to emacs, or it could be an emacs bug.
+;;  Either way, there's nothing that edt-mapper can do about it.  You must
+;;  press RETURN, to skip the current key and continue.  Later, you and/or
+;;  your local X guru can try to figure out why the key is being ignored.
+
+;; ====================================================================
+
+;;;
+;;;  Make sure we're running X-windows and Emacs version 19
+;;;
+(cond
+ ((not (and window-system (not (string-lessp emacs-version "19"))))
+  (insert "
+
+    Whoa!  This isn't going to work...
+
+    You must run edt-mapper.el under X-windows and Emacs version 19.
+
+    Press any key to exit.  ")
+  (sit-for 600)
+  (kill-emacs t)))
+
+
+;;;
+;;;  Decide whether we're running GNU or Lucid emacs.
+;;;
+(defconst edt-lucid-emacs19-p (string-match "Lucid" emacs-version)
+  "Non-NIL if we are running Lucid Emacs version 19.")
+
+
+;;;
+;;;  Key variables
+;;;
+(defvar edt-key nil)
+(defvar edt-enter nil)
+(defvar edt-return nil)
+(defvar edt-key-seq nil)
+(defvar edt-enter-seq nil)
+(defvar edt-return-seq nil)
+
+
+;;;
+;;;  Make sure the window is big enough to display the instructions
+;;;
+(if edt-lucid-emacs19-p (set-screen-size nil 80 36)
+  (set-frame-size (selected-frame) 80 36))
+
+
+;;;
+;;;  Create buffers - Directions and Keys
+;;;
+(if (not (get-buffer "Directions")) (generate-new-buffer "Directions"))
+(if (not (get-buffer "Keys")) (generate-new-buffer "Keys"))
+
+;;;
+;;;  Put header in the Keys buffer
+;;;
+(set-buffer "Keys")
+(insert "\
+;;
+;;  Key definitions for the EDT emulation within GNU Emacs
+;;
+
+(defconst *EDT-keys*
+  '(
+")
+
+;;;
+;;;   Display directions
+;;;
+(switch-to-buffer "Directions")
+(insert "
+                                  EDT MAPPER
+
+    You will be asked to press keys to create a custom mapping (under
+    X-Windows) of your keypad keys and function keys so that they can emulate
+    the LK-201 keypad and function keys or the subset of keys found on a 
+    VT-100 series terminal keyboard.  (The LK-201 keyboard is the standard
+    keyboard attached to VT-200 series terminals, and above.)  
+
+    Sometimes, edt-mapper will ignore a key you press, and just continue to
+    prompt for the same key.  This can happen when your window manager sucks
+    up the key and doesn't pass it on to emacs, or it could be an emacs bug.
+    Either way, there's nothing that edt-mapper can do about it.  You must
+    press RETURN, to skip the current key and continue.  Later, you and/or
+    your local X guru can try to figure out why the key is being ignored.
+
+    Start by pressing the RETURN key, and continue by pressing the keys
+    specified in the mini-buffer.  If you want to entirely omit a key, 
+    because your keyboard does not have a corresponding key, for example, 
+    just press RETURN at the prompt.
+
+")
+(delete-other-windows)
+
+;;;
+;;;  Save <CR> for future reference
+;;;
+(cond
+ (edt-lucid-emacs19-p
+  (setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue "))
+  (setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]")))
+ (t
+  (message "Hit carriage-return <CR> to continue ")
+  (setq edt-return-seq (read-event))
+  (setq edt-return (concat "[" (format "%s" edt-return-seq) "]")))) 
+
+;;;
+;;;   Display Keypad Diagram and Begin Prompting for Keys
+;;;
+(set-buffer "Directions")
+(delete-region (point-min) (point-max))
+(insert "
+
+
+
+          PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW.
+
+
+
+
+    Here's a picture of the standard LK-201 keypad for reference:
+
+          _______________________    _______________________________
+         | HELP  |      DO       |  |  F17  |  F18  |  F19  |  F20  |
+         |       |               |  |       |       |       |       |
+         |_______|_______________|  |_______|_______|_______|_______|
+          _______________________    _______________________________
+         | FIND  |INSERT |REMOVE |  |  PF1  |  PF2  |  PF3  |  PF4  |
+         |       |       |       |  |       |       |       |       |
+         |_______|_______|_______|  |_______|_______|_______|_______|
+         |SELECT |PREVIOU| NEXT  |  |  KP7  |  KP8  |  KP9  |  KP-  |
+         |       |       |       |  |       |       |       |       |
+         |_______|_______|_______|  |_______|_______|_______|_______|
+                 |   UP  |          |  KP4  |  KP5  |  KP6  |  KP,  |
+                 |       |          |       |       |       |       |
+          _______|_______|_______   |_______|_______|_______|_______|
+         |  LEFT |  DOWN | RIGHT |  |  KP1  |  KP2  |  KP3  |       |
+         |       |       |       |  |       |       |       |       |
+         |_______|_______|_______|  |_______|_______|_______|  KPE  |
+                                    |      KP0      |  KPP  |       |
+                                    |               |       |       |
+                                    |_______________|_______|_______|
+
+")
+
+;;;
+;;;  Key mapping functions
+;;;
+(defun edt-lucid-map-key (ident descrip)
+  (interactive)
+  (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
+  (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]"))
+  (cond ((not (equal edt-key edt-return))
+	 (set-buffer "Keys")
+	 (insert (format "    (\"%s\" . %s)\n" ident edt-key))
+	 (set-buffer "Directions"))
+	;; bogosity to get next prompt to come up, if the user hits <CR>!
+	;; check periodically to see if this is still needed...
+	(t
+	 (format "%s" edt-key)))
+  edt-key)
+
+(defun edt-gnu-map-key (ident descrip)
+  (interactive)
+  (message "Press %s%s: " ident descrip)
+  (setq edt-key-seq (read-event))
+  (setq edt-key (concat "[" (format "%s" edt-key-seq) "]"))
+  (cond ((not (equal edt-key edt-return))
+	 (set-buffer "Keys")
+	 (insert (format "    (\"%s\" . %s)\n" ident edt-key))
+	 (set-buffer "Directions"))
+	;; bogosity to get next prompt to come up, if the user hits <CR>!
+	;; check periodically to see if this is still needed...
+	(t
+	 (set-buffer "Keys")
+	 (insert (format "    (\"%s\" . \"\" )\n" ident))
+	 (set-buffer "Directions")))
+  edt-key)
+
+(fset 'edt-map-key (if edt-lucid-emacs19-p 'edt-lucid-map-key 'edt-gnu-map-key))
+(set-buffer "Keys")
+(insert "
+;;
+;;  Arrows
+;;
+")
+(set-buffer "Directions")
+
+(edt-map-key "UP"     " - The Up Arrow Key")
+(edt-map-key "DOWN"   " - The Down Arrow Key")
+(edt-map-key "LEFT"   " - The Left Arrow Key")
+(edt-map-key "RIGHT"  " - The Right Arrow Key")
+
+
+(set-buffer "Keys")
+(insert "
+;;
+;;  PF keys
+;;
+")
+(set-buffer "Directions")
+
+(edt-map-key "PF1"  " - The PF1 (GOLD) Key")
+(edt-map-key "PF2"  " - The Keypad PF2 Key")
+(edt-map-key "PF3"  " - The Keypad PF3 Key")
+(edt-map-key "PF4"  " - The Keypad PF4 Key")
+
+(set-buffer "Keys")
+(insert "
+;;
+;;  KP0-9 KP- KP, KPP and KPE
+;;
+")
+(set-buffer "Directions")
+
+(edt-map-key "KP0"      " - The Keypad 0 Key")
+(edt-map-key "KP1"      " - The Keypad 1 Key")
+(edt-map-key "KP2"      " - The Keypad 2 Key")
+(edt-map-key "KP3"      " - The Keypad 3 Key")
+(edt-map-key "KP4"      " - The Keypad 4 Key")
+(edt-map-key "KP5"      " - The Keypad 5 Key")
+(edt-map-key "KP6"      " - The Keypad 6 Key")
+(edt-map-key "KP7"      " - The Keypad 7 Key")
+(edt-map-key "KP8"      " - The Keypad 8 Key")
+(edt-map-key "KP9"      " - The Keypad 9 Key")
+(edt-map-key "KP-"      " - The Keypad - Key")
+(edt-map-key "KP,"      " - The Keypad , Key")
+(edt-map-key "KPP"      " - The Keypad . Key")
+(edt-map-key "KPE"      " - The Keypad Enter Key")
+;; Save the enter key
+(setq edt-enter edt-key)
+(setq edt-enter-seq edt-key-seq)
+
+
+(set-buffer "Keys")
+(insert "
+;;
+;;  Editing keypad (FIND, INSERT, REMOVE)
+;;                 (SELECT, PREVIOUS, NEXT)
+;;
+")
+(set-buffer "Directions")
+
+(edt-map-key "FIND"      " - The Find key on the editing keypad")
+(edt-map-key "INSERT"    " - The Insert key on the editing keypad")
+(edt-map-key "REMOVE"    " - The Remove key on the editing keypad")
+(edt-map-key "SELECT"    " - The Select key on the editing keypad")
+(edt-map-key "PREVIOUS"  " - The Prev Scr key on the editing keypad")
+(edt-map-key "NEXT"      " - The Next Scr key on the editing keypad")
+
+(set-buffer "Keys")
+(insert "
+;;
+;;  F1-14 Help Do F17-F20
+;;
+")
+(set-buffer "Directions")
+
+(edt-map-key "F1"        " - F1 Function Key")
+(edt-map-key "F2"        " - F2 Function Key")
+(edt-map-key "F3"        " - F3 Function Key")
+(edt-map-key "F4"        " - F4 Function Key")
+(edt-map-key "F5"        " - F5 Function Key")
+(edt-map-key "F6"        " - F6 Function Key")
+(edt-map-key "F7"        " - F7 Function Key")
+(edt-map-key "F8"        " - F8 Function Key")
+(edt-map-key "F9"        " - F9 Function Key")
+(edt-map-key "F10"       " - F10 Function Key")
+(edt-map-key "F11"       " - F11 Function Key")
+(edt-map-key "F12"       " - F12 Function Key")
+(edt-map-key "F13"       " - F13 Function Key")
+(edt-map-key "F14"       " - F14 Function Key")
+(edt-map-key "HELP"      " - HELP Function Key")
+(edt-map-key "DO"        " - DO Function Key")
+(edt-map-key "F17"       " - F17 Function Key")
+(edt-map-key "F18"       " - F18 Function Key")
+(edt-map-key "F19"       " - F19 Function Key")
+(edt-map-key "F20"       " - F20 Function Key")
+
+(set-buffer "Directions")
+(delete-region (point-min) (point-max))
+(insert "
+		       ADDITIONAL FUNCTION KEYS
+
+    Your keyboard may have additional function keys which do not
+    correspond to any LK-201 keys.  The EDT Emulation can be
+    configured to recognize those keys, since you may wish to add your
+    own key bindings to those keys.
+    
+    For example, suppose your keyboard has a keycap marked \"Line Del\"
+    and you wish to add it to the list of keys which can be customized
+    by the EDT Emulation.  First, assign a unique single-word name to
+    the key for use by the EDT Emulation, let's say \"linedel\", in this
+    example.  Then, at the \"EDT Key Name:\" prompt, enter \"linedel\",
+    followed by a press of the RETURN key.  Finally, when prompted,
+    press the \"Line Del\" key.  You now will be able to bind functions
+    to \"linedel\" and \"Gold-linedel\" in edt-user.el in just the same way
+    you can customize bindings of the standard LK-201 keys.
+
+    When you have no additional function keys to specify, just press
+    RETURN at the \"EDT Key Name:\" prompt.  (If you change your mind
+    AFTER you enter an EDT Key Name and before you press a key at the
+    \"Press\" prompt, you may omit the key by simply pressing RETURN at
+    the prompt.)
+")
+(switch-to-buffer "Directions")
+;;;
+;;;  Add support for extras keys
+;;;
+(set-buffer "Keys")
+(insert "\
+;;
+;;  Extra Keys 
+;;
+")
+(setq EDT-key-name "")
+(while (not 
+	(string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) ""))
+  (edt-map-key EDT-key-name ""))
+
+;
+; No more keys to add, so wrap up.
+;
+(set-buffer "Keys")
+(insert "\
+    )
+  )
+")
+
+;;;
+;;;  Save the key mapping program and blow this pop stand
+;;;
+(let ((file (if edt-lucid-emacs19-p "~/.edt-lucid-keys" "~/.edt-gnu-keys")))
+  (set-visited-file-name
+   (read-file-name (format "Save key mapping to file (default %s): " file) nil file)))
+(save-buffer)
+
+(message "That's it!  Press any key to exit")
+(sit-for 600)
+(kill-emacs t)
+
+;;; edt-mapper.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/emulators/edt-pc.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,87 @@
+;;; edt-pc.el --- Enhanced EDT Keypad Mode Emulation for PC 101 Keyboards
+
+;; Copyright (C) 1986, 1994, 1995 Free Software Foundation, Inc.
+
+;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Keywords: emulations
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
+
+;;; Usage:
+
+;;  See edt-user.doc in the Emacs etc directory.
+
+;; ====================================================================
+
+;;;;
+;;;; KEY TRANSLATIONS
+;;;;
+
+;; Associate EDT keynames with Emacs terminal function vector names.
+;;
+;; To emulate the DEC LK-201 keypad keys on the PC 101 keyboard,
+;; NumLock must be ON.
+;;
+;; The PC keypad keys are mapped to the corresponding DEC LK-201
+;; keypad keys according to the corresponding physical position on
+;; the keyboard.  Thus, the physical position of the PC keypad key
+;; determines its function, not the PC keycap name.
+;;
+;; There are two LK-201 keypad keys needing special handling: PF1 and
+;; the keypad comma key.
+;;
+;; PF1:
+;;  Most PC software does not see a press of the NumLock key.  A TSR
+;;  program distributed with MS-Kermit to support its VT-100 emulation
+;;  solves this problem.  The TSR, called GOLD, causes a press of the
+;;  keypad NumLock key to look as if the PC F1 key were pressed.  So
+;;  the PC F1 key is mapped here to behave as the PF1 (GOLD) key.
+;;  Then with GOLD loaded, the NumLock key will behave as the GOLD key.
+;;
+;;  By the way, with GOLD loaded, you can still toggle numlock on/off.
+;;  GOLD binds this to Shift-NumLock.
+;;
+;; Keypad Comma:
+;;  There is no physical PC keypad key to correspond to the LK-201
+;;  keypad comma key.  So, the EDT Emulation is configured below to
+;;  ignore attempts to bind functions to the keypad comma key.
+;;
+;; Finally, F2 through F12 are also available for making key bindings
+;; in the EDT Emulation on the PC.  F1 is reserved for the GOLD key,
+;; so don't attempt to bind anything to it.  Also, F13, F14, HELP, DO,
+;; and F17 through F20 do not exist on the PC, so the EDT emulation is
+;; configured below to ignore attempts to bind functions to those keys.
+;;
+(defconst *EDT-keys*
+  '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3]) 
+    ("KP4" . [kp-4]) ("KP5" . [kp-5]) ("KP6" . [kp-6]) ("KP7" . [kp-7])
+    ("KP8" . [kp-8]) ("KP9" . [kp-9]) ("KP," . "" )
+    ("KP-" . [kp-add]) ("KPP" . [kp-decimal]) ("KPE" . [kp-enter])
+    ("PF1" . [f1]) ("PF2" . [kp-divide]) ("PF3" . [kp-multiply])
+    ("PF4" . [kp-subtract])
+    ("UP" . [up]) ("DOWN" . [down]) ("RIGHT" . [right]) ("LEFT" . [left])
+    ("FIND" . [insert]) ("INSERT" . [home]) ("REMOVE" . [prior])
+    ("SELECT" . [delete]) ("PREVIOUS" . [end]) ("NEXT" . [next])
+    ("F1" . "" ) ("F2" . [f2]) ("F3" . [f3]) ("F4" . [f4]) ("F5" . [f5])
+    ("F6" . [f6]) ("F7" . [f7]) ("F8" . [f8]) ("F9" . [f9]) ("F10" . [f10])
+    ("F11" . [f11]) ("F12" . [f12]) ("F13" . "" ) ("F14" . "" )
+    ("HELP" . "" ) ("DO" . "" ) ("F17" . "" ) ("F18" . "" )
+    ("F19" . "" ) ("F20" . "" )))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/emulators/edt-vt100.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,46 @@
+;;; edt-vt100.el --- Enhanced EDT Keypad Mode Emulation for VT Series Terminals
+
+;; Copyright (C) 1986, 1992, 1993, 1995 Free Software Foundation, Inc.
+
+;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Keywords: emulations
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
+
+;;; Usage:
+
+;;  See edt-user.doc in the Emacs etc directory.
+
+;; ====================================================================
+
+;; Get keyboard function key mapping to EDT keys.
+(load "edt-lk201" nil t)
+
+;; The following functions are called by the EDT screen width commands defined
+;; in edt.el.
+
+(defun edt-set-term-width-80 ()
+  "Set terminal width to 80 columns."
+  (vt100-wide-mode -1))
+
+(defun edt-set-term-width-132 ()
+  "Set terminal width to 132 columns."
+  (vt100-wide-mode 1))
--- a/lisp/emulators/edt.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/edt.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,9 +1,10 @@
-;;; edt.el --- EDT emulation in Emacs
-;; Keywords: emulations
+;;; edt.el --- Enhanced EDT Keypad Mode Emulation for GNU Emacs 19
+
+;; Copyright (C) 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 
-;; Copyright (C) 1986 Free Software Foundation, Inc.
-;;  It started from public domain code by Mike Clarkson
-;;  but has been greatly altered.
+;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
+;; Keywords: emulations
 
 ;; This file is part of XEmacs.
 
@@ -19,491 +20,2003 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
+
+;;; Usage:
+
+;;  See edt-user.doc in the Emacs etc directory.
+
+;; Maintainer's note:  There was a very old edt.el here that wouldn't even
+;; load, so I replaced it completely with the newer one from 19.34. -sb
+;; ====================================================================
+
+;;;  Electric Help functions are used for keypad help displays.  A few
+;;;  picture functions are used in rectangular cut and paste commands.
+(require 'ehelp)
+(require 'picture)
+
+;;;;
+;;;; VARIABLES and CONSTANTS
+;;;;
+
+(defvar edt-last-deleted-lines ""
+  "Last text deleted by an EDT emulation line delete command.")
+
+(defvar edt-last-deleted-words ""
+  "Last text deleted by an EDT emulation word delete command.")
+
+(defvar edt-last-deleted-chars ""
+  "Last text deleted by an EDT emulation character delete command.")
+
+(defvar edt-last-replaced-key-definition ""
+  "Key definition replaced with edt-define-key or edt-learn command.")
+
+(defvar edt-direction-string ""
+  "String indicating current direction of movement.")
+
+(defvar edt-select-mode nil
+  "Non-nil means select mode is active.")
+
+(defvar edt-select-mode-text ""
+  "Text displayed in mode line when select mode is active.")
+
+(defconst edt-select-mode-string " Select"
+  "String to indicate select mode is active.")
+
+(defconst edt-forward-string " ADVANCE"
+  "Direction string in mode line to indicate forward movement.")
+
+(defconst edt-backward-string "  BACKUP"
+  "Direction string in mode line to indicate backward movement.")
+
+(defvar edt-default-map-active nil
+  "Non-nil indicates that default EDT emulation key bindings are active.
+Nil means user-defined custom bindings are active.")
+
+(defvar edt-user-map-configured nil
+  "Non-nil indicates that user custom EDT key bindings are configured.
+This means that an edt-user.el file was found in the user's load-path.")
+
+(defvar edt-keep-current-page-delimiter nil
+  "Non-nil leaves current value of page-delimiter unchanged.
+Nil causes the page-delimiter variable to be set to to \"\\f\"
+when edt-emulation-on is first invoked.  Original value is restored
+when edt-emulation-off is called.")
+
+(defvar edt-use-EDT-control-key-bindings nil
+  "Non-nil causes the control key bindings to be replaced with EDT bindings.
+Nil (the default) means EDT control key bindings are not used and the current
+control key bindings are retained for use in the EDT emulation.")
+
+(defvar edt-word-entities '(?\t)
+  "*Specifies the list of EDT word entity characters.")
+
+;;;
+;;;  Emacs version identifiers - currently referenced by
+;;;
+;;;     o edt-emulation-on      o edt-load-xkeys
+;;;
+(defconst edt-emacs19-p (not (string-lessp emacs-version "19"))
+  "Non-nil if we are running Lucid or GNU Emacs version 19.")
+
+(defconst edt-lucid-emacs19-p
+  (and edt-emacs19-p (string-match "Lucid" emacs-version))
+  "Non-nil if we are running Lucid Emacs version 19.")
+
+(defconst edt-gnu-emacs19-p (and edt-emacs19-p (not edt-lucid-emacs19-p))
+  "Non-nil if we are running GNU Emacs version 19.")
+
+(defvar edt-xkeys-file nil
+  "File mapping X function keys to LK-201 keyboard function and keypad keys.")
+
+;;;;
+;;;; EDT Emulation Commands
+;;;;
+
+;;; Almost all of EDT's keypad mode commands have equivalent
+;;; counterparts in Emacs.  Some behave the same way in Emacs as they
+;;; do in EDT, but most do not.
+;;;
+;;; The following Emacs functions emulate, where practical, the exact
+;;; behavior of the corresponding EDT keypad mode commands.  In a few
+;;; cases, the emulation is not exact, but it is close enough for most
+;;; EDT die-hards.
+;;;
+;;; In a very few cases, we chose to use the superior Emacs way of
+;;; handling things.  For example, we do not emulate the EDT SUBS
+;;; command.  Instead, we chose to use the superior Emacs
+;;; query-replace function.
+;;;
+
+;;;
+;;; PAGE
+;;;
+;;; Emacs uses the regexp assigned to page-delimiter to determine what
+;;; marks a page break.  This is normally "^\f", which causes the
+;;; edt-page command to ignore form feeds not located at the beginning
+;;; of a line.  To emulate the EDT PAGE command exactly,
+;;; page-delimiter is set to "\f" when EDT emulation is turned on, and
+;;; restored to its original value when EDT emulation is turned off.
+;;; But this can be overridden if the EDT definition is not desired by
+;;; placing
+;;;
+;;;         (setq edt-keep-current-page-delimiter t)
+;;;
+;;; in your .emacs file.
+
+(defun edt-page-forward (num)
+  "Move forward to just after next page delimiter.
+Accepts a positive prefix argument for the number of page delimiters to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (if (eobp)
+      (error "End of buffer")
+      (progn
+        (forward-page num)
+	(if (eobp)
+	    (edt-line-to-bottom-of-window)
+	    (edt-line-to-top-of-window)))))
+
+(defun edt-page-backward (num)
+  "Move backward to just after previous page delimiter.
+Accepts a positive prefix argument for the number of page delimiters to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (if (bobp)
+      (error "Beginning of buffer")
+      (progn
+        (backward-page num)
+        (edt-line-to-top-of-window))))
+
+(defun edt-page (num)
+  "Move in current direction to next page delimiter.
+Accepts a positive prefix argument for the number of page delimiters to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-page-forward num)
+      (edt-page-backward num)))
+
+;;;
+;;; SECT
+;;;
+;;; EDT defaults a section size to be 16 lines of its one and only
+;;; 24-line window.  That's two-thirds of the window at a time.  The
+;;; EDT SECT commands moves the cursor, not the window.  
+;;; 
+;;; This emulation of EDT's SECT moves the cursor approximately two-thirds
+;;; of the current window at a time.
+
+(defun edt-sect-forward (num)
+  "Move cursor forward two-thirds of a window.
+Accepts a positive prefix argument for the number of sections to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (edt-line-forward (* (* (/ (- (window-height) 1) 3) 2) num)))
+
+(defun edt-sect-backward (num)
+  "Move cursor backward two-thirds of a window.
+Accepts a positive prefix argument for the number of sections to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (edt-line-backward (* (* (/ (- (window-height) 1) 3) 2) num)))
+
+(defun edt-sect (num)
+  "Move in current direction a full window.
+Accepts a positive prefix argument for the number windows to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-sect-forward num)
+      (edt-sect-backward num)))
+
+;;;
+;;; BEGINNING OF LINE
+;;;
+;;; EDT's beginning-of-line command is not affected by current
+;;; direction, for some unknown reason.
+
+(defun edt-beginning-of-line (num)
+  "Move backward to next beginning of line mark.
+Accepts a positive prefix argument for the number of BOL marks to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (if (bolp)
+      (forward-line (* -1 num))
+      (progn
+        (setq num (1- num))
+        (forward-line (* -1 num)))))
+
+;;;
+;;; EOL (End of Line)
+;;;
+
+(defun edt-end-of-line-forward (num)
+  "Move forward to next end of line mark.
+Accepts a positive prefix argument for the number of EOL marks to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (forward-char)
+  (end-of-line num))
+
+(defun edt-end-of-line-backward (num)
+  "Move backward to next end of line mark.
+Accepts a positive prefix argument for the number of EOL marks to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (end-of-line (1- num)))
+
+(defun edt-end-of-line (num)
+  "Move in current direction to next end of line mark.
+Accepts a positive prefix argument for the number of EOL marks to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-end-of-line-forward num)
+      (edt-end-of-line-backward num)))
+
+;;;
+;;; WORD
+;;;
+;;; This one is a tad messy.  To emulate EDT's behavior everywhere in
+;;; the file (beginning of file, end of file, beginning of line, end
+;;; of line, etc.) it takes a bit of special handling.  
+;;; 
+;;; The variable edt-word-entities contains a list of characters which
+;;; are to be viewed as distinct words where ever they appear in the
+;;; buffer.  This emulates the EDT line mode command SET ENTITY WORD. 
 
 
-;; From mike@yetti.UUCP Fri Aug 29 12:49:28 1986
-;; Path: mit-prep!mit-hermes!mit-eddie!genrad!panda!husc6!seismo!mnetor!yetti!mike
-;; From: mike@yetti.UUCP (Mike Clarkson )
-;; Newsgroups: net.sources
-;; Subject: Gnu Emacs EDT Emulation - Introduction - 1/3
-;; Date: 27 Aug 86 23:30:33 GMT
-;; Reply-To: mike@yetti.UUCP (Mike Clarkson )
-;; Organization: York University Computer Science
-;; 
-;; Here's my EDT emulation for GNU Emacs that is based on the EDT emulation
-;; for Gosling's Emacs sent out on the net a couple of years ago by Lynn Olson
-;; at Tektronics.  This emulation was widely distributed as the file edt.ml
-;; in the maclib directory of most Emacs distributions.
-;;      
-;; My emulation consists of two files: edt.el and edtdoc.el.  The edtdoc.el file
-;; is the documentation, that you can add to the beginning of edt.el if you
-;; want.  I have split them because I have been loading the edt.el file a lot
-;; during debugging.
-;;      
-;; I will gladly take all criticisms and complaints to heart, and will fix
-;; what bugs I can find.   As this is my first elisp hack, you may have to
-;; root out a few nasties hidden in the code.  Please let me know if you
-;; find any (sorry,
-;; no rewards :-).  I would also be interested if there are better,
-;; cleaner, faster ways of doing some of the things that I have done.
-;;      
-;; You must understand some design considerations that I had in mind.
-;; The intention was not really to "emulate" EDT, but rather to take advantage
-;; of the years of EDT experience that had accumulated in my right hand,
-;; while at the same time taking advantage of EMACS.
-;;      
-;; Some major differences are:
-;;      
-;; HELP            is describe-key;
-;; GOLD/HELP       is describe-function;
-;; FIND            is isearch-forward/backward;
-;; GOLD/HELP       is occur-menu, which finds all occurrences of a search string;
-;; ENTER           is other-window;
-;; SUBS            is subprocess-command.  Note that you will have to change this
-;;                 yourself to shell if you are running Un*x;
-;; PAGE            is next-paragraph, because that's more useful than page.
-;; SPECINS         is copy-to-killring;
-;; GOLD/GOLD       is mark-section-wisely, which is my command to mark the
-;;                 section in a manner consistent with the major-mode.  It
-;;                 uses mark-defun for emacs-lisp, lisp, mark-c-function for C,
-;;                 and mark-paragraph for other modes.
-;;      
-;;      
-;; Some subtle differences are:
-;;      
-;; APPEND          is append-to-buffer.  One doesn't append to the kill ring much
-;;                 and SPECINS is now copy-to-killring;
-;; REPLACE         is replace-regexp;
-;; FILL            is fill-region-wisely, which uses indent-region for C, lisp
-;;                 emacs-lisp, and fill-region for others. It asks if you really
-;;                 want to fill-region in TeX-mode, because I find this to be
-;;                 very dangerous.
-;; CHNGCASE        is case-flip for the character under the cursor only.
-;;                 I felt that case-flip region is unlikely, as usually you
-;;                 upcase-region or downcase region.  Also, unlike EDT it
-;;                 is independent of the direction you are going, as that
-;;                 drives me nuts.
-;;      
-;; I use Emacs definition of what a word is.  This is considerably different from
-;; what EDT thinks a word is.  This is not good for dyed-in-the-wool EDT fans,
-;; but is probably preferable for experienced Emacs users.  My assumption is that
-;; the former are a dying breed now that GNU Emacs has made it to VMS, but let me
-;; know how you feel.  Also, when you undelete a word it leave the point at the
-;; end of the undeleted text, rather than the beginning.  I might change this
-;; as I'm not sure if I like this or not. I'm also not sure if I want it to
-;; set the mark each time you delete a character or word.
-;;      
-;; Backspace does not invoke beginning-of-line, because ^H is the help prefix,
-;; and I felt it should be left as such.  You can change this if you like.
-;;      
-;; The ADVANCE and BACKUP keys do not work as terminators for forward or
-;; backward searches. In Emacs, all search strings are terminated by return.
-;; The searches will however go forward or backward depending on your current
-;; direction.  Also, when you change directions, the mode line will not be
-;; updated immediately, but only when you next execute an emacs function.
-;; Personally, I consider this to be a bug, not a feature.
-;;      
-;; This should also work with VT-2xx's, though I haven't tested it extensively
-;; on those terminals.  It assumes that the CSI-map of vt_200.el has been defined.
-;;      
-;; There are also a whole bunch of GOLD letter, and GOLD character bindings:
-;; look at edtdoc.el for them, or better still, look at the edt.el lisp code,
-;; because after all, in the true Lisp tradition, the source code is *assumed*
-;; to be self-documenting :-)
-;;      
-;; Mike Clarkson,            ...!allegra \             BITNET:  mike@YUYETTI or
-;; CRESS, York University,   ...!decvax   \                 SYMALG@YUSOL
-;; 4700 Keele Street,        ...!ihnp4     > !utzoo!yetti!mike
-;; North York, Ontario,      ...!linus    /
-;; CANADA M3J 1P3.           ...!watmath /      Phone: +1 (416) 736-2100 x 7767
-;;      
-;; Note that I am not on ARPA, and must gateway any ARPA mail through BITNET or
-;; UUCP.  If you have a UUCP or BITNET address please use it for communication
-;; so that I can reach you directly.  If you have both, the BITNET address
-;; is preferred.
-;; -- 
-;; Mike Clarkson,		  ...!allegra \		BITNET:	mike@YUYETTI or
-;; CRESS, York University,	  ...!decvax   \		SYMALG@YUSOL
-;; 4700 Keele Street,	  ...!ihnp4     > !utzoo!yetti!mike
-;; North York, Ontario,	  ...!linus    /		     
-;; CANADA M3J 1P3.		  ...!watmath /	Phone: +1 (416) 737-2100 x 7767
+(defun edt-one-word-forward ()
+  "Move forward to first character of next word."
+  (interactive)
+  (if (eobp)
+      (error "End of buffer"))
+  (if (eolp)
+      (forward-char)
+      (progn
+        (if (memq (following-char) edt-word-entities)
+            (forward-char)
+            (while (and 
+                     (not (eolp))
+                     (not (eobp))
+                     (not (eq ?\  (char-syntax (following-char))))
+                     (not (memq (following-char) edt-word-entities)))
+              (forward-char)))
+        (while (and 
+                 (not (eolp))
+                 (not (eobp))
+                 (eq ?\  (char-syntax (following-char)))
+                 (not (memq (following-char) edt-word-entities)))
+          (forward-char)))))
+
+(defun edt-one-word-backward ()
+  "Move backward to first character of previous word."
+  (interactive)
+  (if (bobp)
+      (error "Beginning of buffer"))
+  (if (bolp)
+      (backward-char)
+      (progn
+        (backward-char)
+        (while (and 
+                 (not (bolp))
+                 (not (bobp))
+                 (eq ?\  (char-syntax (following-char)))
+                 (not (memq (following-char) edt-word-entities)))
+          (backward-char))
+        (if (not (memq (following-char) edt-word-entities))
+            (while (and 
+                     (not (bolp))
+                     (not (bobp))
+                     (not (eq ?\  (char-syntax (preceding-char))))
+                     (not (memq (preceding-char) edt-word-entities)))
+              (backward-char))))))
+
+(defun edt-word-forward (num)
+  "Move forward to first character of next word.
+Accepts a positive prefix argument for the number of words to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (while (> num 0)
+    (edt-one-word-forward)
+    (setq num (1- num))))
+
+(defun edt-word-backward (num)
+  "Move backward to first character of previous word.
+Accepts a positive prefix argument for the number of words to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (while (> num 0)
+    (edt-one-word-backward)
+    (setq num (1- num))))
+
+(defun edt-word (num)
+  "Move in current direction to first character of next word.
+Accepts a positive prefix argument for the number of words to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-word-forward num)
+      (edt-word-backward num)))
+
+;;;
+;;; CHAR
+;;;
+
+(defun edt-character (num)
+  "Move in current direction to next character.
+Accepts a positive prefix argument for the number of characters to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (if (equal edt-direction-string edt-forward-string)
+      (forward-char num)
+      (backward-char num)))
+
+;;;
+;;; LINE
+;;;
+;;; When direction is set to BACKUP, LINE behaves just like BEGINNING
+;;; OF LINE in EDT.  So edt-line-backward is not really needed as a
+;;; separate function.
+
+(defun edt-line-backward (num)
+  "Move backward to next beginning of line mark.
+Accepts a positive prefix argument for the number of BOL marks to move."
+  (interactive "p")
+  (edt-beginning-of-line num))
+
+(defun edt-line-forward (num)
+  "Move forward to next beginning of line mark.
+Accepts a positive prefix argument for the number of BOL marks to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (forward-line num))
 
+(defun edt-line (num)
+  "Move in current direction to next beginning of line mark.
+Accepts a positive prefix argument for the number of BOL marks to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-line-forward num)
+      (edt-line-backward num)))
 
-(require 'keypad)
+;;;
+;;; TOP
+;;;
+
+(defun edt-top ()
+  "Move cursor to the beginning of buffer."
+  (interactive)
+  (goto-char (point-min)))
+
+;;;
+;;; BOTTOM
+;;;
+
+(defun edt-bottom ()
+  "Move cursor to the end of buffer."
+  (interactive)
+  (goto-char (point-max))
+  (edt-line-to-bottom-of-window))
+
+;;;
+;;; FIND
+;;;
+
+(defun edt-find-forward (&optional find)
+  "Find first occurrence of a string in forward direction and save it."
+  (interactive)
+  (if (not find)
+      (set 'search-last-string (read-string "Search forward: ")))
+  (if (search-forward search-last-string)
+      (search-backward search-last-string)))
+
+(defun edt-find-backward (&optional find)
+  "Find first occurrence of a string in the backward direction and save it."
+  (interactive)
+  (if (not find)
+      (set 'search-last-string (read-string "Search backward: ")))
+  (search-backward search-last-string))
 
-(defvar edt-last-deleted-lines ""
-  "Last text deleted by an EDT emulation line-delete command.")
-(defvar edt-last-deleted-words ""
-  "Last text deleted by an EDT emulation word-delete command.")
-(defvar edt-last-deleted-chars ""
-  "Last text deleted by an EDT emulation character-delete command.")
+(defun edt-find ()
+  "Find first occurrence of string in current direction and save it."
+  (interactive)
+  (set 'search-last-string (read-string "Search: "))
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-find-forward t)
+      (edt-find-backward t)))
+  
+
+;;;
+;;; FNDNXT
+;;;
+
+(defun edt-find-next-forward ()
+  "Find next occurrence of a string in forward direction."
+  (interactive)
+  (forward-char 1)
+  (if (search-forward search-last-string nil t)
+      (search-backward search-last-string)
+      (progn
+        (backward-char 1)
+        (error "Search failed: \"%s\"." search-last-string))))
 
-(defun delete-current-line (num)
-  "Delete one or specified number of lines after point.
-This includes the newline character at the end of each line.
-They are saved for the EDT undelete-lines command."
-  (interactive "p")
+(defun edt-find-next-backward ()
+  "Find next occurrence of a string in backward direction."
+  (interactive)
+  (if (eq (search-backward search-last-string nil t) nil)
+      (progn
+        (error "Search failed: \"%s\"." search-last-string))))
+
+(defun edt-find-next ()
+  "Find next occurrence of a string in current direction."
+  (interactive)
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-find-next-forward)
+      (edt-find-next-backward)))
+  
+;;;
+;;; APPEND
+;;;
+
+(defun edt-append ()
+  "Append this kill region to last killed region."
+  (interactive "*")
+  (edt-check-selection)
+  (append-next-kill)
+  (kill-region (mark) (point))
+  (message "Selected text APPENDED to kill ring"))
+
+;;;
+;;; DEL L
+;;;
+
+(defun edt-delete-line (num)
+  "Delete from cursor up to and including the end of line mark.
+Accepts a positive prefix argument for the number of lines to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
   (let ((beg (point)))
     (forward-line num)
     (if (not (eq (preceding-char) ?\n))
-	(insert "\n"))
+        (insert "\n"))
     (setq edt-last-deleted-lines
-	  (buffer-substring beg (point)))
+          (buffer-substring beg (point)))
     (delete-region beg (point))))
 
-(defun delete-to-eol (num)
-  "Delete text up to end of line.
-With argument, delete up to to Nth line-end past point.
-They are saved for the EDT undelete-lines command."
-  (interactive "p")
+;;;
+;;; DEL EOL
+;;;
+
+(defun edt-delete-to-end-of-line (num)
+  "Delete from cursor up to but excluding the end of line mark.
+Accepts a positive prefix argument for the number of lines to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
   (let ((beg (point)))
     (forward-char 1)
     (end-of-line num)
     (setq edt-last-deleted-lines
-	  (buffer-substring beg (point)))
-    (delete-region beg (point))))
-
-(defun delete-current-word (num)
-  "Delete one or specified number of words after point.
-They are saved for the EDT undelete-words command."
-  (interactive "p")
-  (let ((beg (point)))
-    (forward-word num)
-    (setq edt-last-deleted-words
-	  (buffer-substring beg (point)))
+          (buffer-substring beg (point)))
     (delete-region beg (point))))
 
-(defun edt-delete-previous-word (num)
-  "Delete one or specified number of words before point.
-They are saved for the EDT undelete-words command."
-  (interactive "p")
+;;;
+;;; SELECT
+;;;
+
+(defun edt-select-mode (arg)
+  "Turn EDT select mode off if ARG is nil; otherwise, turn EDT select mode on.
+In select mode, selected text is highlighted."
+  (if arg
+      (progn
+	(make-local-variable 'edt-select-mode)
+	(setq edt-select-mode 'edt-select-mode-text)
+	(setq rect-start-point (window-point)))
+    (progn
+      (kill-local-variable 'edt-select-mode)))
+  (force-mode-line-update))
+
+(defun edt-select ()
+  "Set mark at cursor and start text selection."
+  (interactive)   
+  (set-mark-command nil)) 
+
+(defun edt-reset ()
+  "Cancel text selection."
+  (interactive)
+  (deactivate-mark))
+
+;;;
+;;; CUT
+;;;
+
+(defun edt-cut ()
+  "Deletes selected text but copies to kill ring."
+  (interactive "*")
+  (edt-check-selection)
+  (kill-region (mark) (point))
+  (message "Selected text CUT to kill ring"))
+
+;;;
+;;; DELETE TO BEGINNING OF LINE
+;;;
+
+(defun edt-delete-to-beginning-of-line (num)
+  "Delete from cursor to beginning of line.
+Accepts a positive prefix argument for the number of lines to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
   (let ((beg (point)))
-    (forward-word (- num))
-    (setq edt-last-deleted-words
-	  (buffer-substring (point) beg))
+    (edt-beginning-of-line num)
+    (setq edt-last-deleted-lines
+          (buffer-substring (point) beg))
     (delete-region beg (point))))
 
-(defun delete-current-char (num)
-  "Delete one or specified number of characters after point.
-They are saved for the EDT undelete-chars command."
-  (interactive "p")
+;;;
+;;; DEL W
+;;;
+
+(defun edt-delete-word (num)
+  "Delete from cursor up to but excluding first character of next word.
+Accepts a positive prefix argument for the number of words to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
+  (let ((beg (point)))
+    (edt-word-forward num)
+    (setq edt-last-deleted-words (buffer-substring beg (point)))
+    (delete-region beg (point))))
+
+;;;
+;;; DELETE TO BEGINNING OF WORD
+;;;
+
+(defun edt-delete-to-beginning-of-word (num)
+  "Delete from cursor to beginning of word.
+Accepts a positive prefix argument for the number of words to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
+  (let ((beg (point)))
+    (edt-word-backward num)
+    (setq edt-last-deleted-words (buffer-substring (point) beg))
+    (delete-region beg (point))))
+
+;;;
+;;; DEL C
+;;;
+
+(defun edt-delete-character (num)
+  "Delete character under cursor.
+Accepts a positive prefix argument for the number of characters to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
   (setq edt-last-deleted-chars
-	(buffer-substring (point) (min (point-max) (+ (point) num))))
+        (buffer-substring (point) (min (point-max) (+ (point) num))))
   (delete-region (point) (min (point-max) (+ (point) num))))
 
-(defun delete-previous-char (num)
-  "Delete one or specified number of characters before point.
-They are saved for the EDT undelete-chars command."
-  (interactive "p")
+;;;
+;;; DELETE CHAR
+;;;
+
+(defun edt-delete-previous-character (num)
+  "Delete character in front of cursor.
+Accepts a positive prefix argument for the number of characters to delete."
+  (interactive "*p")
+  (edt-check-prefix num)
   (setq edt-last-deleted-chars
-	(buffer-substring (max (point-min) (- (point) num)) (point)))
+        (buffer-substring (max (point-min) (- (point) num)) (point)))
   (delete-region (max (point-min) (- (point) num)) (point)))
 
-(defun undelete-lines ()
-  "Yank lines deleted by last EDT line-deletion command."
-  (interactive)
-  (insert edt-last-deleted-lines))
+;;;
+;;; UND L
+;;;
+
+(defun edt-undelete-line ()
+  "Undelete previous deleted line(s)."
+  (interactive "*")
+  (point-to-register 1)
+  (insert edt-last-deleted-lines)
+  (register-to-point 1))
+
+;;;
+;;; UND W
+;;;
+
+(defun edt-undelete-word ()
+  "Undelete previous deleted word(s)."
+  (interactive "*")
+  (point-to-register 1)
+  (insert edt-last-deleted-words)
+  (register-to-point 1))
+
+;;;
+;;; UND C
+;;;
+
+(defun edt-undelete-character ()
+  "Undelete previous deleted character(s)."
+  (interactive "*")
+  (point-to-register 1)
+  (insert edt-last-deleted-chars)
+  (register-to-point 1))
+
+;;;
+;;; REPLACE
+;;;
 
-(defun undelete-words ()
-  "Yank words deleted by last EDT word-deletion command."
-  (interactive)
-  (insert edt-last-deleted-words))
+(defun edt-replace ()
+  "Replace marked section with last CUT (killed) text."
+  (interactive "*")
+  (exchange-point-and-mark)
+  (let ((beg (point)))
+    (exchange-point-and-mark)
+    (delete-region beg (point)))
+  (yank))
+
+;;;
+;;; ADVANCE
+;;;
 
-(defun undelete-chars ()
-  "Yank characters deleted by last EDT character-deletion command."
+(defun edt-advance ()
+  "Set movement direction forward.
+Also, execute command specified if in Minibuffer."
   (interactive)
-  (insert edt-last-deleted-chars))
+  (setq edt-direction-string edt-forward-string)
+  (force-mode-line-update)
+  (if (string-equal " *Minibuf" 
+                    (substring (buffer-name) 0 (min (length (buffer-name)) 9)))
+      (exit-minibuffer)))
+  
+;;;
+;;; BACKUP
+;;;
+
+(defun edt-backup ()
+  "Set movement direction backward.
+Also, execute command specified if in Minibuffer."
+  (interactive)
+  (setq edt-direction-string edt-backward-string)
+  (force-mode-line-update)
+  (if (string-equal " *Minibuf" 
+                    (substring (buffer-name) 0 (min (length (buffer-name)) 9)))
+      (exit-minibuffer)))
+
+;;;
+;;; CHNGCASE
+;;;
+;; This function is based upon Jeff Kowalski's case-flip function in his 
+;; tpu.el.
 
-(defun next-end-of-line (num)
-  "Move to end of line; if at end, move to end of next line.
-Accepts a prefix argument for the number of lines to move."
-  (interactive "p")
-  (forward-char)
-  (end-of-line num))
+(defun edt-change-case (num)
+  "Change the case of specified characters.
+If text selection IS active, then characters between the cursor and mark are
+changed.  If text selection is NOT active, there are two cases.  First, if the
+current direction is ADVANCE, then the prefix number of character(s) under and
+following cursor are changed.  Second, if the current direction is BACKUP, then
+the prefix number of character(s) before the cursor are changed.  Accepts a
+positive prefix for the number of characters to change, but the prefix is
+ignored if text selection is active."
+  (interactive "*p")
+  (edt-check-prefix num)
+  (if edt-select-mode
+      (let ((end (max (mark) (point)))
+            (point-save (point)))
+        (goto-char (min (point) (mark)))
+        (while (not (eq (point) end))
+          (funcall (if (<= ?a (following-char))
+                       'upcase-region 'downcase-region)
+                   (point) (1+ (point)))
+          (forward-char 1))
+        (goto-char point-save))
+      (progn
+        (if (string= edt-direction-string edt-backward-string)
+            (backward-char num))
+        (while (> num 0)
+          (funcall (if (<= ?a (following-char))
+                       'upcase-region 'downcase-region)
+                   (point) (1+ (point)))
+          (forward-char 1)
+          (setq num (1- num))))))
+
+;;;
+;;; DEFINE KEY
+;;;
+
+(defun edt-define-key ()
+  "Assign an interactively-callable function to a specified key sequence.
+The current key definition is saved in edt-last-replaced-key-definition.
+Use edt-restore-key to restore last replaced key definition."
+  (interactive)
+  (let (edt-function
+    edt-key-definition-string)
+    (setq edt-key-definition-string
+         (read-key-sequence "Press the key to be defined: "))
+    (if (string-equal "\C-m" edt-key-definition-string) 
+        (message "Key not defined") 
+        (progn
+          (setq edt-function (read-command "Enter command name: "))
+          (if (string-equal "" edt-function)
+              (message "Key not defined") 
+              (progn
+                (setq edt-last-replaced-key-definition
+                   (lookup-key (current-global-map) edt-key-definition-string))
+                (define-key (current-global-map) 
+                    edt-key-definition-string edt-function)))))))
+
+;;;
+;;; FORM FEED INSERT
+;;;
+
+(defun edt-form-feed-insert (num)
+  "Insert form feed character at cursor position.
+Accepts a positive prefix argument for the number of form feeds to insert."
+  (interactive "*p")
+  (edt-check-prefix num)
+  (while (> num 0)
+    (insert ?\f)
+    (setq num (1- num))))
 
-(defun previous-end-of-line (num)
-  "Move EOL upward.
-Accepts a prefix argument for the number of lines to move."
-  (interactive "p")
-  (end-of-line (- 1 num)))
+;;;
+;;; TAB INSERT
+;;;
+
+(defun edt-tab-insert (num)
+  "Insert tab character at cursor position.
+Accepts a positive prefix argument for the number of tabs to insert."
+  (interactive "*p")
+  (edt-check-prefix num)
+  (while (> num 0)
+    (insert ?\t)
+    (setq num (1- num))))
+
+;;;
+;;; Check Prefix
+;;;
+
+(defun edt-check-prefix (num)
+  "Indicate error if prefix is not positive."
+  (if (<= num 0)
+      (error "Prefix must be positive")))
+      
+;;;
+;;; Check Selection
+;;;
+
+(defun edt-check-selection ()
+  "Indicate error if EDT selection is not active."
+  (if (not edt-select-mode)
+      (error "Selection NOT active")))
+
+;;;;
+;;;; ENHANCEMENTS AND ADDITIONS FOR EDT KEYPAD MODE
+;;;;
 
-(defun forward-to-word (num)
-  "Move to next word-beginning, or to Nth following word-beginning."
+;;; 
+;;; Several enhancements and additions to EDT keypad mode commands are
+;;; provided here.  Some of these have been motivated by similar
+;;; TPU/EVE and EVE-Plus commands.  Others are new.
+
+;;;
+;;; CHANGE DIRECTION
+;;;
+
+(defun edt-change-direction ()
+  "Toggle movement direction."
+  (interactive)
+  (if (equal edt-direction-string edt-forward-string) 
+      (edt-backup)
+      (edt-advance)))
+
+;;;
+;;; TOGGLE SELECT
+;;;
+
+(defun edt-toggle-select ()
+  "Toggle to start (or cancel) text selection."
+  (interactive)
+  (if edt-select-mode
+      (edt-reset)
+    (edt-select)))
+
+;;;
+;;; SENTENCE
+;;;
+
+(defun edt-sentence-forward (num)
+  "Move forward to start of next sentence.
+Accepts a positive prefix argument for the number of sentences to move."
   (interactive "p")
-  (forward-word (1+ num))
-  (forward-word -1))
+  (edt-check-prefix num)
+  (if (eobp)
+      (progn
+        (error "End of buffer"))
+      (progn
+        (forward-sentence num)
+        (edt-one-word-forward))))
 
-(defun backward-to-word (num)
-  "Move back to word-end, or to Nth word-end seen."
+(defun edt-sentence-backward (num)
+  "Move backward to next sentence beginning.
+Accepts a positive prefix argument for the number of sentences to move."
   (interactive "p")
-  (forward-word (- (1+ num)))
-  (forward-word 1))
-
-(defun backward-line (num)
-  "Move point to start of previous line.
-Prefix argument serves as repeat-count."
-  (interactive "p")
-  (forward-line (- num)))
+  (edt-check-prefix num)
+  (if (eobp)
+      (progn
+        (error "End of buffer"))
+      (backward-sentence num)))
 
-(defun scroll-window-down (num)
-  "Scroll the display down a window-full.
-Accepts a prefix argument for the number of window-fulls to scroll."
+(defun edt-sentence (num)
+  "Move in current direction to next sentence.
+Accepts a positive prefix argument for the number of sentences to move."
   (interactive "p")
-  (scroll-down (- (* (window-height) num) 2)))
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-sentence-forward num)
+      (edt-sentence-backward num)))
 
-(defun scroll-window-up (num)
-  "Scroll the display up a window-full.
-Accepts a prefix argument for the number of window-fulls to scroll."
+;;;
+;;; PARAGRAPH
+;;;
+
+(defun edt-paragraph-forward (num)
+  "Move forward to beginning of paragraph.
+Accepts a positive prefix argument for the number of paragraphs to move."
   (interactive "p")
-  (scroll-up (- (* (window-height) num) 2)))
-
-(defun next-paragraph (num)
-  "Move to beginning of the next indented paragraph.
-Accepts a prefix argument for the number of paragraphs."
-  (interactive "p")
+  (edt-check-prefix num)
   (while (> num 0)
     (next-line 1)
     (forward-paragraph)
     (previous-line 1)
-    (if (eolp) (next-line 1))
+    (if (eolp)
+        (next-line 1))
     (setq num (1- num))))
 
-(defun previous-paragraph (num)
-  "Move to beginning of previous indented paragraph.
-Accepts a prefix argument for the number of paragraphs."
+(defun edt-paragraph-backward (num)
+  "Move backward to beginning of paragraph.
+Accepts a positive prefix argument for the number of paragraphs to move."
   (interactive "p")
+  (edt-check-prefix num)
   (while (> num 0)
     (backward-paragraph)
     (previous-line 1)
     (if (eolp) (next-line 1))
     (setq num (1- num))))
 
-(defun move-to-beginning ()
-  "Move cursor to the beginning of buffer, but don't set the mark."
-  (interactive)
-  (goto-char (point-min)))
+(defun edt-paragraph (num)
+  "Move in current direction to next paragraph.
+Accepts a positive prefix argument for the number of paragraph to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-paragraph-forward num)
+      (edt-paragraph-backward num)))
 
-(defun move-to-end ()
-  "Move cursor to the end of buffer, but don't set the mark."
-  (interactive)
-  (goto-char (point-max)))
+;;;
+;;; RESTORE KEY
+;;;
 
-(defun goto-percent (perc)
-  "Move point to ARG percentage of the buffer."
-  (interactive "NGoto-percentage: ")
-  (if (or (> perc 100) (< perc 0))
-      (error "Percentage %d out of range 0 < percent < 100" perc)
-    (goto-char (/ (* (point-max) perc) 100))))
+(defun edt-restore-key ()
+  "Restore last replaced key definition.
+Definition is stored in edt-last-replaced-key-definition."
+  (interactive)
+  (if edt-last-replaced-key-definition
+      (progn
+        (let (edt-key-definition-string)
+          (set 'edt-key-definition-string
+               (read-key-sequence "Press the key to be restored: "))
+          (if (string-equal "\C-m" edt-key-definition-string) 
+              (message "Key not restored") 
+              (define-key (current-global-map) 
+                 edt-key-definition-string edt-last-replaced-key-definition))))
+      (error "No replaced key definition to restore!")))
 
-(defun update-mode-line ()
-  "Make sure mode-line in the current buffer reflects all changes."
-  (set-buffer-modified-p (buffer-modified-p))
-  (sit-for 0))
+;;;
+;;; WINDOW TOP
+;;;
 
-(defun advance-direction ()
-  "Set EDT Advance mode so keypad commands move forward."
+(defun edt-window-top ()
+  "Move the cursor to the top of the window."
+  (interactive)
+  (let ((start-column (current-column)))
+    (move-to-window-line 0)
+    (move-to-column start-column)))
+
+;;;
+;;; WINDOW BOTTOM
+;;;
+
+(defun edt-window-bottom ()
+  "Move the cursor to the bottom of the window."
   (interactive)
-  (setq edt-direction-string " ADVANCE")
-  (define-key function-keymap "\C-c" 'isearch-forward)  ; PF3
-  (define-key function-keymap "8" 'scroll-window-up) ; "8"
-  (define-key function-keymap "7" 'next-paragraph)   ; "7"
-  (define-key function-keymap "1" 'forward-to-word)  ; "1"
-  (define-key function-keymap "2" 'next-end-of-line) ; "2"
-  (define-key function-keymap "3" 'forward-char)     ; "3"
-  (define-key function-keymap "0" 'forward-line)     ; "0"
-  (update-mode-line))
+  (let ((start-column (current-column)))
+    (move-to-window-line (- (window-height) 2))
+    (move-to-column start-column)))
+
+;;;
+;;; SCROLL WINDOW LINE
+;;;
 
-(defun backup-direction ()
-  "Set EDT Backup mode so keypad commands move backward."
+(defun edt-scroll-window-forward-line ()
+  "Move window forward one line leaving cursor at position in window."
+  (interactive)
+  (scroll-up 1))
+
+(defun edt-scroll-window-backward-line ()
+  "Move window backward one line leaving cursor at position in window."
+  (interactive)
+  (scroll-down 1))
+
+(defun edt-scroll-line ()
+  "Move window one line in current direction."
   (interactive)
-  (setq edt-direction-string " BACKUP")
-  (define-key function-keymap "\C-c" 'isearch-backward) ; PF3
-  (define-key function-keymap "8" 'scroll-window-down) ; "8"
-  (define-key function-keymap "7" 'previous-paragraph) ; "7"
-  (define-key function-keymap "1" 'backward-to-word)    ; "1"
-  (define-key function-keymap "2" 'previous-end-of-line) ; "2"
-  (define-key function-keymap "3" 'backward-char)    ; "3"
-  (define-key function-keymap "0" 'backward-line)    ; "0"
-  (update-mode-line))
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-scroll-window-forward-line)
+      (edt-scroll-window-backward-line)))
+
+;;;
+;;; SCROLL WINDOW
+;;;
+;;; Scroll a window (less one line) at a time.  Leave cursor in center of 
+;;; window. 
+
+(defun edt-scroll-window-forward (num)
+  "Scroll forward one window in buffer, less one line.
+Accepts a positive prefix argument for the number of windows to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (scroll-up (- (* (window-height) num) 2))
+  (edt-line-forward (/ (- (window-height) 1) 2)))
 
-(defun edt-beginning-of-window ()
-  "Home cursor to top of window."
-  (interactive)
-  (move-to-window-line 0))
+(defun edt-scroll-window-backward (num)
+  "Scroll backward one window in buffer, less one line.
+Accepts a positive prefix argument for the number of windows to move."
+  (interactive "p")
+  (edt-check-prefix num)
+  (scroll-down (- (* (window-height) num) 2))
+  (edt-line-backward (/ (- (window-height) 1) 2)))
+
+(defun edt-scroll-window (num)
+  "Scroll one window in buffer, less one line, in current direction.
+Accepts a positive prefix argument for the number windows to move."
+  (interactive "p")
+  (if (equal edt-direction-string edt-forward-string)
+      (edt-scroll-window-forward num)
+      (edt-scroll-window-backward num)))
+
+;;;
+;;; LINE TO BOTTOM OF WINDOW
+;;;
 
 (defun edt-line-to-bottom-of-window ()
-  "Move the current line to the top of the window."
+  "Move the current line to the bottom of the window."
   (interactive)
   (recenter -1))
 
+;;;
+;;; LINE TO TOP OF WINDOW
+;;;
+
 (defun edt-line-to-top-of-window ()
   "Move the current line to the top of the window."
   (interactive)
   (recenter 0))
 
-(defun case-flip-character (num)
-  "Change the case of the character under the cursor.
-Accepts a prefix argument of the number of characters to invert."
-  (interactive "p")
-  (while (> num 0)
-    (funcall (if (<= ?a (following-char))
-		 'upcase-region 'downcase-region)
-	     (point) (1+ (point)))
-    (forward-char 1)
-    (setq num (1- num))))
+;;;
+;;; LINE TO MIDDLE OF WINDOW
+;;;
+
+(defun edt-line-to-middle-of-window ()
+  "Move window so line with cursor is in the middle of the window."
+  (interactive)
+  (recenter '(4)))
+
+;;;
+;;; GOTO PERCENTAGE
+;;;
+
+(defun edt-goto-percentage (num)
+  "Move to specified percentage in buffer from top of buffer."
+  (interactive "NGoto-percentage: ")
+  (if (or (> num 100) (< num 0))
+      (error "Percentage %d out of range 0 < percent < 100" num)
+      (goto-char (/ (* (point-max) num) 100))))
+
+;;;
+;;; FILL REGION
+;;;
 
-(defun indent-or-fill-region ()
+(defun edt-fill-region ()
+  "Fill selected text."
+  (interactive "*")         
+  (edt-check-selection)
+  (fill-region (point) (mark)))
+
+;;;
+;;; INDENT OR FILL REGION
+;;;
+
+(defun edt-indent-or-fill-region ()
   "Fill region in text modes, indent region in programming language modes."
-  (interactive)
-  (if (string= paragraph-start "^$\\|^")
+  (interactive "*")         
+  (if (string= paragraph-start "$\\|\f")
       (indent-region (point) (mark) nil)
-    (fill-region (point) (mark))))
+      (fill-region (point) (mark))))
+
+;;;
+;;; MARK SECTION WISELY
+;;;
 
-(defun mark-section-wisely ()
+(defun edt-mark-section-wisely ()
   "Mark the section in a manner consistent with the major-mode.
-Uses mark-defun for emacs-lisp, lisp,
+Uses mark-defun for emacs-lisp and lisp,
 mark-c-function for C,
+mark-fortran-subsystem for fortran,
 and mark-paragraph for other modes."
   (interactive)
-  (cond  ((eq major-mode 'emacs-lisp-mode)
-	  (mark-defun))
-	 ((eq major-mode 'lisp-mode)
-	  (mark-defun))
-	 ((eq major-mode 'c-mode)
-	  (mark-c-function))
-	 (t (mark-paragraph))))
+  (if edt-select-mode
+      (progn
+        (edt-reset))
+      (progn
+	(cond  ((or (eq major-mode 'emacs-lisp-mode)
+		    (eq major-mode 'lisp-mode))
+		(mark-defun)
+		(message "Lisp defun selected"))
+	       ((eq major-mode 'c-mode)
+		(mark-c-function)
+		(message "C function selected"))
+	       ((eq major-mode 'fortran-mode)
+		(mark-fortran-subprogram)
+		(message "Fortran subprogram selected"))
+	       (t (mark-paragraph)
+		  (message "Paragraph selected"))))))
+
+;;;
+;;; COPY
+;;;
+
+(defun edt-copy ()
+  "Copy selected region to kill ring, but don't delete it!"
+  (interactive)
+  (edt-check-selection)
+  (copy-region-as-kill (mark) (point))
+  (edt-reset)
+  (message "Selected text COPIED to kill ring"))
+
+;;;
+;;; CUT or COPY
+;;;
+
+(defun edt-cut-or-copy ()
+  "Cuts (or copies) selected text to kill ring.
+Cuts selected text if buffer-read-only is nil.
+Copies selected text if buffer-read-only is t."
+  (interactive)
+  (if buffer-read-only
+      (edt-copy)
+      (edt-cut)))
+
+;;;
+;;; DELETE ENTIRE LINE
+;;;
+
+(defun edt-delete-entire-line ()
+  "Delete entire line regardless of cursor position in the line."
+  (interactive "*")
+  (beginning-of-line)
+  (edt-delete-line 1))
 
-;;; Key Bindings
-(defun edt-emulation-on ()
-  "Begin emulating DEC's EDT editor.
-Certain keys are rebound; including nearly all keypad keys.
-Use \\[edt-emulation-off] to undo all rebindings except the keypad keys.
-Note that this function does not work if called directly from the .emacs file.
-Instead, the .emacs file should do (setq term-setup-hook 'edt-emulation-on)
-Then this function will be called at the time when it will work."
+;;;
+;;; DUPLICATE LINE
+;;;
+
+(defun edt-duplicate-line (num)
+  "Duplicate a line of text.
+Accepts a positive prefix argument for the number times to duplicate the line."
+  (interactive "*p")
+  (edt-check-prefix num)
+  (let ((old-column (current-column))
+        (count num))
+    (edt-delete-entire-line)
+    (edt-undelete-line)
+    (while (> count 0)
+      (edt-undelete-line)
+      (setq count (1- count)))
+    (edt-line-forward num)
+    (move-to-column old-column)))
+
+;;;
+;;; DUPLICATE WORD
+;;;
+
+(defun edt-duplicate-word()
+  "Duplicate word (or rest of word) found directly above cursor, if any."
+  (interactive "*")
+  (let ((start (point))
+        (start-column (current-column)))
+    (forward-line -1)
+    (move-to-column start-column)
+    (if (and (not (equal start (point)))
+             (not (eolp)))
+        (progn
+          (if (and (equal ?\t (preceding-char))
+                   (< start-column (current-column)))
+              (backward-char))
+          (let ((beg (point)))
+            (edt-one-word-forward)
+            (setq edt-last-copied-word (buffer-substring beg (point))))
+          (forward-line)
+          (move-to-column start-column)
+          (insert edt-last-copied-word))
+        (progn
+	  (if (not (equal start (point)))
+	      (forward-line))
+          (move-to-column start-column)
+          (error "Nothing to duplicate!")))))
+
+;;;
+;;; KEY NOT ASSIGNED
+;;;
+
+(defun edt-key-not-assigned ()
+  "Displays message that key has not been assigned to a function."
   (interactive)
-  (advance-direction)
-  (edt-bind-gold-keypad)	;Must do this *after* $TERM.el is loaded
-  (setq edt-mode-old-c-\\ (lookup-key global-map "\C-\\"))
-  (global-set-key "\C-\\" 'quoted-insert)
-  (setq edt-mode-old-delete (lookup-key global-map "\177"))
-  (global-set-key "\177" 'delete-previous-char)      ;"Delete"
-  (setq edt-mode-old-lisp-delete (lookup-key emacs-lisp-mode-map "\177"))
-  (define-key emacs-lisp-mode-map "\177" 'delete-previous-char) ;"Delete"
-  (define-key lisp-mode-map "\177" 'delete-previous-char) ;"Delete"
-  (setq edt-mode-old-linefeed (lookup-key global-map "\C-j"))
-  (global-set-key "\C-j" 'edt-delete-previous-word)           ;"LineFeed"
-  (define-key esc-map "?" 'apropos))                      ;"<ESC>?"
+  (error "Key not assigned"))
+
+;;;
+;;; TOGGLE CAPITALIZATION OF WORD
+;;;
+
+(defun edt-toggle-capitalization-of-word ()
+  "Toggle the capitalization of the current word and move forward to next."
+  (interactive "*")
+  (edt-one-word-forward)
+  (edt-one-word-backward)
+  (edt-change-case 1)
+  (edt-one-word-backward)
+  (edt-one-word-forward))
+
+;;;
+;;; ELIMINATE ALL TABS
+;;;
+
+(defun edt-eliminate-all-tabs ()
+  "Convert all tabs to spaces in the entire buffer."
+  (interactive "*")
+  (untabify (point-min) (point-max))
+  (message "TABS converted to SPACES"))
+
+;;;
+;;; DISPLAY THE TIME
+;;;
+
+(defun edt-display-the-time ()
+  "Display the current time."
+  (interactive)
+  (set 'time-string (current-time-string))
+  (message "%s" time-string))
+
+;;;
+;;; LEARN
+;;;
+
+(defun edt-learn ()
+  "Learn a sequence of key strokes to bind to a key."
+  (interactive)
+  (if (eq defining-kbd-macro t)
+      (edt-remember)
+      (start-kbd-macro nil)))
+
+;;;
+;;; REMEMBER
+;;;
 
-(defun edt-emulation-off ()
-  "Return from EDT emulation to normal Emacs key bindings.
-The keys redefined by \\[edt-emulation-on] are given their old definitions."
+(defun edt-remember ()
+  "Store the sequence of key strokes started by edt-learn to a key."
+  (interactive)
+  (if (eq defining-kbd-macro nil)
+      (error "Nothing to remember!")
+      (progn
+        (end-kbd-macro nil)
+        (let (edt-key-definition-string)
+          (set 'edt-key-definition-string
+               (read-key-sequence "Enter key for binding: "))
+          (if (string-equal "\C-m" edt-key-definition-string) 
+              (message "Key sequence not remembered") 
+              (progn
+                (set 'edt-learn-macro-count (+ edt-learn-macro-count 1))
+                (setq edt-last-replaced-key-definition
+                      (lookup-key (current-global-map)
+                                  edt-key-definition-string))
+                (define-key (current-global-map) edt-key-definition-string
+                  (name-last-kbd-macro
+                    (intern (concat "last-learned-sequence-"
+                                  (int-to-string edt-learn-macro-count)))))))))))
+
+;;;
+;;; EXIT
+;;;
+
+(defun edt-exit ()
+  "Save current buffer, ask to save other buffers, and then exit Emacs."
+  (interactive)
+  (save-buffer)
+  (save-buffers-kill-emacs))
+
+;;; 
+;;; QUIT
+;;;
+
+(defun edt-quit ()
+  "Quit Emacs without saving changes."
+  (interactive)
+  (kill-emacs))
+
+;;; 
+;;; SPLIT WINDOW
+;;;
+
+(defun edt-split-window ()
+  "Split current window and place cursor in the new window."
+  (interactive)
+  (split-window)
+  (other-window 1))
+
+;;;
+;;; COPY RECTANGLE
+;;;
+
+(defun edt-copy-rectangle ()
+  "Copy a rectangle of text between mark and cursor to register."
   (interactive)
-  (setq edt-direction-string nil)
-  (global-set-key "\C-\\" edt-mode-old-c-\\)
-  (global-set-key "\177" edt-mode-old-delete)		;"Delete"
-  (define-key emacs-lisp-mode-map "\177" edt-mode-old-lisp-delete) ;"Delete"
-  (define-key lisp-mode-map "\177" edt-mode-old-lisp-delete) ;"Delete"
-  (global-set-key "\C-j" edt-mode-old-linefeed))           ;"LineFeed"
+  (edt-check-selection)
+  (copy-rectangle-to-register 3 (region-beginning) (region-end) nil)
+  (edt-reset)
+  (message "Selected rectangle COPIED to register"))
+
+;;;
+;;; CUT RECTANGLE
+;;;
+
+(defun edt-cut-rectangle-overstrike-mode ()
+  "Cut a rectangle of text between mark and cursor to register.
+Replace cut characters with spaces and moving cursor back to
+upper left corner."
+  (interactive "*")
+  (edt-check-selection)
+  (setq edt-rect-start-point (region-beginning))
+  (picture-clear-rectangle-to-register (region-beginning) (region-end) 3)
+  (set-window-point (get-buffer-window (window-buffer)) edt-rect-start-point)
+  (message "Selected rectangle CUT to register"))
+
+(defun edt-cut-rectangle-insert-mode ()
+  "Cut a rectangle of text between mark and cursor to register.
+Move cursor back to upper left corner."
+  (interactive "*")         
+  (edt-check-selection)
+  (setq edt-rect-start-point (region-beginning))
+  (picture-clear-rectangle-to-register (region-beginning) (region-end) 3 t)
+  (fixup-whitespace)
+  (set-window-point (get-buffer-window (window-buffer)) edt-rect-start-point)
+  (message "Selected rectangle CUT to register"))
+
+(defun edt-cut-rectangle ()
+  "Cut a rectangular region of text to register.
+If overwrite mode is active, cut text is replaced with whitespace."
+  (interactive "*")
+  (if overwrite-mode
+      (edt-cut-rectangle-overstrike-mode)
+      (edt-cut-rectangle-insert-mode)))
+
+;;;
+;;; PASTE RECTANGLE
+;;;
+
+(defun edt-paste-rectangle-overstrike-mode ()
+  "Paste a rectangular region of text from register, replacing text at cursor."
+  (interactive "*")    
+  (picture-yank-rectangle-from-register 3))
+
+(defun edt-paste-rectangle-insert-mode ()
+  "Paste previously deleted rectangular region, inserting text at cursor."
+  (interactive "*")
+  (picture-yank-rectangle-from-register 3 t))
+
+(defun edt-paste-rectangle ()
+  "Paste a rectangular region of text.
+If overwrite mode is active, existing text is replace with text from register."
+  (interactive)
+  (if overwrite-mode
+      (edt-paste-rectangle-overstrike-mode)
+      (edt-paste-rectangle-insert-mode)))
+
+;;;
+;;; DOWNCASE REGION
+;;;
+
+(defun edt-lowercase ()
+  "Change specified characters to lower case.
+If text selection IS active, then characters between the cursor and
+mark are changed.  If text selection is NOT active, there are two
+situations.  If the current direction is ADVANCE, then the word under
+the cursor is changed to lower case and the cursor is moved to rest at
+the beginning of the next word.  If the current direction is BACKUP,
+the word prior to the word under the cursor is changed to lower case
+and the cursor is left to rest at the beginning of that word."
+  (interactive "*")
+  (if edt-select-mode
+      (progn
+	(downcase-region (mark) (point)))
+      (progn
+	;; Move to beginning of current word.
+	(if (and
+	      (not (bobp))
+	      (not (eobp))
+	      (not (bolp))
+	      (not (eolp))
+	      (not (eq ?\  (char-syntax (preceding-char))))
+	      (not (memq (preceding-char) edt-word-entities))
+	      (not (memq (following-char) edt-word-entities)))
+	    (edt-one-word-backward))
+	(if (equal edt-direction-string edt-backward-string)
+	    (edt-one-word-backward))
+	(let ((beg (point)))
+	  (edt-one-word-forward)
+	  (downcase-region beg (point)))
+	(if (equal edt-direction-string edt-backward-string)
+	    (edt-one-word-backward)))))
+
+;;;
+;;; UPCASE REGION
+;;;
+
+(defun edt-uppercase ()
+  "Change specified characters to upper case.
+If text selection IS active, then characters between the cursor and
+mark are changed.  If text selection is NOT active, there are two
+situations.  If the current direction is ADVANCE, then the word under
+the cursor is changed to upper case and the cursor is moved to rest at
+the beginning of the next word.  If the current direction is BACKUP,
+the word prior to the word under the cursor is changed to upper case
+and the cursor is left to rest at the beginning of that word."
+  (interactive "*")
+  (if edt-select-mode
+      (progn
+	(upcase-region (mark) (point)))
+      (progn
+	;; Move to beginning of current word.
+	(if (and
+	      (not (bobp))
+	      (not (eobp))
+	      (not (bolp))
+	      (not (eolp))
+	      (not (eq ?\  (char-syntax (preceding-char))))
+	      (not (memq (preceding-char) edt-word-entities))
+	      (not (memq (following-char) edt-word-entities)))
+	    (edt-one-word-backward))
+	(if (equal edt-direction-string edt-backward-string)
+	    (edt-one-word-backward))
+	(let ((beg (point)))
+	  (edt-one-word-forward)
+	  (upcase-region beg (point)))
+	(if (equal edt-direction-string edt-backward-string)
+	    (edt-one-word-backward)))))
 
-(define-key function-keymap "u" 'previous-line)		;Up arrow
-(define-key function-keymap "d" 'next-line)		;down arrow
-(define-key function-keymap "l" 'backward-char)		;right arrow
-(define-key function-keymap "r" 'forward-char)		;left arrow
-(define-key function-keymap "h" 'edt-beginning-of-window)	;home
-(define-key function-keymap "\C-b" 'describe-key)	;PF2
-(define-key function-keymap "\C-d" 'delete-current-line);PF4
-(define-key function-keymap "9" 'append-to-buffer)	;9 keypad key, etc.
-(define-key function-keymap "-" 'delete-current-word)
-(define-key function-keymap "4" 'advance-direction)
-(define-key function-keymap "5" 'backup-direction)
-(define-key function-keymap "6" 'kill-region)
-(define-key function-keymap "," 'delete-current-char)
-(define-key function-keymap "." 'set-mark-command)
-(define-key function-keymap "e" 'other-window)		;enter key
-(define-key function-keymap "\C-a" 'GOLD-prefix)	;PF1 ("gold")
+
+;;;
+;;; INITIALIZATION COMMANDS.
+;;;
+
+;;;
+;;;  Emacs version 19 X-windows key definition support
+;;;
+(defvar edt-last-answer nil 
+  "Most recent response to edt-y-or-n-p.")
+
+(defun edt-y-or-n-p (prompt &optional not-yes)
+  "Prompt for a y or n answer with positive default.
+Optional second argument NOT-YES changes default to negative.
+Like emacs y-or-n-p, also accepts space as y and DEL as n."
+  (message "%s[%s]" prompt (if not-yes "n" "y"))
+  (let ((doit t))
+    (while doit
+      (setq doit nil)
+      (let ((ans (read-char)))
+	(cond ((or (= ans ?y) (= ans ?Y) (= ans ?\ ))
+	       (setq edt-last-answer t))
+	      ((or (= ans ?n) (= ans ?N) (= ans ?\C-?))
+	       (setq edt-last-answer nil))
+	      ((= ans ?\r) (setq edt-last-answer (not not-yes)))
+	      (t
+	       (setq doit t) (beep)
+	       (message "Please answer y or n.  %s[%s]"
+			prompt (if not-yes "n" "y")))))))
+  edt-last-answer)
+
+(defun edt-load-xkeys (file)
+  "Load the EDT X-windows key definitions FILE.
+If FILE is nil, try to load a default file.  The default file names are
+~/.edt-xemacs-keys for XEmacs, and ~/.edt-gnu-keys for GNU emacs."
+  (interactive "fX key definition file: ")
+  (cond (file
+	 (setq file (expand-file-name file)))
+	(edt-xkeys-file
+	 (setq file (expand-file-name edt-xkeys-file)))
+	(edt-gnu-emacs19-p
+	 (setq file (expand-file-name "~/.edt-gnu-keys")))
+	(edt-lucid-emacs19-p
+	 (setq file (expand-file-name "~/.edt-xemacs-keys"))))
+  (cond ((file-readable-p file)
+	 (load-file file))
+	(t
+	 (switch-to-buffer "*scratch*")
+	 (erase-buffer)
+	 (insert "
+
+     Ack!!  You're running the Enhanced EDT Emulation under X-windows
+     without loading an EDT X key definition file.  To create an EDT X
+     key definition file, run the edt-mapper.el program.  But ONLY run
+     it from an XEmacs loaded without any of your own customizations
+     found in your .emacs file, etc.  Some user customization confuse
+     the edt-mapper function.  To do this, you need to invoke XEmacs
+     as follows:
 
-(fset 'GOLD-prefix GOLD-map)
-
-(defvar GOLD-map (make-keymap)
-   "GOLD-map maps the function keys on the VT100 keyboard preceeded
-by the PF1 key.  GOLD is the ASCII the 7-bit escape sequence <ESC>OP.")
+          xemacs -q -l edt-mapper.el
+     
+     The file edt-mapper.el includes these same directions on how to
+     use it!  Perhaps it's laying around here someplace. \n     ")
+	 (let ((file "edt-mapper.el")
+	       (found nil)
+	       (path nil)
+	       (search-list (append (list (expand-file-name ".")) load-path)))
+	   (while (and (not found) search-list)
+	     (setq path (concat (car search-list)
+				(if (string-match "/$" (car search-list)) "" "/")
+				file))
+	     (if (and (file-exists-p path) (not (file-directory-p path)))
+		 (setq found t))
+	     (setq search-list (cdr search-list)))
+	   (cond (found
+		  (insert (format
+			   "Ah yes, there it is, in \n\n       %s \n\n" path))
+		  (if (edt-y-or-n-p "Do you want to run it now? ")
+		      (load-file path)
+		    (error "EDT Emulation not configured.")))
+		 (t
+		  (insert "Nope, I can't seem to find it.  :-(\n\n")
+		  (sit-for 20)
+		  (error "EDT Emulation not configured.")))))))
 
-(defun define-keypad-key (keymap function-keymap-slot definition)
-  (let ((function-key-sequence (function-key-sequence function-keymap-slot)))
-    (if function-key-sequence
-	(define-key keymap function-key-sequence definition))))
+;;;###autoload
+(defun edt-emulation-on ()
+  "Turn on EDT Emulation."
+  (interactive)
+  ;; If using MS-DOS, need to load edt-pc.el
+  (if (eq system-type 'ms-dos)
+      (setq edt-term "pc")
+    (setq edt-term (getenv "TERM")))
+  ;; All DEC VT series terminals are supported by loading edt-vt100.el
+  (if (string-equal "vt" (substring edt-term 0 (min (length edt-term) 2)))
+      (setq edt-term "vt100"))
+  ;; Load EDT terminal specific configuration file.
+  (let ((term edt-term)
+        hyphend)
+    (while (and term
+                (not (load (concat "edt-" term) t t)))
+      ;; Strip off last hyphen and what follows, then try again
+      (if (setq hyphend (string-match "[-_][^-_]+$" term))
+          (setq term (substring term 0 hyphend))
+          (setq term nil)))
+    ;; Override terminal-specific file if running X Windows.  X Windows support
+    ;; is handled differently in edt-load-xkeys
+    (if (eq window-system 'x)
+	(edt-load-xkeys nil)
+      (if (null term)
+	  (error "Unable to load EDT terminal specific file for %s" edt-term)))
+    (setq edt-term term))
+  (setq edt-orig-transient-mark-mode transient-mark-mode)
+  (add-hook 'activate-mark-hook
+	    (function
+	     (lambda ()
+	       (edt-select-mode t))))
+  (add-hook 'deactivate-mark-hook
+	    (function
+	     (lambda ()
+	       (edt-select-mode nil))))
+  (if (load "edt-user" t t)
+      (edt-user-emulation-setup)
+      (edt-default-emulation-setup)))
 
-;;Bind GOLD/Keyboard keys
+(defun edt-emulation-off()
+  "Select original global key bindings, disabling EDT Emulation."
+  (interactive)
+  (use-global-map global-map)
+  (if (not edt-keep-current-page-delimiter)
+      (setq page-delimiter edt-orig-page-delimiter))
+  (setq edt-direction-string "")
+  (setq edt-select-mode-text nil)
+  (edt-reset)
+  (force-mode-line-update t)
+  (setq transient-mark-mode edt-orig-transient-mark-mode)
+  (message "Original key bindings restored; EDT Emulation disabled"))
 
-(define-key GOLD-map "\C-g"  'keyboard-quit)            ; just for safety
-(define-key GOLD-map "\177" 'delete-window)             ;"Delete"
-(define-key GOLD-map "\C-h" 'delete-other-windows)      ;"BackSpace"
-(define-key GOLD-map "\C-m" 'newline-and-indent)        ;"Return"
-(define-key GOLD-map " " 'undo)				;"Spacebar"
-(define-key GOLD-map "%" 'goto-percent)                 ; "%"
-(define-key GOLD-map "=" 'goto-line)                    ; "="
-(define-key GOLD-map "`" 'what-line)                    ; "`"
-(define-key GOLD-map "\C-\\" 'split-window-vertically)  ; "Control-\"
+(defun edt-default-emulation-setup (&optional user-setup)
+  "Setup emulation of DEC's EDT editor."
+  ;; Setup default EDT global map by copying global map bindings.
+  ;; This preserves ESC and C-x prefix bindings and other bindings we
+  ;; wish to retain in EDT emulation mode keymaps.  It also permits
+  ;; customization of these bindings in the EDT global maps without
+  ;; disturbing the original bindings in global-map.
+  (fset 'edt-default-ESC-prefix (copy-keymap 'ESC-prefix))
+  (setq edt-default-global-map (copy-keymap (current-global-map)))
+  (define-key edt-default-global-map "\e" 'edt-default-ESC-prefix)
+  (define-prefix-command 'edt-default-gold-map)
+  (edt-setup-default-bindings)
+  ;; If terminal has additional function keys, the terminal-specific
+  ;; initialization file can assign bindings to them via the optional
+  ;; function edt-setup-extra-default-bindings.
+  (if (fboundp 'edt-setup-extra-default-bindings)
+      (edt-setup-extra-default-bindings))
+  ;; Variable needed by edt-learn.
+  (setq edt-learn-macro-count 0)
+  ;; Display EDT text selection active within the mode line
+  (or (assq 'edt-select-mode minor-mode-alist)
+      (setq minor-mode-alist 
+	    (cons '(edt-select-mode edt-select-mode) minor-mode-alist)))
+  ;; Display EDT direction of motion within the mode line
+  (or (assq 'edt-direction-string minor-mode-alist)
+      (setq minor-mode-alist
+	    (cons
+	      '(edt-direction-string edt-direction-string) minor-mode-alist)))
+  (if user-setup
+      (progn
+        (setq edt-user-map-configured t)
+        (fset 'edt-emulation-on (symbol-function 'edt-select-user-global-map)))
+      (progn
+        (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map))
+        (edt-select-default-global-map))))
+
+(defun edt-user-emulation-setup ()
+  "Setup user custom emulation of DEC's EDT editor."
+  ;; Initialize EDT default bindings.
+  (edt-default-emulation-setup t)
+  ;; Setup user EDT global map by copying default EDT global map bindings.
+  (fset 'edt-user-ESC-prefix (copy-keymap 'edt-default-ESC-prefix))
+  (setq edt-user-global-map (copy-keymap edt-default-global-map))
+  (define-key edt-user-global-map "\e" 'edt-user-ESC-prefix)
+  ;; If terminal has additional function keys, the user's initialization
+  ;; file can assign bindings to them via the optional
+  ;; function edt-setup-extra-default-bindings.
+  (define-prefix-command 'edt-user-gold-map)
+  (fset 'edt-user-gold-map (copy-keymap 'edt-default-gold-map))
+  (edt-setup-user-bindings)
+  (edt-select-user-global-map))
+
+(defun edt-select-default-global-map()
+  "Select default EDT emulation key bindings."
+  (interactive)
+  (transient-mark-mode 1)
+  (use-global-map edt-default-global-map)
+  (if (not edt-keep-current-page-delimiter)
+      (progn
+        (setq edt-orig-page-delimiter page-delimiter)
+        (setq page-delimiter "\f")))
+  (setq edt-default-map-active t)
+  (edt-advance)
+  (setq edt-select-mode-text 'edt-select-mode-string)
+  (edt-reset)
+  (message "Default EDT keymap active"))
+
+(defun edt-select-user-global-map()
+  "Select user EDT emulation custom key bindings."
+  (interactive)
+  (if edt-user-map-configured
+      (progn
+	(transient-mark-mode 1)
+        (use-global-map edt-user-global-map)
+        (if (not edt-keep-current-page-delimiter)
+            (progn
+              (setq edt-orig-page-delimiter page-delimiter)
+              (setq page-delimiter "\f")))
+        (setq edt-default-map-active nil)
+        (edt-advance)
+	(setq edt-select-mode-text 'edt-select-mode-string)
+        (edt-reset)
+        (message "User EDT custom keymap active"))
+      (error "User EDT custom keymap NOT configured!")))
+
+(defun edt-switch-global-maps ()
+  "Toggle between default EDT keymap and user EDT keymap."
+  (interactive)
+  (if edt-default-map-active 
+    (edt-select-user-global-map)
+    (edt-select-default-global-map)))
+
+;; There are three key binding functions needed: one for standard keys
+;; (used to bind control keys, primarily), one for Gold sequences of
+;; standard keys, and one for function keys.  
+
+(defun edt-bind-gold-key (key gold-binding &optional default)
+  "Binds commands to a gold key sequence in the EDT Emulator."
+  (if default
+      (define-key 'edt-default-gold-map key gold-binding)
+      (define-key 'edt-user-gold-map key gold-binding)))
+
+(defun edt-bind-standard-key (key gold-binding &optional default)
+  "Bind commands to a gold key sequence in the default EDT keymap."
+  (if default
+      (define-key edt-default-global-map key gold-binding)
+      (define-key edt-user-global-map key gold-binding)))
+
+(defun edt-bind-function-key 
+    (function-key binding gold-binding &optional default)
+  "Binds function keys in the EDT Emulator."
+  (catch 'edt-key-not-supported
+    (let ((key-vector (cdr (assoc function-key *EDT-keys*))))
+      (if (stringp key-vector)
+	  (throw 'edt-key-not-supported t))
+      (if (not (null key-vector))
+	  (progn
+	    (if default
+		(progn
+		  (define-key edt-default-global-map key-vector binding)
+		  (define-key 'edt-default-gold-map key-vector gold-binding))
+              (progn
+                (define-key edt-user-global-map key-vector binding)
+                (define-key 'edt-user-gold-map key-vector gold-binding))))
+	(error "%s is not a legal function key name" function-key)))))
+
+(defun edt-setup-default-bindings ()
+  "Assigns default EDT Emulation keyboard bindings."
+
+  ;; Function Key Bindings:  Regular and GOLD.
+
+  ;; VT100/VT200/VT300 PF1 (GOLD), PF2, PF3, PF4 Keys
+  (edt-bind-function-key "PF1" 'edt-default-gold-map 'edt-mark-section-wisely t)
+  (edt-bind-function-key "PF2" 'edt-electric-keypad-help 'describe-function t)
+  (edt-bind-function-key "PF3" 'edt-find-next 'edt-find t)
+  (edt-bind-function-key "PF4" 'edt-delete-line 'edt-undelete-line t)
+
+  ;; VT100/VT200/VT300 Arrow Keys
+  (edt-bind-function-key "UP" 'previous-line 'edt-window-top t)
+  (edt-bind-function-key "DOWN" 'next-line 'edt-window-bottom t)
+  (edt-bind-function-key "LEFT" 'backward-char 'edt-sentence-backward t)
+  (edt-bind-function-key "RIGHT" 'forward-char 'edt-sentence-forward t)
+
+  ;; VT100/VT200/VT300 Keypad Keys
+  (edt-bind-function-key "KP0" 'edt-line 'open-line t)
+  (edt-bind-function-key "KP1" 'edt-word 'edt-change-case t)
+  (edt-bind-function-key "KP2" 'edt-end-of-line 'edt-delete-to-end-of-line t)
+  (edt-bind-function-key "KP3" 'edt-character 'quoted-insert t)
+  (edt-bind-function-key "KP4" 'edt-advance 'edt-bottom t)
+  (edt-bind-function-key "KP5" 'edt-backup 'edt-top t)
+  (edt-bind-function-key "KP6" 'edt-cut 'yank t)
+  (edt-bind-function-key "KP7" 'edt-page 'execute-extended-command t)
+  (edt-bind-function-key "KP8" 'edt-sect 'edt-fill-region t)
+  (edt-bind-function-key "KP9" 'edt-append 'edt-replace t)
+  (edt-bind-function-key "KP-" 'edt-delete-word 'edt-undelete-word t)
+  (edt-bind-function-key "KP," 'edt-delete-character 'edt-undelete-character t)
+  (edt-bind-function-key "KPP" 'edt-select 'edt-reset t)
+  (edt-bind-function-key "KPE" 'other-window 'query-replace t)
+
+  ;; VT200/VT300 Function Keys
+  ;; (F1 through F5, on the VT220, are not programmable, so we skip
+  ;; making default bindings to those keys.  
+  (edt-bind-function-key "FIND" 'edt-find-next 'edt-find t)
+  (edt-bind-function-key "INSERT" 'yank 'edt-key-not-assigned t)
+  (edt-bind-function-key "REMOVE" 'edt-cut 'edt-copy t)
+  (edt-bind-function-key "SELECT" 'edt-toggle-select 'edt-key-not-assigned t)
+  (edt-bind-function-key "NEXT" 'edt-sect-forward 'edt-key-not-assigned t)
+  (edt-bind-function-key "PREVIOUS" 'edt-sect-backward 'edt-key-not-assigned t)
+  (edt-bind-function-key "F6" 'edt-key-not-assigned 'edt-key-not-assigned t)
+  (edt-bind-function-key "F7" 'edt-copy-rectangle 'edt-key-not-assigned t)
+  (edt-bind-function-key "F8" 
+       'edt-cut-rectangle-overstrike-mode 'edt-paste-rectangle-overstrike-mode t)
+  (edt-bind-function-key "F9" 
+       'edt-cut-rectangle-insert-mode 'edt-paste-rectangle-insert-mode t)
+  (edt-bind-function-key "F10" 'edt-cut-rectangle 'edt-paste-rectangle t)
+  ;; Under X, the F11 key can be bound.  If using a VT-200 or higher terminal,
+  ;; the default emacs terminal support causes the VT F11 key to seem as if it 
+  ;; is an ESC key when in emacs.
+  (edt-bind-function-key "F11" 
+       'edt-key-not-assigned 'edt-key-not-assigned t)
+  (edt-bind-function-key "F12" 
+       'edt-beginning-of-line 'delete-other-windows t) ;BS
+  (edt-bind-function-key "F13" 
+       'edt-delete-to-beginning-of-word 'edt-key-not-assigned t) ;LF
+  (edt-bind-function-key "F14" 'edt-key-not-assigned 'edt-key-not-assigned t)
+  (edt-bind-function-key "HELP" 'edt-electric-keypad-help 'edt-key-not-assigned t)
+  (edt-bind-function-key "DO" 'execute-extended-command 'edt-key-not-assigned t)
+  (edt-bind-function-key "F17" 'edt-key-not-assigned 'edt-key-not-assigned t)
+  (edt-bind-function-key "F18" 'edt-key-not-assigned 'edt-key-not-assigned t)
+  (edt-bind-function-key "F19" 'edt-key-not-assigned 'edt-key-not-assigned t)
+  (edt-bind-function-key "F20" 'edt-key-not-assigned 'edt-key-not-assigned t)
+
+  ;; Control key bindings:  Regular and GOLD
+  ;; 
+  ;; Standard EDT control key bindings conflict with standard Emacs
+  ;; control key bindings.  Normally, the standard Emacs control key
+  ;; bindings are left unchanged in the default EDT mode.  However, if
+  ;; the variable edt-use-EDT-control-key-bindings is set to true
+  ;; before invoking edt-emulation-on for the first time, then the
+  ;; standard EDT bindings (with some enhancements) as defined here are
+  ;; used, instead.
+  (if edt-use-EDT-control-key-bindings
+      (progn
+        (edt-bind-standard-key "\C-a" 'edt-key-not-assigned t)
+        (edt-bind-standard-key "\C-b" 'edt-key-not-assigned t)
+        ;; Leave binding of C-c as original prefix key.
+        (edt-bind-standard-key "\C-d" 'edt-key-not-assigned t)
+        (edt-bind-standard-key "\C-e" 'edt-key-not-assigned t)
+        (edt-bind-standard-key "\C-f" 'edt-key-not-assigned t)
+        ;; Leave binding of C-g to keyboard-quit
+;        (edt-bind-standard-key "\C-g" 'keyboard-quit t)
+        ;; Standard EDT binding of C-h.  To invoke Emacs help, use
+        ;; GOLD-C-h instead.
+        (edt-bind-standard-key "\C-h" 'edt-beginning-of-line t)
+        (edt-bind-standard-key "\C-i" 'edt-tab-insert t)
+        (edt-bind-standard-key "\C-j" 'edt-delete-to-beginning-of-word t)
+        (edt-bind-standard-key "\C-k" 'edt-define-key t)
+        (edt-bind-gold-key  "\C-k" 'edt-restore-key t)
+        (edt-bind-standard-key "\C-l" 'edt-form-feed-insert t)
+        ;; Leave binding of C-m to newline.
+        (edt-bind-standard-key "\C-n" 'edt-set-screen-width-80 t)
+        (edt-bind-standard-key "\C-o" 'edt-key-not-assigned t)
+        (edt-bind-standard-key "\C-p" 'edt-key-not-assigned t)
+        (edt-bind-standard-key "\C-q" 'edt-key-not-assigned t)
+        ;; Leave binding of C-r to isearch-backward.
+        ;; Leave binding of C-s to isearch-forward.
+        (edt-bind-standard-key "\C-t" 'edt-display-the-time t)
+        (edt-bind-standard-key "\C-u" 'edt-delete-to-beginning-of-line t)
+        (edt-bind-standard-key "\C-v" 'redraw-display t)
+        (edt-bind-standard-key "\C-w" 'edt-set-screen-width-132 t)
+        ;; Leave binding of C-x as original prefix key.
+        (edt-bind-standard-key "\C-y" 'edt-key-not-assigned t)
+;        (edt-bind-standard-key "\C-z" 'suspend-emacs t)
+        )
+      )
+
+  ;; GOLD bindings for a few Control keys.
+  (edt-bind-gold-key  "\C-g" 'keyboard-quit t); Just in case.
+  (edt-bind-gold-key  "\C-h" 'help-for-help t)
+  (edt-bind-gold-key  [f1] 'help-for-help t)
+  (edt-bind-gold-key  [help] 'help-for-help t)
+  (edt-bind-gold-key  "\C-\\" 'split-window-vertically t)
 
-; GOLD letter combinations:
-(define-key GOLD-map "b" 'buffer-menu)                  ; "b"
-(define-key GOLD-map "B" 'buffer-menu)                  ; "B"
-(define-key GOLD-map "d" 'delete-window)                ; "d"
-(define-key GOLD-map "D" 'delete-window)                ; "D"
-(define-key GOLD-map "e" 'compile)                      ; "e"
-(define-key GOLD-map "E" 'compile)                      ; "E"
-(define-key GOLD-map "i" 'insert-file)                  ; "i"
-(define-key GOLD-map "I" 'insert-file)                  ; "I"
-(define-key GOLD-map "l" 'goto-line)                    ; "l"
-(define-key GOLD-map "L" 'goto-line)                    ; "L"
-(define-key GOLD-map "m" 'save-some-buffers)		; "m"
-(define-key GOLD-map "M" 'save-some-buffers)		; "m"
-(define-key GOLD-map "n" 'next-error)                           ; "n"
-(define-key GOLD-map "N" 'next-error)                           ; "N"
-(define-key GOLD-map "o" 'switch-to-buffer-other-window)        ; "o"
-(define-key GOLD-map "O" 'switch-to-buffer-other-window)        ; "O"
-(define-key GOLD-map "r" 'revert-file)                          ; "r"
-(define-key GOLD-map "r" 'revert-file)                          ; "R"
-(define-key GOLD-map "s" 'save-buffer)                          ; "s"
-(define-key GOLD-map "S" 'save-buffer)                          ; "S"
-(define-key GOLD-map "v" 'find-file-other-window)               ; "v"
-(define-key GOLD-map "V" 'find-file-other-window)               ; "V"
-(define-key GOLD-map "w" 'write-file)                           ; "w"
-(define-key GOLD-map "w" 'write-file)                           ; "W"
-;(define-key GOLD-map "z" 'shrink-window)                 ; "z"
-;(define-key GOLD-map "Z" 'shrink-window)                 ; "z"
+  ;; GOLD bindings for regular keys.
+  (edt-bind-gold-key "a" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "A" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "b" 'buffer-menu t)
+  (edt-bind-gold-key "B" 'buffer-menu t)
+  (edt-bind-gold-key "c" 'compile t)
+  (edt-bind-gold-key "C" 'compile t)
+  (edt-bind-gold-key "d" 'delete-window t)
+  (edt-bind-gold-key "D" 'delete-window t)
+  (edt-bind-gold-key "e" 'edt-exit t)
+  (edt-bind-gold-key "E" 'edt-exit t)
+  (edt-bind-gold-key "f" 'find-file t)
+  (edt-bind-gold-key "F" 'find-file t)
+  (edt-bind-gold-key "g" 'find-file-other-window t)
+  (edt-bind-gold-key "G" 'find-file-other-window t)
+  (edt-bind-gold-key "h" 'edt-electric-keypad-help t)
+  (edt-bind-gold-key "H" 'edt-electric-keypad-help t)
+  (edt-bind-gold-key "i" 'insert-file t)
+  (edt-bind-gold-key "I" 'insert-file t)
+  (edt-bind-gold-key "j" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "J" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "k" 'edt-toggle-capitalization-of-word t)
+  (edt-bind-gold-key "K" 'edt-toggle-capitalization-of-word t)
+  (edt-bind-gold-key "l" 'edt-lowercase t)
+  (edt-bind-gold-key "L" 'edt-lowercase t)
+  (edt-bind-gold-key "m" 'save-some-buffers t)
+  (edt-bind-gold-key "M" 'save-some-buffers t)
+  (edt-bind-gold-key "n" 'next-error t)
+  (edt-bind-gold-key "N" 'next-error t)
+  (edt-bind-gold-key "o" 'switch-to-buffer-other-window t)
+  (edt-bind-gold-key "O" 'switch-to-buffer-other-window t)
+  (edt-bind-gold-key "p" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "P" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "q" 'edt-quit t)
+  (edt-bind-gold-key "Q" 'edt-quit t)
+  (edt-bind-gold-key "r" 'revert-buffer t)
+  (edt-bind-gold-key "R" 'revert-buffer t)
+  (edt-bind-gold-key "s" 'save-buffer t)
+  (edt-bind-gold-key "S" 'save-buffer t)
+  (edt-bind-gold-key "t" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "T" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "u" 'edt-uppercase t)
+  (edt-bind-gold-key "U" 'edt-uppercase t)
+  (edt-bind-gold-key "v" 'find-file-other-window t)
+  (edt-bind-gold-key "V" 'find-file-other-window t)
+  (edt-bind-gold-key "w" 'write-file t)
+  (edt-bind-gold-key "W" 'write-file t)
+  (edt-bind-gold-key "x" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "X" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "y" 'edt-emulation-off t)
+  (edt-bind-gold-key "Y" 'edt-emulation-off t)
+  (edt-bind-gold-key "z" 'edt-switch-global-maps t)
+  (edt-bind-gold-key "Z" 'edt-switch-global-maps t)
+  (edt-bind-gold-key "1" 'delete-other-windows t)
+  (edt-bind-gold-key "!" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "2" 'edt-split-window t)
+  (edt-bind-gold-key "@" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "3" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "#" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "4" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "$" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "5" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "%" 'edt-goto-percentage t)
+  (edt-bind-gold-key "6" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "^" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "7" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "&" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "8" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "*" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "9" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "(" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "0" 'edt-key-not-assigned t)
+  (edt-bind-gold-key ")" 'edt-key-not-assigned t)
+  (edt-bind-gold-key " " 'undo t)
+  (edt-bind-gold-key "," 'edt-key-not-assigned t)
+  (edt-bind-gold-key "<" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "." 'edt-key-not-assigned t)
+  (edt-bind-gold-key ">" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "/" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "?" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "\\" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "|" 'edt-key-not-assigned t)
+  (edt-bind-gold-key ";" 'edt-key-not-assigned t)
+  (edt-bind-gold-key ":" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "'" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "\"" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "-" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "_" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "=" 'goto-line t)
+  (edt-bind-gold-key "+" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "[" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "{" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "]" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "}" 'edt-key-not-assigned t)
+  (edt-bind-gold-key "`" 'what-line t)
+  (edt-bind-gold-key "~" 'edt-key-not-assigned t)
+)
+
+;;;
+;;; DEFAULT EDT KEYPAD HELP
+;;;
+
+;;;
+;;; Upper case commands in the keypad diagram below indicate that the
+;;; emulation should look and feel very much like EDT.  Lower case
+;;; commands are enhancements and/or additions to the EDT keypad
+;;; commands or are native Emacs commands.
+;;;
+
+(defun edt-keypad-help ()
+  "
+                              DEFAULT EDT Keypad Active
 
-;Bind GOLD/Keypad keys
-(defun edt-bind-gold-keypad ()
-  (define-keypad-key GOLD-map ?u 'edt-line-to-top-of-window) ;"up-arrow"
-  (define-keypad-key GOLD-map ?d 'edt-line-to-bottom-of-window) ;"down-arrow"
-  (define-keypad-key GOLD-map ?l 'backward-sentence) ;"left-arrow"
-  (define-keypad-key GOLD-map ?r 'forward-sentence) ;"right-arrow"
-  (define-keypad-key GOLD-map ?\C-a 'mark-section-wisely) ;Gold     "PF1"
-  (define-keypad-key GOLD-map ?\C-b 'describe-function)	;Help     "PF2"
-  (define-keypad-key GOLD-map ?\C-c 'occur) ;Find     "PF3"
-  (define-keypad-key GOLD-map ?\C-d 'undelete-lines) ;Und Line "PF4"
-  (define-keypad-key GOLD-map ?0 'open-line) ;Open L   "0"
-  (define-keypad-key GOLD-map ?1 'case-flip-character) ;Chgcase  "1"
-  (define-keypad-key GOLD-map ?2 'delete-to-eol) ;Del EOL  "2"
-  (define-keypad-key GOLD-map ?3 'copy-region-as-kill) ;Copy     "3"
-  (define-keypad-key GOLD-map ?4 'move-to-end) ;Bottom   "4"
-  (define-keypad-key GOLD-map ?5 'move-to-beginning) ;Top      "5"
-  (define-keypad-key GOLD-map ?6 'yank)	;Paste    "6"
-  (define-keypad-key GOLD-map ?7 'execute-extended-command) ;Command  "7"
-  (define-keypad-key GOLD-map ?8 'indent-or-fill-region) ;Fill     "8"
-  (define-keypad-key GOLD-map ?9 'replace-regexp) ;Replace  "9"
-  (define-keypad-key GOLD-map ?- 'undelete-words) ;UND word "-"
-  (define-keypad-key GOLD-map ?, 'undelete-chars) ;UND Char ","
-  (define-keypad-key GOLD-map ?. 'redraw-display) ;Reset Window "."
-  (define-keypad-key GOLD-map ?e 'shell-command)) ;"ENTER"
+   F7: Copy Rectangle             +----------+----------+----------+----------+
+   F8: Cut Rect Overstrike        |Prev Line |Next Line |Bkwd Char |Frwd Char |
+ G-F8: Paste Rect Overstrike      |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
+   F9: Cut Rect Insert            |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
+ G-F9: Paste Rect Insert          +----------+----------+----------+----------+
+  F10: Cut Rectangle
+G-F10: Paste Rectangle
+  F11: ESC                       
+  F12: Begining of Line           +----------+----------+----------+----------+
+G-F12: Delete Other Windows       |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
+  F13: Delete to Begin of Word    |   (PF1)  |   (PF2)  |   (PF3)  |  (PF4)   |
+ HELP: Keypad Help                |Mark Wisel|Desc Funct|   FIND   |  UND L   |
+   DO: Execute extended command   +----------+----------+----------+----------+
+                                  |   PAGE   |   SECT   |  APPEND  |  DEL W   |
+  C-g: Keyboard Quit              |    (7)   |    (8)   |    (9)   |   (-)    |
+G-C-g: Keyboard Quit              |Ex Ext Cmd|Fill Regio| REPLACE  |  UND W   |
+  C-h: Beginning of Line          +----------+----------+----------+----------+
+G-C-h: Emacs Help                 |  ADVANCE |  BACKUP  |   CUT    |  DEL C   |
+  C-i: Tab Insert                 |    (4)   |    (5)   |    (6)   |   (,)    |
+  C-j: Delete to Begin of Word    |   BOTTOM |    TOP   |   Yank   |  UND C   |
+  C-k: Define Key                 +----------+----------+----------+----------+
+G-C-k: Restore Key                |   WORD   |    EOL   |   CHAR   |   Next   |
+  C-l: Form Feed Insert           |    (1)   |    (2)   |    (3)   |  Window  |
+  C-n: Set Screen Width 80        | CHNGCASE |  DEL EOL |Quoted Ins|          !
+  C-r: Isearch Backward           +---------------------+----------+  (ENTER) |
+  C-s: Isearch Forward            |         LINE        |  SELECT  |          !
+  C-t: Display the Time           |         (0)         |    (.)   |   Query  |
+  C-u: Delete to Begin of Line    |      Open Line      |   RESET  |  Replace |
+  C-v: Redraw Display             +---------------------+----------+----------+
+  C-w: Set Screen Width 132       
+  C-z: Suspend Emacs                    +----------+----------+----------+
+G-C-\\: Split Window                     |  FNDNXT  |   Yank   |   CUT    |
+                                        |  (FIND)  | (INSERT) | (REMOVE) |
+  G-b: Buffer Menu                      |   FIND   |          |   COPY   |
+  G-c: Compile                          +----------+----------+----------+
+  G-d: Delete Window                    |SELECT/RES|SECT BACKW|SECT FORWA|
+  G-e: Exit                             | (SELECT) |(PREVIOUS)|  (NEXT)  |
+  G-f: Find File                        |          |          |          |
+  G-g: Find File Other Window           +----------+----------+----------+
+  G-h: Keypad Help             
+  G-i: Insert File                
+  G-k: Toggle Capitalization Word 
+  G-l: Downcase Region             
+  G-m: Save Some Buffers           
+  G-n: Next Error                  
+  G-o: Switch to Next Window
+  G-q: Quit                                                           
+  G-r: Revert File                                                    
+  G-s: Save Buffer                                                    
+  G-u: Upcase Region                                                  
+  G-v: Find File Other Window                                        
+  G-w: Write file                                                  
+  G-y: EDT Emulation OFF          
+  G-z: Switch to User EDT Key Bindings
+  G-1: Delete Other Windows       
+  G-2: Split Window               
+  G-%: Go to Percentage           
+  G- : Undo  (GOLD Spacebar)      
+  G-=: Go to Line                 
+  G-`: What line"
+
+  (interactive)
+  (describe-function 'edt-keypad-help))
 
-;; Make direction of motion show in mode line
-;; while EDT emulation is turned on.
-;; Note that the keypad is always turned on when in Emacs.
+(defun edt-electric-helpify (fun)
+  (let ((name "*Help*"))
+    (if (save-window-excursion
+          (let* ((p (symbol-function 'print-help-return-message))
+                 (b (get-buffer name))
+                 (m (buffer-modified-p b)))
+            (and b (not (get-buffer-window b))
+                 (setq b nil))
+            (unwind-protect
+                (progn
+                  (message "%s..." (capitalize (symbol-name fun)))
+                  (and b
+                       (save-excursion
+                         (set-buffer b)
+                         (set-buffer-modified-p t)))
+                  (fset 'print-help-return-message 'ignore)
+                  (call-interactively fun)
+                  (and (get-buffer name)
+                       (get-buffer-window (get-buffer name))
+                       (or (not b)
+                           (not (eq b (get-buffer name)))
+                           (not (buffer-modified-p b)))))
+              (fset 'print-help-return-message p)
+              (and b (buffer-name b)
+                   (save-excursion
+                     (set-buffer b)
+                     (set-buffer-modified-p m))))))
+        (with-electric-help 'delete-other-windows name t))))
 
-(or (assq 'edt-direction-string minor-mode-alist)
-    (setq minor-mode-alist (cons '(edt-direction-string edt-direction-string)
-				 minor-mode-alist)))
+(defun edt-electric-keypad-help ()
+  "Display default EDT bindings."
+  (interactive)
+  (edt-electric-helpify 'edt-keypad-help))
+
+(defun edt-electric-user-keypad-help ()
+  "Display user custom EDT bindings."
+  (interactive)
+  (edt-electric-helpify 'edt-user-keypad-help))
+
+;;;
+;;; EDT emulation screen width commands.
+;;;
+;; Some terminals require modification of terminal attributes when changing the
+;; number of columns displayed, hence the fboundp tests below.  These functions
+;; are defined in the corresponding terminal specific file, if needed.
+
+(defun edt-set-screen-width-80 ()
+  "Set screen width to 80 columns."
+  (interactive)
+  (if (fboundp 'edt-set-term-width-80)
+      (edt-set-term-width-80))
+  (set-screen-width 80)
+  (message "Screen width 80"))
+
+(defun edt-set-screen-width-132 ()
+  "Set screen width to 132 columns."
+  (interactive)
+  (if (fboundp 'edt-set-term-width-132)
+      (edt-set-term-width-132))
+  (set-screen-width 132)
+  (message "Screen width 132"))
+
+(provide 'edt)
+
+;;; edt.el ends here
--- a/lisp/emulators/mlconvert.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/mlconvert.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,8 +1,10 @@
 ;;; mlconvert.el --- convert buffer of Mocklisp code to real lisp.
-;; Keywords: emulations
 
 ;; Copyright (C) 1985 Free Software Foundation, Inc.
 
+;; Maintainer: FSF
+;; Keywords: emulations
+
 ;; This file is part of XEmacs.
 
 ;; XEmacs is free software; you can redistribute it and/or modify it
@@ -17,7 +19,18 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
+
+;;; Commentary:
+
+;; This package converts Mocklisp code written under a Gosling or UniPress
+;; Emacs for use with GNU Emacs.  The translated code will require runtime
+;; support from the mlsupport.el equivalent.
+
+;;; Code:
 
 ;;;###autoload
 (defun convert-mocklisp-buffer ()
@@ -100,19 +113,19 @@
 		       (if (looking-at "setq[ \t\n]+buffer-modified-p")
 			   (replace-match "set-buffer-modified-p"))))
 
-(ml-expansion 'while '(lambda ()
-			 (let ((end (progn (forward-sexp 2) (point-marker)))
-			       (start (progn (forward-sexp -1) (point))))
-			   (let ((cond (buffer-substring start end)))
-			     (cond ((equal cond "1")
-				    (delete-region (point) end)
-				    (insert "t"))
-				   (t
-				    (insert "(not (zerop ")
-				    (goto-char end)
-				    (insert "))")))
-			     (set-marker end nil)
-			     (goto-char start)))))
+;;(ml-expansion 'while '(lambda ()
+;;			 (let ((end (progn (forward-sexp 2) (point-marker)))
+;;			       (start (progn (forward-sexp -1) (point))))
+;;			   (let ((cond (buffer-substring start end)))
+;;			     (cond ((equal cond "1")
+;;				    (delete-region (point) end)
+;;				    (insert "t"))
+;;				   (t
+;;				    (insert "(not (zerop ")
+;;				    (goto-char end)
+;;				    (insert "))")))
+;;			     (set-marker end nil)
+;;			     (goto-char start)))))
 
 (ml-expansion 'arg "ml-arg")
 (ml-expansion 'nargs "ml-nargs")
@@ -184,6 +197,7 @@
 (ml-expansion 'get-tty-no-blanks-input "read-no-blanks-input")
 (ml-expansion 'get-tty-key "read-key")
 
+(ml-expansion 'concat "ml-concat")
 (ml-expansion 'c= "char-equal")
 (ml-expansion 'goto-character "goto-char")
 (ml-expansion 'substr "ml-substr")
@@ -273,3 +287,4 @@
 
 ;Variable pause-writes-files
 
+;;; mlconvert.el ends here
--- a/lisp/emulators/mlsupport.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/mlsupport.el	Mon Aug 13 09:03:46 2007 +0200
@@ -19,16 +19,17 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
 ;; This package provides equivalents of certain primitives from Gosling
 ;; Emacs (including the commercial UniPress versions).  These have an
 ;; ml- prefix to distinguish them from native GNU Emacs functions with
-;; similar names.  The oackage mlconvert.el translates Mocklisp code
+;; similar names.  The package mlconvert.el translates Mocklisp code
 ;; to use these names.
 
 ;;; Code:
@@ -70,6 +71,10 @@
 (defun define-keymap (name)
   (fset (intern name) (make-keymap)))
 
+;; Make it work to use ml-use-...-map on "esc" and such.
+(fset 'esc-map esc-map)
+(fset 'ctl-x-map ctl-x-map)
+
 (defun ml-use-local-map (name)
   (use-local-map (intern (concat name "-map"))))
 
@@ -238,12 +243,14 @@
 	(define-abbrev-table symbol nil))
     (symbol-value symbol)))
 
+;; XEmacs
 (defun define-hooked-local-abbrev (name exp hook)
   (define-abbrev (or local-abbrev-table
                      (error "Major mode has no abbrev table"))
     (downcase name)
     exp (intern hook)))
 
+;; XEmacs
 (defun define-hooked-global-abbrev (name exp hook)
   (define-abbrev global-abbrev-table (downcase name)
     exp (intern hook)))
@@ -336,6 +343,7 @@
 (defvar use-csh-option-f 1
   "Mocklisp compatibility variable; 1 means pass -f when calling csh.")
 
+;; XEmacs (FSF bugfix? -sb)
 (defun filter-region (command)
   (let* ((shell (if (/= use-users-shell 0) shell-file-name "/bin/sh"))
 	 (csh (equal (file-name-nondirectory shell) "csh")))
@@ -343,6 +351,7 @@
 			 (if (and csh use-csh-option-f) "-cf" "-c")
 			 (concat "exec " command))))
 
+;; XEmacs (FSF bugfix? -sb)
 (defun execute-monitor-command (command)
   (let* ((shell (if (/= use-users-shell 0) shell-file-name "/bin/sh"))
 	 (csh (equal (file-name-nondirectory shell) "csh")))
@@ -436,7 +445,7 @@
     (if (< to 0) (setq to (+ to length)))
     (substring string from (+ from to))))
 
-
+;; XEmacs
 (defun ml-nargs ()
   "Number of arguments to currently executing mocklisp function."
   (if (eq mocklisp-arguments 'interactive)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/emulators/scroll-lock.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,137 @@
+;; @(#) scroll-lock.el -- scroll-locking minor mode
+
+;; Authors:
+;;    Gary D. Foster <Gary.Foster@corp.sun.com>
+;; with contributions/suggestions/ideas from:
+;;    Rick Macdonald <rickm@vsl.com>
+;;    Anders Lindgren <andersl@csd.uu.se>
+;; $Revision: 1.1.1.1 $
+;; Keywords: scroll crisp brief lock
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;; Commentary
+;;    This mode allows multiple buffers to be 'locked' so that scrolling
+;;    up or down lines in any buffer causes all the buffers to mirror
+;;    the scrolling.  It hooks into the post-command-hook to check for
+;;    potential scrolling commands and if we're locked, mirrors them in all
+;;    windows.	This allows us to grab line-at-a-time scrolling as well as
+;;    screen-at-a-time scrolling, and doesn't remap any of the keyboard
+;;    commands to do it.
+
+;; This minor mode is normally autoloaded from the scroll-lock package.
+;; You can disable autoloading of this package by placing
+;; (setq crisp-load-scroll-lock nil) in your .emacs before loading
+;; the crisp package.  If you want to use this package by itself,
+;; you can enable it by placing the following in your .emacs:
+
+;; (require 'scroll-lock)
+
+;; In the first (autoloaded) case, meta-f1 is bound to the command to
+;; toggle the scroll-lock mode.  In the second (non-autoloaded) case,
+;; you can enable and disable it with the 'scroll-lock-mode' command.
+
+(defvar scroll-lock-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
+
+(defvar scroll-lock-modeline-string " *SL*"
+  "String to display in the modeline when Scroll Lock mode is enabled.")
+
+(defvar scroll-lock-is-locked nil
+  "Track status of scroll locking.")
+(if scroll-lock-running-xemacs
+    (add-minor-mode 'scroll-lock-is-locked scroll-lock-modeline-string)
+  (or (assq 'scroll-lock-is-locked minor-mode-alist)
+      (setq minor-mode-alist
+	    (cons '(scroll-lock-is-locked scroll-lock-modeline-string) minor-mode-alist))))
+
+(defun scroll-lock-scroll-down-all (arg)
+  "Scroll-down all visible windows."
+  (interactive "P")
+  (let ((num-windows (count-windows))
+	(count 1))
+    (if (> num-windows 1)
+	( progn (other-window 1)
+		(while (< count num-windows)
+		  (if (not (eq (point) (point-max)))
+		      (progn (call-interactively 'next-line)))
+		  (other-window 1)
+		  (setq count (1+ count)))))))
+
+(defun scroll-lock-scroll-up-all (arg)
+  "Scroll-up all visible windows."
+  (interactive "P")
+  (let ((num-windows (count-windows))
+	(count 1))
+    (if (> num-windows 1)
+	( progn (other-window 1)
+		(while (< count num-windows)
+		  (if (not (eq (point) (point-min)))
+		      (progn (call-interactively 'previous-line)))
+		  (other-window 1)
+		  (setq count (1+ count)))))))
+
+(defun scroll-lock-page-down-all (arg)
+  "Page-down all visible windows."
+  (interactive "P")
+  (let ((num-windows (count-windows))
+	(count 1))
+    (if (> num-windows 1)
+	(progn (other-window 1)
+	       (while (< count num-windows)
+		 (call-interactively 'fkey-scroll-up)
+		 (other-window 1)
+		 (setq count (1+ count)))))))
+
+(defun scroll-lock-page-up-all (arg)
+  "Page-up all visible windows."
+  (interactive "P")
+  (let ((num-windows (count-windows))
+	(count 1))
+    (if (> num-windows 1)
+	(progn (other-window 1)
+	       (while (< count num-windows)
+		 (call-interactively 'fkey-scroll-down)
+		 (other-window 1)
+		 (setq count (1+ count)))))))
+
+
+(defun scroll-lock-check-to-scroll ()
+  "Check last-command to see if a scroll was done."
+  (if (eq this-command 'next-line)
+      (call-interactively 'scroll-lock-scroll-down-all))
+  (if (eq this-command 'previous-line)
+      (call-interactively 'scroll-lock-scroll-up-all))
+  (if (eq this-command 'fkey-scroll-up)
+      (call-interactively 'scroll-lock-page-down-all))
+  (if (eq this-command 'fkey-scroll-down)
+      (call-interactively 'scroll-lock-page-up-all)))
+
+
+(defun scroll-lock-mode (arg)
+  "Toggle scroll-lock minor mode."
+  (interactive "P")
+  (setq scroll-lock-is-locked (not scroll-lock-is-locked))
+  (cond
+   ((eq scroll-lock-is-locked 't)
+    (add-hook 'post-command-hook 'scroll-lock-check-to-scroll))
+   ((eq scroll-lock-is-locked 'nil)
+    (remove-hook 'post-command-hook 'scroll-lock-check-to-scroll))))
+
+(provide 'scroll-lock)
+
+;;; scroll-lock.el ends here
--- a/lisp/emulators/teco.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/teco.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,29 @@
 ;;; teco.el --- Teco interpreter for Gnu Emacs, version 1.
 
-(require 'backquote)
+;; Author: Dale R. Worley.
+;; Keywords: emulators
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
 ;; This code has been tested some, but no doubt contains a zillion bugs.
 ;; You have been warned.
 
@@ -168,6 +191,9 @@
 ;;	DEL	Delete last character typed in
 
 
+;;; Code:
+(require 'backquote)
+
 ;; set a range of elements of an array to a value
 (defun teco-set-elements (array start end value)
   (let ((i start))
--- a/lisp/emulators/tpu-edt.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/tpu-edt.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,36 +1,281 @@
-;; Copyright (C) 1993 Free Software Foundation, Inc.
+;;; tpu-edt.el --- Emacs emulating TPU emulating EDT
+
+;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
-;; Version: 3.2
+;; Version: 4.2
 ;; Keywords: emulations
 
-;; Patched for XEmacs support of zmacs regions by:
-;; R. Kevin Oberman <oberman@es.net>
+;; This file is part of XEmacs.
 
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
+;; 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; 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
+
+;; TPU-edt is based on tpu.el by Jeff Kowalski and Bob Covey.
+
+;;; Commentary:
+
+;; %% TPU-edt -- Emacs emulating TPU emulating EDT
+
+;; %% Contents
+
+;;  % Introduction
+;;  % Differences Between TPU-edt and DEC TPU/edt
+;;  % Starting TPU-edt
+;;  % Customizing TPU-edt using the Emacs Initialization File
+;;  % Regular Expressions in TPU-edt
+
+
+;; %% Introduction
+
+;;    TPU-edt emulates the popular DEC VMS editor EDT (actually, it emulates
+;;    DEC TPU's EDT emulation, hence the name TPU-edt).  TPU-edt features the
+;;    following TPU/edt functionality:
+
+;;     .  EDT keypad
+;;     .  On-line help
+;;     .  Repeat counts
+;;     .  Scroll margins
+;;     .  Learn sequences
+;;     .  Free cursor mode
+;;     .  Rectangular cut and paste
+;;     .  Multiple windows and buffers
+;;     .  TPU line-mode REPLACE command
+;;     .  Wild card search and substitution
+;;     .  Configurable through an initialization file
+;;     .  History recall of search strings, file names, and commands
+
+;;    Please note that TPU-edt does NOT emulate TPU.  It emulates TPU's EDT
+;;    emulation.  Very few TPU line-mode commands are supported.
+
+;;    TPU-edt, like it's VMS cousin, works on VT-series terminals with DEC
+;;    style keyboards.  VT terminal emulators, including xterm with the
+;;    appropriate key translations, work just fine too.
+
+;;    TPU-edt works with X-windows.  This is accomplished through a TPU-edt X
+;;    key map.  The TPU-edt module tpu-mapper creates this map and stores it
+;;    in a file.  Tpu-mapper will be run automatically the first time you
+;;    invoke the X-windows version of emacs, or you can run it by hand.  See
+;;    the commentary in tpu-mapper.el for details.
+
+
+;; %% Differences Between TPU-edt and DEC TPU/edt
+
+;;    In some cases, Emacs doesn't support text highlighting, so selected
+;;    regions are not shown in inverse video.  Emacs uses the concept of "the
+;;    mark".  The mark is set at one end of a selected region; the cursor is
+;;    at the other.  The letter "M" appears in the mode line when the mark is
+;;    set.  The native emacs command ^X^X (Control-X twice) exchanges the
+;;    cursor with the mark; this provides a handy way to find the location of
+;;    the mark.
+
+;;    In TPU the cursor can be either bound or free.  Bound means the cursor
+;;    cannot wander outside the text of the file being edited.  Free means
+;;    the arrow keys can move the cursor past the ends of lines.  Free is the
+;;    default mode in TPU; bound is the only mode in EDT.  Bound is the only
+;;    mode in the base version of TPU-edt; optional extensions add an
+;;    approximation of free mode, see the commentary in tpu-extras.el for
+;;    details.
+
+;;    Like TPU, emacs uses multiple buffers.  Some buffers are used to hold
+;;    files you are editing; other "internal" buffers are used for emacs' own
+;;    purposes (like showing you help).  Here are some commands for dealing
+;;    with buffers.
+
+;;       Gold-B   moves to next buffer, including internal buffers
+;;       Gold-N   moves to next buffer containing a file
+;;       Gold-M   brings up a buffer menu (like TPU "show buffers")
+
+;;    Emacs is very fond of throwing up new windows.  Dealing with all these
+;;    windows can be a little confusing at first, so here are a few commands
+;;    to that may help:
+
+;;       Gold-Next_Scr  moves to the next window on the screen
+;;       Gold-Prev_Scr  moves to the previous window on the screen
+;;       Gold-TAB       also moves to the next window on the screen
+
+;;       Control-x 1    deletes all but the current window
+;;       Control-x 0    deletes the current window
+
+;;    Note that the buffers associated with deleted windows still exist!
+
+;;    Like TPU, TPU-edt has a "command" function, invoked with Gold-KP7 or
+;;    Do.  Most of the commands available are emacs commands.  Some TPU
+;;    commands are available, they are: replace, exit, quit, include, and
+;;    Get (unfortunately, "get" is an internal emacs function, so we are
+;;    stuck with "Get" - to make life easier, Get is available as Gold-g).
+
+;;    TPU-edt supports the recall of commands, file names, and search
+;;    strings.  The history of strings recalled differs slightly from
+;;    TPU/edt, but it is still very convenient.
+
+;;    Help is available!  The traditional help keys (Help and PF2) display
+;;    a small help file showing the default keypad layout, control key
+;;    functions, and Gold key functions.  Pressing any key inside of help
+;;    splits the screen and prints a description of the function of the
+;;    pressed key.  Gold-PF2 invokes the native emacs help, with it's
+;;    zillions of options.
+
+;;    Thanks to emacs, TPU-edt has some extensions that may make your life
+;;    easier, or at least more interesting.  For example, Gold-r toggles
+;;    TPU-edt rectangular mode.  In rectangular mode, Remove and Insert work
+;;    on rectangles.  Likewise, Gold-* toggles TPU-edt regular expression
+;;    mode.  In regular expression mode Find, Find Next, and the line-mode
+;;    replace command work with regular expressions.  [A regular expression
+;;    is a pattern that denotes a set of strings; like VMS wildcards.]
+
+;;    Emacs also gives TPU-edt the undo and occur functions.  Undo does
+;;    what it says; it undoes the last change.  Multiple undos in a row
+;;    undo multiple changes.  For your convenience, undo is available on
+;;    Gold-u.  Occur shows all the lines containing a specific string in
+;;    another window.  Moving to that window, and typing ^C^C (Control-C
+;;    twice) on a particular line moves you back to the original window
+;;    at that line.  Occur is on Gold-o.
+
+;;    Finally, as you edit, remember that all the power of emacs is at
+;;    your disposal.  It really is a fantastic tool.  You may even want to
+;;    take some time and read the emacs tutorial; perhaps not to learn the
+;;    native emacs key bindings, but to get a feel for all the things
+;;    emacs can do for you.  The emacs tutorial is available from the
+;;    emacs help function: "Gold-PF2 t"
+
+
+;; %% Starting TPU-edt
+
+;;    All you have to do to start TPU-edt, is turn it on.  This can be
+;;    done from the command line when running emacs.
+
+;;        prompt> emacs -f tpu-edt
+
+;;    If you've already started emacs, turn on TPU-edt using the tpu-edt
+;;    command.  First press `M-x' (that's usually `ESC' followed by `x')
+;;    and type `tpu-edt' followed by a carriage return.
+
+;;    If you like TPU-edt and want to use it all the time, you can start
+;;    TPU-edt using the emacs initialization file, .emacs.  Simply create
+;;    a .emacs file in your home directory containing the line:
+
+;;        (tpu-edt)
+
+;;    That's all you need to do to start TPU-edt.
+
+
+;; %% Customizing TPU-edt using the Emacs Initialization File
+
+;;    The following is a sample emacs initialization file.  It shows how to
+;;    invoke TPU-edt, and how to customize it.
+
+;;    ; .emacs - a sample emacs initialization file
+
+;;    ; Turn on TPU-edt
+;;    (tpu-edt)
+
+;;    ; Set scroll margins 10% (top) and 15% (bottom).
+;;    (tpu-set-scroll-margins "10%" "15%")       
+
+;;    ; Load the vtxxx terminal control functions.
+;;    (load "vt-control" t)
+
+;;    ; TPU-edt treats words like EDT; here's how to add word separators.
+;;    ; Note that backslash (\) and double quote (") are quoted with '\'.
+;;    (tpu-add-word-separators "]\\[-_,.\"=+()'/*#:!&;$")
+
+;;    ; Emacs is happy to save files without a final newline; other Unix
+;;    ; programs hate that!  Here we make sure that files end with newlines.
+;;    (setq require-final-newline t)
+
+;;    ; Emacs uses Control-s and Control-q.  Problems can occur when using
+;;    ; emacs on terminals that use these codes for flow control (Xon/Xoff
+;;    ; flow control).  These lines disable emacs' use of these characters.
+;;    (global-unset-key "\C-s")
+;;    (global-unset-key "\C-q")
+
+;;    ; The emacs universal-argument function is very useful.
+;;    ; This line maps universal-argument to Gold-PF1.
+;;    (define-key GOLD-SS3-map "P" 'universal-argument)          ; Gold-PF1
+
+;;    ; Make KP7 move by paragraphs, instead of pages.
+;;    (define-key SS3-map "w" 'tpu-paragraph)                    ; KP7
+
+;;    ; Repeat the preceding mappings for X-windows.
+;;    (cond
+;;     (window-system
+;;      (global-set-key [kp_7] 'tpu-paragraph)                   ; KP7
+;;      (define-key GOLD-map [kp_f1] 'universal-argument)))      ; GOLD-PF1
+
+;;    ; Display the TPU-edt version.
+;;    (tpu-version)
+
+
+;; %% Regular Expressions in TPU-edt
+
+;;    Gold-* toggles TPU-edt regular expression mode.  In regular expression
+;;    mode, find, find next, replace, and substitute accept emacs regular
+;;    expressions.  A complete list of emacs regular expressions can be found
+;;    using the emacs "info" command (it's somewhat like the VMS help
+;;    command).  Try the following sequence of commands:
+
+;;        DO info             <enter info mode>
+;;        m emacs             <select the "emacs" topic>
+;;        m regexs            <select the "regular expression" topic>
+
+;;    Type "q" to quit out of info mode.
+
+;;    There is a problem in regular expression mode when searching for empty
+;;    strings, like beginning-of-line (^) and end-of-line ($).  When searching
+;;    for these strings, find-next may find the current string, instead of the
+;;    next one.  This can cause global replace and substitute commands to loop
+;;    forever in the same location.  For this reason, commands like
+
+;;        replace "^" "> "       <add "> " to beginning of line>
+;;        replace "$" "00711"    <add "00711" to end of line>
+
+;;    may not work properly.
+
+;;    Commands like those above are very useful for adding text to the
+;;    beginning or end of lines.  They might work on a line-by-line basis, but
+;;    go into an infinite loop if the "all" response is specified.  If the
+;;    goal is to add a string to the beginning or end of a particular set of
+;;    lines TPU-edt provides functions to do this.
+
+;;        Gold-^  Add a string at BOL in region or buffer
+;;        Gold-$  Add a string at EOL in region or buffer
+
+;;    There is also a TPU-edt interface to the native emacs string replacement
+;;    commands.  Gold-/ invokes this command.  It accepts regular expressions
+;;    if TPU-edt is in regular expression mode.  Given a repeat count, it will
+;;    perform the replacement without prompting for confirmation.
+
+;;    This command replaces empty strings correctly, however, it has its
+;;    drawbacks.  As a native emacs command, it has a different interface
+;;    than the emulated TPU commands.  Also, it works only in the forward
+;;    direction, regardless of the current TPU-edt direction.
+
+;; NOTE: There was a very old tpu-edt in XEmacs 19.14 so I deleted it and
+;;  replaced it with the one in Emacs 19.34. -sb
 
 ;;; Code:
 
 
 ;;;
-;;;  Revision and Version Information
+;;;  Version Information
 ;;;
-(defconst tpu-version "3.2" "TPU-edt version number.")
+(defconst tpu-version "4.2" "TPU-edt version number.")
 
 
 ;;;
@@ -58,17 +303,11 @@
 ;;;     o tpu-update-mode-line  o mode line section
 ;;;
 (defconst tpu-emacs19-p (not (string-lessp emacs-version "19"))
-  "Non-NIL if we are running XEmacs or GNU Emacs version 19.")
-
-(defconst tpu-gnu-emacs18-p (not tpu-emacs19-p)
-  "Non-NIL if we are running GNU Emacs version 18.")
+  "Non-nil if we are running Lucid Emacs or version 19.")
 
-(defconst tpu-xemacs-emacs19-p
-  (and tpu-emacs19-p (string-match "XEmacs" emacs-version))
-  "Non-NIL if we are running XEmacs version 19.")
-
-(defconst tpu-gnu-emacs19-p (and tpu-emacs19-p (not tpu-xemacs-emacs19-p))
-  "Non-NIL if we are running GNU Emacs version 19.")
+(defconst tpu-lucid-emacs19-p
+  (and tpu-emacs19-p (string-match "Lucid" emacs-version))
+  "Non-nil if we are running Lucid Emacs version 19.")
 
 
 ;;;
@@ -83,22 +322,22 @@
 SS3 is DEC's name for the sequence <ESC>O.")
 
 (defvar GOLD-map (make-keymap)
-  "Maps the function keys on the VT100 keyboard preceeded by PF1.
+  "Maps the function keys on the VT100 keyboard preceded by PF1.
 GOLD is the ASCII 7-bit escape sequence <ESC>OP.")
 
 (defvar GOLD-CSI-map (make-sparse-keymap)
-  "Maps the function keys on the VT100 keyboard preceeded by GOLD-CSI.")
+  "Maps the function keys on the VT100 keyboard preceded by GOLD-CSI.")
 
 (defvar GOLD-SS3-map (make-sparse-keymap)
-  "Maps the function keys on the VT100 keyboard preceeded by GOLD-SS3.")
+  "Maps the function keys on the VT100 keyboard preceded by GOLD-SS3.")
 
 (defvar tpu-global-map nil "TPU-edt global keymap.")
 (defvar tpu-original-global-map (copy-keymap global-map)
   "Original global keymap.")
 
-(and tpu-xemacs-emacs19-p
+(and tpu-lucid-emacs19-p
      (defvar minibuffer-local-ns-map (make-sparse-keymap)
-       "Hack to give XEmacs the same maps as GNU emacs."))
+       "Hack to give Lucid Emacs the same maps as ordinary Emacs."))
 
 
 ;;;
@@ -131,7 +370,7 @@
   "True when TPU-edt is operating in the forward direction.")
 (defvar tpu-reverse nil
   "True when TPU-edt is operating in the backward direction.")
-(defvar tpu-control-keys t
+(defvar tpu-control-keys nil
   "If non-nil, control keys are set to perform TPU functions.")
 (defvar tpu-xkeys-file nil
   "File containing TPU-edt X key map.")
@@ -197,8 +436,11 @@
 			     (purecopy "  ")
 			     'tpu-mark-flag
 			     (purecopy " %[(")
-			     'mode-name 'minor-mode-alist "%n" 'mode-line-process
-			     (purecopy ")%]----")
+			     'mode-name 'mode-line-process 'minor-mode-alist
+			     (purecopy "%n")
+			     (purecopy ")%]--")
+			     (purecopy '(line-number-mode "L%l--"))
+			     (purecopy '(column-number-mode "C%c--"))
 			     (purecopy '(-3 . "%p"))
 			     (purecopy "-%-")))
 	 (or (assq 'tpu-newline-and-indent-p minor-mode-alist)
@@ -221,12 +463,12 @@
   (cond (tpu-emacs19-p (force-mode-line-update))
 	(t (set-buffer-modified-p (buffer-modified-p)) (sit-for 0))))
 
-(cond (tpu-gnu-emacs19-p
+(cond (tpu-lucid-emacs19-p
+       (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line)
+       (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line))
+      (tpu-emacs19-p
        (add-hook 'activate-mark-hook 'tpu-update-mode-line)
-       (add-hook 'deactivate-mark-hook 'tpu-update-mode-line))
-      (tpu-xemacs-emacs19-p
-       (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line)
-       (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line)))
+       (add-hook 'deactivate-mark-hook 'tpu-update-mode-line)))
 
 
 ;;;
@@ -281,7 +523,7 @@
 
 (defun tpu-show-match-markers nil
   "Show the values of the match markers."
-  (interactive "_")
+  (interactive)
   (if (markerp tpu-match-beginning-mark)
       (let ((beg (marker-position tpu-match-beginning-mark)))
 	(message "(%s, %s) in %s -- current %s in %s"
@@ -300,17 +542,17 @@
 (defun tpu-mark nil
   "TPU-edt version of the mark function.
 Return the appropriate value of the mark for the current
-version of emacs."
-  (cond (tpu-xemacs-emacs19-p (mark (not zmacs-regions)))
-	(tpu-gnu-emacs19-p (and mark-active (mark (not transient-mark-mode))))
+version of Emacs."
+  (cond (tpu-lucid-emacs19-p (mark (not zmacs-regions)))
+	(tpu-emacs19-p (and mark-active (mark (not transient-mark-mode))))
 	(t (mark))))
 
 (defun tpu-set-mark (pos)
-  "TPU-edt verion of the set-mark function.
-Sets the mark at POS and activates the region acording to the
-current version of emacs."
+  "TPU-edt verion of the `set-mark' function.
+Sets the mark at POS and activates the region according to the
+current version of Emacs."
   (set-mark pos)
-  (and tpu-xemacs-emacs19-p pos (zmacs-activate-region)))
+  (and tpu-lucid-emacs19-p pos (zmacs-activate-region)))
 
 (defun tpu-string-prompt (prompt history-symbol)
   "Read a string with PROMPT."
@@ -323,7 +565,7 @@
 (defun tpu-y-or-n-p (prompt &optional not-yes)
   "Prompt for a y or n answer with positive default.
 Optional second argument NOT-YES changes default to negative.
-Like emacs y-or-n-p, also accepts space as y and DEL as n."
+Like Emacs `y-or-n-p', but also accepts space as y and DEL as n."
   (message "%s[%s]" prompt (if not-yes "n" "y"))
   (let ((doit t))
     (while doit
@@ -364,13 +606,13 @@
 
 (defun tpu-drop-breadcrumb (num)
   "Drops a breadcrumb that can be returned to later with goto-breadcrumb."
-  (interactive "_p")
+  (interactive "p")
   (put tpu-breadcrumb-plist num (list (current-buffer) (point)))
   (message "Mark %d set." num))
 
 (defun tpu-goto-breadcrumb (num)
   "Returns to a breadcrumb set with drop-breadcrumb."
-  (interactive "_p")
+  (interactive "p")
   (cond ((get tpu-breadcrumb-plist num)
 	 (switch-to-buffer (car (get tpu-breadcrumb-plist num)))
 	 (goto-char (tpu-cadr (get tpu-breadcrumb-plist num)))
@@ -385,7 +627,7 @@
 (defun tpu-change-case (num)
   "Change the case of the character under the cursor or region.
 Accepts a prefix argument of the number of characters to invert."
-  (interactive "_p")
+  (interactive "p")
   (cond ((tpu-mark)
 	 (let ((beg (region-beginning)) (end (region-end)))
 	   (while (> end beg)
@@ -413,7 +655,7 @@
 (defun tpu-fill (num)
   "Fill paragraph or marked region.
 With argument, fill and justify."
-  (interactive "_P")
+  (interactive "P")
   (cond ((tpu-mark)
 	 (fill-region (point) (tpu-mark) num)
 	 (tpu-unselect t))
@@ -422,20 +664,20 @@
 
 (defun tpu-version nil
   "Print the TPU-edt version number."
-  (interactive "_")
+  (interactive)
   (message
    "TPU-edt version %s by Rob Riepel (riepel@networking.stanford.edu)"
    tpu-version))
 
 (defun tpu-reset-screen-size (height width)
   "Sets the screen size."
-  (interactive "_nnew screen height: \nnnew screen width: ")
-  (set-screen-height (selected-screen) height)
-  (set-screen-width (selected-screen) width))
+  (interactive "nnew screen height: \nnnew screen width: ")
+  (set-screen-height height)
+  (set-screen-width width))
 
 (defun tpu-toggle-newline-and-indent nil
   "Toggle between 'newline and indent' and 'simple newline'."
-  (interactive "_")
+  (interactive)
   (cond (tpu-newline-and-indent-p
          (setq tpu-newline-and-indent-string "")
          (setq tpu-newline-and-indent-p nil)
@@ -452,7 +694,7 @@
 (defun tpu-spell-check nil
   "Checks the spelling of the region, or of the entire buffer if no
  region is selected."
-  (interactive "_")
+  (interactive)
   (cond (tpu-have-ispell
 	 (if (tpu-mark) (ispell-region (tpu-mark) (point)) (ispell-buffer)))
 	(t
@@ -461,7 +703,7 @@
 
 (defun tpu-toggle-overwrite-mode nil
   "Switches in and out of overwrite mode"
-  (interactive "_")
+  (interactive)
   (cond (overwrite-mode
 	 (tpu-local-set-key "\177" tpu-saved-delete-func)
 	 (overwrite-mode 0))
@@ -473,14 +715,14 @@
 (defun tpu-special-insert (num)
   "Insert a character or control code according to
 its ASCII decimal value."
-  (interactive "_P")
+  (interactive "P")
   (if overwrite-mode (delete-char 1))
   (insert (if num num 0)))
 
 (defun tpu-quoted-insert (num)
   "Read next input character and insert it.
 This is useful for inserting control characters."
-  (interactive "_*p")
+  (interactive "*p")
   (let ((char (read-char)) )
     (if overwrite-mode (delete-char num))
     (insert-char char num)))
@@ -491,20 +733,20 @@
 ;;;
 (defun tpu-include (file)
   "TPU-like include file"
-  (interactive "_fInclude file: ")
+  (interactive "fInclude file: ")
   (save-excursion
     (insert-file file)
     (message "")))
 
 (defun tpu-get (file)
   "TPU-like get file"
-  (interactive "_FFile to get: ")
+  (interactive "FFile to get: ")
   (find-file file))
 
 (defun tpu-what-line nil
   "Tells what line the point is on,
  and the total number of lines in the buffer."
-  (interactive "_")
+  (interactive)
   (if (eobp)
       (message "You are at the End of Buffer.  The last line is %d."
 	       (count-lines 1 (point-max)))
@@ -514,14 +756,14 @@
 
 (defun tpu-exit nil
   "Exit the way TPU does, save current buffer and ask about others."
-  (interactive "_")
+  (interactive)
   (if (not (eq (recursion-depth) 0))
       (exit-recursive-edit)
     (progn (save-buffer) (save-buffers-kill-emacs))))
 
 (defun tpu-quit nil
   "Quit the way TPU does, ask to make sure changes should be abandoned."
-  (interactive "_")
+  (interactive)
   (let ((list (buffer-list))
 	(working t))
     (while (and list working)
@@ -642,25 +884,45 @@
        B     Next Buffer - display the next buffer (all buffers)
        C     Recall - edit and possibly repeat previous commands
        E     Exit - save current buffer and ask about others
+       G     Get - load a file into a new edit buffer
 
-       G     Get - load a file into a new edit buffer
        I     Include - include a file in this buffer
        K     Kill Buffer - abandon edits and delete buffer
-
        M     Buffer Menu - display a list of all buffers
        N     Next File Buffer - display next buffer containing a file
+
        O     Occur - show following lines containing REGEXP
-
        Q     Quit - exit without saving anything
        R     Toggle rectangular mode for remove and insert
        S     Search and substitute - line mode REPLACE command
 
+      ^T     Toggle control key bindings between TPU and emacs
        U     Undo - undo the last edit
        W     Write - save current buffer
        X     Exit - save all modified buffers and exit
 
 \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\f
 
+  More extensive documentation on TPU-edt can be found in the `Commentary'
+  section of tpu-edt.el.  This section can be accessed through the standard
+  Emacs help facility using the `p' option.  Once you exit TPU-edt Help, one
+  of the following key sequences is sure to get you there.
+
+    ^h p        if you're not yet using TPU-edt
+    Gold-PF2 p  if you're using TPU-edt
+
+  Alternatively, fire up Emacs help from the command prompt, with
+
+    M-x help-for-help <CR> p <CR>
+
+  Where `M-x' might be any of `Gold-KP7', 'Do', or 'ESC-x'.
+
+  When you successfully invoke this part of the Emacs help facility, you
+  will see a buffer named `*Finder*' listing a number of topics.  Look for
+  tpu-edt under `emulations'.
+
+\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\f
+
    *** No more help, use P to view previous screen")
 
 (defvar tpu-help-enter (format "%s" "\eOM"))    ; tpu-help enter key symbol
@@ -672,7 +934,7 @@
 
 (defun tpu-help nil
   "Display TPU-edt help."
-  (interactive "_")
+  (interactive)
   ;; Save current window configuration
   (save-window-excursion
     ;; Create and fill help buffer if necessary
@@ -696,12 +958,10 @@
 	(if split
 	    (setq key
 		  (read-key-sequence
-		   "Press the key you want help on (RET=exit, ENTER=redisplay, N=next, 
-P=prev): "))
+		   "Press the key you want help on (RET=exit, ENTER=redisplay, N=next, P=prev): "))
 	  (setq key
 		(read-key-sequence
-		 "Press the key you want help on (RET to exit, N next screen, P prev 
-screen): ")))
+		 "Press the key you want help on (RET to exit, N next screen, P prev screen): ")))
 
 	;; Process the read key
 	;;
@@ -730,7 +990,7 @@
 	        	  (scroll-other-window -8)
 	        	(error nil)))
 	             (t
-	              (backward-page 2)
+	              (backward-page)
 	              (forward-line 1)
 	              (tpu-line-to-top-of-window))))
 	      ((not (equal tpu-help-return fkey))
@@ -746,12 +1006,12 @@
 ;;;
 (defun tpu-insert-escape nil
   "Inserts an escape character, and so becomes the escape-key alias."
-  (interactive "_")
+  (interactive)
   (insert "\e"))
 
 (defun tpu-insert-formfeed nil
   "Inserts a formfeed character."
-  (interactive "_")
+  (interactive)
   (insert "\C-L"))
 
 
@@ -762,14 +1022,14 @@
 
 (defun tpu-end-define-macro-key (key)
   "Ends the current macro definition"
-  (interactive "_kPress the key you want to use to do what was just learned: ")
+  (interactive "kPress the key you want to use to do what was just learned: ")
   (end-kbd-macro nil)
   (global-set-key key last-kbd-macro)
   (global-set-key "\C-r" tpu-saved-control-r))
 
 (defun tpu-define-macro-key nil
   "Bind a set of keystrokes to a single key, or key combination."
-  (interactive "_")
+  (interactive)
   (setq tpu-saved-control-r (global-key-binding "\C-r"))
   (global-set-key "\C-r" 'tpu-end-define-macro-key)
   (start-kbd-macro nil))
@@ -788,12 +1048,12 @@
 (defun tpu-save-all-buffers-kill-emacs nil
   "Save all buffers and exit emacs."
   (interactive)
-  (setq trim-versions-without-asking t)
-  (save-buffers-kill-emacs t))
+  (let ((delete-old-versions t))
+    (save-buffers-kill-emacs t)))
 
 (defun tpu-write-current-buffers nil
   "Save all modified buffers without exiting."
-  (interactive "_")
+  (interactive)
   (save-some-buffers t))
 
 (defun tpu-next-buffer nil
@@ -802,14 +1062,19 @@
   (switch-to-buffer (car (reverse (buffer-list)))))
 
 (defun tpu-next-file-buffer nil
-  "Go to next buffer in ring that is visiting a file."
+  "Go to next buffer in ring that is visiting a file or directory."
   (interactive)
-  (let ((starting-buffer (buffer-name)))
-    (switch-to-buffer (car (reverse (buffer-list))))
-    (while (and (not (equal (buffer-name) starting-buffer))
-		(not (buffer-file-name)))
-      (switch-to-buffer (car (reverse (buffer-list)))))
-    (if (equal (buffer-name) starting-buffer) (error "No other buffers."))))
+  (let ((list (tpu-make-file-buffer-list (buffer-list))))
+    (setq list (delq (current-buffer) list))
+    (if (not list) (error "No other buffers."))
+    (switch-to-buffer (car (reverse list)))))
+
+(defun tpu-make-file-buffer-list (buffer-list)
+  "Returns names from BUFFER-LIST excluding those beginning with a space or star."
+  (delq nil (mapcar '(lambda (b)
+                       (if (or (= (aref (buffer-name b) 0) ? )
+                               (= (aref (buffer-name b) 0) ?*)) nil b))
+                    buffer-list)))
 
 (defun tpu-next-window nil
   "Move to the next window."
@@ -829,7 +1094,7 @@
 ;;;
 (defun tpu-toggle-regexp nil
   "Switches in and out of regular expression search and replace mode."
-  (interactive "_")
+  (interactive)
   (setq tpu-regexp-p (not tpu-regexp-p))
   (tpu-set-search)
   (and (interactive-p)
@@ -846,14 +1111,14 @@
 (defun tpu-search nil
   "Search for a string or regular expression.
 The search is performed in the current direction."
-  (interactive "_")
+  (interactive)
   (tpu-set-search)
   (tpu-search-internal ""))
 
 (defun tpu-search-forward nil
   "Search for a string or regular expression.
 The search is begins in the forward direction."
-  (interactive "_")
+  (interactive)
   (setq tpu-searching-forward t)
   (tpu-set-search t)
   (tpu-search-internal ""))
@@ -861,7 +1126,7 @@
 (defun tpu-search-reverse nil
   "Search for a string or regular expression.
 The search is begins in the reverse direction."
-  (interactive "_")
+  (interactive)
   (setq tpu-searching-forward nil)
   (tpu-set-search t)
   (tpu-search-internal ""))
@@ -869,7 +1134,7 @@
 (defun tpu-search-again nil
   "Search for the same string or regular expression as last time.
 The search is performed in the current direction."
-  (interactive "_")
+  (interactive)
   (tpu-search-internal tpu-search-last-string))
 
 ;;  tpu-set-search defines the search functions used by the TPU-edt internal
@@ -878,10 +1143,11 @@
 ;;  to ensure that the next search will be in the current direction.  It is
 ;;  called from:
 
-;;       tpu-advance              tpu-backup
-;;       tpu-toggle-regexp        tpu-toggle-search-direction (t)
-;;       tpu-search               tpu-lm-replace
-;;       tpu-search-forward (t)   tpu-search-reverse (t)
+;;       tpu-advance                   tpu-backup
+;;       tpu-toggle-regexp             tpu-toggle-search-direction (t)
+;;       tpu-search                    tpu-lm-replace
+;;       tpu-search-forward (t)        tpu-search-reverse (t)
+;;       tpu-search-forward-exit (t)   tpu-search-backward-exit (t)
 
 (defun tpu-set-search (&optional arg)
   "Set the search functions and set the search direction to the current
@@ -910,33 +1176,50 @@
   (tpu-unset-match)
   (tpu-adjust-search)
 
-  (cond ((tpu-emacs-search tpu-search-last-string nil t)
-	 (tpu-set-match) (goto-char (tpu-match-beginning)))
+  (let ((case-fold-search
+	 (and case-fold-search (tpu-check-search-case tpu-search-last-string))))
 
-	(t
-	 (tpu-adjust-search t)
-	 (let ((found nil) (pos nil))
-	   (save-excursion
-	     (let ((tpu-searching-forward (not tpu-searching-forward)))
-	       (tpu-adjust-search)
-	       (setq found (tpu-emacs-rev-search tpu-search-last-string nil t))
-	       (setq pos (match-beginning 0))))
+    (cond ((tpu-emacs-search tpu-search-last-string nil t)
+	   (tpu-set-match) (goto-char (tpu-match-beginning)))
 
-	   (cond (found
-		  (cond ((tpu-y-or-n-p
-			  (format "Found in %s direction.  Go there? "
-				  (if tpu-searching-forward "reverse" "forward")))
-			 (goto-char pos) (tpu-set-match)
-			 (tpu-toggle-search-direction))))
+	  (t
+	   (tpu-adjust-search t)
+	   (let ((found nil) (pos nil))
+	     (save-excursion
+	       (let ((tpu-searching-forward (not tpu-searching-forward)))
+		 (tpu-adjust-search)
+		 (setq found (tpu-emacs-rev-search tpu-search-last-string nil t))
+		 (setq pos (match-beginning 0))))
 
-		 (t
-		  (if (not quiet)
-		      (message
-		       "%sSearch failed: \"%s\""
-		       (if tpu-regexp-p "RE " "") tpu-search-last-string))))))))
+	     (cond
+	      (found
+	       (cond ((tpu-y-or-n-p
+		       (format "Found in %s direction.  Go there? "
+			       (if tpu-searching-forward "reverse" "forward")))
+		      (goto-char pos) (tpu-set-match)
+		      (tpu-toggle-search-direction))))
+
+	      (t
+	       (if (not quiet)
+		   (message
+		    "%sSearch failed: \"%s\""
+		    (if tpu-regexp-p "RE " "") tpu-search-last-string)))))))))
 
 (fset 'tpu-search-internal-core (symbol-function 'tpu-search-internal))
 
+(defun tpu-check-search-case (string)
+  "Returns t if string contains upper case."
+  ;; if using regexp, eliminate upper case forms (\B \W \S.)
+  (if tpu-regexp-p
+      (let ((pat (copy-sequence string)) (case-fold-search nil) (pos 0))
+	(while (setq pos (string-match "\\\\\\\\" pat)) (aset pat (+ 1 pos) ?.))
+	(while (setq pos (string-match "\\\\B" pat)) (aset pat (+ 1 pos) ?.))
+	(while (setq pos (string-match "\\\\W" pat)) (aset pat (+ 1 pos) ?.))
+	(while (setq pos (string-match "\\\\S." pat))
+	  (aset pat (+ 1 pos) ?.) (aset pat (+ 2 pos) ?.))
+	(string-equal pat (downcase pat)))
+    (string-equal string (downcase string))))
+
 (defun tpu-adjust-search (&optional arg)
   "For forward searches, move forward a character before searching,
 and backward a character after a failed search.  Arg means end of search."
@@ -947,20 +1230,34 @@
 (defun tpu-toggle-search-direction nil
   "Toggle the TPU-edt search direction.
 Used for reversing a search in progress."
-  (interactive "_")
+  (interactive)
   (setq tpu-searching-forward (not tpu-searching-forward))
   (tpu-set-search t)
   (and (interactive-p)
        (message "Searching %sward."
 		(if tpu-searching-forward "for" "back"))))
 
+(defun tpu-search-forward-exit nil
+  "Set search direction forward and exit minibuffer."
+  (interactive)
+  (setq tpu-searching-forward t)
+  (tpu-set-search t)
+  (exit-minibuffer))
+
+(defun tpu-search-backward-exit nil
+  "Set search direction backward and exit minibuffer."
+  (interactive)
+  (setq tpu-searching-forward nil)
+  (tpu-set-search t)
+  (exit-minibuffer))
+
 
 ;;;
 ;;;  Select / Unselect
 ;;;
 (defun tpu-select (&optional quiet)
   "Sets the mark to define one end of a region."
-  (interactive "_P")
+  (interactive "P")
   (cond ((tpu-mark)
 	 (tpu-unselect quiet))
 	(t
@@ -974,7 +1271,6 @@
   (setq mark-ring nil)
   (tpu-set-mark nil)
   (tpu-update-mode-line)
-  (zmacs-deactivate-region)
   (if (not quiet) (message "Selection canceled.")))
 
 
@@ -983,7 +1279,7 @@
 ;;;
 (defun tpu-toggle-rectangle nil
   "Toggle rectangular mode for remove and insert."
-  (interactive "_")
+  (interactive)
   (setq tpu-rectangular-p (not tpu-rectangular-p))
   (setq tpu-rectangle-string (if tpu-rectangular-p " Rect" ""))
   (tpu-update-mode-line)
@@ -997,7 +1293,7 @@
   (let ((mc (current-column))
 	(pc (progn (exchange-point-and-mark) (current-column))))
 
-    (cond ((> (point) (tpu-mark))                      ; point on lower line
+    (cond ((> (point) (tpu-mark))                  ; point on lower line
 	   (cond ((> pc mc)                        ; point @  lower-right
 		  (exchange-point-and-mark))       ; point -> upper-left
 
@@ -1066,7 +1362,7 @@
 (defun tpu-append-region (arg)
   "Append selected region to the tpu-cut buffer.  In the absence of an
 argument, delete the selected region too."
-  (interactive "_P")
+  (interactive "P")
   (cond ((tpu-mark)
 	 (let ((beg (region-beginning)) (end (region-end)))
 	   (setq tpu-last-deleted-region
@@ -1088,7 +1384,7 @@
   "Delete one or specified number of lines after point.
 This includes the newline character at the end of each line.
 They are saved for the TPU-edt undelete-lines command."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (forward-line num)
     (if (not (eq (preceding-char) ?\n))
@@ -1101,7 +1397,7 @@
   "Delete text up to end of line.
 With argument, delete up to to Nth line-end past point.
 They are saved for the TPU-edt undelete-lines command."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (forward-char 1)
     (end-of-line num)
@@ -1113,7 +1409,7 @@
   "Delete text back to beginning of line.
 With argument, delete up to to Nth line-end past point.
 They are saved for the TPU-edt undelete-lines command."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (tpu-next-beginning-of-line num)
     (setq tpu-last-deleted-lines
@@ -1123,7 +1419,7 @@
 (defun tpu-delete-current-word (num)
   "Delete one or specified number of words after point.
 They are saved for the TPU-edt undelete-words command."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (tpu-forward-to-word num)
     (setq tpu-last-deleted-words
@@ -1133,7 +1429,7 @@
 (defun tpu-delete-previous-word (num)
   "Delete one or specified number of words before point.
 They are saved for the TPU-edt undelete-words command."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (tpu-backward-to-word num)
     (setq tpu-last-deleted-words
@@ -1143,7 +1439,7 @@
 (defun tpu-delete-current-char (num)
   "Delete one or specified number of characters after point.  The last
 character deleted is saved for the TPU-edt undelete-char command."
-  (interactive "_p")
+  (interactive "p")
   (while (and (> num 0) (not (eobp)))
     (setq tpu-last-deleted-char (char-after (point)))
     (cond (overwrite-mode
@@ -1160,7 +1456,7 @@
 (defun tpu-paste (num)
   "Insert the last region or rectangle of killed text.
 With argument reinserts the text that many times."
-  (interactive "_p")
+  (interactive "p")
   (while (> num 0)
     (cond (tpu-rectangular-p
 	   (let ((beg (point)))
@@ -1175,7 +1471,7 @@
 (defun tpu-undelete-lines (num)
   "Insert lines deleted by last TPU-edt line-deletion command.
 With argument reinserts lines that many times."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (while (> num 0)
       (insert tpu-last-deleted-lines)
@@ -1185,7 +1481,7 @@
 (defun tpu-undelete-words (num)
   "Insert words deleted by last TPU-edt word-deletion command.
 With argument reinserts words that many times."
-  (interactive "_p")
+  (interactive "p")
   (let ((beg (point)))
     (while (> num 0)
       (insert tpu-last-deleted-words)
@@ -1195,7 +1491,7 @@
 (defun tpu-undelete-char (num)
   "Insert character deleted by last TPU-edt character-deletion command.
 With argument reinserts the character that many times."
-  (interactive "_p")
+  (interactive "p")
   (while (> num 0)
     (if overwrite-mode (prog1 (forward-char -1) (delete-char 1)))
     (insert tpu-last-deleted-char)
@@ -1228,7 +1524,7 @@
   "Replace the selected region with the contents of the cut buffer, and
 repeat most recent search.  A numeric argument serves as a repeat count.
 A negative argument means replace all occurrences of the search string."
-  (interactive "_p")
+  (interactive "p")
   (cond ((or (tpu-mark) (tpu-check-match))
 	 (while (and (not (= num 0)) (or (tpu-mark) (tpu-check-match)))
 	   (let ((beg (point)))
@@ -1303,7 +1599,7 @@
 currently in regular expression mode, the emacs regular expression
 replace functions are used.  If an argument is supplied, replacements
 are performed without asking.  Only works in forward direction."
-  (interactive "_P")
+  (interactive "P")
   (cond (dont-ask
 	 (setq current-prefix-arg nil)
 	 (call-interactively
@@ -1362,17 +1658,17 @@
 (defun tpu-char (num)
   "Move to the next character in the current direction.
 A repeat count means move that many characters."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance (tpu-forward-char num) (tpu-backward-char num)))
 
 (defun tpu-forward-char (num)
   "Move right ARG characters (left if ARG is negative)."
-  (interactive "_p")
+  (interactive "p")
   (forward-char num))
 
 (defun tpu-backward-char (num)
   "Move left ARG characters (right if ARG is negative)."
-  (interactive "_p")
+  (interactive "p")
   (backward-char num))
 
 
@@ -1388,13 +1684,13 @@
 (defun tpu-word (num)
   "Move to the beginning of the next word in the current direction.
 A repeat count means move that many words."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance (tpu-forward-to-word num) (tpu-backward-to-word num)))
 
 (defun tpu-forward-to-word (num)
   "Move forward until encountering the beginning of a word.
 With argument, do this that many times."
-  (interactive "_p")
+  (interactive "p")
   (while (and (> num 0) (not (eobp)))
     (let* ((beg (point))
 	   (end (prog2 (end-of-line) (point) (goto-char beg))))
@@ -1411,7 +1707,7 @@
 (defun tpu-backward-to-word (num)
   "Move backward until encountering the beginning of a word.
 With argument, do this that many times."
-  (interactive "_p")
+  (interactive "p")
   (while (and (> num 0) (not (bobp)))
     (let* ((beg (point))
 	   (end (prog2 (beginning-of-line) (point) (goto-char beg))))
@@ -1428,7 +1724,7 @@
 
 (defun tpu-add-word-separators (separators)
   "Add new word separators for TPU-edt word commands."
-  (interactive "_sSeparators: ")
+  (interactive "sSeparators: ")
   (let* ((n 0) (length (length separators)))
     (while (< n length)
       (let ((char (aref separators n))
@@ -1448,13 +1744,13 @@
 
 (defun tpu-reset-word-separators nil
   "Reset word separators to default value."
-  (interactive "_")
+  (interactive)
   (setq tpu-word-separator-list nil)
   (setq tpu-skip-chars "^ \t"))
 
 (defun tpu-set-word-separators (separators)
   "Set new word separators for TPU-edt word commands."
-  (interactive "_sSeparators: ")
+  (interactive "sSeparators: ")
   (tpu-reset-word-separators)
   (tpu-add-word-separators separators))
 
@@ -1465,46 +1761,46 @@
 (defun tpu-next-line (num)
   "Move to next line.
 Prefix argument serves as a repeat count."
-  (interactive "_p")
+  (interactive "p")
   (next-line-internal num)
   (setq this-command 'next-line))
 
 (defun tpu-previous-line (num)
   "Move to previous line.
 Prefix argument serves as a repeat count."
-  (interactive "_p")
+  (interactive "p")
   (next-line-internal (- num))
   (setq this-command 'previous-line))
 
 (defun tpu-next-beginning-of-line (num)
   "Move to beginning of line; if at beginning, move to beginning of next line.
 Accepts a prefix argument for the number of lines to move."
-  (interactive "_p")
+  (interactive "p")
   (backward-char 1)
   (forward-line (- 1 num)))
 
 (defun tpu-end-of-line (num)
   "Move to the next end of line in the current direction.
 A repeat count means move that many lines."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance (tpu-next-end-of-line num) (tpu-previous-end-of-line num)))
 
 (defun tpu-next-end-of-line (num)
   "Move to end of line; if at end, move to end of next line.
 Accepts a prefix argument for the number of lines to move."
-  (interactive "_p")
+  (interactive "p")
   (forward-char 1)
   (end-of-line num))
 
 (defun tpu-previous-end-of-line (num)
   "Move EOL upward.
 Accepts a prefix argument for the number of lines to move."
-  (interactive "_p")
+  (interactive "p")
   (end-of-line (- 1 num)))
 
 (defun tpu-current-end-of-line nil
   "Move point to end of current line."
-  (interactive "_")
+  (interactive)
   (let ((beg (point)))
     (end-of-line)
     (if (= beg (point)) (message "You are already at the end of a line."))))
@@ -1512,19 +1808,20 @@
 (defun tpu-line (num)
   "Move to the beginning of the next line in the current direction.
 A repeat count means move that many lines."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance (tpu-forward-line num) (tpu-backward-line num)))
 
 (defun tpu-forward-line (num)
   "Move to beginning of next line.
 Prefix argument serves as a repeat count."
-  (interactive "_p")
+  (interactive "p")
   (forward-line num))
 
 (defun tpu-backward-line (num)
   "Move to beginning of previous line.
 Prefix argument serves as repeat count."
-  (interactive "_p")
+  (interactive "p")
+  (or (bolp) (>= 0 num) (setq num (- num 1)))
   (forward-line (- num)))
 
 
@@ -1534,14 +1831,14 @@
 (defun tpu-paragraph (num)
   "Move to the next paragraph in the current direction.
 A repeat count means move that many paragraphs."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance
       (tpu-next-paragraph num) (tpu-previous-paragraph num)))
 
 (defun tpu-next-paragraph (num)
   "Move to beginning of the next paragraph.
 Accepts a prefix argument for the number of paragraphs."
-  (interactive "_p")
+  (interactive "p")
   (beginning-of-line)
   (while (and (not (eobp)) (> num 0))
     (if (re-search-forward "^[ \t]*$" nil t)
@@ -1555,7 +1852,7 @@
 (defun tpu-previous-paragraph (num)
   "Move to beginning of previous paragraph.
 Accepts a prefix argument for the number of paragraphs."
-  (interactive "_p")
+  (interactive "p")
   (end-of-line)
   (while (and (not (bobp)) (> num 0))
     (if (not (and (re-search-backward "^[ \t]*$" nil t)
@@ -1574,7 +1871,7 @@
 (defun tpu-page (num)
   "Move to the next page in the current direction.
 A repeat count means move that many pages."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance (forward-page num) (backward-page num))
   (if (eobp) (recenter -1)))
 
@@ -1585,13 +1882,13 @@
 (defun tpu-scroll-window (num)
   "Scroll the display to the next section in the current direction.
 A repeat count means scroll that many sections."
-  (interactive "_p")
+  (interactive "p")
   (if tpu-advance (tpu-scroll-window-up num) (tpu-scroll-window-down num)))
 
 (defun tpu-scroll-window-down (num)
   "Scroll the display down to the next section.
 A repeat count means scroll that many sections."
-  (interactive "_p")
+  (interactive "p")
   (let* ((beg (tpu-current-line))
 	 (height (1- (window-height)))
 	 (lines (* num (/ (* height tpu-percent-scroll) 100))))
@@ -1601,7 +1898,7 @@
 (defun tpu-scroll-window-up (num)
   "Scroll the display up to the next section.
 A repeat count means scroll that many sections."
-  (interactive "_p")
+  (interactive "p")
   (let* ((beg (tpu-current-line))
 	 (height (1- (window-height)))
 	 (lines (* num (/ (* height tpu-percent-scroll) 100))))
@@ -1611,51 +1908,51 @@
 (defun tpu-pan-right (num)
   "Pan right tpu-pan-columns (16 by default).
 Accepts a prefix argument for the number of tpu-pan-columns to scroll."
-  (interactive "_p")
+  (interactive "p")
   (scroll-left (* tpu-pan-columns num)))
 
 (defun tpu-pan-left (num)
   "Pan left tpu-pan-columns (16 by default).
 Accepts a prefix argument for the number of tpu-pan-columns to scroll."
-  (interactive "_p")
+  (interactive "p")
   (scroll-right (* tpu-pan-columns num)))
 
 (defun tpu-move-to-beginning nil
   "Move cursor to the beginning of buffer, but don't set the mark."
-  (interactive "_")
+  (interactive)
   (goto-char (point-min)))
 
 (defun tpu-move-to-end nil
   "Move cursor to the end of buffer, but don't set the mark."
-  (interactive "_")
+  (interactive)
   (goto-char (point-max))
   (recenter -1))
 
 (defun tpu-goto-percent (perc)
   "Move point to ARG percentage of the buffer."
-  (interactive "_NGoto-percentage: ")
+  (interactive "NGoto-percentage: ")
   (if (or (> perc 100) (< perc 0))
       (error "Percentage %d out of range 0 < percent < 100" perc)
     (goto-char (/ (* (point-max) perc) 100))))
 
 (defun tpu-beginning-of-window nil
   "Move cursor to top of window."
-  (interactive "_")
+  (interactive)
   (move-to-window-line 0))
 
 (defun tpu-end-of-window nil
   "Move cursor to bottom of window."
-  (interactive "_")
+  (interactive)
   (move-to-window-line -1))
 
 (defun tpu-line-to-bottom-of-window nil
   "Move the current line to the bottom of the window."
-  (interactive "_")
+  (interactive)
   (recenter -1))
 
 (defun tpu-line-to-top-of-window nil
   "Move the current line to the top of the window."
-  (interactive "_")
+  (interactive)
   (recenter 0))
 
 
@@ -1664,7 +1961,7 @@
 ;;;
 (defun tpu-advance-direction nil
   "Set TPU Advance mode so keypad commands move forward."
-  (interactive "_")
+  (interactive)
   (setq tpu-direction-string " Advance")
   (setq tpu-advance t)
   (setq tpu-reverse nil)
@@ -1673,7 +1970,7 @@
 
 (defun tpu-backup-direction nil
   "Set TPU Backup mode so keypad commands move backward."
-  (interactive "_")
+  (interactive)
   (setq tpu-direction-string " Reverse")
   (setq tpu-advance nil)
   (setq tpu-reverse t)
@@ -1958,33 +2255,38 @@
 (define-key minibuffer-local-map "\eOM" 'exit-minibuffer)
 (define-key minibuffer-local-ns-map "\eOM" 'exit-minibuffer)
 (define-key minibuffer-local-completion-map "\eOM" 'exit-minibuffer)
-(define-key minibuffer-local-must-match-map "\eOM" 
-'minibuffer-complete-and-exit)
+(define-key minibuffer-local-must-match-map "\eOM" 'minibuffer-complete-and-exit)
 (and (boundp 'repeat-complex-command-map)
      (define-key repeat-complex-command-map "\eOM" 'exit-minibuffer))
 
 
 ;;;
-;;;  Map control keys
+;;;  Minibuffer map additions to set search direction
 ;;;
-(define-key global-map "\C-\\" 'quoted-insert)                ; ^\
-(define-key global-map "\C-a" 'tpu-toggle-overwrite-mode)     ; ^A
-(define-key global-map "\C-b" 'repeat-complex-command)        ; ^B
-(define-key global-map "\C-e" 'tpu-current-end-of-line)       ; ^E
-(define-key global-map "\C-h" 'tpu-next-beginning-of-line)    ; ^H (BS)
-(define-key global-map "\C-j" 'tpu-delete-previous-word)      ; ^J (LF)
-(define-key global-map "\C-k" 'tpu-define-macro-key)          ; ^K
-(define-key global-map "\C-l" 'tpu-insert-formfeed)           ; ^L (FF)
-(define-key global-map "\C-r" 'recenter)                      ; ^R
-(define-key global-map "\C-u" 'tpu-delete-to-bol)             ; ^U
-(define-key global-map "\C-v" 'tpu-quoted-insert)             ; ^V
-(define-key global-map "\C-w" 'redraw-display)                ; ^W
-(define-key global-map "\C-z" 'tpu-exit)                      ; ^Z
+(define-key minibuffer-local-map "\eOt" 'tpu-search-forward-exit)
+(define-key minibuffer-local-map "\eOu" 'tpu-search-backward-exit)
 
 
 ;;;
-;;;  Functions to reset and toggle the control key bindings
+;;;  Functions to set, reset, and toggle the control key bindings
 ;;;
+(defun tpu-set-control-keys nil
+  "Set control keys to TPU style functions."
+  (define-key global-map "\C-\\" 'quoted-insert)                ; ^\
+  (define-key global-map "\C-a" 'tpu-toggle-overwrite-mode)     ; ^A
+  (define-key global-map "\C-b" 'repeat-complex-command)        ; ^B
+  (define-key global-map "\C-e" 'tpu-current-end-of-line)       ; ^E
+  (define-key global-map "\C-h" 'tpu-next-beginning-of-line)    ; ^H (BS)
+  (define-key global-map "\C-j" 'tpu-delete-previous-word)      ; ^J (LF)
+  (define-key global-map "\C-k" 'tpu-define-macro-key)          ; ^K
+  (define-key global-map "\C-l" 'tpu-insert-formfeed)           ; ^L (FF)
+  (define-key global-map "\C-r" 'recenter)                      ; ^R
+  (define-key global-map "\C-u" 'tpu-delete-to-bol)             ; ^U
+  (define-key global-map "\C-v" 'tpu-quoted-insert)             ; ^V
+  (define-key global-map "\C-w" 'redraw-display)                ; ^W
+  (define-key global-map "\C-z" 'tpu-exit)                      ; ^Z
+  (setq tpu-control-keys t))
+
 (defun tpu-reset-control-keys (tpu-style)
   "Set control keys to TPU or emacs style functions."
   (let* ((tpu   (and tpu-style (not tpu-control-keys)))
@@ -2013,7 +2315,7 @@
 
 (defun tpu-toggle-control-keys nil
   "Toggles control key bindings between TPU-edt and Emacs."
-  (interactive "_")
+  (interactive)
   (tpu-reset-control-keys (not tpu-control-keys))
   (and (interactive-p)
        (message "Control keys function with %s bindings."
@@ -2025,28 +2327,26 @@
 ;;;
 (defun tpu-next-history-element (n)
   "Insert the next element of the minibuffer history into the minibuffer."
-  (interactive "_p")
+  (interactive "p")
   (next-history-element n)
   (goto-char (point-max)))
 
 (defun tpu-previous-history-element (n)
   "Insert the previous element of the minibuffer history into the minibuffer."
-  (interactive "_p")
+  (interactive "p")
   (previous-history-element n)
   (goto-char (point-max)))
 
 (defun tpu-arrow-history nil
   "Modify minibuffer maps to use arrows for history recall."
-  (interactive "_")
+  (interactive)
   (let ((loc (where-is-internal 'tpu-previous-line)) (cur nil))
     (while (setq cur (car loc))
       (define-key read-expression-map cur 'tpu-previous-history-element)
       (define-key minibuffer-local-map cur 'tpu-previous-history-element)
       (define-key minibuffer-local-ns-map cur 'tpu-previous-history-element)
-      (define-key minibuffer-local-completion-map cur 
-'tpu-previous-history-element)
-      (define-key minibuffer-local-must-match-map cur 
-'tpu-previous-history-element)
+      (define-key minibuffer-local-completion-map cur 'tpu-previous-history-element)
+      (define-key minibuffer-local-must-match-map cur 'tpu-previous-history-element)
       (setq loc (cdr loc)))
 
     (setq loc (where-is-internal 'tpu-next-line))
@@ -2054,10 +2354,8 @@
       (define-key read-expression-map cur 'tpu-next-history-element)
       (define-key minibuffer-local-map cur 'tpu-next-history-element)
       (define-key minibuffer-local-ns-map cur 'tpu-next-history-element)
-      (define-key minibuffer-local-completion-map cur 
-'tpu-next-history-element)
-      (define-key minibuffer-local-must-match-map cur 
-'tpu-next-history-element)
+      (define-key minibuffer-local-completion-map cur 'tpu-next-history-element)
+      (define-key minibuffer-local-must-match-map cur 'tpu-next-history-element)
       (setq loc (cdr loc)))))
 
 
@@ -2067,16 +2365,25 @@
 (defun tpu-load-xkeys (file)
   "Load the TPU-edt X-windows key definitions FILE.
 If FILE is nil, try to load a default file.  The default file names are
-~/.tpu-xemacs-keys for XEmacs emacs, and ~/.tpu-gnu-keys for GNU emacs."
-  (interactive "_fX key definition file: ")
+`~/.tpu-lucid-keys' for Lucid emacs, and `~/.tpu-keys' for Emacs."
+  (interactive "fX key definition file: ")
   (cond (file
 	 (setq file (expand-file-name file)))
 	(tpu-xkeys-file
 	 (setq file (expand-file-name tpu-xkeys-file)))
-	(tpu-gnu-emacs19-p
-	 (setq file (expand-file-name "~/.tpu-gnu-keys")))
-	(tpu-xemacs-emacs19-p
-	 (setq file (expand-file-name "~/.tpu-xemacs-keys"))))
+	(tpu-lucid-emacs19-p
+	 (setq file (convert-standard-filename
+		     (expand-file-name "~/.tpu-lucid-keys"))))
+	(tpu-emacs19-p
+	 (setq file (convert-standard-filename
+		     (expand-file-name "~/.tpu-keys")))
+	 (and (not (file-exists-p file))
+	      (file-exists-p
+	       (convert-standard-filename
+		(expand-file-name "~/.tpu-gnu-keys")))
+	      (tpu-copy-keyfile
+	       (convert-standard-filename
+		(expand-file-name "~/.tpu-gnu-keys")) file))))
   (cond ((file-readable-p file)
 	 (load-file file))
 	(t
@@ -2109,6 +2416,34 @@
 		  (insert "Nope, I can't seem to find it.  :-(\n\n")
 		  (sit-for 120)))))))
 
+(defun tpu-copy-keyfile (oldname newname)
+  "Copy the TPU-edt X key definitions file to the new default name."
+  (interactive "fOld name: \nFNew name: ")
+  (if (not (get-buffer "*TPU-Notice*")) (generate-new-buffer "*TPU-Notice*"))
+  (set-buffer "*TPU-Notice*")
+  (erase-buffer)
+  (insert "
+  NOTICE --
+
+  The default name of the TPU-edt key definition file has changed
+  from `~/.tpu-gnu-keys' to `~/.tpu-keys'.  With your permission,
+  your key definitions will be copied to the new file.  If you'll
+  never use older versions of Emacs, you can remove the old file.
+  If the copy fails, you'll be asked if you want to create a new
+  key definitions file.  Do you want to copy your key definition
+  file now?
+  ")
+  (save-window-excursion
+    (switch-to-buffer-other-window "*TPU-Notice*")
+    (shrink-window-if-larger-than-buffer)
+    (goto-char (point-min))
+    (beep)
+    (and (tpu-y-or-n-p "Copy key definitions to the new file now? ")
+	 (condition-case conditions
+             (copy-file oldname newname)
+	   (error (message "Sorry, couldn't copy - %s" (cdr conditions)))))
+    (kill-buffer "*TPU-Notice*")))
+
 
 ;;;
 ;;;  Start and Stop TPU-edt
@@ -2121,16 +2456,14 @@
    ((not tpu-edt-mode)
     ;; we use picture-mode functions
     (require 'picture)
-    (tpu-reset-control-keys t)
+    (tpu-set-control-keys)
     (cond (tpu-emacs19-p
 	   (and window-system (tpu-load-xkeys nil))
 	   (tpu-arrow-history))
 	  (t
 	   ;; define ispell functions
-	   (autoload 'ispell-word "ispell" "Check spelling of word at or before 
-point" t)
-	   (autoload 'ispell-complete-word "ispell" "Complete word at or before 
-point" t)
+	   (autoload 'ispell-word "ispell" "Check spelling of word at or before point" t)
+	   (autoload 'ispell-complete-word "ispell" "Complete word at or before point" t)
 	   (autoload 'ispell-buffer "ispell" "Check spelling of entire buffer" t)
 	   (autoload 'ispell-region "ispell" "Check spelling of region" t)))
     (tpu-set-mode-line t)
@@ -2151,15 +2484,10 @@
     (setq-default page-delimiter "^\f")
     (setq-default truncate-lines nil)
     (setq scroll-step 0)
+    (setq global-map (copy-keymap tpu-original-global-map))
     (use-global-map global-map)
     (setq tpu-edt-mode nil))))
 
-
-;;;
-;;;  Turn on TPU-edt and announce it as a feature
-;;;
-(tpu-edt-mode)
-
 (provide 'tpu-edt)
 
 ;;; tpu-edt.el ends here
--- a/lisp/emulators/tpu-extras.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/tpu-extras.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,6 @@
 ;;; tpu-extras.el --- Scroll margins and free cursor mode for TPU-edt
 
-;; Copyright (C) 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
@@ -20,10 +20,35 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
 
 ;;; Commentary:
 
+;;  Use the functions defined here to customize TPU-edt to your tastes by
+;;  setting scroll margins and/or turning on free cursor mode.  Here's an
+;;  example for your .emacs file.
+
+;;     (tpu-set-cursor-free)                   ; Set cursor free.
+;;     (tpu-set-scroll-margins "10%" "15%")    ; Set scroll margins.
+
+;;  Scroll margins and cursor binding can be changed from within emacs using
+;;  the following commands:
+
+;;     tpu-set-scroll-margins  or   set scroll margins
+;;     tpu-set-cursor-bound    or   set cursor bound
+;;     tpu-set-cursor-free     or   set cursor free
+
+;;  Additionally, Gold-F toggles between bound and free cursor modes.
+
+;;  Note that switching out of free cursor mode or exiting TPU-edt while in
+;;  free cursor mode strips trailing whitespace from every line in the file.
+
+
+;;; Details:
+
 ;;  The functions contained in this file implement scroll margins and free
 ;;  cursor mode.  The following keys and commands are affected.
 
@@ -67,8 +92,8 @@
 ;;  performance of TPU-edt on slower computers.  In order to support the
 ;;  widest range of computers, scroll margin support is optional.
 
-;;  I don't know for a fact that the overhead associated with scroll
-;;  margin support is significant.  If you find that it is, please send me
+;;  It's actually not known whether the overhead associated with scroll
+;;  margin support is significant.  If you find that it is, please send
 ;;  a note describing the extent of the performance degradation.  Be sure
 ;;  to include a description of the platform where you're running TPU-edt.
 ;;  Send your note to the address provided by Gold-V.
@@ -77,35 +102,15 @@
 ;;  important aspects of the real TPU/edt.  Those who miss free cursor mode
 ;;  and/or scroll margins will appreciate these implementations.
 
-;;; Usage:
-
-;;  To use this file, simply load it after loading TPU-edt.  After that,
-;;  customize TPU-edt to your tastes by setting scroll margins and/or
-;;  turning on free cursor mode.  Here's an example for your .emacs file.
-
-;;     (load "tpu-edt")                      ; Load the base TPU-edt
-;;     (load "tpu-extras")                   ;   and the extras.
-;;     (tpu-set-scroll-margins "10%" "15%")  ; Set scroll margins.
-
-;;  Once the extras are loaded, scroll margins and cursor binding can be
-;;  changed with the following commands:
-
-;;     tpu-set-scroll-margins  or   set scroll margins
-;;     tpu-set-cursor-bound    or   set cursor bound
-;;     tpu-set-cursor-free     or   set cursor free
-
-;;  Additionally, Gold-F toggles between bound and free cursor modes.
-
-;;  Note that switching out of free cursor mode or exiting TPU-edt while in
-;;  free cursor mode strips trailing whitespace from every line in the file.
+;; NOTE: There was a very old tpu-edt in XEmacs 19.14 so I deleted it and
+;;  replaced it with the one in Emacs 19.34. -sb
 
 ;;; Code:
 
 
-;;;  Revision Information
+;;;  Gotta have tpu-edt
 
-(defconst tpu-extras-revision "!Revision: 1.6 !"
-  "Revision number of the TPU-edt extras.")
+(require 'tpu-edt)
 
 
 ;;;  Customization variables
@@ -132,11 +137,7 @@
 ;;;  Hooks  --  Set cursor free in picture mode.
 ;;;             Clean up when writing a file from cursor free mode.
 
-(if tpu-gnu-emacs18-p
-    (or (memq 'tpu-set-cursor-free edit-picture-hook)
-	(setq edit-picture-hook
-	      (cons 'tpu-set-cursor-free edit-picture-hook)))
-  (add-hook 'picture-mode-hook 'tpu-set-cursor-free))
+(add-hook 'picture-mode-hook 'tpu-set-cursor-free)
 
 (defun tpu-write-file-hook nil
   "Eliminate whitespace at ends of lines, if the cursor is free."
@@ -264,6 +265,7 @@
 Prefix argument serves as repeat count."
   (interactive "p")
   (let ((beg (tpu-current-line)))
+    (or (bolp) (>= 0 num) (setq num (- num 1)))
     (next-line-internal (- num))
     (tpu-top-check beg num)
     (beginning-of-line)))
@@ -428,7 +430,7 @@
 
 ;;;  Function to set scroll margins
 
-;;;jwz: don't autoload this by default ###autoload
+;;;###autoload
 (defun tpu-set-scroll-margins (top bottom)
   "Set scroll margins."
   (interactive
@@ -456,7 +458,7 @@
 
 ;;;  Functions to set cursor bound or free
 
-;;;jwz: don't autoload this by default ###autoload
+;;;###autoload
 (defun tpu-set-cursor-free nil
   "Allow the cursor to move freely about the screen."
   (interactive)
@@ -466,7 +468,7 @@
 			     GOLD-map)
   (message "The cursor will now move freely about the screen."))
 
-;;;jwz: don't autoload this by default ###autoload
+;;;###autoload
 (defun tpu-set-cursor-bound nil
   "Constrain the cursor to the flow of the text."
   (interactive)
--- a/lisp/emulators/tpu-mapper.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/tpu-mapper.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,6 @@
-;;; tpu-mapper.el  ---  Create a TPU-edt keymap file for x-windows emacs.
+;;; tpu-mapper.el --- Create a TPU-edt X-windows keymap file
 
-;; Copyright (C) 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
@@ -20,7 +20,10 @@
 
 ;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34
 
 ;;; Commentary:
 
@@ -31,17 +34,17 @@
 
 ;;; Usage:
 
-;;  Simply load this file into the X-windows version of emacs (version 19)
-;;  using the following command.
+;;  Simply load this file into the X-windows version of XEmacs using the
+;;  following command.
 
-;;    emacs -q -l tpu-mapper.el
+;;    xemacs -q -l tpu-mapper
 
 ;;  The "-q" option prevents loading of your .emacs file (commands therein
 ;;  might confuse this program).
 
 ;;  An instruction screen showing the TPU-edt keypad will be displayed, and
 ;;  you will be prompted to press the TPU-edt editing keys.  Tpu-mapper uses
-;;  the keys you press to create an emacs lisp file that will define a
+;;  the keys you press to create an Emacs Lisp file that will define a
 ;;  TPU-edt keypad for your X server.  You can even re-arrange the standard
 ;;  EDT keypad to suit your tastes (or to cope with those silly Sun and PC
 ;;  keypads).
@@ -49,28 +52,25 @@
 ;;  Finally, you will be prompted for the name of the file to store the key
 ;;  definitions.  If you chose the default, TPU-edt will find it and load it
 ;;  automatically.  If you specify a different file name, you will need to
-;;  set the variable "tpu-xkeys-file" before loading TPU-edt.  Here's how
+;;  set the variable "tpu-xkeys-file" before starting TPU-edt.  Here's how
 ;;  you might go about doing that in your .emacs file.
 
 ;;    (setq tpu-xkeys-file (expand-file-name "~/.my-emacs-x-keys"))
-;;    (load "tpu-edt")
+;;    (tpu-edt)
 
 ;;; Known Problems:
 
 ;;  Sometimes, tpu-mapper will ignore a key you press, and just continue to
 ;;  prompt for the same key.  This can happen when your window manager sucks
-;;  up the key and doesn't pass it on to emacs, or it could be an emacs bug.
+;;  up the key and doesn't pass it on to Emacs, or it could be an Emacs bug.
 ;;  Either way, there's nothing that tpu-mapper can do about it.  You must
 ;;  press RETURN, to skip the current key and continue.  Later, you and/or
 ;;  your local X guru can try to figure out why the key is being ignored.
 
-;;; Code:
+;; NOTE: There was a very old tpu-edt in XEmacs 19.14 so I deleted it and
+;;  replaced it with the one in Emacs 19.34. -sb
 
-;;;
-;;;  Revision Information
-;;;
-(defconst tpu-mapper-revision "!Revision: 1.5 !"
-    "Revision number of TPU-edt x-windows emacs key mapper.")
+;;; Code:
 
 
 ;;;
@@ -78,27 +78,21 @@
 ;;;
 (cond
  ((not (and window-system (not (string-lessp emacs-version "19"))))
-  (insert "
-
-    Whoa!  This isn't going to work...
-
-    You must run tpu-mapper.el under X-windows and Emacs version 19.
-
-    Press any key to exit.  ")
-  (sit-for 600)
-  (kill-emacs t)))
+  (error "tpu-mapper requires running in Emacs 19, with an X display")))
 
 
 ;;;
-;;;  Decide whether we're running GNU Emacs or XEmacs.
+;;;  Decide whether we're running Lucid Emacs or Emacs itself.
 ;;;
-(defconst tpu-xemacs-emacs19-p (string-match "XEmacs" emacs-version)
-  "Non-NIL if we are running XEmacs version 19.")
+(defconst tpu-lucid-emacs19-p (string-match "Lucid" emacs-version)
+  "Non-NIL if we are running Lucid Emacs version 19.")
 
 
 ;;;
 ;;;  Key variables
 ;;;
+(defvar tpu-kp4 nil)
+(defvar tpu-kp5 nil)
 (defvar tpu-key nil)
 (defvar tpu-enter nil)
 (defvar tpu-return nil)
@@ -110,7 +104,7 @@
 ;;;
 ;;;  Make sure the window is big enough to display the instructions
 ;;;
-(if tpu-xemacs-emacs19-p (set-screen-size nil 80 36)
+(if tpu-lucid-emacs19-p (set-screen-size (selected-screen) 80 36)
   (set-frame-size (selected-frame) 80 36))
 
 
@@ -138,7 +132,7 @@
 (switch-to-buffer "Directions")
 (insert "
     This program prompts you to press keys to create a custom keymap file
-    for use with the x-windows version of emacs and TPU-edt.
+    for use with the x-windows version of Emacs and TPU-edt.
 
     Start by pressing the RETURN key, and continue by pressing the keys
     specified in the mini-buffer.  You can re-arrange the TPU-edt keypad
@@ -171,24 +165,25 @@
 
 ")
 (delete-other-windows)
+(goto-char (point-min))
 
 ;;;
 ;;;  Save <CR> for future reference
 ;;;
 (cond
- (tpu-xemacs-emacs19-p
+ (tpu-lucid-emacs19-p
   (setq tpu-return-seq (read-key-sequence "Hit carriage-return <CR> to continue "))
   (setq tpu-return (concat "[" (format "%s" (event-key (aref tpu-return-seq 0))) "]")))
  (t
   (message "Hit carriage-return <CR> to continue ")
   (setq tpu-return-seq (read-event))
-  (setq tpu-return (concat "[" (format "%s" tpu-return-seq) "]")))) 
+  (setq tpu-return (concat "[" (format "%s" tpu-return-seq) "]"))))
 
 
 ;;;
 ;;;  Key mapping functions
 ;;;
-(defun tpu-xemacs-map-key (ident descrip func gold-func)
+(defun tpu-lucid-map-key (ident descrip func gold-func)
   (interactive)
   (setq tpu-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
   (setq tpu-key (concat "[" (format "%s" (event-key (aref tpu-key-seq 0))) "]"))
@@ -204,7 +199,7 @@
 	 (format "%s" tpu-key)))
   tpu-key)
 
-(defun tpu-gnu-map-key (ident descrip func gold-func)
+(defun tpu-emacs-map-key (ident descrip func gold-func)
   (interactive)
   (message "Press %s%s: " ident descrip)
   (setq tpu-key-seq (read-event))
@@ -221,7 +216,7 @@
 	 (format "%s" tpu-key)))
   tpu-key)
 
-(fset 'tpu-map-key (if tpu-xemacs-emacs19-p 'tpu-xemacs-map-key 'tpu-gnu-map-key))
+(fset 'tpu-map-key (if tpu-lucid-emacs19-p 'tpu-lucid-map-key 'tpu-emacs-map-key))
 
 
 (set-buffer "Keys")
@@ -275,8 +270,8 @@
 (tpu-map-key "KP-1"      " - The Word/Change-Case key"             "'tpu-word"                 "'tpu-change-case")
 (tpu-map-key "KP-2"      " - The EOL/Delete-EOL key"               "'tpu-end-of-line"          "'tpu-delete-to-eol")
 (tpu-map-key "KP-3"      " - The Character/Special-Insert key"     "'tpu-char"                 "'tpu-special-insert")
-(tpu-map-key "KP-4"      " - The Forward/Bottom key"               "'tpu-advance-direction"    "'tpu-move-to-end")
-(tpu-map-key "KP-5"      " - The Reverse/Top key"                  "'tpu-backup-direction"     "'tpu-move-to-beginning")
+(setq tpu-kp4 (tpu-map-key "KP-4"      " - The Forward/Bottom key"               "'tpu-advance-direction"    "'tpu-move-to-end"))
+(setq tpu-kp5 (tpu-map-key "KP-5"      " - The Reverse/Top key"                  "'tpu-backup-direction"     "'tpu-move-to-beginning"))
 (tpu-map-key "KP-6"      " - The Remove/Insert key"                "'tpu-cut"                  "'tpu-paste")
 (tpu-map-key "KP-7"      " - The Page/Do key"                      "'tpu-page"                 "'execute-extended-command")
 (tpu-map-key "KP-8"      " - The Section/Fill key"                 "'tpu-scroll-window"        "'tpu-fill")
@@ -344,12 +339,22 @@
   (insert (format "(define-key minibuffer-local-completion-map %s 'exit-minibuffer)\n" tpu-enter))
   (insert (format "(define-key minibuffer-local-must-match-map %s 'minibuffer-complete-and-exit)\n" tpu-enter))))
 
+(cond
+ ((not (or (equal tpu-kp4 tpu-return) (equal tpu-kp5 tpu-return)))
+  (insert "
+;;  Minibuffer map additions to allow KP-4/5 termination of search strings.
+;;
+")
+
+  (insert (format "(define-key minibuffer-local-map %s 'tpu-search-forward-exit)\n" tpu-kp4))
+  (insert (format "(define-key minibuffer-local-map %s 'tpu-search-backward-exit)\n" tpu-kp5))))
+
 (insert "
 ;;  Define the tpu-help-enter/return symbols
 ;;
 ")
 
-(cond (tpu-xemacs-emacs19-p
+(cond (tpu-lucid-emacs19-p
        (insert (format "(setq tpu-help-enter \"%s\")\n" tpu-enter-seq))
        (insert (format "(setq tpu-help-return \"%s\")\n" tpu-return-seq))
        (insert "(setq tpu-help-N \"[#<keypress-event N>]\")\n")
@@ -363,15 +368,33 @@
 (set-buffer "Keys")
 
 ;;;
-;;;  Save the key mapping program and blow this pop stand
+;;;  Save the key mapping program
 ;;;
-(let ((file (if tpu-xemacs-emacs19-p "~/.tpu-xemacs-keys" "~/.tpu-gnu-keys")))
+(let ((file
+       (convert-standard-filename
+	(if tpu-lucid-emacs19-p "~/.tpu-lucid-keys" "~/.tpu-keys"))))
   (set-visited-file-name
-   (read-file-name (format "Save key mapping to file (default %s): " file) nil file)))
+   (read-file-name (format "Save key mapping to file (default %s): " file) "" file)))
 (save-buffer)
 
-(message "That's it!  Press any key to exit")
-(sit-for 600)
-(kill-emacs t)
+;;;
+;;;  Load the newly defined keys and clean up
+;;;
+(eval-current-buffer)
+(kill-buffer (current-buffer))
+(kill-buffer "*scratch*")
+(kill-buffer "Gold-Keys")
+
+;;;
+;;;  Let them know it worked.
+;;;
+(switch-to-buffer "Directions")
+(erase-buffer)
+(insert "
+    A custom TPU-edt keymap file has been created.
+
+    Press GOLD-k to remove this buffer and continue editing.
+")
+(goto-char (point-min))
 
 ;;; tpu-mapper.el ends here
--- a/lisp/emulators/ws-mode.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/emulators/ws-mode.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,169 +1,35 @@
 ;;; ws-mode.el --- WordStar emulation mode for GNU Emacs
 
-;; Author:		Juergen Nickelsen <nickel@cs.tu-berlin.de>
-;; Created:		13 Feb 1991
-;; Version:		0.7
-
 ;; Copyright (C) 1991 Free Software Foundation, Inc.
 
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY.  No author or distributor
-;; accepts responsibility to anyone for the consequences of using it
-;; or for whether it serves any particular purpose or works at all,
-;; unless he says so in writing.  Refer to the GNU Emacs General Public
-;; License for full details.
-
-;; Everyone is granted permission to copy, modify and redistribute
-;; this file, but only under the conditions described in the
-;; GNU Emacs General Public License.   A copy of this license is
-;; supposed to have been given to you along with GNU Emacs so you
-;; can know your rights and responsibilities.  It should be in a
-;; file named COPYING.  Among other things, the copyright notice
-;; and this notice must be preserved on all copies.
-
+;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de>
+;; Version: 0.7
+;; Keywords: emulations
 
-;; How to install ws-mode.el:
-;;
-;; either you
-;; put the following line into your default.el (usually
-;; /usr/local/emacs/lisp/default.el):
-;;     (autoload 'wordstar-mode "ws-mode.el" "WordStar emulation mode." t)
-;; put ws-mode.el into a directory in your Emacs load-path (usually
-;; /usr/local/emacs/local/lisp).
-;;
-;; or you
-;; put ws-mode.el into your directory $HOME/lib/emacs (or something
-;; like that)
-;; put the following two lines into your file $HOME/.emacs
-;;     (autoload 'wordstar-mode (expand-file-name "~/lib/emacs/ws-mode.el")
-;;               "WordStar emulation mode." t)
-;;
-;; You can then invoke wordstar-mode for a buffer by typing
-;;     M-x wordstar-mode
-;;
-;; If you want to use Emacs in wordstar-mode by default, put the 
-;; following line in addition into your file $HOME/.emacs :
-;;     (setq default-major-mode 'wordstar-mode)
-;;
-;; If you want to use Emacs *always* in wordstar-mode, even when the
-;; file type would indicate another mode, put the follwoing line in
-;; addition into your file $HOME/.emacs :
-;;     (setq auto-mode-alist nil)
-;;
-;; Enjoy!
+;; This file is part of XEmacs.
 
-
-
-(defun wordstar-mode ()
-  "Major mode with WordStar-like key bindings.
-
-BUGS:
- - Help menus with WordStar commands (C-j just calls help-for-help)
-   are not implemented
- - Options for search and replace
- - Show markers (C-k h) is somewhat strange
- - Search and replace (C-q a) is only available in forward direction
-
-No key bindings beginning with ESC are installed, they will work
-Emacs-like.
-
-The key bindings are:
+;; 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.
 
-  C-a		backward-word
-  C-b		fill-paragraph
-  C-c		scroll-up-line
-  C-d		forward-char
-  C-e		previous-line
-  C-f		forward-word
-  C-g		delete-char
-  C-h		backward-char
-  C-i		indent-for-tab-command
-  C-j		help-for-help
-  C-k		ordstar-C-k-map
-  C-l		ws-repeat-search
-  C-n		open-line
-  C-p		quoted-insert
-  C-r		scroll-down-line
-  C-s		backward-char
-  C-t		kill-word
-  C-u		keyboard-quit
-  C-v		overwrite-mode
-  C-w		scroll-down
-  C-x		next-line
-  C-y		kill-complete-line
-  C-z		scroll-up
+;; 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.
 
-  C-k 0		ws-set-marker-0
-  C-k 1		ws-set-marker-1
-  C-k 2		ws-set-marker-2
-  C-k 3		ws-set-marker-3
-  C-k 4		ws-set-marker-4
-  C-k 5		ws-set-marker-5
-  C-k 6		ws-set-marker-6
-  C-k 7		ws-set-marker-7
-  C-k 8		ws-set-marker-8
-  C-k 9		ws-set-marker-9
-  C-k b		ws-begin-block
-  C-k c		ws-copy-block
-  C-k d		save-buffers-kill-emacs
-  C-k f		find-file
-  C-k h		ws-show-markers
-  C-k i		ws-indent-block
-  C-k k		ws-end-block
-  C-k p		ws-print-block
-  C-k q		kill-emacs
-  C-k r		insert-file
-  C-k s		save-some-buffers
-  C-k t		ws-mark-word
-  C-k u		ws-exdent-block
-  C-k C-u	keyboard-quit
-  C-k v		ws-move-block
-  C-k w		ws-write-block
-  C-k x		kill-emacs
-  C-k y		ws-delete-block
+;; 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.
 
-  C-o c		center-line
-  C-o b		switch-to-buffer
-  C-o j		justify-current-line
-  C-o k		kill-buffer
-  C-o l		list-buffers
-  C-o m		auto-fill-mode
-  C-o r		set-fill-column
-  C-o C-u	keyboard-quit
-  C-o wd	delete-other-windows
-  C-o wh	split-window-horizontally
-  C-o wo	other-window
-  C-o wv	split-window-vertically
+;;; Synched up with: FSF 19.34
+
+;;; Commentary:
 
-  C-q 0		ws-find-marker-0
-  C-q 1		ws-find-marker-1
-  C-q 2		ws-find-marker-2
-  C-q 3		ws-find-marker-3
-  C-q 4		ws-find-marker-4
-  C-q 5		ws-find-marker-5
-  C-q 6		ws-find-marker-6
-  C-q 7		ws-find-marker-7
-  C-q 8		ws-find-marker-8
-  C-q 9		ws-find-marker-9
-  C-q a		ws-query-replace
-  C-q b		ws-to-block-begin
-  C-q c		end-of-buffer
-  C-q d		end-of-line
-  C-q f		ws-search
-  C-q k		ws-to-block-end
-  C-q l		ws-undo
-  C-q p		ws-last-cursorp
-  C-q r		beginning-of-buffer
-  C-q C-u	keyboard-quit
-  C-q w		ws-last-error
-  C-q y		ws-kill-eol
-  C-q DEL	ws-kill-bol
-"
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map wordstar-mode-map)
-  (setq mode-name "WordStar")
-  (setq major-mode 'wordstar-mode))
+;; This emulates WordStar, with a major mode.
+
+;;; Code:
 
 (defvar wordstar-mode-map nil "")
 (defvar wordstar-C-j-map nil "")
@@ -258,8 +124,8 @@
   ;; wordstar-C-o-map
   
   (define-key wordstar-C-o-map " " ())
-  (define-key wordstar-C-o-map "c" 'center-line)
-  (define-key wordstar-C-o-map "\C-c" 'center-line)
+  (define-key wordstar-C-o-map "c" 'wordstar-center-line)
+  (define-key wordstar-C-o-map "\C-c" 'wordstar-center-line)
   (define-key wordstar-C-o-map "b" 'switch-to-buffer)
   (define-key wordstar-C-o-map "\C-b" 'switch-to-buffer)
   (define-key wordstar-C-o-map "j" 'justify-current-line)
@@ -317,21 +183,133 @@
   (define-key wordstar-C-q-map "\C-y" 'ws-kill-eol)
   (define-key wordstar-C-q-map "\177" 'ws-kill-bol))
 
+;;;###autoload
+(defun wordstar-mode ()
+  "Major mode with WordStar-like key bindings.
 
-(defun center-paragraph ()
+BUGS:
+ - Help menus with WordStar commands (C-j just calls help-for-help)
+   are not implemented
+ - Options for search and replace
+ - Show markers (C-k h) is somewhat strange
+ - Search and replace (C-q a) is only available in forward direction
+
+No key bindings beginning with ESC are installed, they will work
+Emacs-like.
+
+The key bindings are:
+
+  C-a		backward-word
+  C-b		fill-paragraph
+  C-c		scroll-up-line
+  C-d		forward-char
+  C-e		previous-line
+  C-f		forward-word
+  C-g		delete-char
+  C-h		backward-char
+  C-i		indent-for-tab-command
+  C-j		help-for-help
+  C-k		ordstar-C-k-map
+  C-l		ws-repeat-search
+  C-n		open-line
+  C-p		quoted-insert
+  C-r		scroll-down-line
+  C-s		backward-char
+  C-t		kill-word
+  C-u		keyboard-quit
+  C-v		overwrite-mode
+  C-w		scroll-down
+  C-x		next-line
+  C-y		kill-complete-line
+  C-z		scroll-up
+
+  C-k 0		ws-set-marker-0
+  C-k 1		ws-set-marker-1
+  C-k 2		ws-set-marker-2
+  C-k 3		ws-set-marker-3
+  C-k 4		ws-set-marker-4
+  C-k 5		ws-set-marker-5
+  C-k 6		ws-set-marker-6
+  C-k 7		ws-set-marker-7
+  C-k 8		ws-set-marker-8
+  C-k 9		ws-set-marker-9
+  C-k b		ws-begin-block
+  C-k c		ws-copy-block
+  C-k d		save-buffers-kill-emacs
+  C-k f		find-file
+  C-k h		ws-show-markers
+  C-k i		ws-indent-block
+  C-k k		ws-end-block
+  C-k p		ws-print-block
+  C-k q		kill-emacs
+  C-k r		insert-file
+  C-k s		save-some-buffers
+  C-k t		ws-mark-word
+  C-k u		ws-exdent-block
+  C-k C-u	keyboard-quit
+  C-k v		ws-move-block
+  C-k w		ws-write-block
+  C-k x		kill-emacs
+  C-k y		ws-delete-block
+
+  C-o c		wordstar-center-line
+  C-o b		switch-to-buffer
+  C-o j		justify-current-line
+  C-o k		kill-buffer
+  C-o l		list-buffers
+  C-o m		auto-fill-mode
+  C-o r		set-fill-column
+  C-o C-u	keyboard-quit
+  C-o wd	delete-other-windows
+  C-o wh	split-window-horizontally
+  C-o wo	other-window
+  C-o wv	split-window-vertically
+
+  C-q 0		ws-find-marker-0
+  C-q 1		ws-find-marker-1
+  C-q 2		ws-find-marker-2
+  C-q 3		ws-find-marker-3
+  C-q 4		ws-find-marker-4
+  C-q 5		ws-find-marker-5
+  C-q 6		ws-find-marker-6
+  C-q 7		ws-find-marker-7
+  C-q 8		ws-find-marker-8
+  C-q 9		ws-find-marker-9
+  C-q a		ws-query-replace
+  C-q b		ws-to-block-begin
+  C-q c		end-of-buffer
+  C-q d		end-of-line
+  C-q f		ws-search
+  C-q k		ws-to-block-end
+  C-q l		ws-undo
+  C-q p		ws-last-cursorp
+  C-q r		beginning-of-buffer
+  C-q C-u	keyboard-quit
+  C-q w		ws-last-error
+  C-q y		ws-kill-eol
+  C-q DEL	ws-kill-bol
+"
+  (interactive)
+  (kill-all-local-variables)
+  (use-local-map wordstar-mode-map)
+  (setq mode-name "WordStar")
+  (setq major-mode 'wordstar-mode))
+
+
+(defun wordstar-center-paragraph ()
   "Center each line in the paragraph at or after point.
-See center-line for more info."
+See `wordstar-center-line' for more info."
   (interactive)
   (save-excursion
     (forward-paragraph)
     (or (bolp) (newline 1))
     (let ((end (point)))
       (backward-paragraph)
-      (center-region (point) end))))
+      (wordstar-center-region (point) end))))
 
-(defun center-region (from to)
+(defun wordstar-center-region (from to)
   "Center each line starting in the region.
-See center-line for more info."
+See `wordstar-center-line' for more info."
   (interactive "r")
   (if (> from to)
       (let ((tem to))
@@ -341,10 +319,10 @@
       (narrow-to-region from to)
       (goto-char from)
       (while (not (eobp))
-	(center-line)
+	(wordstar-center-line)
 	(forward-line 1)))))
 
-(defun center-line ()
+(defun wordstar-center-line ()
   "Center the line point is on, within the width specified by `fill-column'.
 This means adjusting the indentation to match
 the distance between the end of the text and `fill-column'."
@@ -496,7 +474,7 @@
 
 
 (defun ws-indent-block ()
-  "In WordStar mode: Indent block (not yet implemeted)."
+  "In WordStar mode: Indent block (not yet implemented)."
   (interactive)
   (ws-error "Indent block not yet implemented"))
 
@@ -515,10 +493,10 @@
   "In WordStar mode: Mark current word as block."
   (interactive)
   (save-excursion
-    (forward-word)
+    (forward-word 1)
     (sit-for 1)
     (ws-end-block)
-    (backward-word)
+    (forward-word -1)
     (sit-for 1)
     (ws-begin-block)))
 
@@ -531,7 +509,8 @@
   "In WordStar mode: Move block to current cursor position."
   (interactive)
   (if (and ws-block-begin-marker ws-block-end-marker)
-      (let () 
+      (let ()
+	;; XEmacs
 	(kill-region ws-block-begin-marker ws-block-end-marker 'silent)
 	(yank)
 	(save-excursion
@@ -724,7 +703,7 @@
 
 (defun ws-kill-bol ()
   "In WordStar mode: Kill to beginning of line 
-(like WordStar, not like Emacs)."
+\(like WordStar, not like Emacs)."
   (interactive)
   (let ((p (point)))
     (beginning-of-line)
--- a/lisp/games/NeXTify.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/NeXTify.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,3 +1,32 @@
+;;; NeXTify.el --- Character insertion variation
+
+;; Copyright status unknown
+
+;; Author: Unknown
+;; Keywords: games
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;;; Code:
 (defun SeLF-insert-command (arg)
   "Insert the character you TyPE.
 Whichever character you TyPE to run ThIS command is inserted."
@@ -25,3 +54,5 @@
 (define-key text-mode-map "_" 'SeLF-insert-command)
 (define-key text-mode-map ";" 'SeLF-insert-command)
 (define-key text-mode-map ":" 'SeLF-insert-command)
+
+;;; NeXTify.el ends here
--- a/lisp/games/blackbox.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/blackbox.el	Mon Aug 13 09:03:46 2007 +0200
@@ -19,54 +19,54 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
-; by F. Thomas May <uw-nsr!uw-warp!tom@beaver.cs.washington.edu>
-; doc comment by Root Boy Jim <rbj@dsys.icst.nbs.gov>, 27 Apr 89
-; interface improvements by ESR, Dec 5 1991.
+;; by F. Thomas May <uw-nsr!uw-warp!tom@beaver.cs.washington.edu>
+;; doc comment by Root Boy Jim <rbj@dsys.icst.nbs.gov>, 27 Apr 89
+;; interface improvements by ESR, Dec 5 1991.
+
+;; The object of the game is to find four hidden balls by shooting rays
+;; into the black box.  There are four possibilities: 1) the ray will
+;; pass thru the box undisturbed, 2) it will hit a ball and be absorbed,
+;; 3) it will be deflected and exit the box, or 4) be deflected immediately,
+;; not even being allowed entry into the box.
 
-; The object of the game is to find four hidden balls by shooting rays
-; into the black box.  There are four possibilities: 1) the ray will
-; pass thru the box undisturbed, 2) it will hit a ball and be absorbed,
-; 3) it will be deflected and exit the box, or 4) be deflected immediately,
-; not even being allowed entry into the box.
-; 
-; The strange part is the method of deflection.  It seems that rays will
-; not pass next to a ball, and change direction at right angles to avoid it.
-; 
-; 		             R   3   
-; 		 1 - - - - - - - - 1 
-; 		   - - - - - - - -   
-; 		   - O - - - - - - 3 
-; 		 2 - - - - O - O -   
-; 		 4 - - - - - - - - 
-; 		 5 - - - - - - - - 5 
-; 		   - - - - - - - - R 
-; 		 H - - - - - - - O   
-; 		   2   H 4       H   
-; 
-; Rays which enter and exit are numbered.  You can see that rays 1 & 5 pass
-; thru the box undisturbed. Ray 2 is deflected by the northwesternmost
-; ball.  Likewise rays 3 and 4. Rays which hit balls and are absorbed are
-; marked with H.  The bottom of the left and the right of the bottom hit
-; the southeastern ball directly.  Rays may also hit balls after being
-; reflected. Consider the H on the bottom next to the 4.  It bounces off
-; the NW-ern most ball and hits the central ball.  A ray shot from above
-; the right side 5 would hit the SE-ern most ball.  The R beneath the 5
-; is because the ball is returned instantly.  It is not allowed into
-; the box if it would reflect immediately.  The R on the top is a more
-; leisurely return.  Both central balls would tend to deflect it east
-; or west, but it cannot go either way, so it just retreats.
-;
-; At the end of the game, if you've placed guesses for as many balls as
-; there are in the box, the true board position will be revealed.  Each
-; `x' is an incorrect guess of yours; `o' is the true location of a ball.
+;; The strange part is the method of deflection.  It seems that rays will
+;; not pass next to a ball, and change direction at right angles to avoid it.
+;; 
+;; 		             R   3   
+;; 		 1 - - - - - - - - 1 
+;; 		   - - - - - - - -   
+;; 		   - O - - - - - - 3 
+;; 		 2 - - - - O - O -   
+;; 		 4 - - - - - - - - 
+;; 		 5 - - - - - - - - 5 
+;; 		   - - - - - - - - R 
+;; 		 H - - - - - - - O   
+;; 		   2   H 4       H   
+;; 
+;; Rays which enter and exit are numbered.  You can see that rays 1 & 5 pass
+;; thru the box undisturbed. Ray 2 is deflected by the northwesternmost
+;; ball.  Likewise rays 3 and 4. Rays which hit balls and are absorbed are
+;; marked with H.  The bottom of the left and the right of the bottom hit
+;; the southeastern ball directly.  Rays may also hit balls after being
+;; reflected. Consider the H on the bottom next to the 4.  It bounces off
+;; the NW-ern most ball and hits the central ball.  A ray shot from above
+;; the right side 5 would hit the SE-ern most ball.  The R beneath the 5
+;; is because the ball is returned instantly.  It is not allowed into
+;; the box if it would reflect immediately.  The R on the top is a more
+;; leisurely return.  Both central balls would tend to deflect it east
+;; or west, but it cannot go either way, so it just retreats.
+
+;; At the end of the game, if you've placed guesses for as many balls as
+;; there are in the box, the true board position will be revealed.  Each
+;; `x' is an incorrect guess of yours;; `o' is the true location of a ball.
 
 ;;; Code:
 
@@ -236,6 +236,7 @@
   (blackbox-mode)
   (setq buffer-read-only t)
   (buffer-disable-undo (current-buffer))
+  ;; XEmacs makes some local variables here and FSF doesn't.
   (make-local-variable 'bb-board)
   (setq bb-board (bb-init-board (or num 4)))
   (make-local-variable 'bb-balls-placed)
@@ -434,5 +435,3 @@
    (t (cons (car list) (bb-delete item (cdr list))))))
 
 ;;; blackbox.el ends here
-
-
--- a/lisp/games/conx.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/conx.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,11 +1,34 @@
-;;; -*- Mode:Emacs-Lisp; Blat:Foop -*-
+;;; conx.el --- Yet another dissociater
+
+;; Copyright status unknown
+
+;; Author: Jamie Zawinski <jwz@netscape.com>
+;; Keywords: games
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
 
 ;;; conx.el: Yet Another Dissociator.
 ;;; Original design by Skef Wholey <skef@cs.cmu.edu>;
-;;; ported to Emacs-Lisp by Jamie Zawinski <jwz@lucid.com>, 5-mar-91.
-;;;
-(defconst conx-version "1.6,  6-may-94.")
-;;;
+;;; ported to Emacs-Lisp by Jamie Zawinski <jwz@netscape.com>, 5-mar-91.
 ;;; Run this compiled.  It will be an order of magnitude faster.
 ;;;
 ;;; Select a buffer with a lot of text in it.  Say M-x conx-buffer
@@ -46,6 +69,9 @@
 ;;;
 ;;;  o  It could stand to be faster...
 
+;;; Code:
+(defconst conx-version "1.6,  6-may-94.")
+
 (defvar conx-bounce 10) ; 1/x
 (defvar conx-hashtable-size 9923)  ; 9923 is prime
 (defconst conx-words-hashtable nil)
@@ -53,7 +79,7 @@
 (defconst conx-words-vector-fp 0)
 
 (defconst conx-last-word nil)
-
+p
 (defvar conx-files nil "FYI")
 
 (defun conx-init ()
@@ -777,3 +803,4 @@
 	    conx-words-hashtable)
   (sort-numeric-fields -1 (point-min) (point-max)))
 
+;;; conx.el ends here
--- a/lisp/games/cookie1.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/cookie1.el	Mon Aug 13 09:03:46 2007 +0200
@@ -20,11 +20,11 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -106,7 +106,7 @@
     (if sym
 	(symbol-value sym)
       (setq sym (intern phrase-file cookie-cache))
-      (message startmsg)
+      (message "%s" startmsg)
       (save-excursion
 	(let ((buf (generate-new-buffer "*cookie*"))
 	      (result nil))
@@ -117,6 +117,7 @@
 	  (while (progn (skip-chars-forward " \t\n\r\f") (not (eobp)))
 	    (let ((beg (point)))
 	      (re-search-forward cookie-delimiter)
+	      ;; XEmacs change
 	      ;; DBC --- here's the change
 	      ;; This used to be (buffer-substring beg (1- (point))),
 	      ;; which only worked if the regexp matched was one
@@ -125,7 +126,7 @@
 						   (match-beginning 0))
 				 result))))
 	  (kill-buffer buf)
-	  (message endmsg)
+	  (message "%s" endmsg)
 	  (set sym (apply 'vector result)))))))
 
 (defun read-cookie (prompt phrase-file startmsg endmsg &optional require-match)
--- a/lisp/games/dissociate.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/dissociate.el	Mon Aug 13 09:03:46 2007 +0200
@@ -18,11 +18,11 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
--- a/lisp/games/doctor.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/doctor.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,7 @@
 ;;; doctor.el --- psychological help for frustrated users.
+;;; (uncensored version--see below)
 
-;; Copyright (C) 1985, 1987, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1994, 1996  Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: games
@@ -18,11 +19,11 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -30,6 +31,17 @@
 ;; phrase-production techniques similar to the classic ELIZA demonstration
 ;; of pseudo-AI.
 
+;; Original Censorship message:
+;; This file has been censored by the Communications Decency Act.
+;; Some of its features were removed.  The law was promoted as a ban
+;; on pornography, but it bans far more than that.  The doctor program
+;; did not contain pornography, but part of it was prohibited
+;; nonetheless.
+
+;; For information on US government censorship of the Internet, and
+;; what you can do to bring back freedom of the press, see the web
+;; site http://www.vtw.org/
+
 ;;; Code:
 
 (defun doctor-cadr (x) (car (cdr x)))
@@ -226,7 +238,7 @@
   (make-local-variable 'feelings-about)
   (setq feelings-about
 	'((feelings about)
-	  (aprehensions toward)
+	  (apprehensions toward)
 	  (thoughts on)
 	  (emotions toward)))
   (make-local-variable 'random-adjective)
@@ -605,7 +617,7 @@
 (doctor-put-meaning ibm 'mach)
 (doctor-put-meaning pc 'mach)
 (doctor-put-meaning bitching 'foul)
-(doctor-put-meaning shit 'foul)
+(doctor-put-meaning shit 'foul)	; Censored
 (doctor-put-meaning bastard 'foul)
 (doctor-put-meaning damn 'foul)
 (doctor-put-meaning damned 'foul)
@@ -680,7 +692,7 @@
 (doctor-put-meaning lonely 'mood)
 (doctor-put-meaning angry 'mood)
 (doctor-put-meaning mad 'mood)
-(doctor-put-meaning pissed 'mood)
+(doctor-put-meaning pissed 'mood)	; censored
 (doctor-put-meaning jealous 'mood)
 (doctor-put-meaning afraid 'fear)
 (doctor-put-meaning terrified 'fear)
@@ -694,8 +706,8 @@
 (doctor-put-meaning cocks 'sexnoun)
 (doctor-put-meaning dick 'sexnoun)
 (doctor-put-meaning dicks 'sexnoun)
-(doctor-put-meaning cunt 'sexnoun)
-(doctor-put-meaning cunts 'sexnoun)
+(doctor-put-meaning cunt 'sexnoun)	; censored
+(doctor-put-meaning cunts 'sexnoun)	; censored
 (doctor-put-meaning prostitute 'sexnoun)
 (doctor-put-meaning condom 'sexnoun)
 (doctor-put-meaning sex 'sexnoun)
@@ -753,18 +765,18 @@
 (doctor-put-meaning wine 'alcohol)
 (doctor-put-meaning whiskey 'alcohol)
 (doctor-put-meaning scotch 'alcohol)
-(doctor-put-meaning fuck 'sexverb)
-(doctor-put-meaning fucked 'sexverb)
+(doctor-put-meaning fuck 'sexverb)	; censored
+(doctor-put-meaning fucked 'sexverb)	; censored
 (doctor-put-meaning screw 'sexverb)
 (doctor-put-meaning screwing 'sexverb)
-(doctor-put-meaning fucking 'sexverb)
+(doctor-put-meaning fucking 'sexverb)	; censored
 (doctor-put-meaning rape 'sexverb)
 (doctor-put-meaning raped 'sexverb)
 (doctor-put-meaning kiss 'sexverb)
 (doctor-put-meaning kissing 'sexverb)
 (doctor-put-meaning kisses 'sexverb)
 (doctor-put-meaning screws 'sexverb)
-(doctor-put-meaning fucks 'sexverb)
+(doctor-put-meaning fucks 'sexverb)	; censored
 (doctor-put-meaning because 'conj)
 (doctor-put-meaning but 'conj)
 (doctor-put-meaning however 'conj)
@@ -862,7 +874,7 @@
     (setq bak sent)))
 
 (defun doctor-readin nil
-  "Read a sentence. Return it as a list of words."
+  "Read a sentence.  Return it as a list of words."
   (let (sentence)
     (backward-sentence 1)
     (while (not (eobp))
@@ -882,11 +894,11 @@
 (defun doctor-doc (sent)
   (cond
    ((equal sent '(foo))
-    (doctor-type '(bar! ($ please)($ continue))))
+    (doctor-type '(bar! ($ please)($ continue) \.)))
    ((member sent howareyoulst)
     (doctor-type '(i\'m ok \.  ($ describe) yourself \.)))
    ((or (member sent '((good bye) (see you later) (i quit) (so long)
-                       (go away) (get lost)))
+		       (go away) (get lost)))
 	(memq (car sent)
 	      '(bye halt break quit done exit goodbye 
 		    bye\, stop pause goodbye\, stop pause)))
@@ -1002,8 +1014,8 @@
   (setq history (reverse (cdr (reverse history)))))
 
 (defun doctor-query (x)
-  "Prompt for a line of input from the minibuffer until a noun or
-verb is seen.  Put dialogue in buffer."
+  "Prompt for a line of input from the minibuffer until a noun or verb is seen.
+Put dialogue in buffer."
   (let (a
 	(prompt (concat (doctor-make-string x)
 			" what \?  "))
@@ -1026,9 +1038,9 @@
     retval))
 
 (defun doctor-subjsearch (sent key type)
-  "Search for the subject of a sentence SENT, looking for the noun closest to
-and preceding KEY by at least TYPE words. Set global variable subj to the
-subject noun, and return the portion of the sentence following it."
+  "Search for the subject of a sentence SENT, looking for the noun closest
+to and preceding KEY by at least TYPE words.  Set global variable subj to
+the subject noun, and return the portion of the sentence following it."
   (let ((i (- (length sent) (length (memq key sent)) type)))
     (while (and (> i -1) (not (doctor-nounp (nth i sent))))
       (setq i (1- i)))
@@ -1078,8 +1090,8 @@
 		expect expected expects expel expels expelled
 		explain explained explains
 		fart farts feel feels felt fight fights find finds finding
-		forget forgets forgot fought found fuck fucked
-		fucking fucks
+		forget forgets forgot fought found fuck fucked	; censored
+		fucking fucks	; censored
 		gave get gets getting give gives go goes going gone got gotten
 		had harm harms has hate hated hates have having
 		hear heard hears hearing help helped helping helps
@@ -1220,7 +1232,7 @@
   (memq x '(all also always amusing any anyway associated awesome
 		bad beautiful best better but certain clear
 		ever every fantastic fun funny
-		good great gross growdy however if ignorant
+		good great grody gross however if ignorant
 		less linked losing lusing many more much
 		never nice obnoxious often poor pretty real related rich
 		similar some stupid super superb
@@ -1310,8 +1322,8 @@
   (memq x '(?a ?e ?i ?o ?u)))
 
 (defun doctor-replace (sent rlist)
-  "Replace any element of SENT that is the car of a replacement element
-pair in RLIST."
+  "Replace any element of SENT that is the car of a replacement
+element pair in RLIST."
   (apply 'append
 	 (mapcar
 	  (function
@@ -1332,9 +1344,9 @@
 
 (defun doctor-svo (sent key type mem)
   "Find subject, verb and object in sentence SENT with focus on word KEY.
-TYPE is number of words preceding KEY to start looking for subject. MEM is
-t if results are to be put on Doctor's memory stack.
-Return is in global variables `subj', `verb' and `object'."
+TYPE is number of words preceding KEY to start looking for subject.
+MEM is t if results are to be put on Doctor's memory stack.
+Return in the global variables SUBJ, VERB and OBJECT."
   (let ((foo (doctor-subjsearch sent key type)))
     (or foo
 	(setq foo sent
@@ -1348,8 +1360,8 @@
     (cond (mem (doctor-remember (list subj verb obj))))))
 
 (defun doctor-possess (sent key)
-  "Set possessive in SENT for keyword KEY. Hack on previous word, setting
-global variable `owner' to possibly correct result."
+  "Set possessive in SENT for keyword KEY.
+Hack on previous word, setting global variable OWNER to correct result."
   (let* ((i (- (length sent) (length (memq key sent)) 1))
 	 (prev (if (< i 0) 'your
 		 (nth i sent))))
@@ -1623,7 +1635,7 @@
 
 (defun doctor-strangelove ()
   (interactive)
-  (insert "Mein fuhrer!!\n")
+  (insert "Mein fuehrer!!\n")
   (doctor-read-print))
 
 ;;; doctor.el ends here
--- a/lisp/games/dunnet.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/dunnet.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,10 +1,11 @@
 ;;; dunnet.el --- Text adventure for Emacs
 
+;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+
 ;; Author: Ron Schnell <ronnie@media.mit.edu>
 ;; Created: 25 Jul 1992
 ;; Version: 2.0
 ;; Keywords: games
-;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
 
 ;; This file is part of XEmacs.
 
@@ -19,11 +20,11 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -32,7 +33,7 @@
 
 ;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
 ;;;  The log file should be set for your system, and it must
-;;;  be writeable by all.
+;;;  be writable by all.
 
 
 (defvar dun-log-file "/usr/local/dunnet.score"
@@ -41,7 +42,8 @@
 (if nil
     (eval-and-compile (setq byte-compile-warnings nil)))
 
-(require 'cl)
+(eval-when-compile
+  (require 'cl))
 
 ;;;; Mode definitions for interactive mode
 
@@ -49,6 +51,8 @@
   "Major mode for running dunnet."
   (interactive)
   (text-mode)
+  (make-local-variable 'scroll-step)
+  (setq scroll-step 2)
   (use-local-map dungeon-mode-map)
   (setq major-mode 'dungeon-mode)
   (setq mode-name "Dungeon"))
@@ -425,19 +429,22 @@
 (defun dun-climb (obj)
   (let (objnum)
     (setq objnum (dun-objnum-from-args obj))
-    (if (and (not (= objnum obj-special))
-	     (not (member objnum (nth dun-current-room dun-room-objects)))
-	     (not (member objnum (nth dun-current-room dun-room-silents)))
-	     (not (member objnum dun-inventory)))
-	(dun-mprincl "I don't see that here.")
-      (if (and (= objnum obj-special)
-	       (not (member obj-tree (nth dun-current-room dun-room-silents))))
-	  (dun-mprincl "There is nothing here to climb.")
-	(if (and (not (= objnum obj-tree)) (not (= objnum obj-special)))
-	    (dun-mprincl "You can't climb that.")
-	  (dun-mprincl
-"You manage to get about two feet up the tree and fall back down.  You
-notice that the tree is very unsteady."))))))
+    (cond ((null objnum)
+	   (dun-mprincl "I don't know that name."))
+	  ((and (not (eq objnum obj-special))
+		(not (member objnum (nth dun-current-room dun-room-objects)))
+		(not (member objnum (nth dun-current-room dun-room-silents)))
+		(not (member objnum dun-inventory)))
+	   (dun-mprincl "I don't see that here."))
+	  ((and (eq objnum obj-special)
+		(not (member obj-tree (nth dun-current-room dun-room-silents))))
+	   (dun-mprincl "There is nothing here to climb."))
+	  ((and (not (eq objnum obj-tree)) (not (eq objnum obj-special)))
+	   (dun-mprincl "You can't climb that."))
+	  (t
+	   (dun-mprincl
+	    "You manage to get about two feet up the tree and fall back down.  You
+notice that the tree is very unsteady.")))))
 
 (defun dun-eat (obj)
   (let (objnum)
@@ -790,7 +797,7 @@
 (defun dun-sauna-heat ()
   (if (= dun-sauna-level 0)
       (dun-mprincl 
-       "The termperature has returned to normal room termperature."))
+       "The temperature has returned to normal room temperature."))
   (if (= dun-sauna-level 1)
       (dun-mprincl "It is now luke warm in here.  You begin to sweat."))
   (if (= dun-sauna-level 2)
@@ -1342,6 +1349,7 @@
 (defvar dungeon-mode-map nil)
 (setq dungeon-mode-map (make-sparse-keymap))
 (define-key dungeon-mode-map "\r" 'dun-parse)
+;; XEmacs
 (defvar dungeon-batch-map
   (let ((map (make-keymap))
         (n 32))
@@ -1920,7 +1928,7 @@
 		     (type . dun-type)  (insert . dun-put)
 		     (score . dun-score) (help . dun-help) (quit . dun-quit) 
 		     (read . dun-examine) (verbose . dun-long) 
-		     (urinate . dun-piss) (piss . dun-piss)
+		     (urinate . dun-piss) (piss . dun-piss)	; censored
 		     (flush . dun-flush) (sleep . dun-sleep) (lie . dun-sleep) 
 		     (x . dun-examine) (break . dun-break) (drive . dun-drive)
 		     (board . dun-in) (enter . dun-in) (turn . dun-turn)
@@ -2095,7 +2103,7 @@
 		 (floppy . 27) (disk . 27)
 		 
 		 (boulder . -1)
-		 (tree . -2) (trees . -2) 
+		 (tree . -2) (trees . -2) (palm . -2) 
 		 (bear . -3)
 		 (bin . -4) (bins . -4)
 		 (cabinet . -5) (computer . -5) (vax . -5) (ibm . -5) 
@@ -2416,8 +2424,6 @@
 		  nil nil nil nil nil nil nil nil nil nil      ;31-40
 		  nil (list obj-platinum) nil nil nil nil nil nil nil nil))
 
-(setq scroll-step 2)
-
 (setq dun-room-shorts nil)
 (dolist (x dun-rooms)
   (setq dun-room-shorts  
@@ -2583,7 +2589,7 @@
 	(dun-mprincl "
 Welcome to Unix\n
 Please clean up your directories.  The filesystem is getting full.
-Our tcp/ip link to gamma is a little flakey, but seems to work.
+Our tcp/ip link to gamma is a little flaky, but seems to work.
 The current version of ftp can only send files from the current
 directory, and deletes them after they are sent!  Be careful.
 
@@ -2871,7 +2877,7 @@
 	      (dun-uexit nil))))))))
   
 (defun dun-cd (args)
-  (let (tcdpath tcdroom path-elemants room-check)
+  (let (tcdpath tcdroom path-elements room-check)
     (if (not (car args))
 	(dun-mprincl "Usage: cd <path>")
       (setq tcdpath dun-cdpath)
@@ -3330,3 +3336,5 @@
   (dun-mprinc "\n")
   (setq dun-batch-mode t)
   (dun-batch-loop))
+
+;;; dunnet.el ends here
--- a/lisp/games/flame.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/flame.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,3 +1,32 @@
+;;; flame.el --- Automated insults
+
+;; Copyright status Unknown
+
+;; Author: Unknown
+;; Adapted-By: Ian G. Batten, Batten@uk.ac.bham.multics
+;; Keywords: games
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
 ;;; "Flame" program.  This has a chequered past.
 ;;;
 ;;; The original was on a Motorola 286 running Vanilla V.1,
@@ -10,6 +39,7 @@
 ;;; Ian G. Batten, Batten@uk.ac.bham.multics
 ;;;
 
+;;; Code:
 (random t)
 
 (defvar sentence
@@ -308,3 +338,5 @@
     (flame2 (if (= (random 2) 0) 2 1))
     (sit-for 0)
     (doctor-ret-or-read 1)))
+
+;;; flame.el ends here
--- a/lisp/games/hanoi.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/hanoi.el	Mon Aug 13 09:03:46 2007 +0200
@@ -8,7 +8,24 @@
 ; This is in the public domain
 ; since he distributed it without copyright notice in 1985.
 
-;;; Synched up with: FSF 19.30.
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -57,57 +74,41 @@
   "Towers of Hanoi diversion.  Argument is number of rings."
   (interactive
    (list (if (null current-prefix-arg)
-	     3
-	     (prefix-numeric-value current-prefix-arg))))  
+             3
+	   (prefix-numeric-value current-prefix-arg))))  
   (if (<= nrings 0) (error "Negative number of rings"))
   (let* (floor-row
 	 fly-row
-	 (window-height (window-height (selected-window)))
+	 (window-height (1- (window-height (selected-window))))
 	 (window-width (window-width (selected-window)))
 
-	 ;; This is the unit of spacing to use between poles.  It
-	 ;; must be even.  We round down, since rounding up might
-	 ;; cause us to draw off the edge of the window.
-	 (pole-spacing (logand (/ window-width 6) (lognot 1))))
-    (let (
-	  ;; The poles are (1+ NRINGS) rows high; we also want an
-	  ;; empty row at the top for the flying rings, a base, and a
-	  ;; blank line underneath that.
-	  (h (+ nrings 4))
-
-	  ;; If we have NRINGS rings, we label them with the numbers 0
-	  ;; through NRINGS-1.  The width of ring i is 2i+3; it pokes
-	  ;; out i spaces on either side of the pole.  Rather than
-	  ;; checking if the window is wide enough to accommodate this,
-	  ;; we make sure pole-spacing is large enough, since that
-	  ;; works even when we have decremented pole-spacing to make
-	  ;; it even.
-	  (w (1+ nrings)))
-      (if (not (and (>= window-height h)
-		    (> pole-spacing w)))
-	  (progn
-	    (delete-other-windows)
-	    (if (not (and (>= (setq window-height
-				    (window-height (selected-window)))
-			      h)
-			  (> (setq pole-spacing
-				   (logand (/ window-width 6) (lognot 1)))
-			     w)))
-		(error "Screen is too small (need at least %dx%d)" w h))))
-      (setq floor-row (if (> (- window-height 3) h)
-			  (- window-height 3) window-height)))
+	 ;; This is half the spacing to use between poles.
+	 (pole-spacing (/ window-width 6)))
+    (if (not (and (> window-height (1+ nrings))
+		  (> pole-spacing nrings)))
+	(progn
+	  (delete-other-windows)
+	  (if (not (and (> (setq window-height
+				 (1- (window-height (selected-window))))
+			   (1+ nrings))
+			(> (setq pole-spacing (/ window-width 6))
+			   nrings)))
+	      (error "Window is too small (need at least %dx%d)"
+		     (* 6 (1+ nrings)) (+ 2 nrings)))))
+    (setq floor-row (if (> (- window-height 3) (1+ nrings))
+			(- window-height 3) window-height))
     (let ((fly-row (- floor-row nrings 1))
 	  ;; pole: column . fill height
-	  (pole-1 (cons pole-spacing floor-row))
-	  (pole-2 (cons (* 3 pole-spacing) floor-row))
-	  (pole-3 (cons (* 5 pole-spacing) floor-row))
+	  (pole-1 (cons (1- pole-spacing) floor-row))
+	  (pole-2 (cons (1- (* 3 pole-spacing)) floor-row))
+	  (pole-3 (cons (1- (* 5 pole-spacing)) floor-row))
 	  (rings (make-vector nrings nil)))
       ;; construct the ring list
       (let ((i 0))
 	(while (< i nrings)
 	  ;; ring: [pole-number string empty-string]
 	  (aset rings i (vector nil
-				(make-string (+ i i 3) (+ ?0 i))
+				(make-string (+ i i 3) (+ ?0 (% i 10)))
 				(make-string (+ i i 3) ?\  )))
 	  (setq i (1+ i))))
       ;;
@@ -126,7 +127,7 @@
 
       (let ((n 1))
 	(while (< n 6)
-	  (hanoi-topos fly-row (* n pole-spacing))
+	  (hanoi-topos fly-row (1- (* n pole-spacing)))
 	  (setq n (+ n 2))
 	  (let ((i fly-row))
 	    (while (< i floor-row)
@@ -151,10 +152,11 @@
 	  (setq i (1+ i))))
       (setq buffer-read-only t)
       (sit-for 0)
-      ;;
-      ;; do it!
-      ;;
-      (hanoi0 (1- nrings) pole-1 pole-2 pole-3)
+      ;; Disable display of line and column numbers, for speed.
+      (let ((line-number-mode nil)
+	    (column-number-mode nil))
+	;; do it!
+	(hanoi0 (1- nrings) pole-1 pole-2 pole-3))
       (goto-char (point-min))
       (message "Done")
       (setq buffer-read-only t)
--- a/lisp/games/life.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/life.el	Mon Aug 13 09:03:46 2007 +0200
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1988 Free Software Foundation, Inc.
 
-;; Author: Kyle Jones <talos!kjones@uunet.uu.net>
+;; Author: Kyle Jones <kyle@uunet.uu.net>
 ;; Keywords: games
 
 ;; This file is part of XEmacs.
@@ -18,11 +18,11 @@
 ;; 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.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
--- a/lisp/games/mpuz.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/mpuz.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,6 @@
 ;;; mpuz.el --- multiplication puzzle for XEmacs
 
-;;; Copyright (C) 1990 Free Software Foundation, Inc.
+;; Copyright (C) 1990 Free Software Foundation, Inc.
 
 ;; Author: Philippe Schnoebelen <phs@lifia.imag.fr>
 ;; Keywords: games
@@ -18,11 +18,11 @@
 ;; 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.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -188,7 +188,7 @@
 		   D (* A (/ B 10))
 		   E (* A B))
 	     (or (< C 1000) (< D 1000)))) ; forbid leading zeros in C or D
-    ;; Individual digits are now put on their respectives squares.
+    ;; Individual digits are now put on their respective squares.
     ;; [NB: A square is a pair <row,column> of the screen.]
     (mpuz-put-digit-on-board A		 '(2 . 9))
     (mpuz-put-digit-on-board (/ A 10)	 '(2 . 7))
--- a/lisp/games/spook.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/spook.el	Mon Aug 13 09:03:46 2007 +0200
@@ -19,24 +19,22 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
-; Steve Strassmann <straz@media-lab.media.mit.edu> didn't write
-; this, and even if he did, he really didn't mean for you to use it
-; in an anarchistic way.
-; May 1987
-
-; To use this:
-;  Just before sending mail, do M-x spook.
-;  A number of phrases will be inserted into your buffer, to help
-;  give your message that extra bit of attractiveness for automated
-;  keyword scanners.
+;; Steve Strassmann <straz@media-lab.media.mit.edu> didn't write
+;; this, and even if he did, he really didn't mean for you to use it
+;; in an anarchistic way.
+;;
+;; To use this:
+;;  Just before sending mail, do M-x spook.
+;;  A number of phrases will be inserted into your buffer, to help
+;;  give your message that extra bit of attractiveness for automated
+;;  keyword scanners.
 
 ;;; Code:
 
--- a/lisp/games/studly.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/studly.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,10 +1,29 @@
 ;;; studly.el --- StudlyCaps (tm)(r)(c)(xxx)
 
-;;; This is in the public domain, since it was distributed
-;;; by its author without a copyright notice in 1986.
+;; This is in the public domain, since it was distributed
+;; by its author without a copyright notice in 1986.
 
 ;; Keywords: games
 
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
 ;;; Commentary:
 
 ;; Functions to studlycapsify a region, word, or buffer.  Possibly the
--- a/lisp/games/yow.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/games/yow.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,6 @@
 ;;; yow.el --- quote random zippyisms
 
-;; Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Author: Richard Mlynarik
@@ -19,11 +19,10 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -38,15 +37,16 @@
 (require 'cookie1)
 
 (defvar yow-file (concat data-directory "yow.lines")
-   "File containing Pertinent Pinhead Phrases.")
+   "File containing pertinent Pinhead Phrases.")
+
+(defconst yow-load-message "Am I CONSING yet?...")
+(defconst yow-after-load-message "I have SEEN the CONSING!!")
 
 ;;;###autoload
 (defun yow (&optional insert)
   "Return or display a random Zippy quotation.  With prefix arg, insert it."
   (interactive "P")
-  (let ((yow (cookie
-	      yow-file
-              "Am I CONSING yet?..." "I have SEEN the CONSING!!")))
+  (let ((yow (cookie yow-file yow-load-message yow-after-load-message)))
     (cond (insert
 	   (insert yow))
 	  ((not (interactive-p))
@@ -65,30 +65,63 @@
 (defun read-zippyism (prompt &optional require-match)
   "Read a Zippyism from the minibuffer with completion, prompting with PROMPT.
 If optional second arg is non-nil, require input to match a completion."
-  (read-cookie prompt yow-file
-	       "Am I CONSING yet?..." "I have SEEN the CONSING!!"
+  (read-cookie prompt yow-file yow-load-message yow-after-load-message
 	       require-match))
+
 ;;;###autoload
 (defun insert-zippyism (&optional zippyism)
   "Prompt with completion for a known Zippy quotation, and insert it at point."
   (interactive (list (read-zippyism "Pinhead wisdom: " t)))
   (insert zippyism))
+
+;;;###autoload
+(defun apropos-zippy (regexp)
+  "Return a list of all Zippy quotes matching REGEXP.
+If called interactively, display a list of matches."
+  (interactive "sApropos Zippy (regexp): ")
+  ;; Make sure yows are loaded
+  (cookie yow-file yow-load-message yow-after-load-message)
+  (let* ((case-fold-search t)
+	 (cookie-table-symbol (intern yow-file cookie-cache))
+	 (string-table (symbol-value cookie-table-symbol))
+	 (matches nil)
+	 (len (length string-table))
+	 (i 0))
+    (save-match-data
+      (while (< i len)
+	(and (string-match regexp (aref string-table i))
+	     (setq matches (cons (aref string-table i) matches)))
+	(setq i (1+ i))))
+    (and matches
+	 (setq matches (sort matches 'string-lessp)))
+    (and (interactive-p)
+	 (cond ((null matches)
+		(message "No matches found."))
+	       (t
+		(let ((l matches))
+		  (with-output-to-temp-buffer "*Zippy Apropos*"
+		    (while l
+		      (princ (car l))
+		      (setq l (cdr l))
+		      (and l (princ "\n\n"))))))))
+    matches))
+
 
-; Yowza!! Feed zippy quotes to the doctor. Watch results.
-; fun, fun, fun. Entertainment for hours...
-;
-; written by Kayvan Aghaiepour
+;; Yowza!! Feed zippy quotes to the doctor. Watch results.
+;; fun, fun, fun. Entertainment for hours...
+;;
+;; written by Kayvan Aghaiepour
 
 ;;;###autoload
 (defun psychoanalyze-pinhead ()
   "Zippy goes to the analyst."
   (interactive)
   (doctor)				; start the psychotherapy
-  (message nil)
+  (message "")
   (switch-to-buffer "*doctor*")
   (sit-for 0)
   (while (not (input-pending-p))
-    (insert (yow))
+    (insert-string (yow))
     (sit-for 0)
     (doctor-ret-or-read 1)
     (doctor-ret-or-read 1)))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/modes/vhdl-mode.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,2647 @@
+;;; vhdl-mode.el --- major mode for editing VHDL code
+
+;; Copyright (C) 1994, 1995 Rodney J. Whitby
+;; Copyright (C) 1992, 1993, 1994 Barry A. Warsaw
+;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+
+;; Author:	  Rodney J. Whitby <rwhitby@asc.corp.mot.com>
+;; Maintainer:	  Rodney J. Whitby <rwhitby@asc.corp.mot.com>
+;; Created:	  June 1994, adapted from cc-mode.el 4.29 by Barry A. Warsaw.
+;; Version:	  $Revision: 1.1.1.1 $
+;; Last Modified: $Date: 1996/12/18 22:50:39 $
+;; Keywords:	  languages VHDL
+;; Archive:	  ftp.eda.com.au:/pub/emacs/vhdl-mode.tar.gz
+
+;; NOTE: Read the commentary below for the right way to submit bug reports!
+
+;; This file is not yet part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; This package provides indentation support for VHDL code.
+
+;; Details on VHDL-MODE are  now contained in an  accompanying texinfo
+;; manual (vhdl-mode.texi).
+
+;; To submit bug reports, hit "C-c C-b", and please try to include a
+;; code sample so I can reproduce your problem.  If you have other
+;; questions contact me at the address listed at the top of this file.
+
+;; YOU CAN IGNORE ALL BYTE-COMPILER WARNINGS. They are the result of
+;; the multi-Emacsen support. FSF Emacs 19 and XEmacs 19 (formerly
+;; Lucid) do things differently and there's no way to shut the
+;; byte-compiler up at the necessary granularity.  Let me say this
+;; again: YOU CAN IGNORE ALL BYTE-COMPILER WARNINGS (you'd be
+;; surprised at how many people don't follow this advice :-).
+
+;; To use VHDL-MODE, add the following to your .emacs file.  This
+;; assumes you will use .vhd extensions for your VHDL source:
+;;
+;; (autoload 'vhdl-mode   "vhdl-mode" "VHDL Editing Mode" t)
+;; (setq auto-mode-alist
+;;   (append '(("\\.vhd$"  . vhdl-mode)   ; to edit VHDL code
+;;            ) auto-mode-alist))
+;;
+;; If you would like to join the `vhdl-mode-announce' announcements
+;; list or the `vhdl-mode-victims' beta testers list, send add/drop
+;; requests to the address listed at the top of this file.
+;;
+;; Many, many thanks go out to all the folks on the beta test list.
+;; Without their patience, testing, insight, and code contributions,
+;; and encouragement vhdl-mode.el would be a far inferior package.
+;; Special thanks to Ken Wood <ken@eda.com.au> for providing an FTP
+;; repository for vhdl-mode.
+
+;; LCD Archive Entry:
+;; vhdl-mode.el|Rodney J. Whitby|rwhitby@asc.corp.mot.com
+;; |Major mode for editing VHDL code
+;; |$Date: 1996/12/18 22:50:39 $|$Revision: 1.1.1.1 $
+;; |ftp.eda.com.au:/pub/emacs/vhdl-mode.tar.gz
+
+
+;;; Code:
+
+;; user definable variables
+;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+
+(defvar vhdl-inhibit-startup-warnings-p nil
+  "*If non-nil, inhibits start up compatibility warnings.")
+(defvar vhdl-strict-syntax-p nil
+  "*If non-nil, all syntactic symbols must be found in `vhdl-offsets-alist'.
+If the syntactic symbol for a particular line does not match a symbol
+in the offsets alist, an error is generated, otherwise no error is
+reported and the syntactic symbol is ignored.")
+(defvar vhdl-echo-syntactic-information-p nil
+  "*If non-nil, syntactic info is echoed when the line is indented.")
+(defvar vhdl-basic-offset 2
+  "*Amount of basic offset used by + and - symbols in `vhdl-offsets-alist'.")
+
+(defconst vhdl-offsets-alist-default
+  '((string                . -1000)
+    (block-open            . 0)
+    (block-close           . 0)
+    (statement             . 0)
+    (statement-cont        . vhdl-lineup-statement-cont)
+    (statement-block-intro . +)
+    (statement-case-intro  . +)
+    (case-alternative      . +)
+    (comment               . vhdl-lineup-comment)
+    (arglist-intro         . vhdl-lineup-arglist-intro)
+    (arglist-cont          . 0)
+    (arglist-cont-nonempty . vhdl-lineup-arglist)
+    (arglist-close         . vhdl-lineup-arglist)
+    (entity                . 0)
+    (configuration         . 0)
+    (package               . 0)
+    (architecture          . 0)
+    (package-body          . 0)
+    )
+  "Default settings for offsets of syntactic elements.
+Do not change this constant!  See the variable `vhdl-offsets-alist' for
+more information.")
+
+(defvar vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default)
+  "*Association list of syntactic element symbols and indentation offsets.
+As described below, each cons cell in this list has the form:
+
+    (SYNTACTIC-SYMBOL . OFFSET)
+
+When a line is indented, vhdl-mode first determines the syntactic
+context of the line by generating a list of symbols called syntactic
+elements.  This list can contain more than one syntactic element and
+the global variable `vhdl-syntactic-context' contains the context list
+for the line being indented.  Each element in this list is actually a
+cons cell of the syntactic symbol and a buffer position.  This buffer
+position is call the relative indent point for the line.  Some
+syntactic symbols may not have a relative indent point associated with
+them.
+
+After the syntactic context list for a line is generated, vhdl-mode
+calculates the absolute indentation for the line by looking at each
+syntactic element in the list.  First, it compares the syntactic
+element against the SYNTACTIC-SYMBOL's in `vhdl-offsets-alist'.  When it
+finds a match, it adds the OFFSET to the column of the relative indent
+point.  The sum of this calculation for each element in the syntactic
+list is the absolute offset for line being indented.
+
+If the syntactic element does not match any in the `vhdl-offsets-alist',
+an error is generated if `vhdl-strict-syntax-p' is non-nil, otherwise
+the element is ignored.
+
+Actually, OFFSET can be an integer, a function, a variable, or one of
+the following symbols: `+', `-', `++', or `--'.  These latter
+designate positive or negative multiples of `vhdl-basic-offset',
+respectively: *1, *-1, *2, and *-2. If OFFSET is a function, it is
+called with a single argument containing the cons of the syntactic
+element symbol and the relative indent point.  The function should
+return an integer offset.
+
+Here is the current list of valid syntactic element symbols:
+
+ string                 -- inside multi-line string
+ block-open             -- statement block open
+ block-close            -- statement block close
+ statement              -- a VHDL statement
+ statement-cont         -- a continuation of a VHDL statement
+ statement-block-intro  -- the first line in a new statement block
+ statement-case-intro   -- the first line in a case alternative block
+ case-alternative       -- a case statement alternative clause
+ comment                -- a line containing only a comment
+ arglist-intro          -- the first line in an argument list
+ arglist-cont           -- subsequent argument list lines when no
+                           arguments follow on the same line as the
+                           the arglist opening paren
+ arglist-cont-nonempty  -- subsequent argument list lines when at
+                           least one argument follows on the same
+                           line as the arglist opening paren
+ arglist-close          -- the solo close paren of an argument list
+ entity                 -- inside an entity declaration
+ configuration          -- inside a configuration declaration
+ package                -- inside a package declaration
+ architecture           -- inside an architecture body
+ package-body           -- inside a package body
+")
+
+(defvar vhdl-tab-always-indent t
+  "*Controls the operation of the TAB key.
+If t, hitting TAB always just indents the current line.  If nil,
+hitting TAB indents the current line if point is at the left margin or
+in the line's indentation, otherwise it insert a real tab character.
+If other than nil or t, then tab is inserted only within literals
+-- defined as comments and strings -- and inside preprocessor
+directives, but line is always reindented.
+
+Note that indentation of lines containing only comments is also
+controlled by the `vhdl-comment-only-line-offset' variable.")
+
+(defvar vhdl-comment-only-line-offset 0
+  "*Extra offset for line which contains only the start of a comment.
+Can contain an integer or a cons cell of the form:
+
+ (NON-ANCHORED-OFFSET . ANCHORED-OFFSET)
+
+Where NON-ANCHORED-OFFSET is the amount of offset given to
+non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is
+the amount of offset to give column-zero anchored comment-only lines.
+Just an integer as value is equivalent to (<val> . 0)")
+
+(defvar vhdl-special-indent-hook nil
+  "*Hook for user defined special indentation adjustments.
+This hook gets called after a line is indented by the mode.")
+
+(defvar vhdl-style-alist
+  '(("IEEE"
+     (vhdl-basic-offset . 4)
+     (vhdl-offsets-alist . ())
+     )
+    )
+  "Styles of Indentation.
+Elements of this alist are of the form:
+
+  (STYLE-STRING (VARIABLE . VALUE) [(VARIABLE . VALUE) ...])
+
+where STYLE-STRING is a short descriptive string used to select a
+style, VARIABLE is any vhdl-mode variable, and VALUE is the intended
+value for that variable when using the selected style.
+
+There is one special case when VARIABLE is `vhdl-offsets-alist'.  In this
+case, the VALUE is a list containing elements of the form:
+
+  (SYNTACTIC-SYMBOL . VALUE)
+
+as described in `vhdl-offsets-alist'.  These are passed directly to
+`vhdl-set-offset' so there is no need to set every syntactic symbol in
+your style, only those that are different from the default.")
+
+;; dynamically append the default value of most variables
+(or (assoc "Default" vhdl-style-alist)
+    (let* ((varlist '(vhdl-inhibit-startup-warnings-p
+		      vhdl-strict-syntax-p
+		      vhdl-echo-syntactic-information-p
+		      vhdl-basic-offset
+		      vhdl-offsets-alist
+		      vhdl-tab-always-indent
+		      vhdl-comment-only-line-offset))
+	   (default (cons "Default"
+			  (mapcar
+			   (function
+			    (lambda (var)
+			      (cons var (symbol-value var))
+			      ))
+			   varlist))))
+      (setq vhdl-style-alist (cons default vhdl-style-alist))))
+
+(defvar vhdl-mode-hook nil
+  "*Hook called by `vhdl-mode'.")
+
+(defvar vhdl-mode-menu
+  '(["Comment Out Region"     comment-region (mark)]
+    ;; ["Indent Expression"      vhdl-indent-exp
+    ;; (memq (following-char) '(?\( ?\[ ?\{))]
+    ["Indent Line"            vhdl-indent-command t]
+    ["Backward Statement"     vhdl-beginning-of-statement t]
+    ;; ["Forward Statement"      vhdl-end-of-statement t]
+    )
+  "XEmacs 19 (formerly Lucid) menu for VHDL mode.")
+
+;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+;; NO USER DEFINABLE VARIABLES BEYOND THIS POINT
+
+
+;; Emacs variant handling, and standard mode variables and functions:
+
+(defconst vhdl-emacs-features
+  (let ((major (and (boundp 'emacs-major-version)
+		    emacs-major-version))
+	(minor (and (boundp 'emacs-minor-version)
+		    emacs-minor-version))
+	flavor)
+    ;; figure out version numbers if not already discovered
+    (and (or (not major) (not minor))
+	 (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version)
+	 (setq major (string-to-int (substring emacs-version
+					       (match-beginning 1)
+					       (match-end 1)))
+	       minor (string-to-int (substring emacs-version
+					       (match-beginning 2)
+					       (match-end 2)))))
+    (if (not (and major minor))
+	(error "Cannot figure out the major and minor version numbers."))
+    ;; calculate the major version
+    (cond
+     ((= major 18) (setq major 'v18))	;Emacs 18
+     ((= major 4)  (setq major 'v18))	;Epoch 4
+     ((= major 19) (setq major 'v19	;Emacs 19
+			 flavor (cond
+				 ((string-match "Win-Emacs" emacs-version)
+				  'Win-Emacs)
+				 ((or (string-match "Lucid" emacs-version)
+				      (string-match "XEmacs" emacs-version))
+				  'XEmacs)
+				 (t
+				  'FSF))))
+     ;; I don't know
+     (t (error "Cannot recognize major version number: %s" major)))
+    ;; lets do some minimal sanity checking.
+    (if (and (or
+	      ;; Emacs 18 is brain dead
+	      (eq major 'v18)
+	      ;; Lemacs before 19.6 had bugs
+	      (and (eq major 'v19) (eq flavor 'XEmacs) (< minor 6))
+	      ;; FSF 19 before 19.21 had bugs
+	      (and (eq major 'v19) (eq flavor 'FSF) (< minor 21)))
+	     (not vhdl-inhibit-startup-warnings-p))
+	(with-output-to-temp-buffer "*vhdl-mode warnings*"
+	  (print (format
+"The version of Emacs that you are running, %s,
+has known bugs in its syntax.c parsing routines which will affect the
+performance of vhdl-mode. You should strongly consider upgrading to the
+latest available version.  vhdl-mode may continue to work, after a
+fashion, but strange indentation errors could be encountered."
+		     emacs-version))))
+    (list major flavor))
+  "A list of features extant in the Emacs you are using.
+There are many flavors of Emacs out there, each with different
+features supporting those needed by vhdl-mode.  Here's the current
+supported list, along with the values for this variable:
+
+ Emacs 18/Epoch 4:           (v18)
+ XEmacs (formerly Lucid) 19: (v19 XEmacs)
+ Win-Emacs 1.35:             (V19 Win-Emacs)
+ FSF Emacs 19:               (v19 FSF).")
+
+(defvar vhdl-mode-abbrev-table nil
+  "Abbrev table in use in vhdl-mode buffers.")
+(define-abbrev-table 'vhdl-mode-abbrev-table ())
+
+(defvar vhdl-mode-map ()
+  "Keymap used in vhdl-mode buffers.")
+(if vhdl-mode-map
+    ()
+  ;; TBD: should we even worry about naming this keymap. My vote: no,
+  ;; because FSF and XEmacs (formerly Lucid) do it differently.
+  (setq vhdl-mode-map (make-sparse-keymap))
+  ;; put standard keybindings into MAP
+  (define-key vhdl-mode-map "\M-a"	'vhdl-beginning-of-statement)
+  ;;(define-key vhdl-mode-map "\M-e"	'vhdl-end-of-statement)
+  (define-key vhdl-mode-map "\M-\C-f"   'vhdl-forward-sexp)
+  (define-key vhdl-mode-map "\M-\C-b"   'vhdl-backward-sexp)
+  (define-key vhdl-mode-map "\M-\C-u"	'vhdl-backward-up-list)
+  ;;(define-key vhdl-mode-map "\M-\C-d"	'vhdl-down-list)
+  (define-key vhdl-mode-map "\M-\C-a"	'vhdl-beginning-of-defun)
+  (define-key vhdl-mode-map "\M-\C-e"	'vhdl-end-of-defun)
+  (define-key vhdl-mode-map "\M-\C-h"	'vhdl-mark-defun)
+  (define-key vhdl-mode-map "\M-\C-q"	'vhdl-indent-sexp)
+  (define-key vhdl-mode-map "\t"        'vhdl-indent-command)
+  (define-key vhdl-mode-map "\177"      'backward-delete-char-untabify)
+  ;; these are new keybindings, with no counterpart to BOCM
+  (define-key vhdl-mode-map "\C-c\C-b"  'vhdl-submit-bug-report)
+  (define-key vhdl-mode-map "\C-c\C-c"  'comment-region)
+  (define-key vhdl-mode-map "\C-c\C-o"  'vhdl-set-offset)
+  (define-key vhdl-mode-map "\C-c\C-r"  'vhdl-regress-line)
+  (define-key vhdl-mode-map "\C-c\C-s"  'vhdl-show-syntactic-information)
+  (define-key vhdl-mode-map "\C-c\C-v"  'vhdl-version)
+  ;; in XEmacs (formerly Lucid) 19, we want the menu to popup when
+  ;; the 3rd button is hit.  In 19.10 and beyond this is done
+  ;; automatically if we put the menu on mode-popup-menu variable,
+  ;; see c-common-init. RMS decided that this feature should not be
+  ;; included for FSF's Emacs.
+  (if (and (boundp 'current-menubar)
+	   (not (boundp 'mode-popup-menu)))
+      (define-key vhdl-mode-map 'button3 'vhdl-popup-menu))
+  )
+
+(defvar vhdl-mode-syntax-table nil
+  "Syntax table used in vhdl-mode buffers.")
+(if vhdl-mode-syntax-table
+    ()
+  (setq vhdl-mode-syntax-table (make-syntax-table))
+  ;; DO NOT TRY TO SET _ (UNDERSCORE) TO WORD CLASS!
+  (modify-syntax-entry ?\" "\""    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\$ "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\% "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\& "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\' "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\( "()"    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\) ")("    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\* "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\+ "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\. "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\/ "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\: "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\; "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\< "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\= "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\> "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\[ "(]"    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\\ "\\"    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\] ")["    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\{ "(}"    vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\| "."     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\} "){"    vhdl-mode-syntax-table)
+  ;; add comment syntax
+  (modify-syntax-entry ?\- ". 12"  vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\n ">"     vhdl-mode-syntax-table)
+  (modify-syntax-entry ?\^M ">"    vhdl-mode-syntax-table))
+
+(defvar vhdl-syntactic-context nil
+  "Buffer local variable containing syntactic analysis list.")
+(make-variable-buffer-local 'vhdl-syntactic-context)
+
+;; Support for outline modes
+
+(defconst vhdl-outline-regexp
+  (concat "\\(entity\\)\\|\\(package\\)\\|"
+	  "\\( *procedure\\)\\|\\( *function\\)\\|"
+	  "\\( *component\\)\\|\\(architecture\\)\\|"
+	  "\\(package body\\)\\|\\( *[A-Za-z][A-Za-z0-9_]* : block\\)\\|"
+	  "\\( *[A-Za-z][A-Za-z0-9_]* : process\\)\\|\\(configuration\\)"))
+
+(defun vhdl-outline-level ()		; was copied from c-outline-level
+  (save-excursion
+    (skip-chars-forward "\t ")
+    (current-column)))
+
+;; Support for font-lock
+
+(defconst vhdl-font-lock-keywords-1
+  (purecopy
+   (list
+    ;; Highlight names of common constructs
+    (list
+     (concat
+      "^[ \t]*\\(entity\\|architecture\\|configuration\\|function\\|"
+      "procedure\\|component\\|package[ \t]+body\\|package\\|"
+      "end[ \t]+\\(block\\|process\\|case\\|generate\\|loop\\)\\)[ \t]+"
+      "\\(\\(\\w\\|\\s_\\)+\\)")
+     3 'font-lock-function-name-face)
+    
+    ;; Highlight labels of common constructs
+    (list
+     (concat
+      "^[ \t]*\\(\\(\\w\\|\\s_\\)+\\)[ \t]*:[ \t\n]*\\(block\\|process\\|"
+      "if\\|for\\|case\\|exit\\|loop\\|next\\|null\\|with\\|"
+      "\\(\\w\\|\\s_\\)+[ \t\n]+port[ \t]+map\\)\\>[^_]")
+     1 'font-lock-function-name-face)
+    
+    ;; Highlight OF labels
+    (list
+     (concat
+      "^[ \t]*\\(configuration\\|architecture\\|attribute\\)[ \t]+"
+      "\\(\\(\\w\\|\\s_\\)+\\)[ \t]+of[ \t]+\\(\\(\\w\\|\\s_\\)+\\)")
+     4 'font-lock-function-name-face)
+    
+    ;; Fontify library useage clauses.
+    (list
+     (concat
+      "[^\\s_]\\<\\(library\\|use\\)[ \t\n]+\\(entity[ \t\n]+\\)?"
+      "\\(\\(\\w\\|\\s_\\|[\.()]\\)+\\)")
+     3 'font-lock-function-name-face)
+    ))
+  "For consideration as a value of `vhdl-font-lock-keywords'.
+This does fairly subdued highlighting of function names.")
+
+(defconst vhdl-font-lock-keywords-2
+  (purecopy
+   (append
+    vhdl-font-lock-keywords-1
+    (list
+     (list
+      (concat
+       "[^\\s_]\\<\\("
+       (mapconcat
+	'identity
+	'(
+	  ;; the following is a list of all reserved words known in VHDL'93
+	  "abs" "access" "after" "alias" "all" "and" "assert"
+	  "architecture" "array" "attribute"
+	  "begin" "block" "body" "buffer" "bus"
+	  "case" "component" "configuration" "constant"
+	  "disconnect" "downto"
+	  "else" "elsif" "end" "entity" "exit"
+	  "file" "for" "function"
+	  "generate" "generic" "group" "guarded"
+	  "if" "impure" "in" "inertial" "inout" "is"
+	  "label" "library" "linkage" "literal" "loop" 
+	  "map" "mod" 
+	  "nand" "new" "next" "nor" "not" "null"
+	  "of" "on" "open" "or" "others" "out"
+	  "package" "port" "postponed" "procedure" "process" "pure"
+	  "range" "record" "register" "reject" "rem" "report" "return"
+	  "rol" "ror"
+	  "select" "severity" "signal" "shared" "sla" "sll" "sra" "srl"
+	  "subtype"
+	  "then" "to" "transport" "type" 
+	  "unaffected" "units" "until" "use"
+	  "variable" "wait" "when" "while" "with" 
+	  "xnor" "xor"
+	  "note" "warning" "error" "failure"
+	  ;; the following list contains predefined attributes
+	  "base" "left" "right" "high" "low" "pos" "val" "succ"
+	  "pred" "leftof" "rightof" "range" "reverse_range"
+	  "length" "delayed" "stable" "quiet" "transaction"
+	  "event" "active" "last_event" "last_active" "last_value"
+	  "driving" "driving_value" "ascending" "value" "image"
+	  "simple_name" "instance_name" "path_name"
+	  "foreign"
+	  ;; the following list contains standardized types
+	  "boolean" "bit" "bit_vector" "character" "severity_level" "integer"
+	  "real" "time" "natural" "positive" "string" "text" "line"
+	  "unsigned" "signed"
+	  "std_logic" "std_logic_vector"
+	  "std_ulogic" "std_ulogic_vector"
+	  )
+	"\\|")
+       "\\)\\>[^\\s_]")
+      1 'font-lock-keyword-face)
+     )))
+  "For consideration as a value of `vhdl-font-lock-keywords'.
+This does a lot more highlighting.")
+
+;; The keywords in the preceding lists assume case-insensitivity.
+(put 'vhdl-mode 'font-lock-keywords-case-fold-search t)
+
+(defvar vhdl-font-lock-keywords vhdl-font-lock-keywords-1
+  "Additional expressions to highlight in VHDL mode.")
+
+;; This should eventually be subsumed into the respective functions in
+;; the source for "font-lock.el".
+(if (featurep 'advice)
+    (progn
+      (defadvice font-lock-use-default-minimal-decoration
+	(before vhdl-mode activate)
+	"Do it for VHDL mode too."
+	(setq vhdl-font-lock-keywords vhdl-font-lock-keywords-1))
+      
+      (defadvice font-lock-use-default-maximal-decoration
+	(before vhdl-mode activate)
+	"Do it for VHDL mode too."
+	(setq vhdl-font-lock-keywords vhdl-font-lock-keywords-2))
+      ))
+
+
+;; Main entry point for VHDL mode:
+
+;;;###autoload
+(defun vhdl-mode ()
+  "Major mode for editing VHDL code.
+vhdl-mode $Revision: 1.1.1.1 $
+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 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
+that came with the vhdl-mode distribution.
+
+The hook variable `vhdl-mode-hook' is run with no args, if that value is
+bound and has a non-nil value.
+
+Key bindings:
+\\{vhdl-mode-map}"
+  (interactive)
+  (kill-all-local-variables)
+  (set-syntax-table vhdl-mode-syntax-table)
+  (setq major-mode 'vhdl-mode
+	mode-name "VHDL"
+	local-abbrev-table vhdl-mode-abbrev-table)
+  (use-local-map vhdl-mode-map)
+  ;; set local variable values
+  (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
+  (set (make-local-variable 'require-final-newline) t)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (set (make-local-variable 'indent-line-function) 'vhdl-indent-line)
+  (set (make-local-variable 'comment-start) "-- ")
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-column) 32)
+  (set (make-local-variable 'comment-start-skip) "--+ *")
+  (set (make-local-variable 'outline-regexp) vhdl-outline-regexp)
+  (set (make-local-variable 'outline-level) 'vhdl-outline-level)
+
+  ;; setup the comment indent variable in a Emacs version portable way
+  ;; ignore any byte compiler warnings you might get here
+  (if (boundp 'comment-indent-function)
+      (progn
+	   (make-local-variable 'comment-indent-function)
+	   (setq comment-indent-function 'vhdl-comment-indent))
+    (make-local-variable 'comment-indent-hook)
+    (setq comment-indent-hook 'vhdl-comment-indent))
+  ;; put VHDL menu into menubar and on popup menu for XEmacs (formerly
+  ;; Lucid) 19. I think this happens automatically for FSF Emacs 19.
+  (if (and (boundp 'current-menubar)
+	   current-menubar
+	   (not (assoc mode-name current-menubar)))
+      (progn
+	(set-buffer-menubar (copy-sequence current-menubar))
+	(add-menu nil mode-name vhdl-mode-menu)))
+  (if (boundp 'mode-popup-menu)
+      (setq mode-popup-menu
+	    (cons (concat mode-name " Mode Commands") vhdl-mode-menu)))
+  (run-hooks 'vhdl-mode-hook))
+
+;; menus for XEmacs (formerly Lucid)
+
+(defun vhdl-popup-menu (e)
+  "Pops up the VHDL menu."
+  (interactive "@e")
+  (popup-menu (cons (concat mode-name " Mode Commands") vhdl-mode-menu))
+  (vhdl-keep-region-active))
+
+;; active regions
+
+(defun vhdl-keep-region-active ()
+  ;; do whatever is necessary to keep the region active in XEmacs
+  ;; (formerly Lucid). ignore byte-compiler warnings you might see
+  (and (boundp 'zmacs-region-stays)
+       (setq zmacs-region-stays t)))
+
+;; constant regular expressions for looking at various constructs
+
+(defconst vhdl-symbol-key "\\(\\w\\|\\s_\\)+"
+  "Regexp describing a VHDL symbol.
+We cannot use just `word' syntax class since `_' cannot be in word
+class.  Putting underscore in word class breaks forward word movement
+behavior that users are familiar with.")
+
+(defconst vhdl-case-alternative-key "when[( \t\n][^;=>]+=>"
+  "Regexp describing a case statement alternative key.")
+
+(defconst vhdl-case-header-key "case[( \t\n][^;=>]+[) \t\n]is"
+  "Regexp describing a case statement header key.")
+
+(defconst vhdl-label-key
+  (concat vhdl-symbol-key "\\s-*:")
+  "Regexp describing a VHDL label.")
+
+
+;; Macro definitions:
+
+(defmacro vhdl-point (position)
+  ;; Returns the value of point at certain commonly referenced POSITIONs.
+  ;; POSITION can be one of the following symbols:
+  ;; 
+  ;; bol  -- beginning of line
+  ;; eol  -- end of line
+  ;; bod  -- beginning of defun
+  ;; boi  -- back to indentation
+  ;; eoi  -- last whitespace on line
+  ;; ionl -- indentation of next line
+  ;; iopl -- indentation of previous line
+  ;; bonl -- beginning of next line
+  ;; bopl -- beginning of previous line
+  ;; 
+  ;; This function does not modify point or mark.
+  (or (and (eq 'quote (car-safe position))
+	   (null (cdr (cdr position))))
+      (error "bad buffer position requested: %s" position))
+  (setq position (nth 1 position))
+  (` (let ((here (point)))
+       (,@ (cond
+	    ((eq position 'bol)  '((beginning-of-line)))
+	    ((eq position 'eol)  '((end-of-line)))
+	    ((eq position 'bod)  '((save-match-data
+				     (vhdl-beginning-of-defun))))
+	    ((eq position 'boi)  '((back-to-indentation)))
+	    ((eq position 'eoi)  '((end-of-line)(skip-chars-backward " \t")))
+	    ((eq position 'bonl) '((forward-line 1)))
+	    ((eq position 'bopl) '((forward-line -1)))
+	    ((eq position 'iopl)
+	     '((forward-line -1)
+	       (back-to-indentation)))
+	    ((eq position 'ionl)
+	     '((forward-line 1)
+	       (back-to-indentation)))
+	    (t (error "unknown buffer position requested: %s" position))
+	    ))
+       (prog1
+	   (point)
+	 (goto-char here))
+       ;; workaround for an Emacs18 bug -- blech! Well, at least it
+       ;; doesn't hurt for v19
+       (,@ nil)
+       )))
+
+(defmacro vhdl-safe (&rest body)
+  ;; safely execute BODY, return nil if an error occurred
+  (` (condition-case nil
+	 (progn (,@ body))
+       (error nil))))
+
+(defmacro vhdl-add-syntax (symbol &optional relpos)
+  ;; a simple macro to append the syntax in symbol to the syntax list.
+  ;; try to increase performance by using this macro
+  (` (setq vhdl-syntactic-context
+	   (cons (cons (, symbol) (, relpos)) vhdl-syntactic-context))))
+
+(defmacro vhdl-has-syntax (symbol)
+  ;; a simple macro to return check the syntax list.
+  ;; try to increase performance by using this macro
+  (` (assoc (, symbol) vhdl-syntactic-context)))
+
+
+;; Syntactic element offset manipulation:
+
+(defun vhdl-read-offset (langelem)
+  ;; read new offset value for LANGELEM from minibuffer. return a
+  ;; legal value only
+  (let ((oldoff (format "%s" (cdr-safe (assq langelem vhdl-offsets-alist))))
+	(errmsg "Offset must be int, func, var, or one of +, -, ++, --: ")
+	(prompt "Offset: ")
+	offset input interned)
+    (while (not offset)
+      (setq input (read-string prompt oldoff)
+	    offset (cond ((string-equal "+" input) '+)
+			 ((string-equal "-" input) '-)
+			 ((string-equal "++" input) '++)
+			 ((string-equal "--" input) '--)
+			 ((string-match "^-?[0-9]+$" input)
+			  (string-to-int input))
+			 ((fboundp (setq interned (intern input)))
+			  interned)
+			 ((boundp interned) interned)
+			 ;; error, but don't signal one, keep trying
+			 ;; to read an input value
+			 (t (ding)
+			    (setq prompt errmsg)
+			    nil))))
+    offset))
+
+(defun vhdl-set-offset (symbol offset &optional add-p)
+  "Change the value of a syntactic element symbol in `vhdl-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
+`vhdl-offsets-alist' if it doesn't already appear there."
+  (interactive
+   (let* ((langelem
+	   (intern (completing-read
+		    (concat "Syntactic symbol to change"
+			    (if current-prefix-arg " or add" "")
+			    ": ")
+		    (mapcar
+		     (function
+		      (lambda (langelem)
+			(cons (format "%s" (car langelem)) nil)))
+		     vhdl-offsets-alist)
+		    nil (not current-prefix-arg)
+		    ;; initial contents tries to be the last element
+		    ;; on the syntactic analysis list for the current
+		    ;; line
+		    (let* ((syntax (vhdl-get-syntactic-context))
+			   (len (length syntax))
+			   (ic (format "%s" (car (nth (1- len) syntax)))))
+		      (if (memq 'v19 vhdl-emacs-features)
+			  (cons ic 0)
+			ic))
+		    )))
+	  (offset (vhdl-read-offset langelem)))
+     (list langelem offset current-prefix-arg)))
+  ;; sanity check offset
+  (or (eq offset '+)
+      (eq offset '-)
+      (eq offset '++)
+      (eq offset '--)
+      (integerp offset)
+      (fboundp offset)
+      (boundp offset)
+      (error "Offset must be int, func, var, or one of +, -, ++, --: %s"
+	     offset))
+  (let ((entry (assq symbol vhdl-offsets-alist)))
+    (if entry
+	(setcdr entry offset)
+      (if add-p
+	  (setq vhdl-offsets-alist (cons (cons symbol offset) vhdl-offsets-alist))
+	(error "%s is not a valid syntactic symbol." symbol))))
+  (vhdl-keep-region-active))
+
+(defun vhdl-set-style (style &optional local)
+  "Set vhdl-mode variables to use one of several different indentation styles.
+STYLE is a string representing the desired style and optional LOCAL is
+a flag which, if non-nil, means to make the style variables being
+changed buffer local, instead of the default, which is to set the
+global variables.  Interactively, the flag comes from the prefix
+argument.  The styles are chosen from the `vhdl-style-alist' variable."
+  (interactive (list (completing-read "Use which VHDL indentation style? "
+                                      vhdl-style-alist nil t)
+		     current-prefix-arg))
+  (let ((vars (cdr (assoc style vhdl-style-alist))))
+    (or vars
+	(error "Invalid VHDL indentation style `%s'" style))
+    ;; set all the variables
+    (mapcar
+     (function
+      (lambda (varentry)
+	(let ((var (car varentry))
+	      (val (cdr varentry)))
+	  (and local
+	       (make-local-variable var))
+	  ;; special case for vhdl-offsets-alist
+	  (if (not (eq var 'vhdl-offsets-alist))
+	      (set var val)
+	    ;; reset vhdl-offsets-alist to the default value first
+	    (setq vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default))
+	    ;; now set the langelems that are different
+	    (mapcar
+	     (function
+	      (lambda (langentry)
+		(let ((langelem (car langentry))
+		      (offset (cdr langentry)))
+		  (vhdl-set-offset langelem offset)
+		  )))
+	     val))
+	  )))
+     vars))
+  (vhdl-keep-region-active))
+
+(defun vhdl-get-offset (langelem)
+  ;; Get offset from LANGELEM which is a cons cell of the form:
+  ;; (SYMBOL . RELPOS).  The symbol is matched against
+  ;; vhdl-offsets-alist and the offset found there is either returned,
+  ;; or added to the indentation at RELPOS.  If RELPOS is nil, then
+  ;; the offset is simply returned.
+  (let* ((symbol (car langelem))
+	 (relpos (cdr langelem))
+	 (match  (assq symbol vhdl-offsets-alist))
+	 (offset (cdr-safe match)))
+    ;; offset can be a number, a function, a variable, or one of the
+    ;; symbols + or -
+    (cond
+     ((not match)
+      (if vhdl-strict-syntax-p
+	  (error "don't know how to indent a %s" symbol)
+	(setq offset 0
+	      relpos 0)))
+     ((eq offset '+)  (setq offset vhdl-basic-offset))
+     ((eq offset '-)  (setq offset (- vhdl-basic-offset)))
+     ((eq offset '++) (setq offset (* 2 vhdl-basic-offset)))
+     ((eq offset '--) (setq offset (* 2 (- vhdl-basic-offset))))
+     ((and (not (numberp offset))
+	   (fboundp offset))
+      (setq offset (funcall offset langelem)))
+     ((not (numberp offset))
+      (setq offset (eval offset)))
+     )
+    (+ (if (and relpos
+		(< relpos (vhdl-point 'bol)))
+	   (save-excursion
+	     (goto-char relpos)
+	     (current-column))
+	 0)
+       offset)))
+
+
+;; Syntactic support functions:
+
+;; Returns `comment' if in a comment, `string' if in a string literal,
+;; or nil if not in a literal at all.  Optional LIM is used as the
+;; backward limit of the search.  If omitted, or nil, (point-min) is
+;; used.
+
+(defun vhdl-in-literal (&optional lim)
+  ;; Determine if point is in a VHDL literal.
+  (save-excursion
+    (let* ((lim (or lim (point-min)))
+	   (state (parse-partial-sexp lim (point))))
+      (cond
+       ((nth 3 state) 'string)
+       ((nth 4 state) 'comment)
+       (t nil)))
+    ))
+
+;; This is the best we can do in Win-Emacs.
+(defun vhdl-win-il (&optional lim)
+  ;; Determine if point is in a VHDL literal
+  (save-excursion
+    (let* ((here (point))
+	   (state nil)
+	   (match nil)
+	   (lim  (or lim (vhdl-point 'bod))))
+      (goto-char lim )
+      (while (< (point) here)
+	(setq match
+	      (and (re-search-forward "--\\|[\"']"
+				      here 'move)
+		   (buffer-substring (match-beginning 0) (match-end 0))))
+	(setq state
+	      (cond
+	       ;; no match
+	       ((null match) nil)
+	       ;; looking at the opening of a VHDL style comment
+	       ((string= "--" match)
+		(if (<= here (progn (end-of-line) (point))) 'comment))
+	       ;; looking at the opening of a double quote string
+	       ((string= "\"" match)
+		(if (not (save-restriction
+			   ;; this seems to be necessary since the
+			   ;; re-search-forward will not work without it
+			   (narrow-to-region (point) here)
+			   (re-search-forward
+			    ;; this regexp matches a double quote
+			    ;; which is preceded by an even number
+			    ;; of backslashes, including zero
+			    "\\([^\\]\\|^\\)\\(\\\\\\\\\\)*\"" here 'move)))
+		    'string))
+	       ;; looking at the opening of a single quote string
+	       ((string= "'" match)
+		(if (not (save-restriction
+			   ;; see comments from above
+			   (narrow-to-region (point) here)
+			   (re-search-forward
+			    ;; this matches a single quote which is
+			    ;; preceded by zero or two backslashes.
+			    "\\([^\\]\\|^\\)\\(\\\\\\\\\\)?'"
+			    here 'move)))
+		    'string))
+	       (t nil)))
+	) ; end-while
+      state)))
+
+(and (memq 'Win-Emacs vhdl-emacs-features)
+     (fset 'vhdl-in-literal 'vhdl-win-il))
+
+;; Skipping of "syntactic whitespace".  Syntactic whitespace is
+;; defined as lexical whitespace or comments.  Search no farther back
+;; or forward than optional LIM.  If LIM is omitted, (point-min) is
+;; used for backward skipping, (point-max) is used for forward
+;; skipping.
+
+(defun vhdl-forward-syntactic-ws (&optional lim)
+  ;; Forward skip of syntactic whitespace.
+  (save-restriction
+    (let* ((lim (or lim (point-max)))
+	   (here lim)
+	   (hugenum (point-max)))
+      (narrow-to-region lim (point))
+      (while (/= here (point))
+	(setq here (point))
+	(forward-comment hugenum))
+      )))
+
+;; This is the best we can do in Win-Emacs.
+(defun vhdl-win-fsws (&optional lim)
+  ;; Forward skip syntactic whitespace for Win-Emacs.
+  (let ((lim (or lim (point-max)))
+	stop)
+    (while (not stop)
+      (skip-chars-forward " \t\n\r\f" lim)
+      (cond
+       ;; vhdl comment
+       ((looking-at "--") (end-of-line))
+       ;; none of the above
+       (t (setq stop t))
+       ))))
+
+(and (memq 'Win-Emacs vhdl-emacs-features)
+     (fset 'vhdl-forward-syntactic-ws 'vhdl-win-fsws))
+
+(defun vhdl-backward-syntactic-ws (&optional lim)
+  ;; Backward skip over syntactic whitespace.
+  (save-restriction
+    (let* ((lim (or lim (point-min)))
+	   (here lim)
+	   (hugenum (- (point-max))))
+      (if (< lim (point))
+	  (progn
+	    (narrow-to-region lim (point))
+	    (while (/= here (point))
+	      (setq here (point))
+	      (forward-comment hugenum)
+	      )))
+      )))
+
+;; This is the best we can do in Win-Emacs.
+(defun vhdl-win-bsws (&optional lim)
+  ;; Backward skip syntactic whitespace for Win-Emacs.
+  (let ((lim (or lim (vhdl-point 'bod)))
+	stop)
+    (while (not stop)
+      (skip-chars-backward " \t\n\r\f" lim)
+      (cond
+       ;; vhdl comment
+       ((eq (vhdl-in-literal lim) 'comment)
+	(skip-chars-backward "^-" lim)
+	(skip-chars-backward "-" lim)
+	(while (not (or (and (= (following-char) ?-)
+			     (= (char-after (1+ (point))) ?-))
+			(<= (point) lim)))
+	  (skip-chars-backward "^-" lim)
+	  (skip-chars-backward "-" lim)))
+       ;; none of the above
+       (t (setq stop t))
+       ))))
+
+(and (memq 'Win-Emacs vhdl-emacs-features)
+    (fset 'vhdl-backward-syntactic-ws 'vhdl-win-bsws))
+
+;; Functions to help finding the correct indentation column:
+
+(defun vhdl-first-word (point)
+  "If the keyword at POINT is at boi, then return (current-column) at
+that point, else nil."
+  (save-excursion
+    (and (goto-char point)
+	 (eq (point) (vhdl-point 'boi))
+	 (current-column))))
+
+(defun vhdl-last-word (point)
+  "If the keyword at POINT is at eoi, then return (current-column) at
+that point, else nil."
+  (save-excursion
+    (and (goto-char point)
+	 (save-excursion (or (eq (progn (forward-sexp) (point))
+				 (vhdl-point 'eoi))
+			     (looking-at "\\s-*\\(--\\)?")))
+	 (current-column))))
+
+
+;; Core syntactic evaluation functions:
+
+(defconst vhdl-libunit-re
+  "\\b\\(architecture\\|configuration\\|entity\\|package\\)\\b[^_]")
+
+(defun vhdl-libunit-p ()
+  (and
+   (save-excursion
+     (forward-sexp)
+     (skip-chars-forward " \t\n")
+     (not (looking-at "is\\b[^_]")))
+   (save-excursion
+     (backward-sexp)
+     (not (looking-at "use\\b[^_]")))))
+
+(defconst vhdl-defun-re
+  "\\b\\(architecture\\|block\\|configuration\\|entity\\|package\\|process\\|procedure\\|function\\)\\b[^_]")
+
+(defun vhdl-defun-p ()
+  (save-excursion
+    (if (looking-at "block\\|process")
+	;; "block", "process":
+	(save-excursion
+	  (backward-sexp)
+	  (not (looking-at "end\\s-+\\w")))
+      ;; "architecture", "configuration", "entity",
+      ;; "package", "procedure", "function":
+      t)))
+  
+(defun vhdl-corresponding-defun ()
+  "If the word at the current position corresponds to a \"defun\"
+keyword, then return a string that can be used to find the
+corresponding \"begin\" keyword, else return nil."
+  (save-excursion
+    (and (looking-at vhdl-defun-re)
+	 (vhdl-defun-p)
+	 (if (looking-at "block\\|process")
+	     ;; "block", "process":
+	     (buffer-substring (match-beginning 0) (match-end 0))
+	   ;; "architecture", "configuration", "entity", "package",
+	   ;; "procedure", "function":
+	   "is"))))
+
+(defconst vhdl-begin-fwd-re
+  "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|units\\|record\\|for\\)\\b\\([^_]\\|\\'\\)"
+  "A regular expression for searching forward that matches all known
+\"begin\" keywords.")
+
+(defconst vhdl-begin-bwd-re
+  "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|units\\|record\\|for\\)\\b"
+  "A regular expression for searching backward that matches all known
+\"begin\" keywords.")
+
+(defun vhdl-begin-p (&optional lim)
+  "Return t if we are looking at a real \"begin\" keyword.
+Assumes that the caller will make sure that we are looking at
+vhdl-begin-fwd-re, and are not inside a literal, and that we are not in
+the middle of an identifier that just happens to contain a \"begin\"
+keyword."
+  (cond
+   ;; "[architecture|case|configuration|entity|package|
+   ;;   procedure|function] ... is":
+   ((and (looking-at "i")
+	 (save-excursion
+	   ;; Skip backward over first sexp (needed to skip over a
+	   ;; procedure interface list, and is harmless in other
+	   ;; situations).  Note that we need "return" in the
+	   ;; following search list so that we don't run into
+	   ;; semicolons in the function interface list.
+	   (backward-sexp)
+	   (let (foundp)
+	     (while (and (not foundp)
+			 (re-search-backward
+			  ";\\|\\b\\(architecture\\|case\\|configuration\\|entity\\|package\\|procedure\\|return\\|is\\|begin\\|process\\|block\\)\\b[^_]"
+			  lim 'move))
+	       (if (or (= (preceding-char) ?_)
+		       (vhdl-in-literal lim))
+		   (backward-char)
+		 (setq foundp t))))
+	   (and (/= (following-char) ?\;)
+		(not (looking-at "is\\|begin\\|process\\|block")))))
+    t)
+   ;; "begin", "then":
+   ((looking-at "be\\|t")
+    t)
+   ;; "else":
+   ((and (looking-at "e")
+	 ;; make sure that the "else" isn't inside a
+	 ;; conditional signal assignment.
+	 (save-excursion
+	   (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move)
+	   (or (eq (following-char) ?\;)
+	       (eq (point) lim))))
+    t)
+   ;; "block", "component", "generate", "loop", "process",
+   ;; "units", "record":
+   ((and (looking-at "bl\\|[cglpur]")
+	 (save-excursion
+	   (backward-sexp)
+	   (not (looking-at "end\\s-+\\w"))))
+    t)
+   ;; "for" (inside configuration declaration):
+   ((and (looking-at "f")
+	 (save-excursion
+	   (backward-sexp)
+	   (not (looking-at "end\\s-+\\w")))
+	 (vhdl-has-syntax 'configuration))
+    t)
+   ))
+  
+(defun vhdl-corresponding-mid (&optional lim)
+  (cond
+   ((looking-at "is\\|block\\|process")
+    "begin")
+   ((looking-at "then")
+    "<else>")
+   (t
+    "end")))
+
+(defun vhdl-corresponding-end (&optional lim)
+  "If the word at the current position corresponds to a \"begin\"
+keyword, then return a vector containing enough information to find
+the corresponding \"end\" keyword, else return nil.  The keyword to
+search forward for is aref 0.  The column in which the keyword must
+appear is aref 1 or nil if any column is suitable.
+Assumes that the caller will make sure that we are not in the middle
+of an identifier that just happens to contain a \"begin\" keyword."
+  (save-excursion
+    (and (looking-at vhdl-begin-fwd-re)
+	 (/= (preceding-char) ?_)
+	 (not (vhdl-in-literal lim))
+	 (vhdl-begin-p lim)
+	 (cond
+	  ;; "is", "generate", "loop":
+	  ((looking-at "[igl]")
+	   (vector "end"
+		   (and (vhdl-last-word (point))
+			(or (vhdl-first-word (point))
+			    (save-excursion
+			      (vhdl-beginning-of-statement-1 lim)
+			      (vhdl-backward-skip-label lim)
+			      (vhdl-first-word (point)))))))
+	  ;; "begin", "else", "for":
+	  ((looking-at "be\\|[ef]")
+	   (vector "end"
+		   (and (vhdl-last-word (point))
+			(or (vhdl-first-word (point))
+			    (save-excursion
+			      (vhdl-beginning-of-statement-1 lim)
+			      (vhdl-backward-skip-label lim)
+			      (vhdl-first-word (point)))))))
+	  ;; "component", "units", "record":
+	  ((looking-at "[cur]")
+	   ;; The first end found will close the block
+	   (vector "end" nil))
+	  ;; "block", "process":
+	  ((looking-at "bl\\|p")
+	   (vector "end"
+		   (or (vhdl-first-word (point))
+		       (save-excursion
+			 (vhdl-beginning-of-statement-1 lim)
+			 (vhdl-backward-skip-label lim)
+			 (vhdl-first-word (point))))))
+	  ;; "then":
+	  ((looking-at "t")
+	   (vector "elsif\\|else\\|end"
+		   (and (vhdl-last-word (point))
+			(or (vhdl-first-word (point))
+			    (save-excursion
+			      (vhdl-beginning-of-statement-1 lim)
+			      (vhdl-backward-skip-label lim)
+			      (vhdl-first-word (point)))))))
+	  ))))
+
+(defconst vhdl-end-fwd-re "\\b\\(end\\|else\\|elsif\\)\\b\\([^_]\\|\\'\\)")
+
+(defconst vhdl-end-bwd-re "\\b\\(end\\|else\\|elsif\\)\\b")
+
+(defun vhdl-end-p (&optional lim)
+  "Return t if we are looking at a real \"end\" keyword.
+Assumes that the caller will make sure that we are looking at
+vhdl-end-fwd-re, and are not inside a literal, and that we are not in
+the middle of an identifier that just happens to contain an \"end\"
+keyword."
+  (or (not (looking-at "else"))
+      ;; make sure that the "else" isn't inside a conditional signal
+      ;; assignment.
+      (save-excursion
+	(re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move)
+	(or (eq (following-char) ?\;)
+	    (eq (point) lim)))))
+
+(defun vhdl-corresponding-begin (&optional lim)
+  "If the word at the current position corresponds to an \"end\"
+keyword, then return a vector containing enough information to find
+the corresponding \"begin\" keyword, else return nil.  The keyword to
+search backward for is aref 0.  The column in which the keyword must
+appear is aref 1 or nil if any column is suitable.  The supplementary
+keyword to search forward for is aref 2 or nil if this is not
+required.  If aref 3 is t, then the \"begin\" keyword may be found in
+the middle of a statement.
+Assumes that the caller will make sure that we are not in the middle
+of an identifier that just happens to contain an \"end\" keyword."
+  (save-excursion
+    (let (pos)
+      (if (and (looking-at vhdl-end-fwd-re)
+	       (not (vhdl-in-literal lim))
+	       (vhdl-end-p lim))
+	  (if (looking-at "el")
+	      ;; "else", "elsif":
+	      (vector "if\\|elsif" (vhdl-first-word (point)) "then" nil)
+	    ;; "end ...":
+	    (setq pos (point))
+	    (forward-sexp)
+	    (skip-chars-forward " \t\n")
+	    (cond
+	     ;; "end if":
+	     ((looking-at "if\\b[^_]")
+	      (vector "else\\|elsif\\|if"
+		      (vhdl-first-word pos)
+		      "else\\|then" nil))
+	     ;; "end component":
+	     ((looking-at "component\\b[^_]")
+	      (vector (buffer-substring (match-beginning 1)
+					(match-end 1))
+		      (vhdl-first-word pos)
+		      nil nil))
+	     ;; "end units", "end record":
+	     ((looking-at "\\(units\\|record\\)\\b[^_]")
+	      (vector (buffer-substring (match-beginning 1)
+					(match-end 1))
+		      (vhdl-first-word pos)
+		      nil t))
+	     ;; "end block", "end process":
+	     ((looking-at "\\(block\\|process\\)\\b[^_]")
+	      (vector "begin" (vhdl-first-word pos) nil nil))
+	     ;; "end case":
+	     ((looking-at "case\\b[^_]")
+	      (vector "case" (vhdl-first-word pos) "is" nil))
+	     ;; "end generate":
+	     ((looking-at "generate\\b[^_]")
+	      (vector "generate\\|for\\|if"
+		      (vhdl-first-word pos)
+		      "generate" nil))
+	     ;; "end loop":
+	     ((looking-at "loop\\b[^_]")
+	      (vector "loop\\|while\\|for"
+		      (vhdl-first-word pos)
+		      "loop" nil))
+	     ;; "end for" (inside configuration declaration):
+	     ((looking-at "for\\b[^_]")
+	      (vector "for" (vhdl-first-word pos) nil nil))
+	     ;; "end [id]":
+	     (t
+	      (vector "begin\\|architecture\\|configuration\\|entity\\|package\\|procedure\\|function"
+		      (vhdl-first-word pos)
+		      ;; return an alist of (statement . keyword) mappings
+		      '(
+			;; "begin ... end [id]":
+			("begin"          . nil)
+			;; "architecture ... is ... begin ... end [id]":
+			("architecture"   . "is")
+			;; "configuration ... is ... end [id]":
+			("configuration"  . "is")
+			;; "entity ... is ... end [id]":
+			("entity"         . "is")
+			;; "package ... is ... end [id]":
+			("package"        . "is")
+			;; "procedure ... is ... begin ... end [id]":
+			("procedure"      . "is")
+			;; "function ... is ... begin ... end [id]":
+			("function"       . "is")
+			)
+		      nil))
+	     ))) ; "end ..."
+      )))
+
+(defconst vhdl-leader-re
+  "\\b\\(block\\|component\\|process\\|for\\)\\b[^_]")
+
+(defun vhdl-end-of-leader ()
+  (save-excursion
+    (cond ((looking-at "block\\|process")
+	   (if (save-excursion
+		 (forward-sexp)
+		 (skip-chars-forward " \t\n")
+		 (= (following-char) ?\())
+	       (forward-sexp 2)
+	     (forward-sexp))
+	   (point))
+	  ((looking-at "component")
+	   (forward-sexp 2)
+	   (point))
+	  ((looking-at "for")
+	   (forward-sexp 2)
+	   (skip-chars-forward " \t\n")
+	   (while (looking-at "[,:(]")
+	     (forward-sexp)
+	     (skip-chars-forward " \t\n"))
+	   (point))
+	  (t nil)
+	  )))
+
+(defconst vhdl-trailer-re
+  "\\b\\(is\\|then\\|generate\\|loop\\)\\b[^_]")
+
+(defconst vhdl-statement-fwd-re
+  "\\b\\(if\\|for\\|while\\)\\b\\([^_]\\|\\'\\)"
+  "A regular expression for searching forward that matches all known
+\"statement\" keywords.")
+
+(defconst vhdl-statement-bwd-re
+  "\\b\\(if\\|for\\|while\\)\\b"
+  "A regular expression for searching backward that matches all known
+\"statement\" keywords.")
+
+(defun vhdl-statement-p (&optional lim)
+  "Return t if we are looking at a real \"statement\" keyword.
+Assumes that the caller will make sure that we are looking at
+vhdl-statement-fwd-re, and are not inside a literal, and that we are not in
+the middle of an identifier that just happens to contain a \"statement\"
+keyword."
+  (cond
+   ;; "for" ... "generate":
+   ((and (looking-at "f")
+	 ;; Make sure it's the start of a parameter specification.
+	 (save-excursion
+	   (forward-sexp 2)
+	   (skip-chars-forward " \t\n")
+	   (looking-at "in\\b[^_]"))
+	 ;; Make sure it's not an "end for".
+	 (save-excursion
+	   (backward-sexp)
+	   (not (looking-at "end\\s-+\\w"))))
+    t)
+   ;; "if" ... "then", "if" ... "generate", "if" ... "loop":
+   ((and (looking-at "i")
+	 ;; Make sure it's not an "end if".
+	 (save-excursion
+	   (backward-sexp)
+	   (not (looking-at "end\\s-+\\w"))))
+    t)
+   ;; "while" ... "loop":
+   ((looking-at "w")
+    t)
+   ))
+  
+
+;; Core syntactic movement functions:
+
+(defconst vhdl-b-t-b-re
+  (concat vhdl-begin-bwd-re "\\|" vhdl-end-bwd-re))
+
+(defun vhdl-backward-to-block (&optional lim)
+  "Move backward to the previous \"begin\" or \"end\" keyword."
+  (let (foundp)
+    (while (and (not foundp)
+		(re-search-backward vhdl-b-t-b-re lim 'move))
+      (if (or (= (preceding-char) ?_)
+	      (vhdl-in-literal lim))
+	  (backward-char)
+	(cond
+	 ;; "begin" keyword:
+	 ((and (looking-at vhdl-begin-fwd-re)
+	       (/= (preceding-char) ?_)
+	       (vhdl-begin-p lim))
+	  (setq foundp 'begin))
+	 ;; "end" keyword:
+	 ((and (looking-at vhdl-end-fwd-re)
+	       (/= (preceding-char) ?_)
+	       (vhdl-end-p lim))
+	  (setq foundp 'end))
+	 ))
+      )
+    foundp
+    ))
+
+(defun vhdl-forward-sexp (&optional count lim)
+  "Move forward across one balanced expression (sexp).
+With COUNT, do it that many times."
+  (interactive "p")
+  (let ((count (or count 1))
+	(case-fold-search t)
+	end-vec target)
+    (save-excursion
+      (while (> count 0)
+	;; skip whitespace
+	(skip-chars-forward " \t\n")
+	;; Check for an unbalanced "end" keyword
+	(if (and (looking-at vhdl-end-fwd-re)
+		 (/= (preceding-char) ?_)
+		 (not (vhdl-in-literal lim))
+		 (vhdl-end-p lim)
+		 (not (looking-at "else")))
+	    (error
+	     "Containing expression ends prematurely in vhdl-forward-sexp"))
+	;; If the current keyword is a "begin" keyword, then find the
+	;; corresponding "end" keyword.
+	(if (setq end-vec (vhdl-corresponding-end lim))
+	    (let (
+		  ;; end-re is the statement keyword to search for
+		  (end-re
+		   (concat "\\b\\(" (aref end-vec 0) "\\)\\b\\([^_]\\|\\'\\)"))
+		  ;; column is either the statement keyword target column
+		  ;; or nil
+		  (column (aref end-vec 1))
+		  (eol (vhdl-point 'eol))
+		  foundp literal placeholder)
+	      ;; Look for the statement keyword.
+	      (while (and (not foundp)
+			  (re-search-forward end-re nil t)
+			  (setq placeholder (match-end 1))
+			  (goto-char (match-beginning 0)))
+		;; If we are in a literal, or not in the right target
+		;; column and not on the same line as the begin, then
+		;; try again.
+		(if (or (and column
+			     (/= (current-indentation) column)
+			     (> (point) eol))
+			(= (preceding-char) ?_)
+			(setq literal (vhdl-in-literal lim)))
+		    (if (eq literal 'comment)
+			(end-of-line)
+		      (forward-char))
+		  ;; An "else" keyword corresponds to both the opening brace
+		  ;; of the following sexp and the closing brace of the
+		  ;; previous sexp.
+		  (if (not (looking-at "else"))
+		      (goto-char placeholder))
+		  (setq foundp t))
+		)
+	      (if (not foundp)
+		  (error "Unbalanced keywords in vhdl-forward-sexp"))
+	      )
+	  ;; If the current keyword is not a "begin" keyword, then just
+	  ;; perform the normal forward-sexp.
+	  (forward-sexp)
+	  )
+	(setq count (1- count))
+	)
+      (setq target (point)))
+    (goto-char target)
+    nil))
+
+(defun vhdl-backward-sexp (&optional count lim)
+  "Move backward across one balanced expression (sexp).
+With COUNT, do it that many times.  LIM bounds any required backward
+searches."
+  (interactive "p")
+  (let ((count (or count 1))
+	(case-fold-search t)
+	begin-vec target)
+    (save-excursion
+      (while (> count 0)
+	;; Perform the normal backward-sexp, unless we are looking at
+	;; "else" - an "else" keyword corresponds to both the opening brace
+	;; of the following sexp and the closing brace of the previous sexp.
+	(if (and (looking-at "else\\b\\([^_]\\|\\'\\)")
+		 (/= (preceding-char) ?_)
+		 (not (vhdl-in-literal lim)))
+	    nil
+	  (backward-sexp)
+	  (if (and (looking-at vhdl-begin-fwd-re)
+		   (/= (preceding-char) ?_)
+		   (not (vhdl-in-literal lim))
+		   (vhdl-begin-p lim))
+	      (error "Containing expression ends prematurely in vhdl-backward-sexp")))
+	;; If the current keyword is an "end" keyword, then find the
+	;; corresponding "begin" keyword.
+	(if (and (setq begin-vec (vhdl-corresponding-begin lim))
+		 (/= (preceding-char) ?_))
+	    (let (
+		  ;; begin-re is the statement keyword to search for
+		  (begin-re
+		   (concat "\\b\\(" (aref begin-vec 0) "\\)\\b[^_]"))
+		  ;; column is either the statement keyword target column
+		  ;; or nil
+		  (column (aref begin-vec 1))
+		  ;; internal-p controls where the statement keyword can
+		  ;; be found.
+		  (internal-p (aref begin-vec 3))
+		  (last-backward (point)) last-forward
+		  foundp literal keyword)
+	      ;; Look for the statement keyword.
+	      (while (and (not foundp)
+			  (re-search-backward begin-re lim t)
+			  (setq keyword
+				(buffer-substring (match-beginning 1)
+						  (match-end 1))))
+		;; If we are in a literal or in the wrong column,
+		;; then try again.
+		(if (or (and column
+			     (and (/= (current-indentation) column)
+				  ;; possibly accept current-column as
+				  ;; well as current-indentation.
+				  (or (not internal-p)
+				      (/= (current-column) column))))
+			(= (preceding-char) ?_)
+			(vhdl-in-literal lim))
+		    (backward-char)
+		  ;; If there is a supplementary keyword, then
+		  ;; search forward for it. 
+		  (if (and (setq begin-re (aref begin-vec 2))
+			   (or (not (listp begin-re))
+			       ;; If begin-re is an alist, then find the
+			       ;; element corresponding to the actual
+			       ;; keyword that we found.
+			       (progn
+				 (setq begin-re
+				       (assoc keyword begin-re))
+				 (and begin-re
+				      (setq begin-re (cdr begin-re))))))
+		      (and
+		       (setq begin-re
+			     (concat "\\b\\(" begin-re "\\)\\b[^_]"))
+		       (save-excursion
+			 (setq last-forward (point))
+			 ;; Look for the supplementary keyword
+			 ;; (bounded by the backward search start
+			 ;; point).
+			 (while (and (not foundp)
+				     (re-search-forward begin-re
+							last-backward t)
+				     (goto-char (match-beginning 1)))
+			   ;; If we are in a literal, then try again.
+			   (if (or (= (preceding-char) ?_)
+				   (setq literal
+					 (vhdl-in-literal last-forward)))
+			       (if (eq literal 'comment)
+				   (goto-char
+				    (min (vhdl-point 'eol) last-backward))
+				 (forward-char))
+			     ;; We have found the supplementary keyword.
+			     ;; Save the position of the keyword in foundp.
+			     (setq foundp (point)))
+			   )
+			 foundp)
+		       ;; If the supplementary keyword was found, then
+		       ;; move point to the supplementary keyword.
+		       (goto-char foundp))
+		    ;; If there was no supplementary keyword, then
+		    ;; point is already at the statement keyword.
+		    (setq foundp t)))
+		) ; end of the search for the statement keyword
+	      (if (not foundp)
+		  (error "Unbalanced keywords in vhdl-backward-sexp"))
+	      ))
+	(setq count (1- count))
+	)
+      (setq target (point)))
+    (goto-char target)
+    nil))
+
+(defun vhdl-backward-up-list (&optional count limit)
+  "Move backward out of one level of blocks.
+With argument, do this that many times."
+  (interactive "p")
+  (let ((count (or count 1))
+	target)
+    (save-excursion
+      (while (> count 0)
+	(if (looking-at vhdl-defun-re)
+	    (error "Unbalanced blocks"))
+	(vhdl-backward-to-block limit)
+	(setq count (1- count)))
+      (setq target (point)))
+    (goto-char target)))
+
+(defun vhdl-end-of-defun (&optional count)
+  "Move forward to the end of a VHDL defun."
+  (interactive)
+  (let ((case-fold-search t))
+    (vhdl-beginning-of-defun)
+    (if (not (looking-at "block\\|process"))
+	(re-search-forward "\\bis\\b"))
+    (vhdl-forward-sexp)))
+    
+(defun vhdl-mark-defun ()
+  "Put mark at end of this \"defun\", point at beginning."
+  (interactive)
+  (let ((case-fold-search t))
+    (push-mark)
+    (vhdl-beginning-of-defun)
+    (push-mark)
+    (if (not (looking-at "block\\|process"))
+	(re-search-forward "\\bis\\b"))
+    (vhdl-forward-sexp)
+    (exchange-point-and-mark)))
+
+(defun vhdl-beginning-of-libunit ()
+  "Move backward to the beginning of a VHDL library unit.
+Returns the location of the corresponding begin keyword, unless search
+stops due to beginning or end of buffer." 
+  ;; Note that if point is between the "libunit" keyword and the
+  ;; corresponding "begin" keyword, then that libunit will not be
+  ;; recognised, and the search will continue backwards.  If point is
+  ;; at the "begin" keyword, then the defun will be recognised.  The
+  ;; returned point is at the first character of the "libunit" keyword.
+  (let ((last-forward (point))
+	(last-backward
+	 ;; Just in case we are actually sitting on the "begin"
+	 ;; keyword, allow for the keyword and an extra character,
+	 ;; as this will be used when looking forward for the
+	 ;; "begin" keyword.
+	 (save-excursion (forward-word 1) (1+ (point))))
+	foundp literal placeholder)
+    ;; Find the "libunit" keyword.
+    (while (and (not foundp)
+		(re-search-backward vhdl-libunit-re nil 'move))
+      ;; If we are in a literal, or not at a real libunit, then try again.
+      (if (or (= (preceding-char) ?_)
+	      (vhdl-in-literal (point-min))
+	      (not (vhdl-libunit-p)))
+	  (backward-char)
+	;; Find the corresponding "begin" keyword.
+	(setq last-forward (point))
+	(while (and (not foundp)
+		    (re-search-forward "\\bis\\b[^_]" last-backward t)
+		    (setq placeholder (match-beginning 0)))
+	  (if (or (= (preceding-char) ?_)
+		  (setq literal (vhdl-in-literal last-forward)))
+	      ;; It wasn't a real keyword, so keep searching.
+	      (if (eq literal 'comment)
+		  (goto-char
+		   (min (vhdl-point 'eol) last-backward))
+		(forward-char))
+	    ;; We have found the begin keyword, loop will exit.
+	    (setq foundp placeholder)))
+	;; Go back to the libunit keyword
+	(goto-char last-forward)))
+    foundp))
+    
+(defun vhdl-beginning-of-defun (&optional count)
+  "Move backward to the beginning of a VHDL defun.
+With argument, do it that many times.
+Returns the location of the corresponding begin keyword, unless search
+stops due to beginning or end of buffer." 
+  ;; Note that if point is between the "defun" keyword and the
+  ;; corresponding "begin" keyword, then that defun will not be
+  ;; recognised, and the search will continue backwards.  If point is
+  ;; at the "begin" keyword, then the defun will be recognised.  The
+  ;; returned point is at the first character of the "defun" keyword.
+  (interactive "p")
+  (let ((count (or count 1))
+	(case-fold-search t)
+	(last-forward (point))
+	foundp)
+    (while (> count 0)
+      (setq foundp nil)
+      (goto-char last-forward)
+      (let ((last-backward
+	     ;; Just in case we are actually sitting on the "begin"
+	     ;; keyword, allow for the keyword and an extra character,
+	     ;; as this will be used when looking forward for the
+	     ;; "begin" keyword.
+	     (save-excursion (forward-word 1) (1+ (point))))
+	    begin-string literal)
+	(while (and (not foundp)
+		    (re-search-backward vhdl-defun-re nil 'move))
+	  ;; If we are in a literal, then try again.
+	  (if (or (= (preceding-char) ?_)
+		  (vhdl-in-literal (point-min)))
+	      (backward-char)
+	    (if (setq begin-string (vhdl-corresponding-defun))
+		;; This is a real defun keyword.
+		;; Find the corresponding "begin" keyword.
+		;; Look for the begin keyword.
+		(progn
+		  ;; Save the search start point.
+		  (setq last-forward (point))
+		  (while (and (not foundp)
+			      (search-forward begin-string last-backward t))
+		    (if (or (= (preceding-char) ?_)
+			    (save-match-data
+			      (setq literal (vhdl-in-literal last-forward))))
+			;; It wasn't a real keyword, so keep searching.
+			(if (eq literal 'comment)
+			    (goto-char
+			     (min (vhdl-point 'eol) last-backward))
+			  (forward-char))
+		      ;; We have found the begin keyword, loop will exit.
+		      (setq foundp (match-beginning 0)))
+		    )
+		  ;; Go back to the defun keyword
+		  (goto-char last-forward)) ; end search for begin keyword
+	      ))
+	  ) ; end of the search for the defun keyword
+	)
+      (setq count (1- count))
+      )
+    (vhdl-keep-region-active)
+    foundp))
+    
+(defun vhdl-beginning-of-statement (&optional count lim)
+  "Go to the beginning of the innermost VHDL statement.
+With prefix arg, go back N - 1 statements.  If already at the
+beginning of a statement then go to the beginning of the preceding
+one.  If within a string or comment, or next to a comment (only
+whitespace between), move by sentences instead of statements.
+
+When called from a program, this function takes 2 optional args: the
+prefix arg, and a buffer position limit which is the farthest back to
+search."
+  (interactive "p")
+  (let ((count (or count 1))
+	(case-fold-search t)
+	(lim (or lim (point-min)))
+	(here (point))
+	state)
+    (save-excursion
+      (goto-char lim)
+      (setq state (parse-partial-sexp (point) here nil nil)))
+    (if (and (interactive-p)
+	     (or (nth 3 state)
+		 (nth 4 state)
+		 (looking-at (concat "[ \t]*" comment-start-skip))))
+	(forward-sentence (- count))
+      (while (> count 0)
+	(vhdl-beginning-of-statement-1 lim)
+	(setq count (1- count))))
+    ;; its possible we've been left up-buf of lim
+    (goto-char (max (point) lim))
+    )
+  (vhdl-keep-region-active))
+
+(defconst vhdl-b-o-s-re
+  (concat ";\\|\(\\|\)\\|\\bwhen\\b[^_]\\|"
+	  vhdl-begin-bwd-re "\\|" vhdl-statement-bwd-re))
+
+(defun vhdl-beginning-of-statement-1 (&optional lim)
+  ;; move to the start of the current statement, or the previous
+  ;; statement if already at the beginning of one.
+  (let ((lim (or lim (point-min)))
+	(here (point))
+	(pos (point))
+	donep)
+    ;; go backwards one balanced expression, but be careful of
+    ;; unbalanced paren being reached
+    (if (not (vhdl-safe (progn (backward-sexp) t)))
+	(progn
+	  (backward-up-list 1)
+	  (forward-char)
+	  (vhdl-forward-syntactic-ws here)
+	  (setq donep t)))
+    (while (and (not donep)
+		(not (bobp))
+		;; look backwards for a statement boundary
+		(re-search-backward vhdl-b-o-s-re lim 'move))
+      (if (or (= (preceding-char) ?_)
+	      (vhdl-in-literal lim))
+	  (backward-char)
+	(cond
+	 ;; If we are looking at an open paren, then stop after it
+	 ((eq (following-char) ?\()
+	  (forward-char)
+	  (vhdl-forward-syntactic-ws here)
+	  (setq donep t))
+	 ;; If we are looking at a close paren, then skip it
+	 ((eq (following-char) ?\))
+	  (forward-char)
+	  (setq pos (point))
+	  (backward-sexp)
+	  (if (< (point) lim)
+	      (progn (goto-char pos)
+		     (vhdl-forward-syntactic-ws here)
+		     (setq donep t))))
+	 ;; If we are looking at a semicolon, then stop
+	 ((eq (following-char) ?\;)
+	  (progn
+	    (forward-char)
+	    (vhdl-forward-syntactic-ws here)
+	    (setq donep t)))
+	 ;; If we are looking at a "begin", then stop
+	 ((and (looking-at vhdl-begin-fwd-re)
+	       (/= (preceding-char) ?_)
+	       (vhdl-begin-p nil))
+	  ;; If it's a leader "begin", then find the
+	  ;; right place
+	  (if (looking-at vhdl-leader-re)
+	      (save-excursion
+		;; set a default stop point at the begin
+		(setq pos (point))
+		;; is the start point inside the leader area ?
+		(goto-char (vhdl-end-of-leader))
+		(vhdl-forward-syntactic-ws here)
+		(if (< (point) here)
+		    ;; start point was not inside leader area
+		    ;; set stop point at word after leader
+		    (setq pos (point))))
+	    (forward-word 1)
+	    (vhdl-forward-syntactic-ws here)
+	    (setq pos (point)))
+	  (goto-char pos)
+	  (setq donep t))
+	 ;; If we are looking at a "statement", then stop
+	 ((and (looking-at vhdl-statement-fwd-re)
+	       (/= (preceding-char) ?_)
+	       (vhdl-statement-p nil))
+	  (setq donep t))
+	 ;; If we are looking at a case alternative key, then stop
+	 ((looking-at vhdl-case-alternative-key)
+	  (save-excursion
+	    ;; set a default stop point at the when
+	    (setq pos (point))
+	    ;; is the start point inside the case alternative key ?
+	    (goto-char (match-end 0))
+	    (vhdl-forward-syntactic-ws here)
+	    (if (< (point) here)
+		;; start point was not inside the case alternative key
+		;; set stop point at word after case alternative keyleader
+		(setq pos (point))))
+	  (goto-char pos)
+	  (setq donep t))
+	 ;; Bogus find, continue
+	 (t
+	  (backward-char)))))
+    ))
+
+
+;; Defuns for calculating the current syntactic state:
+
+(defun vhdl-get-library-unit (bod placeholder)
+  ;; If there is an enclosing library unit at bod, with it's \"begin\"
+  ;; keyword at placeholder, then return the library unit type.
+  (let ((here (vhdl-point 'bol)))
+    (if (save-excursion
+	  (goto-char placeholder)
+	  (vhdl-safe (vhdl-forward-sexp 1 bod))
+	  (<= here (point)))
+	(save-excursion
+	  (goto-char bod)
+	  (cond
+	   ((looking-at "e") 'entity)
+	   ((looking-at "a") 'architecture)
+	   ((looking-at "c") 'configuration)
+	   ((looking-at "p")
+	    (save-excursion
+	      (goto-char bod)
+	      (forward-sexp)
+	      (vhdl-forward-syntactic-ws here)
+	      (if (looking-at "body\\b[^_]")
+		  'package-body 'package))))))
+    ))
+
+(defun vhdl-get-block-state (&optional lim)
+  ;; Finds and records all the closest opens.
+  ;; lim is the furthest back we need to search (it should be the
+  ;; previous libunit keyword).
+  (let ((here (point))
+	(lim (or lim (point-min)))
+	keyword sexp-start sexp-mid sexp-end
+	preceding-sexp containing-sexp
+	containing-begin containing-mid containing-paren)
+    (save-excursion
+      ;; Find the containing-paren, and use that as the limit
+      (if (setq containing-paren
+		(save-restriction
+		  (narrow-to-region lim (point))
+		  (vhdl-safe (scan-lists (point) -1 1))))
+	  (setq lim containing-paren))
+      ;; Look backwards for "begin" and "end" keywords.
+      (while (and (> (point) lim)
+		  (not containing-sexp))
+	(setq keyword (vhdl-backward-to-block lim))
+	(cond
+	 ((eq keyword 'begin)
+	  ;; Found a "begin" keyword
+	  (setq sexp-start (point))
+	  (setq sexp-mid (vhdl-corresponding-mid lim))
+	  (setq sexp-end (vhdl-safe
+			  (save-excursion
+			    (vhdl-forward-sexp 1 lim) (point))))
+	  (if (and sexp-end (<= sexp-end here))
+	      ;; we want to record this sexp, but we only want to
+	      ;; record the last-most of any of them before here
+	      (or preceding-sexp
+		  (setq preceding-sexp sexp-start))
+	    ;; we're contained in this sexp so put sexp-start on
+	    ;; front of list
+	    (setq containing-sexp sexp-start)
+	    (setq containing-mid sexp-mid)
+	    (setq containing-begin t)))
+	 ((eq keyword 'end)
+	  ;; Found an "end" keyword
+	  (forward-sexp)
+	  (setq sexp-end (point))
+	  (setq sexp-mid nil)
+	  (setq sexp-start
+		(or (vhdl-safe (vhdl-backward-sexp 1 lim) (point))
+		    (progn (backward-sexp) (point))))
+	  ;; we want to record this sexp, but we only want to
+	  ;; record the last-most of any of them before here
+	  (or preceding-sexp
+	      (setq preceding-sexp sexp-start)))
+	 )))
+    ;; Check if the containing-paren should be the containing-sexp
+    (if (and containing-paren
+	     (or (null containing-sexp)
+		 (< containing-sexp containing-paren)))
+	(setq containing-sexp containing-paren
+	      preceding-sexp nil
+	      containing-begin nil
+	      containing-mid nil))
+    (vector containing-sexp preceding-sexp containing-begin containing-mid)
+    ))
+	      
+
+(defconst vhdl-s-c-a-re
+  (concat vhdl-case-alternative-key "\\|" vhdl-case-header-key))
+
+(defun vhdl-skip-case-alternative (&optional lim)
+  ;; skip forward over case/when bodies, with optional maximal
+  ;; limit. if no next case alternative is found, nil is returned and point
+  ;; is not moved
+  (let ((lim (or lim (point-max)))
+	(here (point))
+	donep foundp)
+    (while (and (< (point) lim)
+		(not donep))
+      (if (and (re-search-forward vhdl-s-c-a-re lim 'move)
+	       (save-match-data
+		 (not (vhdl-in-literal)))
+	       (/= (match-beginning 0) here))
+	  (progn
+	    (goto-char (match-beginning 0))
+	    (cond
+	     ((and (looking-at "case")
+		   (re-search-forward "\\bis[^_]" lim t))
+	      (backward-sexp)
+	      (vhdl-forward-sexp))
+	     (t
+	      (setq donep t
+		    foundp t))))))
+    (if (not foundp)
+	(goto-char here))
+    foundp))
+
+(defun vhdl-backward-skip-label (&optional lim)
+  ;; skip backward over a label, with optional maximal
+  ;; limit. if label is found, nil is returned and point
+  ;; is not moved
+  (let ((lim (or lim (point-min)))
+	placeholder)
+    (if (save-excursion
+	  (vhdl-backward-syntactic-ws lim)
+	  (and (eq (preceding-char) ?:)
+	       (progn
+		 (backward-sexp)
+		 (setq placeholder (point))
+		 (looking-at vhdl-label-key))))
+	(goto-char placeholder))
+    ))
+
+(defun vhdl-get-syntactic-context ()
+  ;; guess the syntactic description of the current line of VHDL code.
+  (save-excursion
+    (save-restriction
+      (beginning-of-line)
+      (let* ((indent-point (point))
+	     (case-fold-search t)
+	     vec literal containing-sexp preceding-sexp
+	     containing-begin containing-mid containing-leader
+	     char-before-ip char-after-ip begin-after-ip end-after-ip
+	     placeholder lim library-unit
+	    )
+
+	;; Reset the syntactic context
+	(setq vhdl-syntactic-context nil)
+
+	(save-excursion
+	  ;; Move to the start of the previous library unit, and
+	  ;; record the position of the "begin" keyword.
+	  (setq placeholder (vhdl-beginning-of-libunit))
+	  ;; The position of the "libunit" keyword gives us a gross
+	  ;; limit point.
+	  (setq lim (point))
+	  )
+
+	;; If there is a previous library unit, and we are enclosed by
+	;; it, then set the syntax accordingly.
+	(and placeholder
+	     (setq library-unit (vhdl-get-library-unit lim placeholder))
+	     (vhdl-add-syntax library-unit lim))
+	    
+	;; Find the surrounding state.
+	(if (setq vec (vhdl-get-block-state lim))
+	    (progn
+	      (setq containing-sexp (aref vec 0))
+	      (setq preceding-sexp (aref vec 1))
+	      (setq containing-begin (aref vec 2))
+	      (setq containing-mid (aref vec 3))
+	      ))
+
+	;; set the limit on the farthest back we need to search
+	(setq lim (if containing-sexp
+		      (save-excursion
+			(goto-char containing-sexp)
+			;; set containing-leader if required
+			(if (looking-at vhdl-leader-re)
+			    (setq containing-leader (vhdl-end-of-leader)))
+			(vhdl-point 'bol))
+		    (point-min)))
+
+	;; cache char before and after indent point, and move point to
+	;; the most likely position to perform the majority of tests
+	(goto-char indent-point)
+	(skip-chars-forward " \t")
+	(setq literal (vhdl-in-literal lim))
+	(setq char-after-ip (following-char))
+	(setq begin-after-ip (and
+			      (not literal)
+			      (looking-at vhdl-begin-fwd-re)
+			      (vhdl-begin-p)))
+	(setq end-after-ip (and
+			    (not literal)
+			    (looking-at vhdl-end-fwd-re)
+			    (vhdl-end-p)))
+	(vhdl-backward-syntactic-ws lim)
+	(setq char-before-ip (preceding-char))
+	(goto-char indent-point)
+	(skip-chars-forward " \t")
+
+	;; now figure out syntactic qualities of the current line
+	(cond
+	 ;; CASE 1: in a string or comment.
+	 ((memq literal '(string comment))
+	  (vhdl-add-syntax literal (vhdl-point 'bopl)))
+	 ;; CASE 2: Line is at top level.
+	 ((null containing-sexp)
+	  ;; Find the point to which indentation will be relative
+	  (save-excursion
+	    (if (null preceding-sexp)
+		;; CASE 2X.1
+		;; no preceding-sexp -> use the preceding statement
+		(vhdl-beginning-of-statement-1 lim)
+	      ;; CASE 2X.2
+	      ;; if there is a preceding-sexp then indent relative to it
+	      (goto-char preceding-sexp)
+	      ;; if not at boi, then the block-opening keyword is
+	      ;; probably following a label, so we need a different
+	      ;; relpos
+	      (if (/= (point) (vhdl-point 'boi))
+		  ;; CASE 2X.3
+		  (vhdl-beginning-of-statement-1 lim)))
+	    ;; v-b-o-s could have left us at point-min
+	    (and (bobp)
+		 ;; CASE 2X.4
+		 (vhdl-forward-syntactic-ws indent-point))
+	    (setq placeholder (point)))
+	  (cond
+	   ;; CASE 2A : we are looking at a block-open
+	   (begin-after-ip
+	    (vhdl-add-syntax 'block-open placeholder))
+	   ;; CASE 2B: we are looking at a block-close
+	   (end-after-ip
+	    (vhdl-add-syntax 'block-close placeholder))
+	   ;; CASE 2C: we are looking at a top-level statement
+	   ((progn
+	      (vhdl-backward-syntactic-ws lim)
+	      (or (bobp)
+		  (= (preceding-char) ?\;)))
+	    (vhdl-add-syntax 'statement placeholder))
+	   ;; CASE 2D: we are looking at a top-level statement-cont
+	   (t
+	    (vhdl-beginning-of-statement-1 lim)
+	    ;; v-b-o-s could have left us at point-min
+	    (and (bobp)
+		 ;; CASE 2D.1
+		 (vhdl-forward-syntactic-ws indent-point))
+	    (vhdl-add-syntax 'statement-cont (point)))
+	   )) ; end CASE 2
+	 ;; CASE 3: line is inside parentheses.  Most likely we are
+	 ;; either in a subprogram argument (interface) list, or a
+	 ;; continued expression containing parentheses.
+	 ((null containing-begin)
+	  (vhdl-backward-syntactic-ws containing-sexp)
+	  (cond
+	   ;; CASE 3A: we are looking at the arglist closing paren
+	   ((eq char-after-ip ?\))
+	    (goto-char containing-sexp)
+	    (vhdl-add-syntax 'arglist-close (vhdl-point 'boi)))
+	   ;; CASE 3B: we are looking at the first argument in an empty
+	   ;; argument list.
+	   ((eq char-before-ip ?\()
+	    (goto-char containing-sexp)
+	    (vhdl-add-syntax 'arglist-intro (vhdl-point 'boi)))
+	   ;; CASE 3C: we are looking at an arglist continuation line,
+	   ;; but the preceding argument is on the same line as the
+	   ;; opening paren.  This case includes multi-line
+	   ;; expression paren groupings.
+	   ((and (save-excursion
+		   (goto-char (1+ containing-sexp))
+		   (skip-chars-forward " \t")
+		   (not (eolp))
+		   (not (looking-at "--")))
+		 (save-excursion
+		   (vhdl-beginning-of-statement-1 containing-sexp)
+		   (skip-chars-backward " \t(")
+		   (<= (point) containing-sexp)))
+	    (goto-char containing-sexp)
+	    (vhdl-add-syntax 'arglist-cont-nonempty (vhdl-point 'boi)))
+	   ;; CASE 3D: we are looking at just a normal arglist
+	   ;; continuation line
+	   (t (vhdl-beginning-of-statement-1 containing-sexp)
+	      (vhdl-forward-syntactic-ws indent-point)
+	      (vhdl-add-syntax 'arglist-cont (vhdl-point 'boi)))
+	   ))
+	 ;; CASE 4: A block mid open
+	 ((and begin-after-ip
+	       (looking-at containing-mid))
+	  (goto-char containing-sexp)
+	  ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
+	  (if (looking-at vhdl-trailer-re)
+	      ;; CASE 4.1
+	      (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
+	  (vhdl-backward-skip-label (vhdl-point 'boi))
+	  (vhdl-add-syntax 'block-open (point)))
+	 ;; CASE 5: block close brace
+	 (end-after-ip
+	  (goto-char containing-sexp)
+	  ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
+	  (if (looking-at vhdl-trailer-re)
+	      ;; CASE 5.1
+	      (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
+	  (vhdl-backward-skip-label (vhdl-point 'boi))
+	  (vhdl-add-syntax 'block-close (point)))
+	 ;; CASE 6: A continued statement
+	 ((and (/= char-before-ip ?\;)
+	       ;; check it's not a trailer begin keyword, or a begin
+	       ;; keyword immediately following a label.
+	       (not (and begin-after-ip
+			 (or (looking-at vhdl-trailer-re)
+			     (save-excursion
+			       (vhdl-backward-skip-label containing-sexp)))))
+	       ;; check it's not a statement keyword
+	       (not (and (looking-at vhdl-statement-fwd-re)
+			 (vhdl-statement-p)))
+	       ;; see if the b-o-s is before the indent point
+	       (> indent-point
+		  (save-excursion
+		    (vhdl-beginning-of-statement-1 containing-sexp)
+		    ;; If we ended up after a leader, then this will
+		    ;; move us forward to the start of the first
+		    ;; statement.  Note that a containing sexp here is
+		    ;; always a keyword, not a paren, so this will
+		    ;; have no effect if we hit the containing-sexp.
+		    (vhdl-forward-syntactic-ws indent-point)
+		    (setq placeholder (point))))
+	       ;; check it's not a block-intro
+	       (/= placeholder containing-sexp)
+	       ;; check it's not a case block-intro
+	       (save-excursion
+		 (goto-char placeholder)
+		 (or (not (looking-at vhdl-case-alternative-key))
+		     (> (match-end 0) indent-point))))
+	  (vhdl-add-syntax 'statement-cont placeholder)
+	  (if begin-after-ip
+	      (vhdl-add-syntax 'block-open)))
+	 ;; Statement. But what kind?
+	 ;; CASE 7: A case alternative key
+	 ((looking-at vhdl-case-alternative-key)
+	  ;; for a case alternative key, we set relpos to the first
+	  ;; non-whitespace char on the line containing the "case"
+	  ;; keyword.
+	  (goto-char containing-sexp)
+	  ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
+	  (if (looking-at vhdl-trailer-re)
+	      (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
+	  (vhdl-add-syntax 'case-alternative (vhdl-point 'boi)))
+	 ;; CASE 8: statement catchall
+	 (t
+	  ;; we know its a statement, but we need to find out if it is
+	  ;; the first statement in a block
+	  (if containing-leader
+	      (goto-char containing-leader)
+	    (goto-char containing-sexp)
+	    ;; Note that a containing sexp here is always a keyword,
+	    ;; not a paren, so skip over the keyword.
+	    (forward-sexp))
+	  ;; move to the start of the first statement
+	  (vhdl-forward-syntactic-ws indent-point)
+	  (setq placeholder (point))
+	  ;; we want to ignore case alternatives keys when skipping forward
+	  (let (incase-p)
+	    (while (looking-at vhdl-case-alternative-key)
+	      (setq incase-p (point))
+	      ;; we also want to skip over the body of the
+	      ;; case/when statement if that doesn't put us at
+	      ;; after the indent-point
+	      (while (vhdl-skip-case-alternative indent-point))
+	      ;; set up the match end
+	      (looking-at vhdl-case-alternative-key)
+	      (goto-char (match-end 0))
+	      ;; move to the start of the first case alternative statement
+	      (vhdl-forward-syntactic-ws indent-point)
+	      (setq placeholder (point)))
+	    (cond
+	     ;; CASE 8A: we saw a case/when statement so we must be
+	     ;; in a switch statement.  find out if we are at the
+	     ;; statement just after a case alternative key
+	     ((and incase-p
+		   (= (point) indent-point))
+	      ;; relpos is the "when" keyword
+	      (vhdl-add-syntax 'statement-case-intro incase-p))
+	     ;; CASE 8B: any old statement
+	     ((< (point) indent-point)
+	      ;; relpos is the first statement of the block
+	      (vhdl-add-syntax 'statement placeholder)
+	      (if begin-after-ip
+		  (vhdl-add-syntax 'block-open)))
+	     ;; CASE 8C: first statement in a block
+	     (t
+	      (goto-char containing-sexp)
+	      ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
+	      (if (looking-at vhdl-trailer-re)
+		  (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
+	      (vhdl-backward-skip-label (vhdl-point 'boi))
+	      (vhdl-add-syntax 'statement-block-intro (point))
+	      (if begin-after-ip
+		  (vhdl-add-syntax 'block-open)))
+	     )))
+	 )
+
+	;; now we need to look at any modifiers
+	(goto-char indent-point)
+	(skip-chars-forward " \t")
+	(if (looking-at "--")
+	    (vhdl-add-syntax 'comment))
+	;; return the syntax
+	vhdl-syntactic-context))))
+
+
+;; Standard indentation line-ups:
+
+(defun vhdl-lineup-arglist (langelem)
+  ;; lineup the current arglist line with the arglist appearing just
+  ;; after the containing paren which starts the arglist.
+  (save-excursion
+    (let* ((containing-sexp
+	    (save-excursion
+	      ;; arglist-cont-nonempty gives relpos ==
+	      ;; to boi of containing-sexp paren. This
+	      ;; is good when offset is +, but bad
+	      ;; when it is vhdl-lineup-arglist, so we
+	      ;; have to special case a kludge here.
+	      (if (memq (car langelem) '(arglist-intro arglist-cont-nonempty))
+		  (progn
+		    (beginning-of-line)
+		    (backward-up-list 1)
+		    (skip-chars-forward " \t" (vhdl-point 'eol)))
+		(goto-char (cdr langelem)))
+	      (point)))
+	   (cs-curcol (save-excursion
+			(goto-char (cdr langelem))
+			(current-column))))
+      (if (save-excursion
+	    (beginning-of-line)
+	    (looking-at "[ \t]*)"))
+	  (progn (goto-char (match-end 0))
+		 (backward-sexp)
+		 (forward-char)
+		 (vhdl-forward-syntactic-ws)
+		 (- (current-column) cs-curcol))
+	(goto-char containing-sexp)
+	(or (eolp)
+	    (let ((eol (vhdl-point 'eol))
+		  (here (progn
+			  (forward-char)
+			  (skip-chars-forward " \t")
+			  (point))))
+	      (vhdl-forward-syntactic-ws)
+	      (if (< (point) eol)
+		  (goto-char here))))
+	(- (current-column) cs-curcol)
+	))))
+
+(defun vhdl-lineup-arglist-intro (langelem)
+  ;; lineup an arglist-intro line to just after the open paren
+  (save-excursion
+    (let ((cs-curcol (save-excursion
+		       (goto-char (cdr langelem))
+		       (current-column)))
+	  (ce-curcol (save-excursion
+		       (beginning-of-line)
+		       (backward-up-list 1)
+		       (skip-chars-forward " \t" (vhdl-point 'eol))
+		       (current-column))))
+      (- ce-curcol cs-curcol -1))))
+
+(defun vhdl-lineup-comment (langelem)
+  ;; support old behavior for comment indentation. we look at
+  ;; vhdl-comment-only-line-offset to decide how to indent comment
+  ;; only-lines
+  (save-excursion
+    (back-to-indentation)
+    ;; at or to the right of comment-column
+    (if (>= (current-column) comment-column)
+	(vhdl-comment-indent)
+      ;; otherwise, indent as specified by vhdl-comment-only-line-offset
+      (if (not (bolp))
+	  (or (car-safe vhdl-comment-only-line-offset)
+	      vhdl-comment-only-line-offset)
+	(or (cdr-safe vhdl-comment-only-line-offset)
+	    (car-safe vhdl-comment-only-line-offset)
+	    -1000			;jam it against the left side
+	    )))))
+
+(defun vhdl-lineup-statement-cont (langelem)
+  ;; line up statement-cont after the assignment operator
+  (save-excursion
+    (let* ((relpos (cdr langelem))
+	   (assignp (save-excursion
+		     (goto-char (vhdl-point 'boi))
+		     (and (re-search-forward "\\(<\\|:\\)="
+					     (vhdl-point 'eol) t)
+			  (- (point) (vhdl-point 'boi)))))
+	   (curcol (progn
+		     (goto-char relpos)
+		     (current-column)))
+	   foundp)
+      (while (and (not foundp)
+		  (< (point) (vhdl-point 'eol)))
+	(re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move)
+	(if (vhdl-in-literal (cdr langelem))
+	    (forward-char)
+	  (if (= (preceding-char) ?\()
+	      ;; skip over any parenthesized expressions
+	      (goto-char (min (vhdl-point 'eol)
+			      (scan-lists (point) 1 1)))
+	    ;; found an assignment operator (not at eol)
+	    (setq foundp (not (looking-at "\\s-*$"))))))
+      (if (not foundp)
+	  ;; there's no assignment operator on the line
+	  vhdl-basic-offset
+	;; calculate indentation column after assign and ws, unless
+	;; our line contains an assignment operator
+	(if (not assignp)
+	    (progn
+	      (forward-char)
+	      (skip-chars-forward " \t")
+	      (setq assignp 0)))
+	(- (current-column) assignp curcol))
+      )))
+
+
+;; Indentation commands:
+
+;; This is used by indent-for-comment to decide how much to indent a
+;; comment in VHDL code based on its context.
+(defun vhdl-comment-indent ()
+  (if (looking-at (concat "^--"))
+      0				;Existing comment at bol stays there.
+    (let ((opoint (point))
+	  placeholder)
+      (save-excursion
+	(beginning-of-line)
+	(cond
+	 ;; CASE 1: use comment-column if previous line is a
+	 ;; comment-only line indented to the left of comment-column
+	 ((save-excursion
+	    (beginning-of-line)
+	    (and (not (bobp))
+		 (forward-line -1))
+	    (skip-chars-forward " \t")
+	    (prog1
+		(looking-at "--")
+	      (setq placeholder (point))))
+	  (goto-char placeholder)
+	  (if (< (current-column) comment-column)
+	      comment-column
+	    (current-column)))
+	 ;; CASE 2: If comment-column is 0, and nothing but space
+	 ;; before the comment, align it at 0 rather than 1.
+	 ((progn
+	    (goto-char opoint)
+	    (skip-chars-backward " \t")
+	    (and (= comment-column 0) (bolp)))
+	  0)
+	 ;; CASE 3: indent at comment column except leave at least one
+	 ;; space.
+	 (t (max (1+ (current-column))
+		 comment-column))
+	 )))))
+
+(defun vhdl-indent-line ()
+  ;; indent the current line as VHDL code. Returns the amount of
+  ;; indentation change
+  (let* ((syntax (vhdl-get-syntactic-context))
+	 (pos (- (point-max) (point)))
+	 (indent (apply '+ (mapcar 'vhdl-get-offset syntax)))
+	 (shift-amt  (- (current-indentation) indent)))
+    (and vhdl-echo-syntactic-information-p
+	 (message "syntax: %s, indent= %d" syntax indent))
+    (if (zerop shift-amt)
+	nil
+      (delete-region (vhdl-point 'bol) (vhdl-point 'boi))
+      (beginning-of-line)
+      (indent-to indent))
+    (if (< (point) (vhdl-point 'boi))
+	(back-to-indentation)
+      ;; If initial point was within line's indentation, position after
+      ;; the indentation.  Else stay at same point in text.
+      (if (> (- (point-max) pos) (point))
+	  (goto-char (- (point-max) pos)))
+      )
+    (run-hooks 'vhdl-special-indent-hook)
+    shift-amt))
+
+(defun vhdl-indent-command (&optional whole-exp)
+  "Indent current line as VHDL code, or in some cases insert a tab character.
+
+If `vhdl-tab-always-indent' is t, always just indent the current line.
+If nil, indent the current line only if point is at the left margin or
+in the line's indentation; otherwise insert a tab.  If other than nil
+or t, then tab is inserted only within literals (comments and strings)
+and inside preprocessor directives, but line is always reindented.
+
+A numeric argument, regardless of its value, means indent rigidly all
+the lines of the expression starting after point so that this line
+becomes properly indented.  The relative indentation among the lines
+of the expression are preserved."
+  (interactive "P")
+  (if whole-exp
+      ;; If arg, always indent this line as VHDL
+      ;; and shift remaining lines of expression the same amount.
+      (let ((shift-amt (vhdl-indent-line))
+	    beg end)
+	(save-excursion
+	  (if (eq vhdl-tab-always-indent t)
+	      (beginning-of-line))
+	  (setq beg (point))
+	  (forward-sexp)
+	  (setq end (point))
+	  (goto-char beg)
+	  (forward-line 1)
+	  (setq beg (point)))
+	(if (> end beg)
+	    (indent-code-rigidly beg end (- shift-amt))))
+    ;; No arg supplied, use vhdl-tab-always-indent to determine
+    ;; behavior
+    (cond
+     ;; CASE 1: indent when at column zero or in lines indentation,
+     ;; otherwise insert a tab
+     ((not vhdl-tab-always-indent)
+      (if (save-excursion
+	    (skip-chars-backward " \t")
+	    (not (bolp)))
+	  (insert-tab)
+	(vhdl-indent-line)))
+     ;; CASE 2: just indent the line
+     ((eq vhdl-tab-always-indent t)
+      (vhdl-indent-line))
+     ;; CASE 3: if in a literal, insert a tab, but always indent the
+     ;; line
+     (t
+      (if (vhdl-in-literal (vhdl-point 'bod))
+	  (insert-tab))
+      (vhdl-indent-line)
+      ))))
+
+(defun vhdl-indent-sexp (&optional endpos)
+  "Indent each line of the list starting just after point.
+If optional arg ENDPOS is given, indent each line, stopping when
+ENDPOS is encountered.  (interactive)"
+  (interactive)
+  (save-excursion
+    (let ((beg (point))
+	  (end (progn
+		 (vhdl-forward-sexp nil endpos)
+		 (point))))
+      (indent-region beg end nil))))
+
+(defun vhdl-show-syntactic-information ()
+  "Show syntactic information for current line."
+  (interactive)
+  (message "syntactic analysis: %s" (vhdl-get-syntactic-context))
+  (vhdl-keep-region-active))
+
+
+;; Verification and regression functions:
+
+(defun vhdl-regress-line (&optional arg)
+  "Check syntactic information for current line."
+  (interactive "P")
+  (let ((expected (save-excursion
+		    (end-of-line)
+		    (if (search-backward " -- ((" (vhdl-point 'bol) t)
+			(progn
+			  (forward-char 4)
+			  (read (current-buffer))))))
+	(actual (vhdl-get-syntactic-context))
+	(expurgated))
+    ;; remove the library unit symbols
+    (mapcar
+     (function
+      (lambda (elt)
+	(if (memq (car elt) '(entity configuration package
+				     package-body architecture))
+	    nil
+	  (setq expurgated (append expurgated (list elt))))))
+     actual)
+    (if (and (not arg) expected (listp expected))
+	(if (not (equal expected expurgated))
+	    (error "Should be: %s, is: %s" expected expurgated))
+      (save-excursion
+	(beginning-of-line)
+	(if (not (looking-at "^\\s-*\\(--.*\\)?$"))
+	    (progn
+	      (end-of-line)
+	      (if (search-backward " -- ((" (vhdl-point 'bol) t)
+		  (kill-line))
+	      (insert " -- ")
+	      (insert (format "%s" expurgated)))))))
+  (vhdl-keep-region-active))
+
+(defun test-vhdl-get-block-state ()
+  (interactive)
+  (let ((case-fold-search t)
+	here vec (delay 0.5))
+    (setq here (point))
+    (message "%s" (prin1-to-string (setq vec (vhdl-get-block-state))))
+    (and (aref vec 0)
+	 (goto-char (aref vec 0))
+	 (sit-for delay))
+    (and (aref vec 1)
+	 (goto-char (aref vec 1))
+	 (sit-for delay))
+    (goto-char here)
+    ))
+
+;; Support for Barry Warsaw's elp (emacs lisp profiler) package:
+
+(setq elp-all-instrumented-list nil)
+(setq elp-function-list
+      '(
+	vhdl-indent-command
+	vhdl-indent-line
+	vhdl-comment-indent
+	vhdl-lineup-statement-cont
+	vhdl-lineup-comment
+	vhdl-lineup-arglist-intro
+	vhdl-lineup-arglist
+	vhdl-get-syntactic-context
+	vhdl-skip-case-alternative
+	vhdl-get-block-state
+	vhdl-get-library-unit
+	vhdl-beginning-of-statement
+	vhdl-beginning-of-statement-1
+	vhdl-beginning-of-defun
+	vhdl-beginning-of-libunit
+	vhdl-backward-sexp
+	vhdl-forward-sexp
+	vhdl-backward-to-block
+	vhdl-statement-p
+	vhdl-end-of-leader
+	vhdl-corresponding-begin
+	vhdl-end-p
+	vhdl-corresponding-end
+	vhdl-corresponding-mid
+	vhdl-begin-p
+	vhdl-corresponding-defun
+	vhdl-defun-p
+	vhdl-libunit-p
+	vhdl-last-word
+	vhdl-first-word
+	vhdl-backward-syntactic-ws
+	vhdl-forward-syntactic-ws
+	vhdl-in-literal
+	vhdl-keep-region-active
+	))
+
+;; (elp-instrument-list elp-function-list)
+
+(defun vhdl-trace-all-functions ()
+  (interactive)
+  (let ((list elp-function-list))
+    (while list
+      (trace-function-background (car list))
+      (setq list (cdr list)))))
+
+
+;; Defuns for submitting bug reports:
+
+(defconst vhdl-version "$Revision: 1.1.1.1 $"
+  "vhdl-mode version number.")
+(defconst vhdl-mode-help-address "rwhitby@asc.corp.mot.com"
+  "Address accepting submission of bug reports.")
+
+(defun vhdl-version ()
+  "Echo the current version of vhdl-mode in the minibuffer."
+  (interactive)
+  (message "Using vhdl-mode %s" vhdl-version)
+  (vhdl-keep-region-active))
+
+;; get reporter-submit-bug-report when byte-compiling
+(and (fboundp 'eval-when-compile)
+     (eval-when-compile
+      (require 'reporter)))
+
+(defun vhdl-submit-bug-report ()
+  "Submit via mail a bug report on vhdl-mode."
+  (interactive)
+  ;; load in reporter
+  (and
+   (y-or-n-p "Do you want to submit a report on vhdl-mode? ")
+   (require 'reporter)
+   (reporter-submit-bug-report
+    vhdl-mode-help-address
+    (concat "vhdl-mode " vhdl-version)
+    (list
+     ;; report only the vars that affect indentation
+     'vhdl-basic-offset
+     'vhdl-offsets-alist
+     'vhdl-comment-only-line-offset
+     'vhdl-tab-always-indent
+     'tab-width
+     )
+    (function
+     (lambda ()
+       (insert
+	(if vhdl-special-indent-hook
+	    (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+		    "vhdl-special-indent-hook is set to '"
+		    (format "%s" vhdl-special-indent-hook)
+		    ".\nPerhaps this is your problem?\n"
+		    "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n")
+	  "\n")
+	(format "vhdl-emacs-features: %s\n" vhdl-emacs-features)
+	)))
+    nil
+    "Dear Rod,"
+    )))
+
+(provide 'vhdl-mode)
+;;; vhdl-mode.el ends here
--- a/lisp/packages/apropos.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/apropos.el	Mon Aug 13 09:03:46 2007 +0200
@@ -66,22 +66,34 @@
   "*Whether the apropos commands should do more.
 Slows them down more or less.  Set this non-nil if you have a fast machine.")
 
-(defvar apropos-symbol-face 'bold
+;; XEmacs addition
+(defvar apropos-symbol-face (if (boundp 'font-lock-keyword-face)
+				font-lock-keyword-face
+			      'bold)
   "*Face for symbol name in apropos output or `nil'.  
 This looks good, but slows down the commands several times.")
 
-(defvar apropos-keybinding-face 'underline
+;; XEmacs addition
+(defvar apropos-keybinding-face (if (boundp 'font-lock-string-face)
+				    font-lock-string-face
+				  'underline)
   "*Face for keybinding display in apropos output or `nil'.  
 This looks good, but slows down the commands several times.")
 
-(defvar apropos-label-face 'italic
+;; XEmacs addition
+(defvar apropos-label-face (if (boundp 'font-lock-comment-face)
+			       font-lock-comment-face
+			     'italic)
   "*Face for label (Command, Variable ...) in apropos output or `nil'.
 If this is `nil' no mouse highlighting occurs.
 This looks good, but slows down the commands several times.
 When this is a face name, as it is initially, it gets transformed to a
 text-property list for efficiency.")
 
-(defvar apropos-property-face 'bold-italic
+;; XEmacs addition
+(defvar apropos-property-face (if (boundp 'font-lock-variable-name-face)
+				  font-lock-variable-name-face
+				'bold-italic)
   "*Face for property name in apropos output or `nil'.  
 This looks good, but slows down the commands several times.")
 
@@ -93,7 +105,8 @@
 (defvar apropos-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map [(control m)] 'apropos-follow)
-    (define-key map [(button2)] 'apropos-mouse-follow)
+    (define-key map [(button2up)] 'apropos-mouse-follow)
+    (define-key map [(button2)] 'undefined)
     map)
   "Keymap used in Apropos mode.")
 
@@ -110,6 +123,8 @@
 (defvar apropos-item ()
   "Current item in or for apropos-accumulator.")
 
+(defvar apropos-mode-hook nil) ; XEmacs
+
 (defun apropos-mode ()
   "Major mode for following hyperlinks in output of apropos commands.
 
@@ -118,7 +133,8 @@
   (kill-all-local-variables)
   (use-local-map apropos-mode-map)
   (setq major-mode 'apropos-mode
-	mode-name "Apropos"))
+	mode-name "Apropos")
+  (run-hooks 'apropos-mode-hook)) ; XEmacs
 
 
 ;; For auld lang syne:
@@ -460,7 +476,8 @@
 	  (sort apropos-accumulator (lambda (a b)
 				      (string-lessp (car a) (car b)))))
     (and apropos-label-face
-	 (symbolp apropos-label-face)
+	 (or (symbolp apropos-label-face)
+	     (facep apropos-label-face)) ; XEmacs
 	 (setq apropos-label-face `(face ,apropos-label-face
 					 mouse-face highlight)))
     (with-output-to-temp-buffer "*Apropos*"
@@ -628,4 +645,6 @@
     (princ ")")
     (print-help-return-message)))
 
+(provide 'apropos) ; XEmacs
+
 ;;; apropos.el ends here
--- a/lisp/packages/autoinsert.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/autoinsert.el	Mon Aug 13 09:03:46 2007 +0200
@@ -17,9 +17,9 @@
 ;; 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.
+;; 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.
 
@@ -135,19 +135,22 @@
 
 ;; 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
+;; 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.
+;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
 
 ;;; Commentary:
 
@@ -156,6 +159,7 @@
 ;;; Code:
 
 
+(provide ' " (file-name-nondirectory (buffer-file-name)) ")
 
 ;;; " (file-name-nondirectory (buffer-file-name)) " ends here"))
   "A list specifying text to insert by default into a new file.
@@ -252,4 +256,6 @@
 	(setq auto-insert-alist (cons (cons key action)
 				      auto-insert-alist))))))
 
+(provide 'autoinsert)
+
 ;;; autoinsert.el ends here
--- a/lisp/packages/buff-menu.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/buff-menu.el	Mon Aug 13 09:03:46 2007 +0200
@@ -3,6 +3,7 @@
 ;; Copyright (C) 1985, 86, 87, 93, 94, 95 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
+;; Keywords: extensions
 
 ;; This file is part of XEmacs.
 
@@ -17,11 +18,11 @@
 ;; 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.
+;; 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.30 except as noted.
+;;; Synched up with: FSF 19.34 except as noted.
 
 ;;; Commentary:
 
@@ -69,7 +70,7 @@
     ()
   (setq Buffer-menu-mode-map (make-keymap))
   (suppress-keymap Buffer-menu-mode-map t)
-  (set-keymap-name Buffer-menu-mode-map 'Buffer-menu-mode-map)
+  (set-keymap-name Buffer-menu-mode-map 'Buffer-menu-mode-map) ; XEmacs
   (define-key Buffer-menu-mode-map "q" 'Buffer-menu-quit)
   (define-key Buffer-menu-mode-map "v" 'Buffer-menu-select)
   (define-key Buffer-menu-mode-map "2" 'Buffer-menu-2-window)
@@ -95,8 +96,8 @@
   (define-key Buffer-menu-mode-map "t" 'Buffer-menu-visit-tags-table)
   (define-key Buffer-menu-mode-map "%" 'Buffer-menu-toggle-read-only)
   (define-key Buffer-menu-mode-map "g" 'revert-buffer)
-  (define-key Buffer-menu-mode-map 'button2 'Buffer-menu-mouse-select)
-  (define-key Buffer-menu-mode-map 'button3 'Buffer-menu-popup-menu)
+  (define-key Buffer-menu-mode-map [mouse-2] 'Buffer-menu-mouse-select)
+  (define-key Buffer-menu-mode-map [mouse-3] 'Buffer-menu-popup-menu)
   )
 
 ;; Buffer Menu mode is suitable only for specially formatted data.
@@ -136,8 +137,8 @@
   (setq revert-buffer-function 'Buffer-menu-revert-function)
   (setq truncate-lines t)
   (setq buffer-read-only t)
-  (make-local-variable 'mouse-track-click-hook)
-  (add-hook 'mouse-track-click-hook 'Buffer-menu-maybe-mouse-select)
+  (make-local-variable 'mouse-track-click-hook) ; XEmacs
+  (add-hook 'mouse-track-click-hook 'Buffer-menu-maybe-mouse-select) ; XEmacs
   (run-hooks 'buffer-menu-mode-hook))
 
 (defun Buffer-menu-revert-function (ignore1 ignore2)
@@ -253,7 +254,7 @@
     (forward-line 1)))
 
 (defun Buffer-menu-save ()
-  "Mark buffer on this line to be saved by \\[Buffer-menu-execute] command."
+  "Mark buffer on this line to be saved by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command."
   (interactive)
   (beginning-of-line)
   (if (looking-at " [-M]")		;header lines
@@ -366,6 +367,7 @@
   (switch-to-buffer (Buffer-menu-buffer t))
   (bury-buffer (other-buffer))
   (delete-other-windows)
+  ;; XEmacs:
   ;; This is to get w->force_start set to nil.  Don't ask me, I only work here.
   (set-window-buffer (selected-window) (current-buffer)))
 
@@ -374,16 +376,17 @@
   (interactive "e")
   (let (buffer)
     (save-excursion
-      (set-buffer (event-buffer event))
+      (set-buffer (event-buffer event)) ; XEmacs
       (save-excursion
-	(goto-char (event-point event))
+	(goto-char (event-point event)) ; XEmacs
 	(setq buffer (Buffer-menu-buffer t))))
-    (select-window (event-window event))
+    (select-window (event-window event)) ; XEmacs
     (if (and (window-dedicated-p (selected-window))
 	     (eq (selected-window) (frame-root-window)))
 	(switch-to-buffer-other-frame buffer)
       (switch-to-buffer buffer))))
 
+;; XEmacs
 (defun Buffer-menu-maybe-mouse-select (event &optional click-count)
   (interactive "e")
   (and (>= click-count 2)
@@ -443,6 +446,7 @@
             (delete-char 1)
             (insert char))))))
 
+;; XEmacs
 (defvar Buffer-menu-popup-menu
   '("Buffer Commands"
     ["Select Buffer"			Buffer-menu-select		t]
@@ -457,6 +461,7 @@
     ["Delete/Save Marked Buffers"	Buffer-menu-execute		t]
     ))
 
+;; XEmacs
 (defun Buffer-menu-popup-menu (event)
   (interactive "e")
   (mouse-set-point event)
@@ -472,15 +477,18 @@
       (error "no buffer on this line"))))
 
 
+;; XEmacs
 (defvar list-buffers-header-line
   (purecopy (concat " MR Buffer           Size  Mode         File\n"
                     " -- ------           ----  ----         ----\n")))
 
+;; XEmacs
 (defvar list-buffers-identification 'default-list-buffers-identification
   "String used to identify this buffer, or a function of one argument
 to generate such a string.  This variable is always buffer-local.")
 (make-variable-buffer-local 'list-buffers-identification)
 
+;; XEmacs
 (defvar list-buffers-directory)
 (make-variable-buffer-local 'list-buffers-directory)
 
@@ -582,6 +590,7 @@
       (Buffer-menu-mode)
       (if (not (bufferp current))
           (goto-char current)))))
+;(define-key ctl-x-map "\C-b" 'list-buffers)
 
 (defun list-buffers (&optional files-only)
   "Display a list of names of existing buffers.
@@ -591,7 +600,7 @@
 
 The M column contains a * for buffers that are modified.
 The R column contains a % for buffers that are read-only."
-  (interactive (list (if current-prefix-arg t nil)))
+  (interactive (list (if current-prefix-arg t nil))) ; XEmacs
   (display-buffer (list-buffers-noselect files-only)))
 
 ;; #### not synched
--- a/lisp/packages/column.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/column.el	Mon Aug 13 09:03:46 2007 +0200
@@ -65,10 +65,14 @@
 
 ;; Function updating the string containing the current column.
 (defvar update-column-function 
-  (function (lambda ()
-	      (setq current-column (int-to-string (current-column)))
-	      (setq current-line   (int-to-string (current-line)))
-	      (set-buffer-modified-p (buffer-modified-p)))))
+  (lambda ()
+    (setq current-column
+	  (int-to-string (if (and (boundp 'column-number-start-at-one)
+				  column-number-start-at-one)
+			     (1+ (current-column))
+			   (current-column))))
+    (setq current-line   (int-to-string (current-line)))
+    (set-buffer-modified-p (buffer-modified-p))))
 
 (defvar display-column-mode nil
   "Show current column and line in mode line if non-nil.")
--- a/lisp/packages/hexl.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/hexl.el	Mon Aug 13 09:03:46 2007 +0200
@@ -689,15 +689,15 @@
   (define-key hexl-mode-map [right] 'hexl-forward-char)
   (define-key hexl-mode-map [up] 'hexl-previous-line)
   (define-key hexl-mode-map [down] 'hexl-next-line)
-  (define-key hexl-mode-map [M-left] 'hexl-backward-short)
-  (define-key hexl-mode-map [M-right] 'hexl-forward-short)
+  (define-key hexl-mode-map [(meta left)] 'hexl-backward-short)
+  (define-key hexl-mode-map [(meta right)] 'hexl-forward-short)
   (define-key hexl-mode-map [next] 'hexl-scroll-up)
   (define-key hexl-mode-map [prior] 'hexl-scroll-down)
   (define-key hexl-mode-map [home] 'hexl-beginning-of-buffer)
   (define-key hexl-mode-map [deletechar] 'undefined)
   (define-key hexl-mode-map [deleteline] 'undefined)
   (define-key hexl-mode-map [insertline] 'undefined)
-  (define-key hexl-mode-map [S-delete] 'undefined)
+  (define-key hexl-mode-map [(shift delete)] 'undefined)
   (define-key hexl-mode-map "\177" 'undefined)
 
   (define-key hexl-mode-map "\C-a" 'hexl-beginning-of-line)
--- a/lisp/packages/icomplete.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/icomplete.el	Mon Aug 13 09:03:46 2007 +0200
@@ -4,7 +4,7 @@
 
 ;;; Author: Ken Manheimer <klm@nist.gov>
 ;;; Maintainer: Ken Manheimer <klm@nist.gov>
-;;; Version: $Id: icomplete.el,v 1.1.1.1 1996/12/18 22:42:52 steve Exp $
+;;; Version: $Id: icomplete.el,v 1.1.1.2 1996/12/18 22:50:53 steve Exp $
 ;;; Created: Mar 1993 klm@nist.gov - first release to usenet
 ;;; Keywords: help, abbrev
 
@@ -91,6 +91,9 @@
 will constrain rsz-mini to a maximum minibuffer height of 3 lines when
 icompletion is occurring.")
 
+(if (string-match "XEmacs\\|Lucid" emacs-version)
+    (add-hook 'icomplete-minibuffer-setup-hook 'icomplete-exhibit))
+
 ;;;_ + Internal Variables
 ;;;_  = icomplete-mode
 (defvar icomplete-mode t
@@ -273,7 +276,7 @@
 		   " [Matched]"
 	   ;; XEmacs
 		   (if (and icomplete-show-key-bindings
-			    (commandp (car comps)))
+			    (commandp (intern-soft (car comps))))
 		       (icomplete-get-keys (car comps))
 		     "")
 		   ))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/packages/man-xref.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,166 @@
+;;; man-xref.el --- cross reference selection functions for man mode
+
+;; Author:  Mark Hood <hood@eng.sun.com>
+;; @(#)man-xref.el	1.15	
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.35.
+
+;;; Commentary:
+
+;; This package is an add-on to the man.el that comes with Emacs
+;; 19.34.  It renders manpage cross references in bold, sets them up
+;; for mouse highlighting, and allows selection via keystrokes or
+;; mouse.  All strings matching Man-reference-regexp in the text of
+;; the man page are set up, in addition to the ones in the See Also
+;; section.
+
+;; To use this package, put something like the following in your Emacs
+;; initialization file.  This example causes tab and M-tab to go to
+;; the next and previous manual cross references, causes carriage
+;; return to display a man page for the reference under point, and
+;; allows mouse button 2 to invoke a man page display.
+
+;; (add-hook 'Man-mode-hook
+;;	  '(lambda ()
+;;	     (Man-mouseify-xrefs)
+;;	     (define-key Man-mode-map "\r" 'Man-do-manual-reference)
+;;	     (define-key Man-mode-map "\t" 'Man-next-manual-reference)
+;;	     (define-key Man-mode-map "\e\t" 'Man-prev-manual-reference)
+;;	     (define-key Man-mode-map [mouse-2] 'Man-mouse-manual-reference)
+;;	     ))
+;;
+;; (autoload 'Man-mouseify-xrefs "~/emacs/man-xref")
+
+(eval-when-compile (require 'cl))
+
+(defvar Man-word-syntax "w_()" "Syntax for words in a man buffer.")
+
+(defun Man-current-word ()
+  "Return word under point, using `Man-word-syntax' for word syntax."
+  (save-excursion
+    (let ((s (+ (point) (skip-syntax-backward Man-word-syntax))))
+      (skip-syntax-forward Man-word-syntax)
+      (buffer-substring s (point)))))
+
+(defun Man-prev-word-hyphen-p ()
+  "Return nil if previous word is not hyphenated.
+Non-nil value is the buffer position of the beginning of the hyphenated word."
+  (save-excursion
+    (skip-syntax-backward Man-word-syntax)
+    (skip-chars-backward " \t")
+    (cond ((and (> (point) (1+ (point-min)))
+		(string-equal "-\n" (buffer-substring (- (point) 2) (point))))
+	   (backward-char)
+	   (skip-syntax-backward Man-word-syntax)
+	   (point)))))
+
+(defun Man-next-manual-reference ()
+  "Move point to the beginning of the next manual reference."
+  (interactive)
+  (let ((current (point))
+	(end (re-search-forward (concat "[ \t]" Man-reference-regexp) nil t))
+	(start (or (Man-prev-word-hyphen-p) (1+ (match-beginning 0)))))
+    (cond ((eq end nil))
+	  ((> start current)
+	   (goto-char start))
+	  ;; current is in the pre-hyphen portion of a hyphenated reference
+	  ((re-search-forward Man-reference-regexp nil t)
+	   (goto-char (or (Man-prev-word-hyphen-p) (match-beginning 0))))
+	  ((goto-char current)))))
+
+(defun Man-prev-manual-reference ()
+  "Move point to the beginning of the previous manual reference."
+  (interactive)
+  (if (re-search-backward (concat "[ \t]" Man-reference-regexp) nil t)
+      (goto-char (or (Man-prev-word-hyphen-p) (1+ (match-beginning 0))))))
+
+(defun Man-mouseify-xrefs ()
+  "Render man cross references in bold font and set up mouse highlighting.
+Add these cross references to `Man-refpages-alist'."
+  (let (start end xref hyphen alist)
+    (goto-char (point-min))
+    (forward-line 1)
+    (while (re-search-forward Man-reference-regexp nil t)
+      (setq start (match-beginning 0))
+      (setq end (match-end 0))
+      (setq xref (buffer-substring start end))
+      (cond ((setq hyphen (Man-prev-word-hyphen-p))
+	     (setq start hyphen)
+	     (goto-char hyphen)
+	     (setq xref (concat (substring (Man-current-word) 0 -1) xref))
+	     (goto-char end)))
+      (setq Man-refpages-alist (cons (list xref) Man-refpages-alist))
+      (Man-boldify-mouse-region start end))
+    (setq Man-refpages-alist
+	  (sort Man-refpages-alist
+		(function (lambda (a b) (string< (car a) (car b))))))
+    ;; delete duplicate entries in the alist
+    (setq alist Man-refpages-alist)
+    (while alist
+      (cond ((string= (car (car alist)) (car (car (cdr alist))))
+	     (setcdr alist (cdr (cdr alist))))
+	    ((setq alist (cdr alist)))))
+    (goto-char (point-min))
+    (forward-line 1)))
+
+(defun Man-mouse-manual-reference (mouse)
+  "Move point to mouse position and run `Man-getpage-in-background' there."
+  (interactive "e")
+  (select-window (car (car (cdr mouse))))
+  (goto-char (car (cdr (car (cdr mouse)))))
+  (Man-do-manual-reference))
+
+(defun Man-do-manual-reference ()
+  "Run `Man-getpage-in-background' on cross reference under point.
+Word under point is checked for a match with `Man-reference-regexp'.  
+If point is not over a word, try to use previous word for a match."
+  (interactive)
+  (save-excursion
+    (let ((xref (Man-current-word)) (hyphen (Man-prev-word-hyphen-p)))
+      (if (and (zerop (length xref))
+	       (setq xref " ")
+	       (skip-syntax-backward " ")
+	       (not (eq (point) (point-min))))
+	  (Man-do-manual-reference)
+	(cond ((string-equal "-" (substring xref -1))
+	       (skip-syntax-forward Man-word-syntax)
+	       (skip-syntax-forward " ")
+	       (setq xref (concat (substring xref 0 -1) (Man-current-word))))
+	      (hyphen
+	       (goto-char hyphen)
+	       (setq xref (concat (substring (Man-current-word) 0 -1) xref))))
+	(if (string-match Man-reference-regexp xref)
+	    (Man-getpage-in-background
+	     (Man-translate-references
+	      (substring xref (match-beginning 0) (match-end 0))))
+	  (message "No cross reference found under point."))))))
+
+(eval-and-compile
+  (when (string-match "XEmacs\\|Lucid" emacs-version)
+    (fset 'make-overlay 'make-extent)
+    (fset 'overlay-put 'set-extent-property)))
+
+(defun Man-boldify-mouse-region (beg end)
+  "Render region text in bold with mouse highlighting."
+  (let ((overlay (make-overlay beg end)))
+    (overlay-put overlay 'face 'bold)
+    (overlay-put overlay 'mouse-face 'highlight)
+    (overlay-put overlay 'hilit t)))
+
--- a/lisp/packages/man.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/man.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,8 +1,11 @@
 ;;; man.el --- browse UNIX manual pages
-;; Keywords: help
+
+;; Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
 
-;; Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc.
-;;
+;; Author:		Barry A. Warsaw <bwarsaw@cen.com>
+;; Keywords:		help
+;; Adapted-By:		ESR, pot
+
 ;; This file is part of XEmacs.
 
 ;; XEmacs is free software; you can redistribute it and/or modify it
@@ -16,1211 +19,1046 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: Not synched with FSF.
-;;; ICK!  This file is almost completely different from FSF.
-;;; Someone clarify please.
+;;; Synched up with: FSF 19.34.
 
-;; Mostly rewritten by Alan K. Stebbens <aks@hub.ucsb.edu> 11-apr-90.
-;;
-;;  o  Match multiple man pages using TOPIC as a simple pattern
-;;  o  Search unformatted pages, even when formatted matches are found
-;;  o  Query the user as to which pages are desired
-;;  o  Use of the prefix arg to toggle/bypass the above features
-;;  o  Buffers named by the first topic in the buffer
-;;  o  Automatic uncompress for compressed man pages (.Z, .z, and .gz)
-;;  o  View the resulting buffer using M-x view mode
-;;
-;; Modified 16-mar-91 by Jamie Zawinski <jwz@lucid.com> to default the 
-;; manual topic to the symbol at point, just like find-tag does.
-;;
-;; Modified 22-mar-93 by jwz to use multiple fonts and follow xrefs with mouse.
-;;
-;; Modified 16-apr-93 by Dave Gillespie <daveg@synaptics.com> to make
-;; apropos work nicely; work correctly when bold or italic is unavailable; 
-;; reuse old buffer if topic is re-selected (in Manual-topic-buffer mode).
-;;
-;; Modified 4-apr-94 by jwz: merged in Tibor Polgar's code for manpath.conf.
-;;
-;; Modified 19-apr-94 by Tibor Polgar <tlp00@spg.amdahl.com> to add support for
-;; $PAGER variable to be emacsclient and properly process man pages (assuming
-;; the man pages were built by man in /tmp.  also fixed bug with man list being
-;; backwards.
-;;
-;; Modified 23-aug-94 by Tibor Polgar <tlp00@spg.amdahl.com> to add support for
-;; displaying only one instance of a man page (Manual-unique-man-sections-only)
-;; Fixed some more man page ordering bugs, bug with Manual-query-multiple-pages.
+;;; Commentary:
+
+;; This code provides a function, `man', with which you can browse
+;; UNIX manual pages.  Formatting is done in background so that you
+;; can continue to use your Emacs while processing is going on.
 ;;
-;; Modified 29-nov-94 by Ben Wing <wing@spg.amdahl.com>: small fixes
-;; that should hopefully make things work under HPUX and IRIX.; 
-;;
-;; Modified 15-jul-95 by Dale Atems <atems@physics.wayne.edu>:
-;; some extensive rewriting to make things work right (more or less)
-;; under IRIX.
-;;
-;; Modified 08-mar-96 by Hubert Palme <palme@wrcs3.urz.uni-wuppertal.de>:
-;; added /usr/share/catman to the manual directory list for IRIX (5.3)
-;; 
-;; This file defines "manual-entry", and the remaining definitions all
-;; begin with "Manual-".  This makes the autocompletion on "M-x man" work.
-;;
-;; Variables of interest:
-;;
-;;	Manual-program
-;;	Manual-topic-buffer
-;;	Manual-buffer-view-mode
-;;	Manual-directory-list
-;;	Manual-formatted-directory-list
-;;	Manual-match-topic-exactly
-;;	Manual-query-multiple-pages
-;;	Manual-page-history
-;;	Manual-subdirectory-list
-;;	Manual-man-page-section-ids
-;;	Manual-formatted-page-prefix
-;;	Manual-unformatted-page-prefix
-;;	Manual-use-full-section-ids
+;; The mode also supports hypertext-like following of manual page SEE
+;; ALSO references, and other features.  See below or do `?' in a
+;; manual page buffer for details.
+
+;; ========== Credits and History ========== 
+;; In mid 1991, several people posted some interesting improvements to
+;; man.el from the standard emacs 18.57 distribution.  I liked many of
+;; these, but wanted everything in one single package, so I decided
+;; to incorporate them into a single manual browsing mode.  While
+;; much of the code here has been rewritten, and some features added,
+;; these folks deserve lots of credit for providing the initial
+;; excellent packages on which this one is based.
+
+;; Nick Duffek <duffek@chaos.cs.brandeis.edu>, posted a very nice
+;; improvement which retrieved and cleaned the manpages in a
+;; background process, and which correctly deciphered such options as
+;; man -k.
+
+;; Eric Rose <erose@jessica.stanford.edu>, submitted manual.el which
+;; provided a very nice manual browsing mode.
+
+;; This package was available as `superman.el' from the LCD package
+;; for some time before it was accepted into Emacs 19.  The entry
+;; point and some other names have been changed to make it a drop-in
+;; replacement for the old man.el package.
+
+;; Francesco Potorti` <pot@cnuce.cnr.it> cleaned it up thoroughly,
+;; making it faster, more robust and more tolerant of different
+;; systems' man idiosyncrasies.
+
+;; ========== Features ==========
+;; + Runs "man" in the background and pipes the results through a
+;;   series of sed and awk scripts so that all retrieving and cleaning
+;;   is done in the background. The cleaning commands are configurable.
+;; + Syntax is the same as Un*x man
+;; + Functionality is the same as Un*x man, including "man -k" and
+;;   "man <section>", etc.
+;; + Provides a manual browsing mode with keybindings for traversing
+;;   the sections of a manpage, following references in the SEE ALSO
+;;   section, and more.
+;; + Multiple manpages created with the same man command are put into
+;;   a narrowed buffer circular list.
 
-(defvar Manual-program "man" "\
-*Name of the program to invoke in order to format the source man pages.")
+;; ============= TODO ===========
+;; - Add a command for printing.
+;; - The awk script deletes multiple blank lines.  This behaviour does
+;;   not allow to understand if there was indeed a blank line at the
+;;   end or beginning of a page (after the header, or before the
+;;   footer).  A different algorithm should be used.  It is easy to
+;;   compute how many blank lines there are before and after the page
+;;   headers, and after the page footer.  But it is possible to compute
+;;   the number of blank lines before the page footer by euristhics
+;;   only.  Is it worth doing?
+;; - Allow a user option to mean that all the manpages should go in
+;;   the same buffer, where they can be browsed with M-n and M-p.
+;; - Allow completion on the manpage name when calling man.  This
+;;   requires a reliable list of places where manpages can be found.  The
+;;   drawback would be that if the list is not complete, the user might
+;;   be led to believe that the manpages in the missing directories do
+;;   not exist.
+
+
+;;; Code:
+
+(require 'assoc)
+
+;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+;; empty defvars (keep the compiler quiet)
 
-(defvar Manual-section-switch (if (eq system-type 'usg-unix-v) "-s" nil)
-  "SysV needs this to work right.")
+(defvar Man-notify)
+(defvar Man-current-page)
+(defvar Man-page-list)
+(defvar Man-filter-list nil
+  "*Manpage cleaning filter command phrases.
+This variable contains a list of the following form:
+
+'((command-string phrase-string*)*)
+
+Each phrase-string is concatenated onto the command-string to form a
+command filter.  The (standard) output (and standard error) of the Un*x
+man command is piped through each command filter in the order the
+commands appear in the association list.  The final output is placed in
+the manpage buffer.")
 
-(defvar Manual-topic-buffer t "\
-*Non-nil means \\[Manual-entry] should output the manual entry for TOPIC into
-a buffer named *man TOPIC*, otherwise, it should name the buffer
-*Manual Entry*.")
+(defvar Man-original-frame)
+(defvar Man-arguments)
+(defvar Man-sections-alist)
+(defvar Man-refpages-alist)
+(defvar Man-uses-untabify-flag t
+  "When non-nil use `untabify' instead of Man-untabify-command.")
+(defvar Man-page-mode-string)
+(defvar Man-sed-script nil
+  "Script for sed to nuke backspaces and ANSI codes from manpages.")
+
+;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+;; user variables
+
+(defvar Man-fontify-manpage-flag t
+  "*Make up the manpage with fonts.")
+
+(defvar Man-overstrike-face 'bold
+  "*Face to use when fontifying overstrike.")
 
-(defvar Manual-buffer-view-mode t "\
-*Whether manual buffers should be placed in view-mode.
-nil means leave the buffer in fundamental-mode in another window.
-t means use `view-buffer' to display the man page in the current window.
-Any other value means use `view-buffer-other-window'.")
+(defvar Man-underline-face 'underline
+  "*Face to use when fontifying underlining.")
+
+;; Use the value of the obsolete user option Man-notify, if set.
+(defvar Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly)
+  "*Selects the behavior when manpage is ready.
+This variable may have one of the following values, where (sf) means
+that the frames are switched, so the manpage is displayed in the frame
+where the man command was called from:
 
-(defvar Manual-match-topic-exactly t "\
-*Non-nil means that \\[manual-entry] will match the given TOPIC exactly, rather
-apply it as a pattern.  When this is nil, and \"Manual-query-multiple-pages\"
-is non-nil, then \\[manual-entry] will query you for all matching TOPICs.
-This variable only has affect on the preformatted man pages (the \"cat\" files),
-since the \"man\" command always does exact topic matches.")
+newframe   -- put the manpage in its own frame (see `Man-frame-parameters')
+pushy      -- make the manpage the current buffer in the current window
+bully      -- make the manpage the current buffer and only window (sf)
+aggressive -- make the manpage the current buffer in the other window (sf)
+friendly   -- display manpage in the other window but don't make current (sf)
+polite     -- don't display manpage, but prints message and beep when ready
+quiet      -- like `polite', but don't beep
+meek       -- make no indication that the manpage is ready
 
-(defvar Manual-query-multiple-pages nil "\
-*Non-nil means that \\[manual-entry] will query the user about multiple man
-pages which match the given topic.  The query is done using the function 
-\"y-or-n-p\".  If this variable is nil, all man pages with topics matching the
-topic given to \\[manual-entry] will be inserted into the temporary buffer.
-See the variable \"Manual-match-topic-exactly\" to control the matching.")
+Any other value of `Man-notify-method' is equivalent to `meek'.")
+
+(defvar Man-frame-parameters nil
+  "*Frame parameter list for creating a new frame for a manual page.")
 
-(defvar Manual-unique-man-sections-only nil
-  "*Only present one man page per section.  This variable is useful if the same or
-up/down level man pages for the same entry are present in mulitple man paths.
-When set to t, only the first entry found in a section is displayed, the others
-are ignored without any messages or warnings.  Note that duplicates can occur if
-the system has both formatted and unformatted version of the same page.")
+(defvar Man-downcase-section-letters-flag t
+  "*Letters in sections are converted to lower case.
+Some Un*x man commands can't handle uppercase letters in sections, for
+example \"man 2V chmod\", but they are often displayed in the manpage
+with the upper case letter.  When this variable is t, the section
+letter (e.g., \"2V\") is converted to lowercase (e.g., \"2v\") before
+being sent to the man background process.")
 
-(defvar Manual-mode-hook nil
-  "Function or functions run on entry to Manual-mode.")
+(defvar Man-circular-pages-flag t
+  "*If t, the manpage list is treated as circular for traversal.")
 
-(defvar Manual-directory-list nil "\
-*A list of directories used with the \"man\" command, where each directory
-contains a set of \"man?\" and \"cat?\" subdirectories.  If this variable is nil,
-it is initialized by \\[Manual-directory-list-init].")
+(defvar Man-section-translations-alist
+  (list
+   '("3C++" . "3")
+   ;; Some systems have a real 3x man section, so let's comment this.
+   ;; '("3X" . "3")                        ; Xlib man pages
+   '("3X11" . "3")
+   '("1-UCB" . ""))
+  "*Association list of bogus sections to real section numbers.
+Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in
+their references which Un*x `man' does not recognize.  This
+association list is used to translate those sections, when found, to
+the associated section number.")
 
-(defvar Manual-formatted-directory-list nil "\
-A list of directories containing formatted man pages.  Initialized by
-\\[Manual-directory-list-init].")
+(defvar manual-program "man"
+  "The name of the program that produces man pages.")
 
-(defvar Manual-unformatted-directory-list nil "\
-A list of directories containing the unformatted (source) man pages.  
-Initialized by \\[Manual-directory-list-init].")
+(defvar Man-untabify-command "pr"
+  "Command used for untabifying.")
+
+(defvar Man-untabify-command-args (list "-t" "-e")
+  "List of arguments to be passed to Man-untabify-command (which see).")
 
-(defvar Manual-page-history nil "\
-A list of names of previously visited man page buffers.")
+(defvar Man-sed-command "sed"
+  "Command used for processing sed scripts.")
 
-(defvar Manual-manpath-config-file "/usr/lib/manpath.config"
-  "*Location of the manpath.config file, if any.")
-
-(defvar Manual-apropos-switch "-k"
-  "*Man apropos switch")
+(defvar Man-awk-command "awk"
+  "Command used for processing awk scripts.")
 
-;; New variables.
+(defvar Man-mode-line-format
+  '("" mode-line-modified
+       mode-line-buffer-identification "  "
+       global-mode-string
+       " " Man-page-mode-string
+       "  %[(" mode-name mode-line-process minor-mode-alist ")%]----"
+       (-3 . "%p") "-%-")
+  "Mode line format for manual mode buffer.")
 
-(defvar Manual-subdirectory-list nil "\
-A list of all the subdirectories in which man pages may be found.
-Iniialized by Manual-directory-list-init.")
+(defvar Man-mode-map nil
+  "Keymap for Man mode.")
+
+(defvar Man-mode-hook nil
+  "Hook run when Man mode is enabled.")
 
-;; This is for SGI systems; don't know what it should be otherwise.
-(defvar Manual-man-page-section-ids "1nl6823457poD" "\
-String containing all suffix characters for \"cat\" and \"man\"
-that identify valid sections of the Un*x manual.") 
+(defvar Man-cooked-hook nil
+  "Hook run after removing backspaces but before Man-mode processing.")
+
+(defvar Man-name-regexp "[-a-zA-Z0-9_][-a-zA-Z0-9_.]*"
+  "Regular expression describing the name of a manpage (without section).")
 
-(defvar Manual-formatted-page-prefix "cat" "\
-Prefix for directories where formatted man pages are to be found.
-Defaults to \"cat\".")
+(defvar Man-section-regexp "[0-9][a-zA-Z+]*\\|[LNln]"
+  "Regular expression describing a manpage section within parentheses.")
 
-(defvar Manual-unformatted-page-prefix "man" "\
-Prefix for directories where unformatted man pages are to be found.
-Defaults to \"man\".")
+(defvar Man-page-header-regexp
+  (concat "^[ \t]*\\(" Man-name-regexp
+	  "(\\(" Man-section-regexp "\\))\\).*\\1")
+  "Regular expression describing the heading of a page.")
 
-(defvar Manual-leaf-signature "" "\
-Regexp for identifying \"leaf\" subdirectories in the search path.
-If empty, initialized by Manual-directory-list-init.")
+(defvar Man-heading-regexp "^\\([A-Z][A-Z ]+\\)$"
+  "Regular expression describing a manpage heading entry.")
+
+(defvar Man-see-also-regexp "SEE ALSO"
+  "Regular expression for SEE ALSO heading (or your equivalent).
+This regexp should not start with a `^' character.")
 
-(defvar Manual-use-full-section-ids t "\
-If non-nil, pass full section ids to Manual-program, otherwise pass
-only the first character. Defaults to 't'.")
+(defvar Man-first-heading-regexp "^[ \t]*NAME$\\|^[ \t]*No manual entry fo.*$"
+  "Regular expression describing first heading on a manpage.
+This regular expression should start with a `^' character.")
+
+(defvar Man-reference-regexp
+  (concat "\\(" Man-name-regexp "\\)(\\(" Man-section-regexp "\\))")
+  "Regular expression describing a reference in the SEE ALSO section.")
 
-(defvar Manual-use-subdirectory-list (eq system-type 'irix) "\
-This makes manual-entry work correctly on SGI machines but it
-imposes a large startup cost which is why it is not simply on by
-default on all systems.")
+(defvar Man-switches ""
+  "Switches passed to the man command, as a single string.")
 
-(defvar Manual-use-rosetta-man (not (null (locate-file "rman" exec-path))) "\
-If non-nil, use RosettaMan (rman) to filter man pages.
-This makes man-page cleanup virtually instantaneous, instead of
-potentially taking a long time.
+(defvar Man-specified-section-option
+  (if (string-match "-solaris[0-9.]*$" system-configuration)
+      "-s"
+    "")
+  "Option that indicates a specified a manual section name.")
 
-Here is information on RosettaMan, from Neal.Becker@comsat.com (Neal Becker):
+;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+;; end user variables
+
+;; other variables and keymap initializations
+(make-variable-buffer-local 'Man-sections-alist)
+(make-variable-buffer-local 'Man-refpages-alist)
+(make-variable-buffer-local 'Man-page-list)
+(make-variable-buffer-local 'Man-current-page)
+(make-variable-buffer-local 'Man-page-mode-string)
+(make-variable-buffer-local 'Man-original-frame)
+(make-variable-buffer-local 'Man-arguments)
 
-RosettaMan is a filter for UNIX manual pages.  It takes as input man
-pages formatted for a variety of UNIX flavors (not [tn]roff source)
-and produces as output a variety of file formats.  Currently
-RosettaMan accepts man pages as formatted by the following flavors of
-UNIX: Hewlett-Packard HP-UX, AT&T System V, SunOS, Sun Solaris, OSF/1,
-DEC Ultrix, SGI IRIX, Linux, SCO; and produces output for the following
-formats: printable ASCII only (stripping page headers and footers),
-section and subsection headers only, TkMan, [tn]roff, Ensemble, RTF,
-SGML (soon--I finally found a DTD), HTML, MIME, LaTeX, LaTeX 2e, Perl 5's pod.
+(setq-default Man-sections-alist nil)
+(setq-default Man-refpages-alist nil)
+(setq-default Man-page-list nil)
+(setq-default Man-current-page 0)
+(setq-default Man-page-mode-string "1 of 1")
 
-RosettaMan improves on other man page filters in several ways: (1) its
-analysis recognizes the structural pieces of man pages, enabling high
-quality output, (2) its modular structure permits easy augmentation of
-output formats, (3) it accepts man pages formatted with the varient
-macros of many different flavors of UNIX, and (4) it doesn't require
-modification or cooperation with any other program.
+(defconst Man-sysv-sed-script "\
+/\b/ {	s/_\b//g
+	s/\b_//g
+        s/o\b+/o/g
+        s/+\bo/o/g
+	:ovstrk
+	s/\\(.\\)\b\\1/\\1/g
+	t ovstrk
+	}
+/\e\\[[0-9][0-9]*m/ s///g"
+  "Script for sysV-like sed to nuke backspaces and ANSI codes from manpages.")
 
-RosettaMan is a rewrite of TkMan's man page filter, called bs2tk.  (If
-you haven't heard about TkMan, a hypertext man page browser, you
-should grab it via anonymous ftp from ftp.cs.berkeley.edu:
-/ucb/people/phelps/tkman.tar.Z.)  Whereas bs2tk generated output only for
-TkMan, RosettaMan generalizes the process so that the analysis can be
-leveraged to new output formats.  A single analysis engine recognizes
-section heads, subsection heads, body text, lists, references to other
-man pages, boldface, italics, bold italics, special characters (like
-bullets), tables (to a degree) and strips out page headers and
-footers.  The engine sends signals to the selected output functions so
-that an enhancement in the engine improves the quality of output of
-all of them.  Output format functions are easy to add, and thus far
-average about about 75 lines of C code each.
-
-
-
-*** NOTES ON CURRENT VERSION ***
+(defconst Man-berkeley-sed-script "\
+/\b/ {	s/_\b//g\\
+	s/\b_//g\\
+        s/o\b+/o/g\\
+        s/+\bo/o/g\\
+	:ovstrk\\
+	s/\\(.\\)\b\\1/\\1/g\\
+	t ovstrk\\
+	}\\
+/\e\\[[0-9][0-9]*m/ s///g"
+  "Script for berkeley-like sed to nuke backspaces and ANSI codes from manpages.")
 
-Help!  I'm looking for people to help with the following projects.
-\(1) Better RTF output format.  The current one works, but could be
-made better.  (2) Roff macros that produce text that is easily
-parsable.  RosettaMan handles a great variety, but some things, like
-H-P's tables, are intractable.  If you write an output format or
-otherwise improve RosettaMan, please send in your code so that I may
-share the wealth in future releases.
-
-This version can try to identify tables (turn this on with the -T
-switch) by looking for lines with a large amount of interword spacing,
-reasoning that this is space between columns of a table.  This
-heuristic doesn't always work and sometimes misidentifies ordinary
-text as tables.  In general I think it is impossible to perfectly
-identify tables from nroff formatted text.  However, I do think the
-heuristics can be tuned, so if you have a collection of manual pages
-with unrecognized tables, send me the lot, in formatted form (i.e.,
-after formatting with nroff -man), and uuencode them to preserve the
-control characters.  Better, if you can think of heuristics that
-distinguish tables from ordinary text, I'd like to hear them.
-
+(if Man-mode-map
+    nil
+  (setq Man-mode-map (make-keymap))
+  (suppress-keymap Man-mode-map)
+  (define-key Man-mode-map " "    'scroll-up)
+  (define-key Man-mode-map "\177" 'scroll-down)
+  (define-key Man-mode-map "n"    'Man-next-section)
+  (define-key Man-mode-map "p"    'Man-previous-section)
+  (define-key Man-mode-map "\en"  'Man-next-manpage)
+  (define-key Man-mode-map "\ep"  'Man-previous-manpage)
+  (define-key Man-mode-map ">"    'end-of-buffer)
+  (define-key Man-mode-map "<"    'beginning-of-buffer)
+  (define-key Man-mode-map "."    'beginning-of-buffer)
+  (define-key Man-mode-map "r"    'Man-follow-manual-reference)
+  (define-key Man-mode-map "g"    'Man-goto-section)
+  (define-key Man-mode-map "s"    'Man-goto-see-also-section)
+  (define-key Man-mode-map "k"    'Man-kill)
+  (define-key Man-mode-map "q"    'Man-quit)
+  (define-key Man-mode-map "m"    'man)
+  (define-key Man-mode-map "?"    'describe-mode)
+  )
 
-Notes for HTML consumers: This filter does real (heuristic)
-parsing--no <PRE>!  Man page references are turned into hypertext links.")
+
+;; ======================================================================
+;; utilities
 
-(make-face 'man-italic)
-(or (face-differs-from-default-p 'man-italic)
-    (copy-face 'italic 'man-italic))
-;; XEmacs (from Darrell Kindred): underlining is annoying due to
-;; large blank spaces in this face.
-;; (or (face-differs-from-default-p 'man-italic)
-;;    (set-face-underline-p 'man-italic t))
+(defun Man-init-defvars ()
+  "Used for initialising variables based on the value of window-system.
+This is necessary if one wants to dump man.el with emacs."
 
-(make-face 'man-bold)
-(or (face-differs-from-default-p 'man-bold)
-    (copy-face 'bold 'man-bold))
-(or (face-differs-from-default-p 'man-bold)
-    (copy-face 'man-italic 'man-bold))
+  ;; The following is necessary until fonts are implemented on
+  ;; terminals.
+  (setq Man-fontify-manpage-flag (and Man-fontify-manpage-flag
+				      window-system))
 
-(make-face 'man-heading)
-(or (face-differs-from-default-p 'man-heading)
-    (copy-face 'man-bold 'man-heading))
-
-(make-face 'man-xref)
-(or (face-differs-from-default-p 'man-xref)
-    (set-face-underline-p 'man-xref t))
+  (setq Man-sed-script
+	(cond
+	 (Man-fontify-manpage-flag
+	  nil)
+	 ((= 0 (call-process Man-sed-command nil nil nil Man-sysv-sed-script))
+	  Man-sysv-sed-script)
+	 ((= 0 (call-process Man-sed-command nil nil nil Man-berkeley-sed-script))
+	  Man-berkeley-sed-script)
+	 (t
+	  nil)))
 
-;; Manual-directory-list-init
-;; Initialize the directory lists.
+  (setq Man-filter-list
+	(list
+	 (cons
+	  Man-sed-command
+	  (list
+	   (if Man-sed-script
+	       (concat "-e '" Man-sed-script "'")
+	     "")
+	   "-e '/^[\001-\032][\001-\032]*$/d'"
+	   "-e '/\e[789]/s///g'"
+	   "-e '/Reformatting page.  Wait/d'"
+	   "-e '/Reformatting entry.  Wait/d'"
+	   "-e '/^[ \t]*Hewlett-Packard[ \t]Company[ \t]*-[ \t][0-9]*[ \t]-/d'"
+	   "-e '/^[ \t]*Hewlett-Packard[ \t]*-[ \t][0-9]*[ \t]-.*$/d'"
+	   "-e '/^[ \t][ \t]*-[ \t][0-9]*[ \t]-[ \t]*Formatted:.*[0-9]$/d'"
+	   "-e '/^[ \t]*Page[ \t][0-9]*.*(printed[ \t][0-9\\/]*)$/d'"
+	   "-e '/^Printed[ \t][0-9].*[0-9]$/d'"
+	   "-e '/^[ \t]*X[ \t]Version[ \t]1[01].*Release[ \t][0-9]/d'"
+	   "-e '/^[A-za-z].*Last[ \t]change:/d'"
+	   "-e '/^Sun[ \t]Release[ \t][0-9].*[0-9]$/d'"
+	   "-e '/[ \t]*Copyright [0-9]* UNIX System Laboratories, Inc.$/d'"
+	   "-e '/^[ \t]*Rev\\..*Page [0-9][0-9]*$/d'"
+	   ))
+	 (cons
+	  Man-awk-command
+	  (list
+	   "'\n"
+	   "BEGIN { blankline=0; anonblank=0; }\n"
+	   "/^$/ { if (anonblank==0) next; }\n"
+	   "{ anonblank=1; }\n"
+	   "/^$/ { blankline++; next; }\n"
+	   "{ if (blankline>0) { print \"\"; blankline=0; } print $0; }\n"
+	   "'"
+	   ))
+	 (if (not Man-uses-untabify-flag)
+	     (cons
+	      Man-untabify-command
+	      Man-untabify-command-args)
+	   )))
+)
+
+(defsubst Man-match-substring (&optional n string)
+  "Return the substring matched by the last search.
+Optional arg N means return the substring matched by the Nth paren
+grouping.  Optional second arg STRING means return a substring from
+that string instead of from the current buffer."
+  (if (null n) (setq n 0))
+  (if string
+      (substring string (match-beginning n) (match-end n))
+    (buffer-substring (match-beginning n) (match-end n))))
+
+(defsubst Man-make-page-mode-string ()
+  "Formats part of the mode line for Man mode."
+  (format "%s page %d of %d"
+	  (or (nth 2 (nth (1- Man-current-page) Man-page-list))
+	      "")
+	  Man-current-page
+	  (length Man-page-list)))
+
+(defsubst Man-build-man-command ()
+  "Builds the entire background manpage and cleaning command."
+  (let ((command (concat manual-program " " Man-switches " %s 2>/dev/null"))
+	(flist Man-filter-list))
+    (while (and flist (car flist))
+      (let ((pcom (car (car flist)))
+	    (pargs (cdr (car flist))))
+	(setq command
+	      (concat command " | " pcom " "
+		      (mapconcat '(lambda (phrase)
+				    (if (not (stringp phrase))
+					(error "Malformed Man-filter-list"))
+				    phrase)
+				 pargs " ")))
+	(setq flist (cdr flist))))
+    command))
 
-(defun Manual-directory-list-init (&optional arg) 
-  "Initialize the Manual-directory-list variable from $MANPATH
-if it is not already set, or if a prefix argument is provided."
-  (interactive "P")
-  (if arg (setq Manual-directory-list nil))
-  (if (null Manual-directory-list)
-      (let ((manpath (getenv "MANPATH"))
-	    (global (Manual-manpath-config-contents))
-	    (dirlist nil)
-	    dir)
-	(cond ((and manpath global)
-	       (setq manpath (concat manpath ":" global)))
-	      (global
-	       (setq manpath global))
-	      ((not manpath)
-	       ;; XEmacs - (bpw/stig) Unix-specifix hack for lusers w/ no manpath
-	       (setq manpath "/usr/local/man:/usr/share/man:/usr/share/catman:/usr/contrib/man:/usr/X11/man:/usr/man:/usr/catman")))
-	;; Make sure that any changes we've made internally are seen by man.
-	(setenv "MANPATH" manpath)
-	(while (string-match "\\`:*\\([^:]+\\)" manpath)
-	  (setq dir (substring manpath (match-beginning 1) (match-end 1)))
-	  (and (not (member dir dirlist))
-	       (setq dirlist (cons dir dirlist)))
-	  (setq manpath (substring manpath (match-end 0))))
-	(setq dirlist (nreverse dirlist))
-	(setq Manual-directory-list dirlist)
-	(setq Manual-subdirectory-list nil)
-	(setq Manual-formatted-directory-list nil)
-	(setq Manual-unformatted-directory-list nil)))
-  (if (string-equal Manual-leaf-signature "")
-      (setq Manual-leaf-signature
-	    (concat "/\\("
-		    Manual-formatted-page-prefix
-		    "\\|" Manual-unformatted-page-prefix
-		    "\\)"
-		    "[" Manual-man-page-section-ids
-		    "].?/.")))
-  (if Manual-use-subdirectory-list
-      (progn
-	(if (null Manual-subdirectory-list)
-	    (setq Manual-subdirectory-list
-		  (Manual-all-subdirectories Manual-directory-list
-					     Manual-leaf-signature nil)))
-	(if (null Manual-formatted-directory-list)
-	    (setq Manual-formatted-directory-list
-		  (Manual-filter-subdirectories Manual-subdirectory-list
-						Manual-formatted-page-prefix)))
-	(if (null Manual-unformatted-directory-list)
-	    (setq Manual-unformatted-directory-list
-		  (Manual-filter-subdirectories Manual-subdirectory-list
-						Manual-unformatted-page-prefix))))
-    (if (null Manual-formatted-directory-list)
-        (setq Manual-formatted-directory-list
-	      (Manual-select-subdirectories Manual-directory-list
-					    Manual-formatted-page-prefix)))
-    (if (null Manual-unformatted-directory-list)
-        (setq Manual-unformatted-directory-list
-	      (Manual-select-subdirectories Manual-directory-list
-					    Manual-unformatted-page-prefix)))))
+(defun Man-translate-references (ref)
+  "Translates REF from \"chmod(2V)\" to \"2v chmod\" style.
+Leave it as is if already in that style.  Possibly downcase and
+translate the section (see the Man-downcase-section-letters-flag
+and the Man-section-translations-alist variables)."
+  (let ((name "")
+	(section "")
+	(slist Man-section-translations-alist))
+    (cond
+     ;; "chmod(2V)" case ?
+     ((string-match (concat "^" Man-reference-regexp "$") ref)
+      (setq name (Man-match-substring 1 ref)
+	    section (Man-match-substring 2 ref)))
+     ;; "2v chmod" case ?
+     ((string-match (concat "^\\(" Man-section-regexp
+			    "\\) +\\(" Man-name-regexp "\\)$") ref)
+      (setq name (Man-match-substring 2 ref)
+	    section (Man-match-substring 1 ref))))
+    (if (string= name "")
+	ref				; Return the reference as is
+      (if Man-downcase-section-letters-flag
+	  (setq section (downcase section)))
+      (while slist
+	(let ((s1 (car (car slist)))
+	      (s2 (cdr (car slist))))
+	  (setq slist (cdr slist))
+	  (if Man-downcase-section-letters-flag
+	      (setq s1 (downcase s1)))
+	  (if (not (string= s1 section)) nil
+	    (setq section (if Man-downcase-section-letters-flag
+			      (downcase s2)
+			    s2)
+		  slist nil))))
+      (concat Man-specified-section-option section " " name))))
 
+
+;; ======================================================================
+;; default man entry: get word under point
 
-(defun Manual-manpath-config-contents ()
-  "Parse the `Manual-manpath-config-file' file, if any.
-Returns a string like in $MANPATH."
-  (if (and Manual-manpath-config-file
-	   (file-readable-p Manual-manpath-config-file))
-      (let ((buf (get-buffer-create " *Manual-config*"))
-	    path)
-	(set-buffer buf)
-	(buffer-disable-undo buf)
-	(erase-buffer)
-	(insert-file-contents Manual-manpath-config-file)
-	(while (re-search-forward "^\\(MANDATORY_MANPATH\\|MANPATH_MAP\\)"
-				  nil t)
-	  (and (re-search-forward "\\(/[^ \t\n]+\\)[ \t]*$")
-	       (setq path (concat path (buffer-substring (match-beginning 1)
-							 (match-end 1))
-				  ":"))))
-	(kill-buffer buf)
-	path)))
-;;
-;; manual-entry  -- The "main" user function
-;;
+(defsubst Man-default-man-entry ()
+  "Make a guess at a default manual entry.
+This guess is based on the text surrounding the cursor, and the
+default section number is selected from `Man-auto-section-alist'."
+  (let (default-title)
+    (save-excursion
+      
+      ;; Default man entry title is any word the cursor is on, or if
+      ;; cursor not on a word, then nearest preceding word.  Cannot
+      ;; use the current-word function because it skips the dots.
+      (if (not (looking-at "[-a-zA-Z_.]"))
+	  (skip-chars-backward "^a-zA-Z"))
+      (skip-chars-backward "-(a-zA-Z_0-9_.")
+      (if (looking-at "(") (forward-char 1))
+      (setq default-title
+	    (buffer-substring
+	     (point)
+	     (progn (skip-chars-forward "-a-zA-Z0-9_.") (point))))
+      
+      ;; If looking at something like ioctl(2) or brc(1M), include the
+      ;; section number in the returned value.  Remove text properties.
+      (let ((result (concat
+		     default-title
+		     (if (looking-at
+			  (concat "[ \t]*([ \t]*\\("
+				  Man-section-regexp "\\)[ \t]*)"))
+			 (format "(%s)" (Man-match-substring 1))))))
+	(set-text-properties 0 (length result) nil result)
+	result))))
+
+
+;; ======================================================================
+;; Top level command and background process sentinel
+
+;; For compatibility with older versions.
+;;;###autoload
+(defalias 'manual-entry 'man)
 
 ;;;###autoload
-(defun manual-entry (topic &optional arg silent)
-  "Display the Unix manual entry (or entries) for TOPIC.
-If prefix arg is given, modify the search according to the value:
-  2 = complement default exact matching of the TOPIC name;
-      exact matching default is specified by `Manual-match-topic-exactly'
-  3 = force a search of the unformatted man directories
-  4 = both 2 and 3
-The manual entries are searched according to the variable
-Manual-directory-list, which should be a list of directories.  If
-Manual-directory-list is nil, \\[Manual-directory-list-init] is
-invoked to create this list from the MANPATH environment variable.
-See the variable Manual-topic-buffer which controls how the buffer
-is named.  See also the variables Manual-match-topic-exactly,
-Manual-query-multiple-pages, and Manual-buffer-view-mode."
+(defun man (man-args)
+  "Get a Un*x manual page and put it in a buffer.
+This command is the top-level command in the man package.  It runs a Un*x
+command to retrieve and clean a manpage in the background and places the
+results in a Man mode (manpage browsing) buffer.  See variable
+`Man-notify-method' for what happens when the buffer is ready.
+If a buffer already exists for this man page, it will display immediately."
   (interactive
-   (list (let* ((fmh "-A-Za-z0-9_.")
-		(default (save-excursion
-			   (buffer-substring
-			    (progn
-			      (re-search-backward "\\sw" nil t)
-			      (skip-chars-backward fmh) (point))
-			    (progn (skip-chars-forward fmh) (point)))))
-		(thing (read-string
-			(if (equal default "") "Manual entry: "
-			  (concat "Manual entry: (default " default ") ")))))
-	   (if (equal thing "") default thing))
-	 (prefix-numeric-value current-prefix-arg)))
-  ;;(interactive "sManual entry (topic): \np")
-  (or arg (setq arg 1))
-  (Manual-directory-list-init nil)
-  (let ((exact (if (or (= arg 2) (= arg 4))
-		   (not Manual-match-topic-exactly)
-		 Manual-match-topic-exactly))
-	(force (if (>= arg 3)
-                   t
-                   nil))
-	section fmtlist manlist 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)))
-	(if (string-match "\\`[ \t]*-k[ \t]+\\([^ \t]+\\)\\'" topic)
-	    (setq section "-k"
-		  topic (substring topic (match-beginning 1))))))
-    (if (equal section "-k")
-	(setq apropos-mode t)
-      (or silent
-	  (message "Looking for formatted entry for %s%s..."
-		   topic (if section (concat "(" section ")") "")))
-      (setq fmtlist (Manual-select-man-pages
-                      Manual-formatted-directory-list
-                      topic section exact '()))
-      (if (or force (not section) (null fmtlist))
-	  (progn
-	    (or silent
-		(message "%sooking for unformatted entry for %s%s..."
-			 (if fmtlist "L" "No formatted entry, l")
-			 topic (if section (concat "(" section ")") "")))
-	    (setq manlist (Manual-select-man-pages
-                            Manual-unformatted-directory-list
-                            topic section exact (if force '() fmtlist))))))
-
-    ;; Delete duplicate man pages (a file of the same name in multiple
-    ;; directories.)
-    (or nil ;force
-        (let ((rest (append fmtlist manlist)))
-          (while rest
-            (let ((rest2 (cdr rest)))
-              (while rest2
-                (if (equal (file-name-nondirectory (car rest))
-                           (file-name-nondirectory (car rest2)))
-                    (setq fmtlist (delq (car rest2) fmtlist)
-                          manlist (delq (car rest2) manlist)))
-                (setq rest2 (cdr rest2))))
-            (setq rest (cdr rest)))))
-
-    (if (not (or fmtlist manlist apropos-mode))
-        (progn
-          (message "No entries found for %s%s" topic
-                   (if section (concat "(" section ")") ""))
-          nil)
-      (let ((bufname (cond ((not Manual-topic-buffer)
-                            ;; What's the point of retaining this?
-                            (if apropos-mode
-                                "*Manual Apropos*"
-                                "*Manual Entry*"))
-                           (apropos-mode
-                            (concat "*man apropos " topic "*"))
-                           (t
-                            (concat "*man "
-                                    (cond (exact
-                                           (if section
-                                               (concat topic "." section)
-                                               topic))
-                                          ((or (cdr fmtlist) (cdr manlist)
-                                               (and fmtlist manlist))
-                                           ;; more than one entry found
-                                           (concat topic "..."))
-                                          (t
-                                           (file-name-nondirectory
-                                            (car (or fmtlist manlist)))))
-                                    "*"))))
-            (temp-buffer-show-function 
-             (cond ((eq 't Manual-buffer-view-mode) 'view-buffer)
-                   ((eq 'nil Manual-buffer-view-mode)
-                    temp-buffer-show-function)
-                   (t 'view-buffer-other-window))))
-
-        (if apropos-mode
-            (setq manlist (list (format "%s.%s" topic section))))
+   (list (let* ((default-entry (Man-default-man-entry))
+		(input (read-string
+			(format "Manual entry%s: "
+				(if (string= default-entry "")
+				    ""
+				  (format " (default %s)" default-entry))))))
+	   (if (string= input "")
+	       (if (string= default-entry "")
+		   (error "No man args given")
+		 default-entry)
+	     input))))
 
-        (cond
-          ((and Manual-topic-buffer (get-buffer bufname))
-           ;; reselect an old man page buffer if it exists already.
-           (save-excursion
-             (set-buffer (get-buffer bufname))
-             (Manual-mode))
-           (if temp-buffer-show-function
-               (funcall temp-buffer-show-function (get-buffer bufname))
-               (display-buffer bufname)))
-          (t
-           (with-output-to-temp-buffer bufname
-             (buffer-disable-undo standard-output)
-             (save-excursion
-               (set-buffer standard-output)
-               (setq buffer-read-only nil)
-               (erase-buffer)
-	       (Manual-insert-pages fmtlist manlist apropos-mode)
-               (set-buffer-modified-p nil)
-               (Manual-mode)
-               ))))
-        (setq Manual-page-history
-              (cons (buffer-name)
-                    (delete (buffer-name) Manual-page-history)))
-        (message nil)
-        t))))
-
-(defun Manpage-apropos (topic &optional arg silent)
-  "Apropos on Unix manual pages for TOPIC.
-It calls the function `manual-entry'. Look at this function for
-further description. Look also at the variable `Manual-apropos-switch',
-if this function doesn't work on your system."
-  (interactive
-   (list (let* ((fmh "-A-Za-z0-9_.")
-		(default (save-excursion
-			   (buffer-substring
-			    (progn
-			      (re-search-backward "\\sw" nil t)
-			      (skip-chars-backward fmh) (point))
-			    (progn (skip-chars-forward fmh) (point)))))
-		(thing (read-string
-			(if (equal default "") "Manual entry: "
-			  (concat "Manual entry: (default " default ") ")))))
-	   (if (equal thing "") default thing))
-	 (prefix-numeric-value current-prefix-arg)))
-  (manual-entry (concat Manual-apropos-switch " " topic) arg silent))
+  ;; Possibly translate the "subject(section)" syntax into the
+  ;; "section subject" syntax and possibly downcase the section.
+  (setq man-args (Man-translate-references man-args))
 
-(defun Manual-insert-pages (fmtlist manlist apropos-mode)
-  (let ((sep (make-string 65 ?-))
-	name start end topic section)
-    (while fmtlist			; insert any formatted files
-      (setq name (car fmtlist))
-      (goto-char (point-max))
-      (setq start (point))
-      ;; In case the file can't be read or uncompressed or
-      ;; something like that.
-      (condition-case ()
-	  (Manual-insert-man-file name)
-	(file-error nil))
-      (goto-char (point-max))
-      (setq end (point))
-      (save-excursion
-	(save-restriction
-	  (message "Cleaning manual entry for %s..."
-		   (file-name-nondirectory name))
-	  (narrow-to-region start end)
-	  (Manual-nuke-nroff-bs)
-	  (goto-char (point-min))
-	  (insert "File: " name "\n")
-	  (goto-char (point-max))
-	  ))
-      (if (or (cdr fmtlist) manlist)
-	  (insert "\n\n" sep "\n"))
-      (setq fmtlist (cdr fmtlist)))
-
-    (while manlist			; process any unformatted files
-      (setq name (car manlist))
-      (or (string-match "\\([^/]+\\)\\.\\([^./]+\\)\\(\\.gz\\'\\)" name)
-	  (string-match "\\([^/]+\\)\\.\\([^./]+\\)\\'" name))
-      (setq topic (substring name (match-beginning 1) (match-end 1)))
-      (setq section (substring name (match-beginning 2) (match-end 2)))
-      ;; This won't work under IRIX, because SGI man accepts only the
-      ;; "main" (one-character) section id, not full section ids
-      ;; like 1M, 3X, etc. Put (setq Manual-use-full-section-ids nil)
-      ;; in your .emacs to work around this problem.
-      (if (not (or Manual-use-full-section-ids (string-equal section "")))
-	  (setq section (substring section 0 1)))
-      (message "Invoking man %s%s %s..."
-	       (if Manual-section-switch
-		   (concat Manual-section-switch " ")
-		 "")
-	       section topic)
-      (setq start (point))
-      (Manual-run-formatter name topic section)
-      (setq end (point))
-      (save-excursion
-	(save-restriction
-	  (message "Cleaning manual entry for %s(%s)..." topic section)
-	  (narrow-to-region start end)
-	  (Manual-nuke-nroff-bs apropos-mode)
-	  (goto-char (point-min))
-	  (insert "File: " name "\n")
-	  (goto-char (point-max))
-	  ))
-      (if (cdr manlist)
-	  (insert "\n\n" sep "\n"))
-      (setq manlist (cdr manlist))))
-  (if (< (buffer-size) 200)
-      (progn
-	(goto-char (point-min))
-	(if (looking-at "^File: ")
-	    (forward-line 1))
-	(error (buffer-substring (point) (progn (end-of-line) (point))))))
-  nil)
-
-
-(defun Manual-run-formatter (name topic section)
-  (cond
-   ((string-match "roff\\'" Manual-program)
-    ;; kludge kludge
-    (call-process Manual-program nil t nil "-Tman" "-man" name))
-
-   (t
-    (call-process Manual-program nil t nil
-                  (concat Manual-section-switch section) topic))))
-
-   ;(Manual-use-rosetta-man
-   ; (call-process "/bin/sh" nil t nil "-c"
-   ;               (format "man %s %s | rman" section topic)))
+  (Man-getpage-in-background man-args))
 
 
-(defvar Manual-mode-map
-  (let ((m (make-sparse-keymap)))
-    (set-keymap-name m 'Manual-mode-map)
-    (define-key m "l" 'Manual-last-page)
-    (define-key m 'button2 'Manual-follow-xref)
-    (define-key m 'button3 'Manual-popup-menu)
-    m))
+(defun Man-getpage-in-background (topic)
+  "Uses TOPIC to build and fire off the manpage and cleaning command."
+  (let* ((man-args topic)
+	 (bufname (concat "*Man " man-args "*"))
+	 (buffer  (get-buffer bufname)))
+    (if buffer
+	(Man-notify-when-ready buffer)
+      (require 'env)
+      (message "Invoking %s %s in the background" manual-program man-args)
+      (setq buffer (generate-new-buffer bufname))
+      (save-excursion
+	(set-buffer buffer)
+	(setq Man-original-frame (selected-frame))
+	(setq Man-arguments man-args))
+      (let ((process-environment (copy-sequence process-environment)))
+	;; Prevent any attempt to use display terminal fanciness.
+	(setenv "TERM" "dumb")
+	(set-process-sentinel
+	 (start-process manual-program buffer "sh" "-c"
+			(format (Man-build-man-command) man-args))
+	 'Man-bgproc-sentinel)))))
 
-(defun Manual-mode ()
-  (kill-all-local-variables)
-  (setq buffer-read-only t)
-  (use-local-map Manual-mode-map)
-  (setq major-mode 'Manual-mode
-	mode-name "Manual")
-  ;; man pages with long lines are buggy!
-  ;; This looks slightly better if they only
-  ;; overran by a couple of chars.
-  (setq truncate-lines t)
-  (if (featurep 'scrollbar)
-      ;; turn off horizontal scrollbars in this buffer
-      (set-specifier scrollbar-height (cons (current-buffer) 0)))
-  (run-hooks 'Manual-mode-hook))
+(defun Man-notify-when-ready (man-buffer)
+  "Notify the user when MAN-BUFFER is ready.
+See the variable `Man-notify-method' for the different notification behaviors."
+  (let ((saved-frame (save-excursion
+		       (set-buffer man-buffer)
+		       Man-original-frame)))
+    (cond
+     ((eq Man-notify-method 'newframe)
+      ;; Since we run asynchronously, perhaps while Emacs is waiting
+      ;; for input, we must not leave a different buffer current.  We
+      ;; can't rely on the editor command loop to reselect the
+      ;; selected window's buffer.
+      (save-excursion
+	(set-buffer man-buffer)
+	(make-frame Man-frame-parameters)))
+     ((eq Man-notify-method 'pushy)
+      (switch-to-buffer man-buffer))
+     ((eq Man-notify-method 'bully)
+      (and window-system
+	   (frame-live-p saved-frame)
+	   (select-frame saved-frame))
+      (pop-to-buffer man-buffer)
+      (delete-other-windows))
+     ((eq Man-notify-method 'aggressive)
+      (and window-system
+	   (frame-live-p saved-frame)
+	   (select-frame saved-frame))
+      (pop-to-buffer man-buffer))
+     ((eq Man-notify-method 'friendly)
+      (and window-system
+	   (frame-live-p saved-frame)
+	   (select-frame saved-frame))
+      (display-buffer man-buffer 'not-this-window))
+     ((eq Man-notify-method 'polite)
+      (beep)
+      (message "Manual buffer %s is ready" (buffer-name man-buffer)))
+     ((eq Man-notify-method 'quiet)
+      (message "Manual buffer %s is ready" (buffer-name man-buffer)))
+     ((or (eq Man-notify-method 'meek)
+	  t)
+      (message ""))
+     )))
 
-(defun Manual-last-page ()
+(defun Man-fontify-manpage ()
+  "Convert overstriking and underlining to the correct fonts.
+Same for the ANSI bold and normal escape sequences."
   (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)))
-
-
-;; Manual-select-subdirectories
-;; Given a DIRLIST and a SUBDIR name, return all subdirectories of the former which
-;; match the latter.
-
-(defun Manual-select-subdirectories (dirlist subdir)
-  (let ((dirs '())
-        (case-fold-search nil)
-        (match (concat "\\`" (regexp-quote subdir)))
-        d)
-    (while dirlist
-      (setq d (car dirlist) dirlist (cdr dirlist))
-      (if (file-directory-p d)
-          (let ((files (directory-files d t match nil 'dirs-only))
-		(dir-temp '()))
-            (while files
-              (if (file-executable-p (car files))
-                  (setq dir-temp (cons (file-name-as-directory (car files))
-                                   dir-temp)))
-              (setq files (cdr files)))
-	    (and dir-temp
-		 (setq dirs (append dirs (nreverse dir-temp)))))))
-    dirs))
-
+  (message "Please wait: making up the %s man page..." Man-arguments)
+  (goto-char (point-min))
+  (while (search-forward "\e[1m" nil t)
+    (delete-backward-char 4)
+    (put-text-property (point)
+		       (progn (if (search-forward "\e[0m" nil 'move)
+				  (delete-backward-char 4))
+			      (point))
+		       'face Man-overstrike-face))
+  (goto-char (point-min))
+  (while (search-forward "_\b" nil t)
+    (backward-delete-char 2)
+    (put-text-property (point) (1+ (point)) 'face Man-underline-face))
+  (goto-char (point-min))
+  (while (search-forward "\b_" nil t)
+    (backward-delete-char 2)
+    (put-text-property (1- (point)) (point) 'face Man-underline-face))
+  (goto-char (point-min))
+  (while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t)
+    (replace-match "\\1")
+    (put-text-property (1- (point)) (point) 'face Man-overstrike-face))
+  (goto-char (point-min))
+  (while (re-search-forward "o\b\\+\\|\\+\bo" nil t)
+    (replace-match "o")
+    (put-text-property (1- (point)) (point) 'face 'bold))
+  (goto-char (point-min))
+  (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t)
+    (replace-match "+")
+    (put-text-property (1- (point)) (point) 'face 'bold))
+  ;; \255 is some kind of dash in Latin-1.
+  (goto-char (point-min))
+  (while (search-forward "\255" nil t) (replace-match "-"))
+  (message "%s man page made up" Man-arguments))
 
-;; Manual-filter-subdirectories
-;; Given a DIRLIST and a SUBDIR name, return all members of the former
-;; which match the latter.
+(defun Man-cleanup-manpage ()
+  "Remove overstriking and underlining from the current buffer."
+  (interactive)
+  (message "Please wait: cleaning up the %s man page..."
+	   Man-arguments)
+  (if (or (interactive-p) (not Man-sed-script))
+      (progn
+	(goto-char (point-min))
+	(while (search-forward "_\b" nil t) (backward-delete-char 2))
+	(goto-char (point-min))
+	(while (search-forward "\b_" nil t) (backward-delete-char 2))
+	(goto-char (point-min))
+	(while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t)
+	  (replace-match "\\1"))
+	(goto-char (point-min))
+	(while (re-search-forward "\e\\[[0-9]+m" nil t) (replace-match ""))
+	(goto-char (point-min))
+	(while (re-search-forward "o\b\\+\\|\\+\bo" nil t) (replace-match "o"))
+	))
+  (goto-char (point-min))
+  (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) (replace-match "+"))
+  ;; \255 is some kind of dash in Latin-1.
+  (goto-char (point-min))
+  (while (search-forward "\255" nil t) (replace-match "-"))
+  (message "%s man page cleaned up" Man-arguments))
+
+(defun Man-bgproc-sentinel (process msg)
+  "Manpage background process sentinel."
+  (let ((Man-buffer (process-buffer process))
+	(delete-buff nil)
+	(err-mess nil))
+
+    (if (null (buffer-name Man-buffer)) ;; deleted buffer
+	(set-process-buffer process nil)
 
-(defun Manual-filter-subdirectories (dirlist subdir)
-  (let ((match (concat
-		"/"
-		(regexp-quote subdir)
-		"[" Manual-man-page-section-ids "]"))
-	slist dir)
-    (while dirlist
-      (setq dir (car dirlist) dirlist (cdr dirlist))
-      (if (and (file-executable-p dir) (string-match match dir))
-	    (setq slist (cons dir slist))))
-    (nreverse slist)))
+      (save-excursion
+	(set-buffer Man-buffer)
+	(let ((case-fold-search nil))
+	  (goto-char (point-min))
+	  (cond ((or (looking-at "No \\(manual \\)*entry for")
+		     (looking-at "[^\n]*: nothing appropriate$"))
+		 (setq err-mess (buffer-substring (point)
+						  (progn
+						    (end-of-line) (point)))
+		       delete-buff t))
+		((not (and (eq (process-status process) 'exit)
+			   (= (process-exit-status process) 0)))
+		 (setq err-mess
+		       (concat (buffer-name Man-buffer)
+			       ": process "
+			       (let ((eos (1- (length msg))))
+				 (if (= (aref msg eos) ?\n)
+				     (substring msg 0 eos) msg))))
+		 (goto-char (point-max))
+		 (insert (format "\nprocess %s" msg))
+		 ))
+	  (if delete-buff
+	      (kill-buffer Man-buffer)
+	    (if Man-fontify-manpage-flag
+		(Man-fontify-manpage)
+	      (Man-cleanup-manpage))
+	    (run-hooks 'Man-cooked-hook)
+	    (Man-mode)
+	    (set-buffer-modified-p nil)
+	    ))
+	;; Restore case-fold-search before calling
+	;; Man-notify-when-ready because it may switch buffers.
 
-
-(defun Manual-all-subdirectories (dirlist leaf-signature dirs &optional silent) "\
-Given a DIRLIST, return a backward-sorted list of all subdirectories
-thereof, prepended to DIRS if non-nil. This function calls itself
-recursively until subdirectories matching LEAF-SIGNATURE are reached,
-or the hierarchy has been thoroughly searched. This code is a modified
-version of a function written by Tim Bradshaw (tfb@ed.ac.uk)."
-  (Manual-all-subdirectories-noloop dirlist leaf-signature dirs nil silent))
+	(if (not delete-buff)
+	    (Man-notify-when-ready Man-buffer))
 
-(defun Manual-all-subdirectories-noloop (dirlist leaf-signature dirs been &optional silent) "\
-Does the job of manual-all-subdirectories and keeps track of where it
-has been to avoid loops."
-  (let (dir)
-    (while dirlist
-      (setq dir (car dirlist) dirlist (cdr dirlist))
-      (if (file-directory-p dir)
-	  (let ((dir-temp (cons (file-name-as-directory dir) dirs)))
-	    ;; Without feedback the user might wonder about the delay!
-	    (or silent (message
-			"Building list of search directories... %s"
-			(car dir-temp)))
-	    (if (member (file-truename dir) been)
-		()		 ; Ignore. We have been here before
-	      (setq been (cons (file-truename dir) been))
-	      (setq dirs
-		    (if (string-match leaf-signature dir)
-			dir-temp
-		      (Manual-all-subdirectories-noloop
-		       (directory-files dir t "[^.]$" nil 'dirs-only)
-		       leaf-signature dir-temp been silent))))))))
-  dirs)
+	(if err-mess
+	    (error err-mess))
+	))))
+
+
+;; ======================================================================
+;; set up manual mode in buffer and build alists
+
+(defun Man-mode ()
+  "A mode for browsing Un*x manual pages.
+
+The following man commands are available in the buffer. Try
+\"\\[describe-key] <key> RET\" for more information:
+
+\\[man]       Prompt to retrieve a new manpage.
+\\[Man-follow-manual-reference]       Retrieve reference in SEE ALSO section.
+\\[Man-next-manpage]   Jump to next manpage in circular list.
+\\[Man-previous-manpage]   Jump to previous manpage in circular list.
+\\[Man-next-section]       Jump to next manpage section.
+\\[Man-previous-section]       Jump to previous manpage section.
+\\[Man-goto-section]       Go to a manpage section.
+\\[Man-goto-see-also-section]       Jumps to the SEE ALSO manpage section.
+\\[Man-quit]       Deletes the manpage window, bury its buffer.
+\\[Man-kill]       Deletes the manpage window, kill its buffer.
+\\[describe-mode]       Prints this help text.
+
+The following variables may be of some use. Try
+\"\\[describe-variable] <variable-name> RET\" for more information:
 
-
-(defvar Manual-bogus-file-pattern "\\.\\(lpr\\|ps\\|PS\\)\\'"
-  "Some systems have files in the man/man*/ directories which aren't man pages.
-This pattern is used to prune those files.")
+Man-notify-method               What happens when manpage formatting is done.
+Man-downcase-section-letters-flag  Force section letters to lower case.
+Man-circular-pages-flag         Treat multiple manpage list as circular.
+Man-auto-section-alist          List of major modes and their section numbers.
+Man-section-translations-alist  List of section numbers and their Un*x equiv.
+Man-filter-list                 Background manpage filter command.
+Man-mode-line-format            Mode line format for Man mode buffers.
+Man-mode-map                    Keymap bindings for Man mode buffers.
+Man-mode-hook                   Normal hook run on entry to Man mode.
+Man-section-regexp              Regexp describing manpage section letters.
+Man-heading-regexp              Regexp describing section headers.
+Man-see-also-regexp             Regexp for SEE ALSO section (or your equiv).
+Man-first-heading-regexp        Regexp for first heading on a manpage.
+Man-reference-regexp            Regexp matching a references in SEE ALSO.
+Man-switches			Background `man' command switches.
 
-;; Manual-select-man-pages
-;;
-;; Given a DIRLIST, discover all filenames which complete given the TOPIC
-;; and SECTION.
+The following key bindings are currently in effect in the buffer:
+\\{Man-mode-map}"
+  (interactive)
+  (setq major-mode 'Man-mode
+	mode-name "Man"
+	buffer-auto-save-file-name nil
+	mode-line-format Man-mode-line-format
+	truncate-lines t
+	buffer-read-only t)
+  (buffer-disable-undo (current-buffer))
+  (auto-fill-mode -1)
+  (use-local-map Man-mode-map)
+  (Man-build-page-list)
+  (Man-strip-page-headers)
+  (Man-unindent)
+  (Man-goto-page 1)
+  (run-hooks 'Man-mode-hook))
 
-;; ## Note: BSD man looks for .../man1/foo.1 and .../man1/$MACHINE/foo.1
+(defsubst Man-build-section-alist ()
+  "Build the association list of manpage sections."
+  (setq Man-sections-alist nil)
+  (goto-char (point-min))
+  (let ((case-fold-search nil))
+    (while (re-search-forward Man-heading-regexp (point-max) t)
+      (aput 'Man-sections-alist (Man-match-substring 1))
+      (forward-line 1))))
 
-;; ## Fixed for SGI IRIX 5.x on Sat Jul 15 1995 by Dale Atems
-;; (atems@physics.wayne.edu).
+(defsubst Man-build-references-alist ()
+  "Build the association list of references (in the SEE ALSO section)."
+  (setq Man-refpages-alist nil)
+  (save-excursion
+    (if (Man-find-section Man-see-also-regexp)
+	(let ((start (progn (forward-line 1) (point)))
+	      (end (progn
+		     (Man-next-section 1)
+		     (point)))
+	      hyphenated
+	      (runningpoint -1))
+	  (save-restriction
+	    (narrow-to-region start end)
+	    (goto-char (point-min))
+	    (back-to-indentation)
+	    (while (and (not (eobp)) (/= (point) runningpoint))
+	      (setq runningpoint (point))
+	      (if (re-search-forward Man-reference-regexp end t)
+		  (let* ((word (Man-match-substring 0))
+			 (len (1- (length word))))
+		    (if hyphenated
+			(setq word (concat hyphenated word)
+			      hyphenated nil))
+		    (if (= (aref word len) ?-)
+			(setq hyphenated (substring word 0 len))
+		      (aput 'Man-refpages-alist word))))
+	      (skip-chars-forward " \t\n,")))))))
+
+(defun Man-build-page-list ()
+  "Build the list of separate manpages in the buffer."
+  (setq Man-page-list nil)
+  (let ((page-start (point-min))
+	(page-end (point-max))
+	(header ""))
+    (goto-char page-start)
+    ;; (switch-to-buffer (current-buffer))(debug)
+    (while (not (eobp))
+      (setq header
+	    (if (looking-at Man-page-header-regexp)
+		(Man-match-substring 1)
+	      nil))
+      ;; Go past both the current and the next Man-first-heading-regexp
+      (if (re-search-forward Man-first-heading-regexp nil 'move 2)
+	  (let ((p (progn (beginning-of-line) (point))))
+	    ;; We assume that the page header is delimited by blank
+	    ;; lines and that it contains at most one blank line.  So
+	    ;; if we back by three blank lines we will be sure to be
+	    ;; before the page header but not before the possible
+	    ;; previous page header.
+	    (search-backward "\n\n" nil t 3)
+	    (if (re-search-forward Man-page-header-regexp p 'move)
+		(beginning-of-line))))
+      (setq page-end (point))
+      (setq Man-page-list (append Man-page-list
+				  (list (list (copy-marker page-start)
+					      (copy-marker page-end)
+					      header))))
+      (setq page-start page-end)
+      )))
 
-(defun Manual-select-man-pages (dirlist topic section exact shadow)
-  (let ((case-fold-search nil))
-    (and section
-      (let ((l '())
-	    ;;(match (concat (substring section 0 1) "/?\\'"))
-	    ;;                                          ^^^
-	    ;; We'll lose any pages inside subdirectories of the "standard"
-	    ;; ones if we insist on this! The following regexp should
-	    ;; match any directory ending with the full section id or
-	    ;; its first character, or any direct subdirectory thereof:
-	    (match (concat "\\("
-			   (regexp-quote section)
-			   "\\|"
-			   (substring section 0 1)
-			   "\\)/?"))
-	    d)
-	(while dirlist
-	  (setq d (car dirlist) dirlist (cdr dirlist))
-	  (if (string-match match d)
-	      (setq l (cons d l))))
-	(setq dirlist l)))
-    (if shadow
-        (setq shadow (concat "/\\("
-                             (mapconcat #'(lambda (n)
-                                            (regexp-quote
-                                             (file-name-nondirectory n)))
-                                        shadow
-                                        "\\|")
-                             "\\)\\'")))
-    (let ((manlist '())
-          (match (concat "\\`"
-                           (regexp-quote topic)
-			    ;; **Note: on IRIX the preformatted pages
-			    ;; are packed, so they end with ".z". This
-			    ;; way you miss them if you specify a
-			    ;; section. I don't see any point to it here
-			    ;; even on BSD systems since we're looking
-			    ;; one level down already, but I can't test
-			    ;; this. More thought needed (???)
+(defun Man-strip-page-headers ()
+  "Strip all the page headers but the first from the manpage."
+  (let ((buffer-read-only nil)
+	(case-fold-search nil)
+	(page-list Man-page-list)
+	(page ())
+	(header ""))
+    (while page-list
+      (setq page (car page-list))
+      (and (nth 2 page)
+	   (goto-char (car page))
+	   (re-search-forward Man-first-heading-regexp nil t)
+	   (setq header (buffer-substring (car page) (match-beginning 0)))
+	   ;; Since the awk script collapses all successive blank
+	   ;; lines into one, and since we don't want to get rid of
+	   ;; the fast awk script, one must choose between adding
+	   ;; spare blank lines between pages when there were none and
+	   ;; deleting blank lines at page boundaries when there were
+	   ;; some.  We choose the first, so we comment the following
+	   ;; line.
+	   ;; (setq header (concat "\n" header)))
+	   (while (search-forward header (nth 1 page) t)
+	     (replace-match "")))
+      (setq page-list (cdr page-list)))))
+
+(defun Man-unindent ()
+  "Delete the leading spaces that indent the manpage."
+  (let ((buffer-read-only nil)
+	(case-fold-search nil)
+	(page-list Man-page-list))
+    (while page-list
+      (let ((page (car page-list))
+	    (indent "")
+	    (nindent 0))
+	(narrow-to-region (car page) (car (cdr page)))
+	(if Man-uses-untabify-flag
+	    (untabify (point-min) (point-max)))
+	(if (catch 'unindent
+	      (goto-char (point-min))
+	      (if (not (re-search-forward Man-first-heading-regexp nil t))
+		  (throw 'unindent nil))
+	      (beginning-of-line)
+	      (setq indent (buffer-substring (point)
+					     (progn
+					       (skip-chars-forward " ")
+					       (point))))
+	      (setq nindent (length indent))
+	      (if (zerop nindent)
+		  (throw 'unindent nil))
+	      (setq indent (concat indent "\\|$"))
+	      (goto-char (point-min))
+	      (while (not (eobp))
+		(if (looking-at indent)
+		    (forward-line 1)
+		  (throw 'unindent nil)))
+	      (goto-char (point-min)))
+	    (while (not (eobp))
+	      (or (eolp)
+		  (delete-char nindent))
+	      (forward-line 1)))
+	(setq page-list (cdr page-list))
+	))))
+
+
+;; ======================================================================
+;; Man mode commands
 
-			   (cond ((and section
-				       (not Manual-use-subdirectory-list))
-				  (concat "\\." (regexp-quote section)))
-                                 (exact
-                                  ;; If Manual-match-topic-exactly is
-                                  ;; set, then we must make sure the
-                                  ;; completions are exact, except for
-                                  ;; trailing weird characters after
-                                  ;; the section.
-                                  "\\.")
-                                 (t
-                                  ""))))
-          dir)
-      (while dirlist
-        (setq dir (car dirlist) dirlist (cdr dirlist))
-        (if (not (file-directory-p dir))
-            (progn
-              (message "warning: %s is not a directory" dir)
-              ;;(sit-for 1)
-              )
-            (let ((files (directory-files dir t match nil t))
-                  f)
-              (while files
-                (setq f (car files) files (cdr files))
-                (cond ((string-match Manual-bogus-file-pattern f)
-		       ;(message "Bogus fule %s" f) (sit-for 2)
-                       )
-		      ((and shadow (string-match shadow f))
-                       ;(message "Shadowed %s" f) (sit-for 2)
-                       )
-                      ((not (file-readable-p f))
-                       ;(message "Losing with %s" f) (sit-for 2)
-                       )
-                      (t
-                       (setq manlist (cons f manlist))))))))
-      (setq manlist (nreverse manlist))
-      (and Manual-unique-man-sections-only
-	   (setq manlist (Manual-clean-to-unique-pages-only manlist)))
-      (if (and manlist Manual-query-multiple-pages)
-          (apply #'append
-                 (mapcar #'(lambda (page)
-                             (and page 
-                                  (y-or-n-p (format "Read %s? " page))
-				  (list page)))
-                         manlist))
-          manlist))))
+(defun Man-next-section (n)
+  "Move point to Nth next section (default 1)."
+  (interactive "p")
+  (let ((case-fold-search nil))
+    (if (looking-at Man-heading-regexp)
+	(forward-line 1))
+    (if (re-search-forward Man-heading-regexp (point-max) t n)
+	(beginning-of-line)
+      (goto-char (point-max)))))
+
+(defun Man-previous-section (n)
+  "Move point to Nth previous section (default 1)."
+  (interactive "p")
+  (let ((case-fold-search nil))
+    (if (looking-at Man-heading-regexp)
+	(forward-line -1))
+    (if (re-search-backward Man-heading-regexp (point-min) t n)
+	(beginning-of-line)
+      (goto-char (point-min)))))
+
+(defun Man-find-section (section)
+  "Move point to SECTION if it exists, otherwise don't move point.
+Returns t if section is found, nil otherwise."
+  (let ((curpos (point))
+	(case-fold-search nil))
+    (goto-char (point-min))
+    (if (re-search-forward (concat "^" section) (point-max) t)
+	(progn (beginning-of-line) t)
+      (goto-char curpos)
+      nil)
+    ))
+
+(defun Man-goto-section ()
+  "Query for section to move point to."
+  (interactive)
+  (aput 'Man-sections-alist
+	(let* ((default (aheadsym Man-sections-alist))
+	       (completion-ignore-case t)
+	       chosen
+	       (prompt (concat "Go to section: (default " default ") ")))
+	  (setq chosen (completing-read prompt Man-sections-alist))
+	  (if (or (not chosen)
+		  (string= chosen ""))
+	      default
+	    chosen)))
+  (Man-find-section (aheadsym Man-sections-alist)))
+
+(defun Man-goto-see-also-section ()
+  "Move point the the \"SEE ALSO\" section.
+Actually the section moved to is described by `Man-see-also-regexp'."
+  (interactive)
+  (if (not (Man-find-section Man-see-also-regexp))
+      (error (concat "No " Man-see-also-regexp
+		     " section found in the current manpage"))))
 
-(defun Manual-clean-to-unique-pages-only (manlist)
-  "Prune the current list of pages down to a unique set."
-  (let (page-name unique-pages)
-    (apply 'append
-	   (mapcar '(lambda (page)
-		      (cond (page
-			     (and (string-match ".*/\\(.*\\)" page)
-				  (setq page-name (substring page (match-beginning 1)
-							     (match-end 1)))
-				  ;; try to clip off .Z, .gz suffixes
-				  (and (string-match "\\(.*\\)\\.\\(.+\\)\\.\\(.+\\)"
-						     page-name)
-				       (setq page-name
-					     (substring page-name (match-beginning 1)
-							(match-end 2)))))
-			     ;; add Manual-unique-pages if it isn't there
-			     ;;  and return file
-			     (if (and unique-pages
-				      page-name
-				      (string-match (concat "\\b" page-name "\\b")
-						    unique-pages))
-				 nil
-			       (setq unique-pages (concat unique-pages
-								 page-name
-								 " "))
-			       (list page)))))
-		   manlist))))
-			    
+(defun Man-follow-manual-reference (reference)
+  "Get one of the manpages referred to in the \"SEE ALSO\" section.
+Specify which reference to use; default is based on word at point."
+  (interactive
+   (if (not Man-refpages-alist)
+       (error "There are no references in the current man page")
+     (list (let* ((default (or
+			     (car (all-completions
+				   (save-excursion
+				     (skip-syntax-backward "w()")
+				     (skip-chars-forward " \t")
+				     (let ((word (current-word)))
+				       ;; strip a trailing '-':
+				       (if (string-match "-$" word)
+					   (substring word 0
+						      (match-beginning 0))
+					 word)))
+				   Man-refpages-alist))
+			     (aheadsym Man-refpages-alist)))
+		   chosen
+		   (prompt (concat "Refer to: (default " default ") ")))
+	      (setq chosen (completing-read prompt Man-refpages-alist nil t))
+	      (if (or (not chosen)
+		      (string= chosen ""))
+		  default
+		chosen)))))
+  (if (not Man-refpages-alist)
+      (error "Can't find any references in the current manpage")
+    (aput 'Man-refpages-alist reference)
+    (Man-getpage-in-background
+     (Man-translate-references (aheadsym Man-refpages-alist)))))
+
+(defun Man-kill ()
+  "Kill the buffer containing the manpage."
+  (interactive)
+  (let ((buff (current-buffer)))
+    (delete-windows-on buff)
+    (kill-buffer buff))
+  (if (and window-system
+	   (or (eq Man-notify-method 'newframe)
+	       (and pop-up-frames
+		    (eq Man-notify-method 'bully))))
+      (delete-frame)))
+
+(defun Man-quit ()
+  "Bury the buffer containing the manpage."
+  (interactive)
+  (let ((buff (current-buffer)))
+    (delete-windows-on buff)
+    (bury-buffer buff))
+  (if (and window-system
+	   (or (eq Man-notify-method 'newframe)
+	       (and pop-up-frames
+		    (eq Man-notify-method 'bully))))
+      (delete-frame)))
+
+(defun Man-goto-page (page)
+  "Go to the manual page on page PAGE."
+  (interactive
+   (if (not Man-page-list)
+       (let ((args Man-arguments))
+	 (kill-buffer (current-buffer))
+	 (error "Can't find the %s manpage" args))
+     (if (= (length Man-page-list) 1)
+	 (error "You're looking at the only manpage in the buffer")
+       (list (read-minibuffer (format "Go to manpage [1-%d]: "
+				      (length Man-page-list)))))))
+  (if (not Man-page-list)
+      (let ((args Man-arguments))
+	(kill-buffer (current-buffer))
+	(error "Can't find the %s manpage" args)))
+  (if (or (< page 1)
+	  (> page (length Man-page-list)))
+      (error "No manpage %d found" page))
+  (let* ((page-range (nth (1- page) Man-page-list))
+	 (page-start (car page-range))
+	 (page-end (car (cdr page-range))))
+    (setq Man-current-page page
+	  Man-page-mode-string (Man-make-page-mode-string))
+    (widen)
+    (goto-char page-start)
+    (narrow-to-region page-start page-end)
+    (Man-build-section-alist)
+    (Man-build-references-alist)
+    (goto-char (point-min))))
 
 
-(defun Manual-insert-man-file (name)
-  ;; Insert manual file (unpacked as necessary) into buffer
-  (cond ((equal (substring name -3) ".gz")
-	 (call-process "gunzip" nil t nil "--stdout" name))
-        ((or (equal (substring name -2) ".Z")
-	     ;; HPUX uses directory names that end in .Z and compressed
-	     ;; files that don't.  How gratuitously random.
-             (let ((case-fold-search nil))
-               (string-match "\\.Z/" name)))
-	 (call-process "zcat" name t nil)) ;; XEmacs change for HPUX
-	((equal (substring name -2) ".z")
-	 (call-process "pcat" nil t nil name))
-	(t
-	 (insert-file-contents name))))
-
-(defmacro Manual-delete-char (n)
-  ;; in v19, delete-char is compiled as a function call, but delete-region
-  ;; is byte-coded, so it's much faster.
-  ;; (We were spending 40% of our time in delete-char alone.)
-  (list 'delete-region '(point) (list '+ '(point) n)))
-
-;; Hint: BS stands for more things than "back space"
-(defun Manual-nuke-nroff-bs (&optional apropos-mode)
-  (interactive "*")
-  (if Manual-use-rosetta-man
-      (call-process-region (point-min) (point-max) "rman" t t nil)
-    ;;
-    ;; turn underlining into italics
-    ;;
-    (goto-char (point-min))
-    (while (search-forward "_\b" nil t)
-      ;; searching for underscore-backspace and then comparing the following
-      ;; chars until the sequence ends turns out to be much faster than searching
-      ;; for a regexp which matches the whole sequence.
-      (let ((s (match-beginning 0)))
-	(goto-char s)
-	(while (and (= (following-char) ?_)
-		    (= (char-after (1+ (point))) ?\b))
-	  (Manual-delete-char 2)
-	  (forward-char 1))
-	(set-extent-face (make-extent s (point)) 'man-italic)))
-    ;;
-    ;; turn overstriking into bold
-    ;;
-    (goto-char (point-min))
-    (while (re-search-forward "\\([^\n]\\)\\(\b\\1\\)" nil t)
-      ;; Surprisingly, searching for the above regexp is faster than searching
-      ;; for a backspace and then comparing the preceding and following chars,
-      ;; I presume because there are many false matches, meaning more funcalls
-      ;; to re-search-forward.
-      (let ((s (match-beginning 0)))
-	(goto-char s)
-	;; Some systems (SGI) overstrike multiple times, eg, "M\bM\bM\bM".
-	(while (looking-at "\\([^\n]\\)\\(\b\\1\\)+")
-	  (delete-region (+ (point) 1) (match-end 0))
-	  (forward-char 1))
-	(set-extent-face (make-extent s (point)) 'man-bold)))
-    ;;
-    ;; hack bullets: o^H+ --> +
-    (goto-char (point-min))
-    (while (search-forward "\b" nil t)
-      (Manual-delete-char -2))
-
-    (if (> (buffer-size) 100) ; minor kludge
-	(Manual-nuke-nroff-bs-footers))
-    ) ;; not Manual-use-rosetta-man
-  ;;
-  ;; turn subsection header lines into bold
-  ;;
-  (goto-char (point-min))
-  (if apropos-mode
-      (while (re-search-forward "[a-zA-Z0-9] ([0-9]" nil t)
-	(forward-char -2)
-	(delete-backward-char 1))
-
-    ;;    (while (re-search-forward "^[^ \t\n]" nil t)
-    ;;      (set-extent-face (make-extent (match-beginning 0)
-    ;;                                   (progn (end-of-line) (point)))
-    ;;                      'man-heading))
-
-    ;; boldface the first line
-    (if (looking-at "[^ \t\n].*$")
-	(set-extent-face (make-extent (match-beginning 0) (match-end 0))
-			 'man-bold))
-
-    ;; boldface subsequent title lines
-    ;; Regexp to match section headers changed to match a non-indented
-    ;; line preceded by a blank line and followed by an indented line. 
-    ;; This seems to work ok for manual pages but gives better results
-    ;; with other nroff'd files
-    (while (re-search-forward "\n\n\\([^ \t\n].*\\)\n[ \t]+[^ \t\n]" nil t)
-      (goto-char (match-end 1))
-      (set-extent-face (make-extent (match-beginning 1) (match-end 1))
-		       'man-heading)
-      (forward-line 1))
-    )
-
-  (if Manual-use-rosetta-man
-      nil
-    ;; Zap ESC7,  ESC8, and ESC9
-    ;; This is for Sun man pages like "man 1 csh"
-    (goto-char (point-min))
-    (while (re-search-forward "\e[789]" nil t)
-      (replace-match "")))
-  
-  ;; Nuke blanks lines at start.
-  ;;  (goto-char (point-min))
-  ;;  (skip-chars-forward "\n")
-  ;;  (delete-region (point-min) (point))
-
-  (Manual-mouseify-xrefs)
-  )
-
-(fset 'nuke-nroff-bs 'Manual-nuke-nroff-bs) ; use old name
-
-
-(defun Manual-nuke-nroff-bs-footers ()
-  ;; Nuke headers and footers.
-  ;;
-  ;; nroff assumes pages are 66 lines high.  We assume that, and that the
-  ;; first and last line on each page is expendible.  There is no way to
-  ;; tell the difference between a page break in the middle of a paragraph
-  ;; and a page break between paragraphs (the amount of extra whitespace
-  ;; that nroff inserts is the same in both cases) so this might strip out
-  ;; a blank line were one should remain.  I think that's better than
-  ;; leaving in a blank line where there shouldn't be one.  (Need I say
-  ;; it: FMH.)
-  ;;
-  ;; Note that if nroff spits out error messages, pages will be more than
-  ;; 66 lines high, and we'll lose badly.  That's ok because standard
-  ;; nroff doesn't do any diagnostics, and the "gnroff" wrapper for groff
-  ;; turns off error messages for compatibility.  (At least, it's supposed
-  ;; to.)
-  ;; 
-  (goto-char (point-min))
-  ;; first lose the status output
-  (let ((case-fold-search t))
-    (if (and (not (looking-at "[^\n]*warning"))
-	     (looking-at "Reformatting.*\n"))
-	(delete-region (match-beginning 0) (match-end 0))))
-
-  ;; kludge around a groff bug where it won't keep quiet about some
-  ;; warnings even with -Wall or -Ww.
-  (cond ((looking-at "grotty:")
-	 (while (looking-at "grotty:")
-	   (delete-region (point) (progn (forward-line 1) (point))))
-	 (if (looking-at " *done\n")
-	     (delete-region (point) (match-end 0)))))
-
-  (let ((pages '())
-	p)
-    ;; collect the page boundary markers before we start deleting, to make
-    ;; it easier to strip things out without changing the page sizes.
-    (while (not (eobp))
-      (forward-line 66)
-      (setq pages (cons (point-marker) pages)))
-    (setq pages (nreverse pages))
-    (while pages
-      (goto-char (car pages))
-      (set-marker (car pages) nil)
-      ;;
-      ;; The lines are: 3 blank; footer; 6 blank; header; 3 blank.
-      ;; We're in between the previous footer and the following header,
-      ;;
-      ;; First lose 3 blank lines, the header, and then 3 more.
-      ;;
-      (setq p (point))
-      (skip-chars-forward "\n")
-      (delete-region p (point))
-      (and (looking-at "[^\n]+\n\n?\n?\n?")
-	   (delete-region (match-beginning 0) (match-end 0)))
-      ;;
-      ;; Next lose the footer, and the 3 blank lines after, and before it.
-      ;; But don't lose the last footer of the manual entry; that contains
-      ;; the "last change" date, so it's not completely uninteresting.
-      ;; (Actually lose all blank lines before it; sh(1) needs this.)
-      ;;
-      (skip-chars-backward "\n")
-      (beginning-of-line)
-      (if (null (cdr pages))
-	  nil
-	(and (looking-at "[^\n]+\n\n?\n?\n?")
-	     (delete-region (match-beginning 0) (match-end 0))))
-      (setq p (point))
-      (skip-chars-backward "\n")
-      (if (> (- p (point)) 4)
-	  (delete-region (+ 2 (point)) p)
-	(delete-region (1+ (point)) p))
-;      (and (looking-at "\n\n?\n?")
-;	   (delete-region (match-beginning 0) (match-end 0)))
+(defun Man-next-manpage ()
+  "Find the next manpage entry in the buffer."
+  (interactive)
+  (if (= (length Man-page-list) 1)
+      (error "This is the only manpage in the buffer"))
+  (if (< Man-current-page (length Man-page-list))
+      (Man-goto-page (1+ Man-current-page))
+    (if Man-circular-pages-flag
+	(Man-goto-page 1)
+      (error "You're looking at the last manpage in the buffer"))))
 
-      (setq pages (cdr pages)))
-    ;;
-    ;; Now nuke the extra blank lines at the beginning and end.
-    (goto-char (point-min))
-    (if (looking-at "\n+")
-	(delete-region (match-beginning 0) (match-end 0)))
-    (forward-line 1)
-    (if (looking-at "\n\n+")
-	(delete-region (1+ (match-beginning 0)) (match-end 0)))
-    (goto-char (point-max))
-    (skip-chars-backward "\n")
-    (delete-region (point) (point-max))
-    (beginning-of-line)
-    (forward-char -1)
-    (setq p (point))
-    (skip-chars-backward "\n")
-    (if (= ?\n (following-char)) (forward-char 1))
-    (if (> (point) (1+ p))
-	(delete-region (point) p))
-    ))
-
-;(defun Manual-nuke-nroff-bs-footers ()
-;  ;; Nuke headers: "MORE(1) UNIX Programmer's Manual MORE(1)"
-;  (goto-char (point-min))
-;  (while (re-search-forward "^ *\\([A-Za-z][-_A-Za-z0-9]*([0-9A-Za-z]+)\\).*\\1$" nil t)
-;    (replace-match ""))
-;  
-;  ;;
-;  ;; it would appear that we have a choice between sometimes introducing
-;  ;; an extra blank line when a paragraph was broken by a footer, and
-;  ;; sometimes not putting in a blank line between two paragraphs when
-;  ;; a footer appeared right between them.  FMH; I choose the latter.
-;  ;;
-;
-;  ;; Nuke footers: "Printed 12/3/85	27 April 1981	1"
-;  ;;    Sun appear to be on drugz:
-;  ;;     "Sun Release 3.0B  Last change: 1 February 1985     1"
-;  ;;    HP are even worse!
-;  ;;     "     Hewlett-Packard   -1- (printed 12/31/99)"  FMHWA12ID!!
-;  ;;    System V (well WICATs anyway):
-;  ;;     "Page 1			  (printed 7/24/85)"
-;  ;;    Who is administering PCP to these corporate bozos?
-;  (goto-char (point-min))
-;  (while (re-search-forward
-;	   (cond
-;	    ((eq system-type 'hpux)
-;	     "\n\n?[ \t]*Hewlett-Packard\\(\\| Company\\)[ \t]*- [0-9]* -.*\n")
-;	    ((eq system-type 'dgux-unix)
-;	     "\n\n?[ \t]*Licensed material--.*Page [0-9]*\n")
-;	    ((eq system-type 'usg-unix-v)
-;	     "\n\n? *Page [0-9]*.*(printed [0-9/]*)\n")
-;	    (t
-;	     "\n\n?\\(Printed\\|Sun Release\\) [0-9].*[0-9]\n"))
-;	   nil t)
-;    (replace-match ""))
-;
-;  ;;    Also, hack X footers:
-;  ;;     "X Version 11         Last change: Release 5         1"
-;  (goto-char (point-min))
-;  (while (re-search-forward "\n\n?X Version [^\n]+\n" nil t)
-;    (replace-match ""))
-;
-;  ;; Crunch blank lines
-;  (goto-char (point-min))
-;  (while (re-search-forward "\n\n\n\n*" nil t)
-;    (replace-match "\n\n"))
-;  )
+(defun Man-previous-manpage ()
+  "Find the previous manpage entry in the buffer."
+  (interactive)
+  (if (= (length Man-page-list) 1)
+      (error "This is the only manpage in the buffer"))
+  (if (> Man-current-page 1)
+      (Man-goto-page (1- Man-current-page))
+    (if Man-circular-pages-flag
+	(Man-goto-page (length Man-page-list))
+      (error "You're looking at the first manpage in the buffer"))))
+
+;; Init the man package variables, if not already done.
+(Man-init-defvars)
 
-(defun Manual-mouseify-xrefs ()
-  (goto-char (point-min))
-  (forward-line 1)
-  (let ((case-fold-search nil)
-	s e name 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%
-    ;; of which is this call to re-search-forward.
-    (while (re-search-forward "[a-zA-Z_][-a-zA-Z0-9_.]*([0-9][a-zA-Z0-9]*)"
-			      nil t)
-      (setq s (match-beginning 0)
-	    e (match-end 0)
-	    name (buffer-substring s e))
-      (goto-char s)
-      (skip-chars-backward " \t")
-      (if (and (bolp)
-	       (progn (backward-char 1) (= (preceding-char) ?-)))
-	  (progn
-	    (setq s (point))
-	    (skip-chars-backward "-a-zA-Z0-9_.")
-	    (setq name (concat (buffer-substring (point) (1- s)) name))
-	    (setq s (point))))
-      ;; 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))
-      (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))))
-
-(defun Manual-follow-xref (&optional name-or-event)
-  "Invoke `manual-entry' on the cross-reference under the mouse.
-When invoked noninteractively, the arg may be an xref string to parse instead."
-  (interactive "e")
-  (if (eventp name-or-event)
-      (let* ((p (event-point name-or-event))
-	     (extent (and p (extent-at p
-			     (event-buffer name-or-event)
-			     'highlight)))
-	     (data (and extent (extent-property extent 'man))))
-	(if (eq (car-safe data) 'Manual-follow-xref)
-	    (eval data)
-	  (error "no manual cross-reference there.")))
-    (let ((Manual-match-topic-exactly t)
-	  (Manual-query-multiple-pages nil))
-      (or (manual-entry name-or-event)
-	  ;; If that didn't work, maybe it's in a different section than the
-	  ;; man page writer expected.  For example, man pages tend assume
-	  ;; that all user programs are in section 1, but X tends to generate
-	  ;; makefiles that put things in section "n" instead...
-	  (and (string-match "[ \t]*([^)]+)\\'" name-or-event)
-	       (progn
-		 (message "No entries found for %s; checking other sections..."
-			  name-or-event)
-		 (manual-entry
-		  (substring name-or-event 0 (match-beginning 0))
-		  nil t)))))))
+(provide 'man)
 
-(defun Manual-popup-menu (&optional event)
-  "Pops up a menu of cross-references in this manual page.
-If there is a cross-reference under the mouse button which invoked this
-command, it will be the first item on the menu.  Otherwise, they are
-on the menu in the order in which they appear in the buffer."
-  (interactive "e")
-  (let ((buffer (current-buffer))
-	(sep "---")
-	(prefix "Show Manual Page for ")
-	xref items)
-    (cond (event
-	   (setq buffer (event-buffer event))
-	   (let* ((p (event-point event))
-		  (extent (and p (extent-at p buffer 'highlight)))
-		  (data (and extent (extent-property extent 'man))))
-	     (if (eq (car-safe data) 'Manual-follow-xref)
-		 (setq xref (nth 1 data))))))
-    (if xref (setq items (list sep xref)))
-    (map-extents #'(lambda (extent ignore)
-		     (let ((data (extent-property extent 'man)))
-		       (if (and (eq (car-safe data) 'Manual-follow-xref)
-				(not (member (nth 1 data) items)))
-			   (setq items (cons (nth 1 data) items)))
-		    nil))
-		 buffer)
-    (if (eq sep (car items)) (setq items (cdr items)))
-    (let ((popup-menu-titles nil))
-      (popup-menu
-       (cons "Manual Entry"
-	     (mapcar #'(lambda (item)
-			 (if (eq item sep)
-			     item
-                           (vector (concat prefix item)
-                                   (list 'Manual-follow-xref item) t)))
-		     (nreverse items)))))))
-
-(defun pager-cleanup-hook ()
-  "cleanup man page if called via $PAGER"
-  (let ((buf-name (or buffer-file-name (buffer-name))))
-	(if (and (or (string-match "^/tmp/man[0-9]+" buf-name)
-		     (string-match ".*/man/\\(man\\|cat\\)[1-9a-z]/" buf-name))
-		 (not (string-match Manual-bogus-file-pattern buf-name)))
-	    (let (buffer manpage)
-	      (require 'man)
-	      (goto-char (point-min))
-	      (setq buffer-read-only nil)
-	      (Manual-nuke-nroff-bs)
-	      (goto-char (point-min))
-	      (if (re-search-forward "[^ \t]")
-		  (goto-char (- (point) 1)))
-	      (if (looking-at "\\([a-zA-Z0-9]+\\)[ \t]*(")
-		  (setq manpage (buffer-substring (match-beginning 1) (match-end 1)))
-		(setq manpage "???"))
-	      (setq buffer
-		    (rename-buffer
-		     (generate-new-buffer-name (concat "*man " manpage "*"))))
-	      (setq buffer-file-name nil)
-	      (goto-char (point-min))
-	      (insert (format "%s\n" buf-name))
-	      (goto-char (point-min))
-	      (buffer-disable-undo buffer)
-	      (set-buffer-modified-p nil)
-	      (Manual-mode)
-	      ))))
-
-(add-hook 'server-visit-hook 'pager-cleanup-hook)
-(provide 'man)
+;;; man.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/packages/mic-paren.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,577 @@
+;;; mic-paren.el --- highlight matching paren.
+;;; Version 1.0 - 96-08-16
+;;; Copyright (C) 1996 Mikael Sjödin (mic@docs.uu.se)
+;;;
+;;; Author: Mikael Sjödin  --  mic@docs.uu.se
+;;; Keywords: languages, faces
+;;;
+;;; This file is NOT part of GNU Emacs.
+;;; You may however 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.
+;;;
+;;; mic-paren 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.
+
+;;; ----------------------------------------------------------------------
+;;; Short Description:
+;;;
+;;; Load this file and Emacs will display highlighting on whatever
+;;; parenthesis matches the one before or after point.  This is an extension to
+;;; the paren.el file distributed with Emacs.  The default behaviour is similar
+;;; to paren.el but try the authors favourite options:
+;;;   (setq paren-face 'bold)
+;;;   (setq paren-sexp-mode t)
+
+;;; ----------------------------------------------------------------------
+;;; Installation:
+;;;
+;;; o Place this file in a directory in your 'load-path.
+;;; o Put the following in your .emacs file:
+;;;     (if window-system
+;;;         (require 'mic-paren))
+;;; o Restart your Emacs. mic-paren is now installed and activated!
+;;; o To list the possible customisation enter `C-h f paren-activate'
+
+;;; ----------------------------------------------------------------------
+;;; Long Description:
+;;;
+;;; mic-paren.el is an extension to the packages paren.el and stig-paren.el for
+;;; Emacs.  When mic-paren is active (it is activated when loaded) Emacs normal
+;;; parenthesis matching is deactivated.  Instead parenthesis matching will be
+;;; performed as soon as the cursor is positioned at a parenthesis.  The
+;;; matching parenthesis (or the entire expression between the parenthesises)
+;;; is highlighted until the cursor is moved away from the parenthesis.
+;;; Features include:
+;;; o Both forward and backward parenthesis matching (_simultaneously_ if
+;;;   cursor is between two expressions).
+;;; o Indication of mismatched parenthesises.
+;;; o Option to select if only the matching parenthesis or the entire
+;;;   expression should be highlighted.
+;;; o Message describing the match when the matching parenthesis is
+;;;   off-screen. 
+;;; o Optional delayed highlighting (useful on slow systems), 
+;;; o Functions to activate/deactivate mic-paren.el is provided.
+;;; o Numerous options to control the behaviour and appearance of
+;;;   mic-paren.el. 
+;;;
+;;; mic-paren.el is developed and tested under Emacs 19.28 - 19.31.  It should
+;;; work on earlier and forthcoming Emacs versions.
+;;;
+;;; This file can be obtained from http://www.docs.uu.se/~mic/emacs.html
+
+;; Ported to XEmacs 15-September, 1996 Steve Baur <steve@miranova.com>
+;;; ======================================================================
+;;; User Options:
+
+(defvar paren-priority nil
+  "*Defines the behaviour of mic-paren when point is between a closing and an
+  opening parenthesis.
+
+A value of 'close means highlight the parenthesis matching the
+close-parenthesis before the point.
+
+A value of 'open means highlight the parenthesis matching the open-parenthesis
+after the point.
+
+Any other value means highlight both parenthesis matching the parenthesis
+beside the point.")
+
+
+;;; ------------------------------
+
+(defvar paren-sexp-mode nil
+  "*If nil only the matching parenthesis is highlighted.
+If non-nil the whole s-expression between the matching parenthesis is
+highlighted.")
+
+;;; ------------------------------
+
+(defvar paren-highlight-at-point t
+  "*If non-nil and point is after a close parenthesis, both the close and
+open parenthesis is highlighted. If nil, only the open parenthesis is
+highlighted.")
+
+;;; ------------------------------
+
+(defvar paren-highlight-offscreen nil
+  "*If non-nil stig-paren will highlight text which is not visible in the
+current buffer.  
+
+This is useful if you regularly display the current buffer in multiple windows
+or frames. For instance if you use follow-mode (by andersl@csd.uu.se), however
+it may slow down your Emacs.
+
+(This variable is ignored (treated as non-nil) if you set paren-sexp-mode to
+non-nil.)")
+
+;;; ------------------------------
+
+(defvar paren-message-offscreen t
+  "*Display message if matching parenthesis is off-screen.")
+
+;;; ------------------------------
+
+(defvar paren-message-no-match t
+  "*Display message if no matching parenthesis is found.")
+
+;;; ------------------------------
+
+(defvar paren-ding-unmatched nil
+  "*Make noise if the cursor is at an unmatched parenthesis or no matching
+parenthesis is found.
+
+Even if nil, typing an unmatched parenthesis produces a ding.")
+
+;;; ------------------------------
+
+(defvar paren-delay nil
+  "*This variable controls when highlighting is done.  The variable has
+different meaning in different versions of Emacs.
+
+In Emacs 19.29 and below: 
+  This variable is ignored.
+
+In Emacs 19.30:
+  A value of nil will make highlighting happen immediately (this may slow down
+  your Emacs if running on a slow system).  Any non-nil value will delay
+  highlighting for the time specified by post-command-idle-delay.  
+
+In Emacs 19.31 and above:
+  A value of nil will make highlighting happen immediately (this may slow down
+  your Emacs if running on a slow system).  If not nil, the value should be a
+  number (possible a floating point number if your Emacs support floating point
+  numbers).  The number is the delay before mic-paren performs highlighting.
+
+If you change this variable when mic-paren is active you have to re-activate
+(with M-x paren-activate) mic-paren for the change to take effect.")
+
+
+;;; ------------------------------
+
+(defvar paren-dont-touch-blink nil
+  "*If non-nil mic-paren will not change the value of blink-matching-paren when
+activated of deactivated.
+
+If nil mic-paren turns of blinking when activated and turns on blinking when
+deactivated.")
+
+;;; ------------------------------
+
+(defvar paren-dont-activate-on-load nil
+ "*If non-nil mic-paren will not activate itself when loaded.")
+
+;;; ------------------------------
+
+(defvar paren-face (if (x-display-color-p) 'highlight 'underline)
+  "*Face to use for showing the matching parenthesis.")
+
+;;; ------------------------------
+
+(defvar paren-mismatch-face (if (x-display-color-p)
+				(let ((fn 'paren-mismatch-face))
+				  (copy-face 'default fn)
+				  (set-face-background fn "DeepPink")
+				  fn)
+			      'modeline)
+  "*Face to use when highlighting a mismatched parenthesis.")
+
+;;; ======================================================================
+;;; User Functions:
+
+;; XEmacs compatibility
+(eval-and-compile
+  (if (fboundp 'make-extent)
+      (progn
+	(fset 'mic-make-overlay 'make-extent)
+	(fset 'mic-delete-overlay 'delete-extent)
+	(fset 'mic-overlay-put 'set-extent-property)
+	(defun mic-cancel-timer (timer) (delete-itimer timer))
+	(defun mic-run-with-idle-timer (secs repeat function &rest args)
+	  (start-itimer "mic-paren-idle" function secs nil))
+	)
+    (fset 'mic-make-overlay 'make-overlay)
+    (fset 'mic-delete-overlay 'delete-overlay)
+    (fset 'mic-overlay-put 'overlay-put)
+    (fset 'mic-cancel-timer 'cancel-timer)
+    (fset 'mic-run-with-idle-timer 'run-with-idle-timer)
+    ))
+
+
+(defun paren-activate ()
+  "Activates mic-paren parenthesis highlighting.
+paren-activate deactivates the paren.el and stig-paren.el packages if they are
+active 
+Options:
+  paren-priority
+  paren-sexp-mode
+  paren-highlight-at-point
+  paren-highlight-offscreen
+  paren-message-offscreen
+  paren-message-no-match
+  paren-ding-unmatched
+  paren-delay
+  paren-dont-touch-blink
+  paren-dont-activate-on-load
+  paren-face
+  paren-mismatch-face"
+  (interactive)
+  ;; Deactivate mic-paren.el (To remove redundant hooks)
+  (paren-deactivate)
+  ;; Deactivate paren.el if loaded
+  (if (boundp 'post-command-idle-hook)
+      (remove-hook 'post-command-idle-hook 'show-paren-command-hook))
+  (remove-hook 'post-command-hook 'show-paren-command-hook)
+  (and (boundp 'show-paren-overlay)
+       show-paren-overlay
+       (mic-delete-overlay show-paren-overlay))
+  (and (boundp 'show-paren-overlay-1)
+       show-paren-overlay-1
+       (mic-delete-overlay show-paren-overlay-1))
+  ;; Deactivate stig-paren.el if loaded
+  (if (boundp 'post-command-idle-hook)
+      (remove-hook 'post-command-idle-hook 'stig-paren-command-hook))
+  (remove-hook 'post-command-hook 'stig-paren-command-hook)
+  (remove-hook 'post-command-hook 'stig-paren-safe-command-hook)
+  (remove-hook 'pre-command-hook 'stig-paren-delete-overlay)
+  ;; Deactivate Emacs standard parenthesis blinking
+  (or paren-dont-touch-blink
+      (setq blink-matching-paren nil))
+
+  (cond
+	;; If timers are available use them
+	;; (Emacs 19.31 and above)
+	((or (featurep 'timer) (featurep 'itimer))
+	 (if (numberp paren-delay)
+	     (setq mic-paren-idle-timer 
+		   (mic-run-with-idle-timer paren-delay t
+					    'mic-paren-command-idle-hook))
+	   (add-hook 'post-command-hook 'mic-paren-command-hook)))
+       ;; If the idle hook exists assume it is functioning and use it 
+       ;; (Emacs 19.30)
+       ((and (boundp 'post-command-idle-hook) 
+	     (boundp 'post-command-idle-delay))
+	(if paren-delay
+	    (add-hook 'post-command-idle-hook 'mic-paren-command-idle-hook)
+	  (add-hook 'post-command-hook 'mic-paren-command-hook)))
+       ;; Check if we (at least) have a post-comand-hook, and use it
+       ;; (Emacs 19.29 and below)
+       ((boundp 'post-command-hook) 
+	(add-hook 'post-command-hook 'mic-paren-command-hook))
+       ;; Not possible to install mic-paren hooks
+       (t (error "Cannot activate mic-paren in this Emacs version"))))
+
+
+
+(defun paren-deactivate ()
+  "Deactivates mic-paren parenthesis highlighting"
+  (interactive)
+  ;; Deactivate (don't bother to check where/if mic-paren is acivte, just
+  ;; delete all possible hooks and timers)
+  (if (boundp 'post-command-idle-hook)
+      (remove-hook 'post-command-idle-hook 'mic-paren-command-idle-hook))
+  (if mic-paren-idle-timer
+      (mic-cancel-timer mic-paren-idle-timer))
+  (remove-hook 'post-command-hook 'mic-paren-command-hook)
+
+  ;; Remove any old highlighs
+  (mic-delete-overlay mic-paren-backw-overlay)
+  (mic-delete-overlay mic-paren-point-overlay)
+  (mic-delete-overlay mic-paren-forw-overlay)
+
+  ;; Reactivate Emacs standard parenthesis blinking
+  (or paren-dont-touch-blink
+      (setq blink-matching-paren t))
+  )
+
+;;; ======================================================================
+;;; Internal variables:
+
+(defvar mic-paren-backw-overlay (mic-make-overlay (point-min) (point-min))
+  "Overlay for the open-paren which matches the close-paren before
+point. When in sexp-mode this is the overlay for the expression before point.")
+
+(defvar mic-paren-point-overlay (mic-make-overlay (point-min) (point-min))
+  "Overlay for the close-paren before point.
+(Not used when is sexp-mode.)")
+
+(defvar mic-paren-forw-overlay (mic-make-overlay (point-min) (point-min))
+  "Overlay for the close-paren which matches the open-paren after
+point. When in sexp-mode this is the overlay for the expression after point.")
+
+(defvar mic-paren-idle-timer nil
+  "Idle-timer.  Used only in Emacs 19.31 and above (and if paren-delay is nil)")
+
+
+
+
+;;; ======================================================================
+;;; Internal function:
+
+
+
+(defun mic-paren-command-hook ()
+  (or executing-kbd-macro
+      (input-pending-p)			;[This might cause trouble since the
+                                        ; function is unreliable]
+      (condition-case paren-error
+	  (mic-paren-highligt)
+	(error 
+	 (if (not (window-minibuffer-p (selected-window)))
+	     (message "mic-paren catched error (please report): %s"
+		      paren-error))))))
+
+(defun mic-paren-command-idle-hook ()
+  (condition-case paren-error
+      (mic-paren-highligt)
+    (error 
+     (if (not (window-minibuffer-p (selected-window)))
+	 (message "mic-paren catched error (please report): %s" 
+		  paren-error)))))
+
+
+(defun mic-paren-highligt ()
+  "The main-function of mic-paren. Does all highlighting, dinging, messages,
+cleaning-up."
+  ;; Remove any old highlighting
+  (mic-delete-overlay mic-paren-forw-overlay)
+  (mic-delete-overlay mic-paren-point-overlay)
+  (mic-delete-overlay mic-paren-backw-overlay)
+
+  ;; Handle backward highlighting (when after a close-paren):
+  ;; If positioned after a close-paren, and
+  ;;    not before an open-paren when priority=open, and
+  ;;    the close-paren is not escaped then
+  ;;      perform highlighting
+  ;; else
+  ;;      remove any old backward highlights
+  (if (and (eq (char-syntax (preceding-char)) ?\))
+	   (not (and (eq (char-syntax (following-char)) ?\()
+		     (eq paren-priority 'open)))
+	   (paren-evenp (paren-backslashes-before-char (1- (point)))))
+       (let (open)
+	 ;; Find the position for the open-paren
+	 (save-excursion
+	   (save-restriction
+	     (if blink-matching-paren-distance
+		 (narrow-to-region 
+		  (max (point-min)
+		       (- (point) blink-matching-paren-distance))
+		  (point-max)))
+	     (condition-case ()
+		 (setq open (scan-sexps (point) -1))
+	       (error nil))))
+
+	 ;; If match found
+	 ;;    highlight and/or print messages
+	 ;; else
+	 ;;    print no-match message
+	 ;;    remove any old highlights
+	 (if open
+	     (let ((mismatch (/= (matching-paren (preceding-char)) 
+				 (char-after open)))
+		   (visible (pos-visible-in-window-p open)))
+	       ;; If highlight is appropriate
+	       ;;    highligt
+	       ;; else
+	       ;;    remove any old highlight
+	       (if (or visible paren-highlight-offscreen paren-sexp-mode)
+		   ;; If sexp-mode
+		   ;;    highlight sexp
+		   ;; else
+		   ;;    highlight the two parens
+		   (if paren-sexp-mode
+		       (progn
+			 (setq mic-paren-backw-overlay
+			       (mic-make-overlay open (point)))
+			 (if mismatch
+			     (mic-overlay-put mic-paren-backw-overlay 
+					      'face paren-mismatch-face)
+			   (mic-overlay-put mic-paren-backw-overlay 
+					    'face paren-face)))
+		     (setq mic-paren-backw-overlay
+			   (mic-make-overlay open (1+ open)))
+		     (and paren-highlight-at-point
+			  (setq mic-paren-point-overlay
+				(mic-make-overlay (1- (point)) (point))))
+		     (if mismatch
+			 (progn
+			   (mic-overlay-put mic-paren-backw-overlay 
+					    'face paren-mismatch-face)
+			   (and paren-highlight-at-point
+				(mic-overlay-put mic-paren-point-overlay 
+						 'face paren-mismatch-face)))
+		       (mic-overlay-put mic-paren-backw-overlay 
+					'face paren-face)
+		       (and paren-highlight-at-point 
+			    (mic-overlay-put mic-paren-point-overlay 
+					     'face paren-face)))))
+	       ;; Print messages if match is offscreen
+	       (and paren-message-offscreen
+		    (not visible)
+		    (not (window-minibuffer-p (selected-window)))
+		    (message "%s %s" 
+			     (if mismatch "MISMATCH:" "Matches")
+			     (mic-paren-get-matching-open-text open)))
+	       ;; Ding if mismatch
+	       (and mismatch
+		    paren-ding-unmatched
+		    (ding)))
+	   (and paren-message-no-match
+		(not (window-minibuffer-p (selected-window)))
+		(message "No opening parenthesis found"))
+	   (and paren-message-no-match
+		paren-ding-unmatched
+		(ding)))))
+
+  ;; Handle forward highlighting (when before an open-paren):
+  ;; If positioned before an open-paren, and
+  ;;    not after a close-paren when priority=close, and
+  ;;    the open-paren is not escaped then
+  ;;      perform highlighting
+  ;; else
+  ;;      remove any old forward highlights
+  (if (and (eq (char-syntax (following-char)) ?\()
+	   (not (and (eq (char-syntax (preceding-char)) ?\))
+		     (eq paren-priority 'close)))
+	   (paren-evenp (paren-backslashes-before-char (point))))
+       (let (close)
+	 ;; Find the position for the close-paren
+	 (save-excursion
+	   (save-restriction
+	     (if blink-matching-paren-distance
+		 (narrow-to-region 
+		  (point-min)
+		  (min (point-max)
+		       (+ (point) blink-matching-paren-distance))))
+      	     (condition-case ()
+		 (setq close (scan-sexps (point) 1))
+	       (error nil))))
+	 ;; If match found
+	 ;;    highlight and/or print messages
+	 ;; else
+	 ;;    print no-match message
+	 ;;    remove any old highlights
+	 (if close
+	     (let ((mismatch (/= (matching-paren (following-char)) 
+				 (char-after (1- close))))
+		   (visible (pos-visible-in-window-p close)))
+	       ;; If highlight is appropriate
+	       ;;    highligt
+	       ;; else
+	       ;;    remove any old highlight
+	       (if (or visible paren-highlight-offscreen paren-sexp-mode)
+		   ;; If sexp-mode
+		   ;;    highlight sexp
+		   ;; else
+		   ;;    highlight the two parens
+		   (if paren-sexp-mode
+		       (progn
+			 (setq mic-paren-forw-overlay
+			       (mic-make-overlay (point) close))
+			 (if mismatch
+			     (mic-overlay-put mic-paren-forw-overlay 
+					      'face paren-mismatch-face)
+			   (mic-overlay-put mic-paren-forw-overlay 
+					    'face paren-face)))
+		     (setq mic-paren-forw-overlay
+			   (mic-make-overlay (1- close) close))
+		     (if mismatch
+			 (mic-overlay-put mic-paren-forw-overlay 
+					  'face paren-mismatch-face)
+		       (mic-overlay-put mic-paren-forw-overlay 
+					'face paren-face))))
+
+	       ;; Print messages if match is offscreen
+	       (and paren-message-offscreen
+		    (not visible)
+		    (not (window-minibuffer-p (selected-window)))
+		    (message "%s %s" 
+			     (if mismatch "MISMATCH:" "Matches")
+			     (mic-paren-get-matching-close-text close)))
+	       ;; Ding if mismatch
+	       (and mismatch
+		    paren-ding-unmatched
+		    (ding)))
+	   (and paren-message-no-match
+		(not (window-minibuffer-p (selected-window)))
+		(message "No closing parenthesis found"))
+	   (and paren-message-no-match
+		paren-ding-unmatched
+		(ding))))))
+
+;;; --------------------------------------------------
+
+(defun mic-paren-get-matching-open-text (open)
+  "Returns a string with the context around OPEN-paren."
+  ;; If there's stuff on this line preceding the paren, then display text from
+  ;; beginning of line to paren.
+  ;;
+  ;; If, however, the paren is at the beginning of a line, then skip whitespace
+  ;; forward and display text from paren to end of the next line containing
+  ;; non-space text.
+  ;;
+  ;; (Same as in stig-paren.el)
+  (save-excursion
+    (goto-char open)
+    (if (save-excursion
+	  (skip-chars-backward " \t")
+	  (not (bolp)))
+	(progn
+	  (beginning-of-line)
+	  (concat (buffer-substring (point) (1+ open)) "..."))
+      (forward-char 1)			;From the beginning-of-line
+      (skip-chars-forward "\n \t")
+      (end-of-line)
+      (buffer-substring open (point)))))
+
+
+(defun mic-paren-get-matching-close-text (close)
+  "Returns a string with the context around CLOSE-paren."
+  ;; The whole line up until the close-paren with "..." appended if there are
+  ;; more text after the close-paren
+  (save-excursion
+    (goto-char close)
+    (beginning-of-line)
+    (concat
+     (buffer-substring (point) close)
+     (progn 
+       (goto-char close)
+       (if (looking-at "[ \t]*$")
+	   ""
+	 "...")))))
+  
+
+(defun paren-evenp (number)
+  "Returns t if NUMBER is an even number, nil otherwise"
+  (eq 0 (% number 2)))
+
+(defun paren-backslashes-before-char (pnt)
+  (setq pnt (1- pnt))
+  (let ((n 0))
+    (while (and (>= pnt (point-min))
+		(eq (char-syntax (char-after pnt)) ?\\))
+      (setq n (1+ n))
+      (setq pnt (1- pnt)))
+    n))
+
+    
+
+;;; ======================================================================
+;;; Initialisation when loading:
+
+
+(or paren-dont-activate-on-load
+    (paren-activate))
+
+;;; This is in case mic-paren.el is preloaded. [Does this work? /Mic]
+(add-hook 'window-setup-hook
+	  (function (lambda ()
+		      (and window-system
+			   (not paren-dont-activate-on-load)
+			   (paren-activate)))))
+
+(provide 'mic-paren)
+(provide 'paren)
--- a/lisp/packages/time-stamp.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/packages/time-stamp.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,134 +1,419 @@
 ;;; time-stamp.el --- Maintain last change time stamps in files edited by Emacs
-;;; Copyright 1989, 1993 Free Software Foundation, Inc.
 
+;; Copyright 1989, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+;; Maintainer's Time-stamp: <95/12/28 19:48:49 gildea>
 ;; Maintainer: Stephen Gildea <gildea@lcs.mit.edu>
-;; Time-stamp: <93/06/20 17:36:04 gildea>
 ;; Keywords: tools
 
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; 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.
 
-;; This file 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.
+;; 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: Not synched with FSF.
+;;; Synched up with: 19.34.
 
 ;;; Commentary:
 
-;;; If you put a time stamp template anywhere in the first 8 lines of a file,
-;;; it can be updated every time you save the file.  See the top of
-;;; time-stamp.el for a sample.  The template looks like one of the following:
-;;;     Time-stamp: <>
-;;;     Time-stamp: " "
-;;; The time stamp is written between the brackets or quotes, resulting in
-;;;     Time-stamp: <93/06/18 10:26:51 gildea>
-;;; Here is an example which puts the file name and time stamp in the binary:
-;;; static char *time_stamp = "sdmain.c Time-stamp: <>";
+;; If you put a time stamp template anywhere in the first 8 lines of a file,
+;; it can be updated every time you save the file.  See the top of
+;; time-stamp.el for a sample.  The template looks like one of the following:
+;;     Time-stamp: <>
+;;     Time-stamp: " "
+;; The time stamp is written between the brackets or quotes, resulting in
+;;     Time-stamp: <95/01/18 10:20:51 gildea>
+;; Here is an example that puts the file name and time stamp in the binary:
+;; static char *time_stamp = "sdmain.c Time-stamp: <>";
 
-;;; To activate automatic time stamping, add this code to your .emacs file:
-;;;
-;;; (autoload 'time-stamp "time-stamp" "Update the time stamp in a buffer." t)
-;;; (if (not (memq 'time-stamp write-file-hooks))
-;;;     (setq write-file-hooks
-;;;           (cons 'time-stamp write-file-hooks)))
+;; To activate automatic time stamping in GNU Emacs 19, add this code
+;; to your .emacs file:
+;; (add-hook 'write-file-hooks 'time-stamp)
+;;
+;; In Emacs 18 you will need to do this instead:
+;; (if (not (memq 'time-stamp write-file-hooks))
+;;     (setq write-file-hooks
+;;           (cons 'time-stamp write-file-hooks)))
+;; (autoload 'time-stamp "time-stamp" "Update the time stamp in a buffer." t)
+
+;; See the documentation for the function `time-stamp' for more details.
 
 ;;; Change Log:
 
-;;; Originally based on the 19 Dec 88 version of
-;;;   date.el by John Sturdy <mcvax!harlqn.co.uk!jcgs@uunet.uu.net>
+;; Originally based on the 19 Dec 88 version of
+;;   date.el by John Sturdy <mcvax!harlqn.co.uk!jcgs@uunet.uu.net>
+;; version 2, January 1995: replaced functions with %-escapes
+;; $Id: time-stamp.el,v 1.1.1.2 1996/12/18 22:50:44 steve Exp $
 
 ;;; Code:
 
 (defvar time-stamp-active t
-  "*Non-nil to enable time-stamping of files.  See the function time-stamp.")
+  "*Non-nil to enable time-stamping of buffers by \\[time-stamp].
+Can be toggled by \\[time-stamp-toggle-active].
+See also the variable time-stamp-warn-inactive.")
+
+(defvar time-stamp-warn-inactive t
+  "*Non-nil to have \\[time-stamp] warn if a buffer did not get time-stamped.
+A warning is printed if time-stamp-active is nil and the buffer contains
+a time stamp template that would otherwise have been updated.")
+
+(defvar time-stamp-format "%02y/%02m/%02d %02H:%02M:%02S %u"
+  "*Template for the string inserted by \\[time-stamp].
+Value may be a string or a list.  (Lists are supported only for
+backward compatibility.)  A string is used verbatim except
+for character sequences beginning with %:
 
-(defvar time-stamp-format
-  '(time-stamp-yy/mm/dd time-stamp-hh:mm:ss user-login-name)
-  "*A list of functions to call to generate the time stamp string.
-Each element of the list is called as a function and the results are
-concatenated together separated by spaces.  Elements may also be strings,
-which are included verbatim.  Spaces are not inserted around literal strings.")
+%a  weekday name: `Monday'.		%A gives uppercase: `MONDAY'
+%b  month name: `January'.		%B gives uppercase: `JANUARY'
+%d  day of month
+%H  24-hour clock hour
+%I  12-hour clock hour
+%m  month number
+%M  minute
+%p  `am' or `pm'.			%P gives uppercase: `AM' or `PM'
+%S  seconds
+%w  day number of week, Sunday is 0
+%y  year: `1995'
+%z  time zone name: `est'.		%Z gives uppercase: `EST'
+
+Non-date items:
+%%  a literal percent character: `%'
+%f  file name without directory		%F gives absolute pathname
+%s  system name
+%u  user's login name
+%h  mail host name
+
+Decimal digits between the % and the type character specify the
+field width.  Strings are truncated on the right; numbers on the left.
+A leading zero causes numbers to be zero-filled.
+
+For example, to get the format used by the `date' command,
+use \"%3a %3b %2d %02H:%02M:%02S %Z %y\"")
+
 
 ;;; Do not change time-stamp-line-limit, time-stamp-start, or
 ;;; time-stamp-end in your .emacs or you will be incompatible
 ;;; with other people's files!  If you must change them,
 ;;; do so only in the local variables section of the file itself.
 
-(defvar time-stamp-line-limit 8	    ;Do not change!  See comment above.
-  "Number of lines at the beginning of a file that are searched.
-The patterns time-stamp-start and time-stamp-end must be found on one
-of the first time-stamp-line-limit lines of the file for the file to
-be time-stamped.")
+(defvar time-stamp-line-limit 8	    ;Do not change!
+  "Lines of a file searched; positive counts from start, negative from end.
+The patterns `time-stamp-start' and `time-stamp-end' must be found on one
+of the first (last) `time-stamp-line-limit' lines of the file for the
+file to be time-stamped by \\[time-stamp].
 
-(defvar time-stamp-start "Time-stamp: \\\\?[\"<]+"    ;Do not change!
-  "Regexp after which the time stamp is written by \\[time-stamp].
-See also the variables  time-stamp-end  and  time-stamp-line-limit.
-
-Do not change time-stamp-line-limit, time-stamp-start, or
-time-stamp-end for yourself or you will be incompatible
+Do not change `time-stamp-line-limit', `time-stamp-start', or
+`time-stamp-end' for yourself or you will be incompatible
 with other people's files!  If you must change them for some application,
 do so in the local variables section of the time-stamped file itself.")
 
 
-(defvar time-stamp-end "\\\\?[\">]"    ;Do not change!  See comment above.
+(defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+"    ;Do not change!
+  "Regexp after which the time stamp is written by \\[time-stamp].
+See also the variables `time-stamp-end' and `time-stamp-line-limit'.
+
+Do not change `time-stamp-line-limit', `time-stamp-start', or
+`time-stamp-end' for yourself or you will be incompatible
+with other people's files!  If you must change them for some application,
+do so in the local variables section of the time-stamped file itself.")
+
+
+(defvar time-stamp-end "\\\\?[\">]"    ;Do not change!
   "Regexp marking the text after the time stamp.
-\\[time-stamp] deletes the text between the first match of  time-stamp-start
-\(which see) and the following match of  time-stamp-end  on the same line,
-then writes the time stamp specified by  time-stamp-format  between them.")
+\\[time-stamp] deletes the text between the first match of `time-stamp-start'
+and the following match of `time-stamp-end' on the same line,
+then writes the time stamp specified by `time-stamp-format' between them.
+
+Do not change `time-stamp-line-limit', `time-stamp-start', or
+`time-stamp-end' for yourself or you will be incompatible
+with other people's files!  If you must change them for some application,
+do so in the local variables section of the time-stamped file itself.")
+
 
 ;;;###autoload
 (defun time-stamp ()
   "Update the time stamp string in the buffer.
+If you put a time stamp template anywhere in the first 8 lines of a file,
+it can be updated every time you save the file.  See the top of
+`time-stamp.el' for a sample.  The template looks like one of the following:
+    Time-stamp: <>
+    Time-stamp: \" \"
+The time stamp is written between the brackets or quotes, resulting in
+    Time-stamp: <95/01/18 10:20:51 gildea>
 Only does its thing if the variable  time-stamp-active  is non-nil.
 Typically used on  write-file-hooks  for automatic time-stamping.
-The format of the time stamp is determined by the variable
-time-stamp-format.  The first  time-stamp-line-limit  lines of the
-buffer (normally 8) are searched for the time stamp template,
-and if it is found, a new time stamp is written into it."
+The format of the time stamp is determined by the variable  time-stamp-format.
+The variables time-stamp-line-limit, time-stamp-start, and time-stamp-end
+control finding the template."
   (interactive)
-  (if time-stamp-active
-       (let ((case-fold-search nil))
-	 (if (and (stringp time-stamp-start)
-		  (stringp time-stamp-end))
-	     (save-excursion
-	       (goto-char (point-min))
-	       (if (re-search-forward time-stamp-start
-				      (save-excursion
-					(forward-line time-stamp-line-limit)
-					(point))
-				      t)
-		   (let ((start (point)))
-		     (if (re-search-forward time-stamp-end
-					    (save-excursion (end-of-line) (point))
-					    t)
-			 (let ((end (match-beginning 0)))
-			   (delete-region start end)
-			   (goto-char start)
-			   (insert (time-stamp-string))
-			   (setq end (point))
-			   ;; remove any tabs used to format the time stamp
-			   (goto-char start)
-			   (if (search-forward "\t" end t)
-			       (untabify start end)))))))
-	   ;; don't signal an error in a write-file-hook
-	   (message "time-stamp-start or time-stamp-end is not a string"))))
+  (let ((case-fold-search nil)
+	(need-to-warn nil)
+	start search-end)
+    (if (and (stringp time-stamp-start)
+	     (stringp time-stamp-end))
+	(save-excursion
+	  (save-restriction
+	    (widen)
+	    (if (> time-stamp-line-limit 0)
+		(progn
+		  (goto-char (setq start (point-min)))
+		  (forward-line time-stamp-line-limit)
+		  (setq search-end (point)))
+	      (goto-char (setq search-end (point-max)))
+	      (forward-line time-stamp-line-limit)
+	      (setq start (point)))
+	    (goto-char start)
+	    (while
+		(and (< (point) search-end)
+		     (re-search-forward time-stamp-start search-end 'move))
+	      (setq start (point))
+	      (end-of-line)
+	      (let ((line-end (point)))
+		(goto-char start)
+		(if (re-search-forward time-stamp-end line-end 'move)
+		    (progn
+		      (if time-stamp-active
+			  (let ((end (match-beginning 0)))
+			    (delete-region start end)
+			    (goto-char start)
+			    (insert (time-stamp-string))
+			    (setq end (point))
+			    ;; remove any tabs used to format time stamp
+			    (goto-char start)
+			    (if (search-forward "\t" end t)
+				(untabify start end)))
+			(if time-stamp-warn-inactive
+			    ;; do warning outside save-excursion
+			    (setq need-to-warn t)))
+		      (setq search-end (point))))))))
+      ;; don't signal an error in a write-file-hook
+      (message "time-stamp-start or time-stamp-end is not a string")
+      (sit-for 1))
+    (if need-to-warn
+	(progn
+	  (message "Warning: time-stamp-active is off; did not time-stamp buffer.")
+	  (sit-for 1))))
   ;; be sure to return nil so can be used on write-file-hooks
   nil)
 
+;;;###autoload
+(defun time-stamp-toggle-active (&optional arg)
+  "Toggle time-stamp-active, setting whether \\[time-stamp] updates a buffer.
+With arg, turn time stamping on if and only if arg is positive."
+  (interactive "P")
+  (setq time-stamp-active
+	(if (null arg)
+	    (not time-stamp-active)
+	  (> (prefix-numeric-value arg) 0)))
+  (message "time-stamp is now %s." (if time-stamp-active "active" "off")))
+
+
 (defun time-stamp-string ()
   "Generate the new string to be inserted by \\[time-stamp]."
-  (time-stamp-fconcat time-stamp-format " "))
+  (if (stringp time-stamp-format)
+      (time-stamp-strftime time-stamp-format)
+    (time-stamp-fconcat time-stamp-format " "))) ;version 1 compatibility
+
+(defconst time-stamp-month-numbers
+  '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) ("May" . 5) ("Jun" . 6)
+    ("Jul" . 7) ("Aug" . 8) ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12))
+  "Alist of months and their number.")
+
+(defconst time-stamp-month-full-names
+  ["(zero)" "January" "February" "March" "April" "May" "June"
+   "July" "August" "September" "October" "November" "December"])
+
+(defconst time-stamp-weekday-numbers
+  '(("Sun" . 0) ("Mon" . 1) ("Tue" . 2) ("Wed" . 3)
+    ("Thu" . 4) ("Fri" . 5) ("Sat" . 6))
+  "Alist of weekdays and their number.")
+
+(defconst time-stamp-weekday-full-names
+  ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"])
+
+(defconst time-stamp-am-pm '("am" "pm")
+  "List of strings used to denote morning and afternoon.")
+
+(defconst time-stamp-no-file "(no file)"
+  "String to use when the buffer is not associated with a file.")
+
+(defun time-stamp-strftime (format &optional time)
+  "Uses a FORMAT to format date, time, file, and user information.
+Optional second argument TIME will be used instead of the current time.
+See the description of the variable `time-stamp-format' for a description
+of the format string."
+  (let ((time-string (cond ((stringp time)
+			    time)
+			   (time
+			    (current-time-string time))
+			   (t
+			    (current-time-string))))
+	(fmt-len (length format))
+	(ind 0)
+	cur-char
+	(prev-char nil)
+	(result "")
+	field-index
+	field-width
+	field-result
+	(paren-level 0))
+    (while (< ind fmt-len)
+      (setq cur-char (aref format ind))
+      (setq
+       result
+       (concat result 
+      (cond
+       ((eq cur-char ?%)
+	(setq field-index (1+ ind))
+	(while (progn
+		 (setq ind (1+ ind))
+		 (setq cur-char (if (< ind fmt-len)
+				    (aref format ind)
+				  ?\0))
+		 (and (<= ?0 cur-char) (>= ?9 cur-char))))
+	(setq field-width (substring format field-index ind))
+	;; eat any additional args to allow for future expansion
+	(while (or (and (<= ?0 cur-char) (>= ?9 cur-char)) (eq ?. cur-char)
+		   (eq ?, cur-char) (eq ?: cur-char) (eq ?@ cur-char)
+		   (eq ?- cur-char) (eq ?+ cur-char)
+		   (eq ?\  cur-char) (eq ?# cur-char)
+		   (and (eq ?\( cur-char)
+			(not (eq prev-char ?\\))
+			(setq paren-level (1+ paren-level)))
+		   (if (and (eq ?\) cur-char)
+			    (not (eq prev-char ?\\))
+			    (> paren-level 0))
+		       (setq paren-level (1- paren-level))
+		     (and (> paren-level 0)
+			  (< ind fmt-len))))
+	  (setq ind (1+ ind))
+	  (setq prev-char cur-char)
+	  (setq cur-char (if (< ind fmt-len)
+			     (aref format ind)
+			   ?\0)))
+	(setq field-result
+	(cond
+	 ((eq cur-char ?%)
+	  "%")
+	 ((or (eq cur-char ?a)		;weekday name
+	      (eq cur-char ?A))
+	  (let ((name
+		 (aref time-stamp-weekday-full-names
+		       (cdr (assoc (substring time-string 0 3)
+				   time-stamp-weekday-numbers)))))
+	    (if (eq cur-char ?a)
+		name
+	      (upcase name))))
+	 ((or (eq cur-char ?b)		;month name
+	      (eq cur-char ?B))
+	  (let ((name
+		 (aref time-stamp-month-full-names
+		       (cdr (assoc (substring time-string 4 7)
+				   time-stamp-month-numbers)))))
+	    (if (eq cur-char ?b)
+		name
+	      (upcase name))))
+	 ((eq cur-char ?d)		;day of month, 1-31
+	  (string-to-int (substring time-string 8 10)))
+	 ((eq cur-char ?H)		;hour, 0-23
+	  (string-to-int (substring time-string 11 13)))
+	 ((eq cur-char ?I)		;hour, 1-12
+	  (let ((hour (string-to-int (substring time-string 11 13))))
+	    (cond ((< hour 1)
+		   (+ hour 12))
+		  ((> hour 12)
+		   (- hour 12))
+		  (t
+		   hour))))
+	 ((eq cur-char ?m)		;month number, 1-12
+	  (cdr (assoc (substring time-string 4 7)
+		      time-stamp-month-numbers)))
+	 ((eq cur-char ?M)		;minute, 0-59
+	  (string-to-int (substring time-string 14 16)))
+	 ((or (eq cur-char ?p)		;am or pm
+	      (eq cur-char ?P))
+	  (let ((name
+		 (if (> 12 (string-to-int (substring time-string 11 13)))
+		     (car time-stamp-am-pm)
+		   (car (cdr time-stamp-am-pm)))))
+	    (if (eq cur-char ?p)
+		name
+	      (upcase name))))
+	 ((eq cur-char ?S)		;seconds, 00-60
+	  (string-to-int (substring time-string 17 19)))
+	 ((eq cur-char ?w)		;weekday number, Sunday is 0
+	  (cdr (assoc (substring time-string 0 3) time-stamp-weekday-numbers)))
+	 ((eq cur-char ?y)		;year
+	  (string-to-int (substring time-string -4)))
+	 ((or (eq cur-char ?z)		;time zone
+	      (eq cur-char ?Z))
+	  (let ((name
+		 (if (fboundp 'current-time-zone)
+		     (car (cdr (current-time-zone time))))))
+	    (or name (setq name ""))
+	    (if (eq cur-char ?z)
+		(downcase name)
+	      (upcase name))))
+	 ((eq cur-char ?f)		;buffer-file-name, base name only
+	  (if buffer-file-name
+	      (file-name-nondirectory buffer-file-name)
+	    time-stamp-no-file))
+	 ((eq cur-char ?F)		;buffer-file-name, full path
+	  (or buffer-file-name
+	      time-stamp-no-file))
+	 ((eq cur-char ?s)		;system name
+	  (system-name))
+	 ((eq cur-char ?u)		;user name
+	  (user-login-name))
+	 ((eq cur-char ?h)		;mail host name
+	  (time-stamp-mail-host-name))
+	 ))
+	(if (string-equal field-width "")
+	    field-result
+	  (let ((padded-result
+		 (format (format "%%%s%c"
+				 field-width
+				 (if (numberp field-result) ?d ?s))
+			 (or field-result ""))))
+	    (let ((initial-length (length padded-result))
+		  (desired-length (string-to-int field-width)))
+	      (if (> initial-length desired-length)
+		  ;; truncate strings on right, numbers on left
+		  (if (stringp field-result)
+		      (substring padded-result 0 desired-length)
+		    (substring padded-result (- desired-length)))
+		padded-result)))))
+       (t
+	(char-to-string cur-char)))))
+      (setq ind (1+ ind)))
+    result))
+
+(defun time-stamp-mail-host-name ()
+  "Return the name of the host where the user receives mail.
+This is the value of `mail-host-address' if bound and a string,
+otherwise the value of `time-stamp-mail-host' (for versions of Emacs
+before 19.29) otherwise the value of the function system-name."
+  (or (and (boundp 'mail-host-address)
+	   (stringp mail-host-address)
+	   mail-host-address)
+      (and (boundp 'time-stamp-mail-host) ;for backward compatibility
+	   (stringp time-stamp-mail-host)
+	   time-stamp-mail-host)
+      (system-name)))
+
+;;; the rest of this file is for version 1 compatibility
 
 (defun time-stamp-fconcat (list sep)
-  "Similar to (mapconcat 'funcall LIST SEP) but LIST can have literals.
+  "Similar to (mapconcat 'funcall LIST SEP) but LIST allows literals.
 If an element of LIST is a symbol, it is funcalled to get the string to use;
 the separator SEP is used between two strings obtained by funcalling a
 symbol.  Otherwise the element itself is inserted; no separator is used
@@ -148,43 +433,17 @@
     return-string))
 
 
-(defconst time-stamp-month-numbers
-  '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) ("May" . 5) ("Jun" . 6)
-    ("Jul" . 7) ("Aug" . 8) ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12))
-  "Assoc list of months and their number.")
-
-(defconst time-stamp-month-full-names
-  ["(zero)" "January" "February" "March" "April" "May" "June"
-   "July" "August" "September" "October" "November" "December"])
-
-(defvar time-stamp-mail-host nil
-  "Name of the host where the user receives mail.
-See the function time-stamp-mail-host-name.")
-
 ;;; Some useful functions to use in time-stamp-format
 
 ;;; Could generate most of a message-id with
-;;; '(yymmdd "" hhmm "@" mail-host-name)
-
-(defun time-stamp-mail-host-name ()
-  "Return the name of the host where the user receives mail.
-This is the value of time-stamp-mail-host if bound and a string,
-otherwise the value of the function system-name."
-  (or (and (boundp 'time-stamp-mail-host)
-	   (stringp time-stamp-mail-host)
-	   time-stamp-mail-host)
-      (system-name)))
-
-(defun time-stamp-current-year ()
-  "Return the current year as a four-character string."
-  (substring (current-time-string) -4))
+;;; '(time-stamp-yymmdd "" time-stamp-hhmm "@" time-stamp-mail-host-name)
 
 ;;; pretty form, suitable for a title page
 
 (defun time-stamp-month-dd-yyyy ()
-  "Return the current date as a string in \"Month dd, yyyy\" form."
+  "Return the current date as a string in \"Month DD, YYYY\" form."
   (let ((date (current-time-string)))
-    (format "%s %02d, %s"
+    (format "%s %d, %s"
 	    (aref time-stamp-month-full-names
 		  (cdr (assoc (substring date 4 7) time-stamp-month-numbers)))
 	    (string-to-int (substring date 8 10))
@@ -193,8 +452,8 @@
 ;;; same as __DATE__ in ANSI C
 
 (defun time-stamp-mon-dd-yyyy ()
-  "Return the current date as a string in \"Mon dd yyyy\" form.
-The first character of dd is Space if the value is less than 10."
+  "Return the current date as a string in \"Mon DD YYYY\" form.
+The first character of DD is space if the value is less than 10."
   (let ((date (current-time-string)))
     (format "%s %2d %s"
 	    (substring date 4 7)
@@ -204,7 +463,7 @@
 ;;; RFC 822 date
 
 (defun time-stamp-dd-mon-yy ()
-  "Return the current date as a string in \"dd Mon yy\" form."
+  "Return the current date as a string in \"DD Mon YY\" form."
   (let ((date (current-time-string)))
     (format "%02d %s %s"
 	    (string-to-int (substring date 8 10))
@@ -214,7 +473,7 @@
 ;;; RCS 3 date
 
 (defun time-stamp-yy/mm/dd ()
-  "Return the current date as a string in \"yy/mm/dd\" form."
+  "Return the current date as a string in \"YY/MM/DD\" form."
   (let ((date (current-time-string)))
     (format "%s/%02d/%02d"
 	    (substring date -2)
@@ -224,47 +483,37 @@
 ;;; RCS 5 date
 
 (defun time-stamp-yyyy/mm/dd ()
-  "Return the current date as a string in \"yyyy/mm/dd\" form."
+  "Return the current date as a string in \"YYYY/MM/DD\" form."
   (let ((date (current-time-string)))
     (format "%s/%02d/%02d"
 	    (substring date -4)
 	    (cdr (assoc (substring date 4 7) time-stamp-month-numbers))
 	    (string-to-int (substring date 8 10)))))
 
+;;; ISO 8601 date
+
+(defun time-stamp-yyyy-mm-dd ()
+  "Return the current date as a string in \"YYYY-MM-DD\" form."
+  (let ((date (current-time-string)))
+    (format "%s-%02d-%02d"
+	    (substring date -4)
+	    (cdr (assoc (substring date 4 7) time-stamp-month-numbers))
+	    (string-to-int (substring date 8 10)))))
+
 (defun time-stamp-yymmdd ()
-  "Return the current date as a string in \"yymmdd\" form."
+  "Return the current date as a string in \"YYMMDD\" form."
   (let ((date (current-time-string)))
     (format "%s%02d%02d"
 	    (substring date -2)
 	    (cdr (assoc (substring date 4 7) time-stamp-month-numbers))
 	    (string-to-int (substring date 8 10)))))
 
-(defun time-stamp-dd/mm/yy ()
-  "Return the current date as a string in \"dd/mm/yy\" form."
-  (let ((date (current-time-string)))
-    (format "%02d/%02d/%s"
-	    (string-to-int (substring date 8 10))
-	    (cdr (assoc (substring date 4 7) time-stamp-month-numbers))
-	    (substring date -2))))
-
-(defun time-stamp-mm/dd/yy ()
-  "Return the current date as a string in \"mm/dd/yy\" form."
-  (let ((date (current-time-string)))
-    (format "%02d/%02d/%s"
-	    (cdr (assoc (substring date 4 7) time-stamp-month-numbers))
-	    (string-to-int (substring date 8 10))
-	    (substring date -2))))
-
 (defun time-stamp-hh:mm:ss ()
-  "Return the current time as a string in \"hh:mm:ss\" form."
+  "Return the current time as a string in \"HH:MM:SS\" form."
   (substring (current-time-string) 11 19))
 
-(defun time-stamp-hh:mm ()
-  "Return the current time as a string in \"hh:mm\" form."
-  (substring (current-time-string) 11 16))
-
 (defun time-stamp-hhmm ()
-  "Return the current time as a string in \"hhmm\" form."
+  "Return the current time as a string in \"HHMM\" form."
   (let ((date (current-time-string)))
     (concat (substring date 11 13)
 	    (substring date 14 16))))
--- a/lisp/prim/buffer.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/buffer.el	Mon Aug 13 09:03:46 2007 +0200
@@ -66,12 +66,16 @@
 If optional second arg NOT-THIS-WINDOW-P is non-nil, insist on finding
 another window even if BUFNAME is already visible in the selected window.
 If optional third arg is non-nil, it is the frame to pop to this
-buffer on."
+buffer on.
+If `focus-follows-mouse' is non-nil, keyboard focus is left unchanged."
   ;; #ifdef I18N3
   ;; #### Doc string should indicate that the buffer name will get
   ;; translated.
   ;; #endif
-  (let (buf window frame)
+  ;; This is twisted.  It is evil to throw the keyboard focus around
+  ;; willy-nilly if the user wants focus-follows-mouse.
+  (let ((oldbuf (current-buffer))
+	buf window frame)
     (if (null bufname)
 	(setq buf (other-buffer (current-buffer)))
       (setq buf (get-buffer bufname))
@@ -84,9 +88,15 @@
     (setq window (display-buffer buf not-this-window-p on-frame))
     (setq frame (window-frame window))
     ;; if the display-buffer hook decided to show this buffer in another
-    ;; frame, then select that frame.
-    (if (not (eq frame (selected-frame)))
+    ;; frame, then select that frame, (unless obeying focus-follows-mouse -sb).
+    (if (and (not focus-follows-mouse)
+	     (not (eq frame (selected-frame))))
 	(select-frame frame))
     (record-buffer buf)
-    (select-window window)
+    (if (and focus-follows-mouse
+	     on-frame
+	     (not (eq on-frame (selected-frame))))
+	(set-buffer oldbuf)
+      ;; select-window will modify the internal keyboard focus of XEmacs
+      (select-window window))
     buf))
--- a/lisp/prim/debug.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/debug.el	Mon Aug 13 09:03:46 2007 +0200
@@ -18,11 +18,17 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.
 
-;;; Synched up with: FSF 19.30.
+;;; Commentary:
+
+;; NB: There are lots of formatting changes in the XEmacs version. -sb
+
+;; This is a major mode documented in the Emacs manual.
 
 ;;; Code:
 
@@ -47,10 +53,14 @@
 (defvar debugger-outer-last-command)
 (defvar debugger-outer-this-command)
 (defvar debugger-outer-unread-command-event)
+;; FSF: (defvar debugger-outer-unread-command-char)
+(defvar debugger-outer-unread-command-events)
 (defvar debugger-outer-last-input-event)
 (defvar debugger-outer-last-input-char)
 (defvar debugger-outer-last-input-time)
 (defvar debugger-outer-last-command-event)
+;; (defvar debugger-outer-last-nonmenu-event)
+;; (defvar debugger-outer-last-event-frame)
 (defvar debugger-outer-last-command-char)
 (defvar debugger-outer-standard-input)
 (defvar debugger-outer-standard-output)
@@ -66,12 +76,12 @@
 ;;;###autoload
 (defun debug (&rest debugger-args)
   "Enter debugger.  To return, type \\<debugger-mode-map>`\\[debugger-continue]'.
-Arguments are mainly for use when this is called
- from the internals of the evaluator.
-You may call with no args, or you may
- pass nil as the first arg and any other args you like.
- In that case, the list of args after the first will 
- be printed into the backtrace buffer."
+Arguments are mainly for use when this is called from the internals
+of the evaluator.
+
+You may call with no args, or you may pass nil as the first arg and
+any other args you like.  In that case, the list of args after the
+first will be printed into the backtrace buffer."
   (interactive)
   ;; XEmacs: it doesn't work to enter the debugger non-interactively
   ;; so just print out a backtrace and exit.
@@ -80,32 +90,32 @@
   (let (debugger-value
 	(debug-on-error nil)
 	(debug-on-quit nil)
-	(debug-on-signal nil)
+	(debug-on-signal nil)	; XEmacs
 	(debugger-buffer (let ((default-major-mode 'fundamental-mode))
 			   (get-buffer-create "*Backtrace*")))
 	;; #### I18N3 set the debugger-buffer to output-translating
 	(debugger-old-buffer (current-buffer))
 	(debugger-step-after-exit nil)
-        ;; Don't keep reading from an executing kbd macro!
-        (executing-macro nil)
-        ;; Save the outer values of these vars for the `e' command
+	;; Don't keep reading from an executing kbd macro!
+	(executing-macro nil)
+	;; Save the outer values of these vars for the `e' command
 	;; before we replace the values.
 	(debugger-outer-match-data (match-data))
 	(debugger-outer-load-read-function load-read-function)
 	(debugger-outer-overriding-local-map overriding-local-map)
 	;; FSFmacs (debugger-outer-track-mouse track-mouse)
-        (debugger-outer-last-command last-command)
-        (debugger-outer-this-command this-command)
-        (debugger-outer-unread-command-event unread-command-event)
-        (debugger-outer-last-input-event last-input-event)
-        (debugger-outer-last-input-char last-input-char)
-        (debugger-outer-last-input-time last-input-time)
-        (debugger-outer-last-command-event last-command-event)
-        (debugger-outer-last-command-char last-command-char)
-        (debugger-outer-standard-input standard-input)
-        (debugger-outer-standard-output standard-output)
-        (debugger-outer-cursor-in-echo-area cursor-in-echo-area)
-        )
+	(debugger-outer-last-command last-command)
+	(debugger-outer-this-command this-command)
+	(debugger-outer-unread-command-event unread-command-event)
+	(debugger-outer-unread-command-events unread-command-events)
+	(debugger-outer-last-input-event last-input-event)
+	(debugger-outer-last-input-char last-input-char)
+	(debugger-outer-last-input-time last-input-time)
+	(debugger-outer-last-command-event last-command-event)
+	(debugger-outer-last-command-char last-command-char)
+	(debugger-outer-standard-input standard-input)
+	(debugger-outer-standard-output standard-output)
+	(debugger-outer-cursor-in-echo-area cursor-in-echo-area))
     ;; Don't let these magic variables affect the debugger itself.
     (unwind-protect                     ;XEmacs change
 	(let ((last-command nil)
@@ -133,12 +143,13 @@
 	      (debugger-mode)
 	      (delete-region (point)
 			     (progn
+			       ;; XEmacs change
 			       (re-search-forward "\n[* ] debug(")
 			       (forward-line 1)
 			       (point)))
+	      (debugger-reenable)
 	      ;; lambda is for debug-on-call when a function call is next.
 	      ;; debug is for debug-on-entry function called.
-	      (debugger-reenable)
 	      (cond ((memq (car debugger-args) '(lambda debug))
 		     (insert "Entering:\n")
 		     (if (eq (car debugger-args) 'debug)
@@ -160,13 +171,12 @@
 		     (beginning-of-line))
 		    ;; Debugger entered for an error.
 		    ((eq (car debugger-args) 'error)
-		     (insert "Signalling: ")
+		     (insert "Signaling: ")
 		     (prin1 (nth 1 debugger-args) (current-buffer))
 		     (insert ?\n))
 		    ;; debug-on-call, when the next thing is an eval.
 		    ((eq (car debugger-args) t)
-		     (insert
-		      "Beginning evaluation of function call form:\n"))
+		     (insert "Beginning evaluation of function call form:\n"))
 		    ;; User calls debug directly.
 		    (t
 		     (prin1 (if (eq (car debugger-args) 'nil)
@@ -177,11 +187,12 @@
 	      (let ((inhibit-trace t)
 		    (standard-output nil)
 		    (buffer-read-only t))
-		(message nil)
+		(message "")
 		(recursive-edit)))
+	    ;; XEmacs change
 	    debugger-value))
-	;; Kill or at least neuter the backtrace buffer, so that users
-	;; don't try to execute debugger commands in an invalid context.
+      ;; Kill or at least neuter the backtrace buffer, so that users
+      ;; don't try to execute debugger commands in an invalid context.
       (if (get-buffer-window debugger-buffer 'visible)
 	    ;; Still visible despite the save-window-excursion?  Maybe it
 	    ;; it's in a pop-up frame.  It would be annoying to delete and
@@ -201,6 +212,7 @@
       (setq last-command debugger-outer-last-command)
       (setq this-command debugger-outer-this-command)
       (setq unread-command-event debugger-outer-unread-command-event)
+      (setq unread-command-event debugger-outer-unread-command-events)
       (setq last-input-event debugger-outer-last-input-event)
       (setq last-input-char debugger-outer-last-input-char)
       (setq last-input-time debugger-outer-last-input-time)
@@ -212,7 +224,7 @@
       (setq debug-on-next-call debugger-step-after-exit) ;do this last!
       )))
 
-
+;; XEmacs
 (defun debugger-exit ()
   (condition-case nil
       (let ((debug-on-error nil)
@@ -229,12 +241,14 @@
   (interactive)
   (setq debugger-step-after-exit t)
   (message "Proceeding, will debug on next eval or call.")
+  ;; XEmacs
   (debugger-exit))
 
 (defun debugger-continue ()
   "Continue, evaluating this expression without stopping."
   (interactive)
   (message "Continuing.")
+  ;; XEmacs
   (debugger-exit))
 
 (defun debugger-return-value (val)
@@ -247,6 +261,7 @@
   (prin1 debugger-value)
   (exit-recursive-edit))
 
+;; XEmacs: [Moved block]
 ;; Chosen empirically to account for all the frames
 ;; that will exist when debugger-frame is called
 ;; within the first one that appears in the backtrace buffer.
@@ -287,7 +302,7 @@
     (let ((opoint (point))
 	  (count 0))
       (goto-char (point-min))
-      ;; #### I18N3 will not localize properly!
+      ;; XEmacs:#### I18N3 will not localize properly!
       (if (or (equal (buffer-substring (point) (+ (point) 6))
 		     (gettext "Signal"))
 	      (equal (buffer-substring (point) (+ (point) 6))
@@ -344,15 +359,16 @@
 	(setq debugger-old-buffer (current-buffer)))
     (set-buffer debugger-old-buffer)
     (let ((last-command debugger-outer-last-command)
-          (this-command debugger-outer-this-command)
-          (unread-command-event debugger-outer-unread-command-event)
-          (last-input-event debugger-outer-last-input-event)
-          (last-input-char debugger-outer-last-input-char)
-          (last-input-time debugger-outer-last-input-time)
-          (last-command-event debugger-outer-last-command-event)
-          (last-command-char debugger-outer-last-command-char)
-          (standard-input debugger-outer-standard-input)
-          (standard-output debugger-outer-standard-output)
+	  (this-command debugger-outer-this-command)
+	  (unread-command-event debugger-outer-unread-command-event)
+	  (unread-command-event debugger-outer-unread-command-events)
+	  (last-input-event debugger-outer-last-input-event)
+	  (last-input-char debugger-outer-last-input-char)
+	  (last-input-time debugger-outer-last-input-time)
+	  (last-command-event debugger-outer-last-command-event)
+	  (last-command-char debugger-outer-last-command-char)
+	  (standard-input debugger-outer-standard-input)
+	  (standard-output debugger-outer-standard-output)
 	  (cursor-in-echo-area debugger-outer-cursor-in-echo-area)
 	  (overriding-local-map debugger-outer-overriding-local-map)
 	  (load-read-function debugger-outer-load-read-function))
@@ -373,23 +389,24 @@
               debugger-outer-standard-output standard-output
               debugger-outer-cursor-in-echo-area cursor-in-echo-area)))))
 
-(defvar debugger-mode-map
-  (let ((map (make-keymap)))
-    (set-keymap-name map 'debugger-mode-map)
-    (suppress-keymap map)
-    (define-key map "-" 'negative-argument)
-    (define-key map "b" 'debugger-frame)
-    (define-key map "c" 'debugger-continue)
-    (define-key map "j" 'debugger-jump)
-    (define-key map "r" 'debugger-return-value)
-    (define-key map "u" 'debugger-frame-clear)
-    (define-key map "d" 'debugger-step-through)
-    (define-key map "l" 'debugger-list-functions)
-    (define-key map "h" 'describe-mode)
-    (define-key map "q" 'top-level)
-    (define-key map "e" 'debugger-eval-expression)
-    (define-key map " " 'next-line)
-    map))
+(defvar debugger-mode-map nil)
+(if debugger-mode-map
+    nil
+  (let ((loop ? ))
+    (setq debugger-mode-map (make-keymap))
+    (suppress-keymap debugger-mode-map)
+    (define-key debugger-mode-map "-" 'negative-argument)
+    (define-key debugger-mode-map "b" 'debugger-frame)
+    (define-key debugger-mode-map "c" 'debugger-continue)
+    (define-key debugger-mode-map "j" 'debugger-jump)
+    (define-key debugger-mode-map "r" 'debugger-return-value)
+    (define-key debugger-mode-map "u" 'debugger-frame-clear)
+    (define-key debugger-mode-map "d" 'debugger-step-through)
+    (define-key debugger-mode-map "l" 'debugger-list-functions)
+    (define-key debugger-mode-map "h" 'describe-mode)
+    (define-key debugger-mode-map "q" 'top-level)
+    (define-key debugger-mode-map "e" 'debugger-eval-expression)
+    (define-key debugger-mode-map " " 'next-line)))
 
 (put 'debugger-mode 'mode-class 'special)
 
@@ -410,7 +427,7 @@
 \\{debugger-mode-map}"
   (kill-all-local-variables)    
   (setq major-mode 'debugger-mode)
-  (setq mode-name (gettext "Debugger"))
+  (setq mode-name (gettext "Debugger"))	; XEmacs
   (setq truncate-lines t)
   (set-syntax-table emacs-lisp-mode-syntax-table)
   (use-local-map debugger-mode-map))
@@ -442,11 +459,12 @@
 If argument is nil or an empty string, cancel for all functions."
   (interactive
    (list (let ((name
-                (completing-read "Cancel debug on entry (to function): "
-                                 ;; Make an "alist" of the functions
+		(completing-read "Cancel debug on entry (to function): "
+				 ;; Make an "alist" of the functions
 				 ;; that now have debug on entry.
-				 (mapcar 'list (mapcar 'symbol-name
-                                                       debug-function-list))
+				 (mapcar 'list
+					 (mapcar 'symbol-name
+						 debug-function-list))
 				 nil t nil)))
 	   (if name (intern name)))))
   (debugger-reenable)
@@ -486,7 +504,8 @@
       (let (tail prec)
 	(if (stringp (car (nthcdr 2 defn)))
 	    (setq tail (nthcdr 3 defn)
-		  prec (list (car defn) (car (cdr defn)) (car (cdr (cdr defn)))))
+		  prec (list (car defn) (car (cdr defn))
+			     (car (cdr (cdr defn)))))
 	  (setq tail (nthcdr 2 defn)
 		prec (list (car defn) (car (cdr defn)))))
 	(if (eq flag (equal (car tail) '(debug 'debug)))
--- a/lisp/prim/files-nomule.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/files-nomule.el	Mon Aug 13 09:03:46 2007 +0200
@@ -20,7 +20,13 @@
 ;; Free Software Foundation, 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-;;; Synched up with: Not in FSF.
+;;; Synched up with: FSF 19.34 (files.el).
+
+;;; Commentary:
+
+;; These stubs were moved from the bottom of files.el.
+
+;;; Code:
 
 (defun insert-file-contents (filename &optional visit beg end replace)
   "Insert contents of file FILENAME after point.
@@ -75,3 +81,4 @@
 Return t if file exists."
   (load-internal file noerror nomessage nosuffix nil nil))
 
+;;; files-nomule.el ends here
\ No newline at end of file
--- a/lisp/prim/files.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/files.el	Mon Aug 13 09:03:46 2007 +0200
@@ -16,11 +16,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34 [Partial].
 ;;; Warning: Merging this file is tough.  Beware.
 
 ;;; Commentary:
@@ -31,14 +31,28 @@
 
 ;;; Code:
 
-;; Avoid compilation warnings.
+;; XEmacs: Avoid compilation warnings.
 (defvar overriding-file-coding-system)
 (defvar file-coding-system)
 
-;; In buffer.c
+;; XEmacs: In buffer.c
 ;(defconst delete-auto-save-files t
 ;  "*Non-nil means delete auto-save file when a buffer is saved or killed.")
 
+;; FSF has automount-dir-prefix.  Our directory-abbrev-alist is more general.
+;; note: tmp_mnt bogosity conversion is established in paths.el.
+(defvar directory-abbrev-alist nil
+  "*Alist of abbreviations for file directories.
+A list of elements of the form (FROM . TO), each meaning to replace
+FROM with TO when it appears in a directory name.
+This replacement is done when setting up the default directory of a
+newly visited file.  *Every* FROM string should start with \\\\` or ^.
+
+Use this feature when you have directories which you normally refer to
+via absolute symbolic links or to eliminate automounter mount points
+from the beginning of your filenames.  Make TO the name of the link,
+and FROM the name it is linked to.")
+
 ;;; Turn off backup files on VMS since it has version numbers.
 (defconst make-backup-files (not (eq system-type 'vax-vms))
   "*Non-nil means make a backup of a file the first time it is saved.
@@ -96,6 +110,7 @@
 Automatically local in all buffers.")
 (make-variable-buffer-local 'buffer-offer-save)
 
+;; FSF uses normal defconst
 (defvaralias 'find-file-visit-truename 'find-file-use-truenames)
 (defvaralias 'find-file-existing-other-name 'find-file-compare-truenames)
 
@@ -107,6 +122,9 @@
 (make-variable-buffer-local 'buffer-file-number)
 (put 'buffer-file-number 'permanent-local t)
 
+(defvar buffer-file-numbers-unique (not (memq system-type '(windows-nt)))
+  "Non-nil means that buffer-file-number uniquely identifies files.")
+
 (defconst file-precious-flag nil
   "*Non-nil means protect against I/O errors while saving files.
 Some modes set this non-nil in particular buffers.
@@ -180,15 +198,19 @@
 and the rest are not called.
 These hooks are considered to pertain to the visited file.
 So this list is cleared if you change the visited file name.
-See also `write-contents-hooks' and `continue-save-buffer'.
-Don't make this variable buffer-local; instead, use `local-write-file-hooks'.")
+See also `write-contents-hooks' and `continue-save-buffer'.")
 ;;; However, in case someone does make it local...
 (put 'write-file-hooks 'permanent-local t)
 
 (defvar local-write-file-hooks nil
   "Just like `write-file-hooks', except intended for per-buffer use.
 The functions in this list are called before the ones in
-`write-file-hooks'.")
+`write-file-hooks'.
+
+This variable is meant to be used for hooks that have to do with a
+particular visited file.  Therefore, it is a permanent local, so that
+changing the major mode does not clear it.  However, calling
+`set-visited-file-name' does clear it.")
 (make-variable-buffer-local 'local-write-file-hooks)
 (put 'local-write-file-hooks 'permanent-local t)
 
@@ -213,7 +235,7 @@
 not clear this variable, but changing the major mode does clear it.
 See also `write-file-hooks' and `continue-save-buffer'.")
 
-;;  Not in FSF19
+;;  XEmacs addition
 ;;  Energize needed this to hook into save-buffer at a lower level; we need
 ;;  to provide a new output method, but don't want to have to duplicate all
 ;;  of the backup file and file modes logic.that does not occur if one uses
@@ -248,15 +270,6 @@
 The command \\[normal-mode] always obeys local-variables lists
 and ignores this variable.")
 
-(defvar hack-local-variables-hook nil
-  "Normal hook run after processing a file's local variables specs.
-Major modes can use this to examine user-specified local variables
-in order to initialize other data structure based on them.
-
-This hook runs even if there were no local variables or if their
-evaluation was suppressed.  See also `enable-local-variables' and
-`enable-local-eval'.")
-
 ;; Avoid losing in versions where CLASH_DETECTION is disabled.
 (or (fboundp 'lock-buffer)
     (defalias 'lock-buffer 'ignore))
@@ -300,7 +313,7 @@
 (defun parse-colon-path (cd-path)
   "Explode a colon-separated list of paths into a string list."
   (and cd-path
-       (let (cd-list (cd-start 0) cd-colon)
+       (let (cd-list cd-list (cd-start 0) cd-colon)
 	 (setq cd-path (concat cd-path path-separator))
 	 (while (setq cd-colon (string-match path-separator cd-path cd-start))
 	   (setq cd-list
@@ -335,41 +348,40 @@
   "Make DIR become the current buffer's default directory.
 If your environment includes a `CDPATH' variable, try each one of that
 colon-separated list of directories when resolving a relative directory name."
-;  (interactive "DChange default directory: ")
   (interactive
-   ;; XEmacs change?
+   ;; XEmacs change? (read-file-name => read-directory-name)
    (list (read-directory-name "Change default directory: "
 			      default-directory default-directory
 			      (and (member cd-path '(nil ("./")))
 				   (null (getenv "CDPATH"))))))
   (if (file-name-absolute-p dir)
       (cd-absolute (expand-file-name dir))
-    (progn
-      (if (null cd-path)
-          ;;#### Unix-specific
-          (let ((trypath (parse-colon-path (getenv "CDPATH"))))
-            (setq cd-path (or trypath (list "./")))))
-      (or (catch 'found
-            (mapcar #'(lambda (x)
-                        (let ((f (expand-file-name (concat x dir))))
-                          (if (file-directory-p f)
-                              (progn
-                                (cd-absolute f)
-                                (throw 'found t)))))
-                    cd-path)
-            nil)
-	  ;; jwz: give a better error message to those of us with the
-	  ;; good taste not to use a kludge like $CDPATH.
-	  (if (equal cd-path '("./"))
-	      (error "No such directory: %s" (expand-file-name dir))
-	    (error "Directory not found in $CDPATH: %s" dir))))))
+    ;; XEmacs
+    (if (null cd-path)
+	;;#### Unix-specific
+	(let ((trypath (parse-colon-path (getenv "CDPATH"))))
+	  (setq cd-path (or trypath (list "./")))))
+    (or (catch 'found
+	  (mapcar #'(lambda (x)
+		        (let ((f (expand-file-name (concat x dir))))
+			  (if (file-directory-p f)
+			      (progn
+			        (cd-absolute f)
+			        (throw 'found t)))))
+		  cd-path)
+	  nil)
+	;; jwz: give a better error message to those of us with the
+	;; good taste not to use a kludge like $CDPATH.
+	(if (equal cd-path '("./"))
+	    (error "No such directory: %s" (expand-file-name dir))
+	  (error "Directory not found in $CDPATH: %s" dir)))))
 
 (defun load-file (file)
   "Load the Lisp file named FILE."
   (interactive "fLoad file: ")
   (load (expand-file-name file) nil nil t))
 
-; We now dump utils/lib-complete.el which has improved versions of these.
+; We now dump utils/lib-complete.el which has improved versions of this.
 ;(defun load-library (library)
 ;  "Load the library named LIBRARY.
 ;This is an interface to the function `load'."
@@ -394,6 +406,7 @@
 	(funcall handler 'file-local-copy file)
       nil)))
 
+;; XEmacs change block
 ; We have this in C and use the realpath() system call.
 
 ;(defun file-truename (filename &optional counter prev-dirs)
@@ -503,6 +516,7 @@
 	(setq buffer-file-name (abbreviate-file-name buffer-file-truename)
 	      default-directory (file-name-directory buffer-file-name)))
     buffer-file-truename))
+;; End XEmacs change block
 
 (defun file-chase-links (filename)
   "Chase links in FILENAME until a name that is not a link.
@@ -745,20 +759,6 @@
 Choose the buffer's name using `generate-new-buffer-name'."
   (get-buffer-create (generate-new-buffer-name name)))
 
-;; FSF has automount-dir-prefix.  Our directory-abbrev-alist is more general.
-;; note: tmp_mnt bogosity conversion is established in paths.el.
-(defvar directory-abbrev-alist nil
-  "*Alist of abbreviations for file directories.
-A list of elements of the form (FROM . TO), each meaning to replace
-FROM with TO when it appears in a directory name.
-This replacement is done when setting up the default directory of a
-newly visited file.  *Every* FROM string should start with \\\\` or ^.
-
-Use this feature when you have directories which you normally refer to
-via absolute symbolic links or to eliminate automounter mount points
-from the beginning of your filenames.  Make TO the name of the link,
-and FROM the name it is linked to.")
-
 (defvar abbreviated-home-dir nil
   "The user's homedir abbreviated according to `directory-abbrev-alist'.")
 
@@ -1257,6 +1257,15 @@
                   (funcall mode))
               ))))))
 
+(defvar hack-local-variables-hook nil
+  "Normal hook run after processing a file's local variables specs.
+Major modes can use this to examine user-specified local variables
+in order to initialize other data structure based on them.
+
+This hook runs even if there were no local variables or if their
+evaluation was suppressed.  See also `enable-local-variables' and
+`enable-local-eval'.")
+
 (defun hack-local-variables (&optional force)
   "Parse, and bind or evaluate as appropriate, any local variables
 for current buffer."
@@ -2907,6 +2916,3 @@
       (error "Apparently circular symlink path"))))
 
 ;;; files.el ends here
-
-
-
--- a/lisp/prim/format.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/format.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,7 +1,9 @@
 ;;; format.el --- read and save files in multiple formats
+
 ;; Copyright (c) 1994, 1995 Free Software Foundation
 
 ;; Author: Boris Goldowsky <boris@gnu.ai.mit.edu>
+;; Keywords: extensions
 
 ;; This file is part of GNU Emacs.
 
@@ -9,55 +11,59 @@
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
-;;
+
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
-;;
+
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
-;; This file defines a unified mechanism for saving & loading files stored in
-;; different formats.  `format-alist' contains information that directs
+
+;; This file defines a unified mechanism for saving & loading files stored
+;; in different formats.  `format-alist' contains information that directs
 ;; Emacs to call an encoding or decoding function when reading or writing
-;; files that match certain conditions.  
+;; files that match certain conditions.
 ;;
-;; When a file is visited, its format is determined by matching the beginning
-;; of the file against regular expressions stored in `format-alist'.  If this
-;; fails, you can manually translate the buffer using `format-decode-buffer'.
-;; In either case, the formats used are listed in the variable
-;; `buffer-file-format', and become the default format for saving the buffer.
-;; To save a buffer in a different format, change this variable, or use
-;; `format-write-file'.
+;; When a file is visited, its format is determined by matching the
+;; beginning of the file against regular expressions stored in
+;; `format-alist'.  If this fails, you can manually translate the buffer
+;; using `format-decode-buffer'.  In either case, the formats used are
+;; listed in the variable `buffer-file-format', and become the default
+;; format for saving the buffer.  To save a buffer in a different format,
+;; change this variable, or use `format-write-file'.
 ;;
 ;; Auto-save files are normally created in the same format as the visited
-;; file, but the variable `auto-save-file-format' can be set to a particularly
-;; fast or otherwise preferred format to be used for auto-saving (or nil to do
-;; no encoding on auto-save files, but then you risk losing any
-;; text-properties in the buffer).
+;; file, but the variable `auto-save-file-format' can be set to a
+;; particularly fast or otherwise preferred format to be used for
+;; auto-saving (or nil to do no encoding on auto-save files, but then you
+;; risk losing any text-properties in the buffer).
 ;;
-;; You can manually translate a buffer into or out of a particular format with
-;; the functions `format-encode-buffer' and `format-decode-buffer'.
-;; To translate just the region use the functions `format-encode-region' and
-;; `format-decode-region'.  
+;; You can manually translate a buffer into or out of a particular format
+;; with the functions `format-encode-buffer' and `format-decode-buffer'.
+;; To translate just the region use the functions `format-encode-region'
+;; and `format-decode-region'.  
 ;;
-;; You can define a new format by writing the encoding and decoding functions,
-;; and adding an entry to `format-alist'.  See enriched.el for an example of
-;; how to implement a file format.  There are various functions defined
-;; in this file that may be useful for writing the encoding and decoding
-;; functions:
-;;  * `format-annotate-region' and `format-deannotate-region' allow a single
-;;     alist of information to be used for encoding and decoding.  The alist
-;;     defines a correspondence between strings in the file ("annotations")
-;;     and text-properties in the buffer.
+;; You can define a new format by writing the encoding and decoding
+;; functions, and adding an entry to `format-alist'.  See enriched.el for
+;; an example of how to implement a file format.  There are various
+;; functions defined in this file that may be useful for writing the
+;; encoding and decoding functions:
+;;  * `format-annotate-region' and `format-deannotate-region' allow a
+;;     single alist of information to be used for encoding and decoding.
+;;     The alist defines a correspondence between strings in the file
+;;     ("annotations") and text-properties in the buffer.
 ;;  * `format-replace-strings' is similarly useful for doing simple
 ;;     string->string translations in a reversible manner.
 
+;;; Code:
+
 (put 'buffer-file-format 'permanent-local t)
 
 (defconst format-alist 
@@ -470,7 +476,7 @@
 		  (message "Extra closing annotation (%s) in file" name)
 	      ;; If one is open, but not on the top of the stack, close
 	      ;; the things in between as well.  Set `found' when the real
-	      ;; oneis closed.
+	      ;; one is closed.
 		(while (not found)
 		  (let* ((top (car open-ans)) ; first on stack: should match.
 			 (top-name (car top))
@@ -497,8 +503,21 @@
 						    (assoc r open-ans))
 						  ans))
 				    nil	; multiple ans not satisfied
-				  ;; Yes, use the current property name &
-				  ;; value.  Set loop variables to nil so loop
+				  ;; Yes, all set.
+				  ;; If there are multiple annotations going
+				  ;; into one text property, adjust the 
+				  ;; begin points of the other annotations
+				  ;; so that we don't get double marking.
+				  (let ((to-reset ans)
+					this-one)
+				    (while to-reset
+				      (setq this-one
+					    (assoc (car to-reset) 
+						   (cdr open-ans)))
+				      (if this-one
+					  (setcdr this-one (list loc)))
+				      (setq to-reset (cdr to-reset))))
+				  ;; Set loop variables to nil so loop
 				  ;; will exit.
 				  (setq alist nil aalist nil matched t
 					;; pop annotation off stack.
@@ -734,11 +753,9 @@
     (if (not prop-alist)
 	nil
       ;; If property is numeric, nil means 0
-      (cond ((and (numberp old) (null new)
-		  (numberp (car (car prop-alist))))
+      (cond ((and (numberp old) (null new))
 	     (setq new 0))
-	    ((and (numberp new) (null old)
-		  (numberp (car (car prop-alist))))
+	    ((and (numberp new) (null old))
 	     (setq old 0)))
       ;; If either old or new is a list, have to treat both that way.
       (if (or (consp old) (consp new))
@@ -763,12 +780,11 @@
 
 (defun format-annotate-atomic-property-change (prop-alist old new)
   "Internal function annotate a single property change.
-PROP-ALIST is the relevant segement of a TRANSLATIONS list.
+PROP-ALIST is the relevant segment of a TRANSLATIONS list.
 OLD and NEW are the values."
   (cond
    ;; Numerical annotation - use difference
-   ((and (numberp old) (numberp new)
-	 (numberp (car (car prop-alist))))
+   ((and (numberp old) (numberp new))
     (let* ((entry (progn
 		    (while (and (car (car prop-alist))
 				(not (numberp (car (car prop-alist)))))
--- a/lisp/prim/help.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/help.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1097,9 +1097,10 @@
     (setq library (symbol-name library)))
   ;; XEmacs: We have the nifty `locate-file' so we use it.
   (let ((file (locate-file library load-path (if nosuffix nil ".elc:.el:"))))
-    (if file
-	(message "Library is file %s" file)
-      (message "No library %s in search path" library))
+    (when (interactive-p)
+      (if file
+	  (message "Library is file %s" file)
+	(message "No library %s in search path" library)))
     file))
 
 ;; Functions ported from C into Lisp in XEmacs
--- a/lisp/prim/indent.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/indent.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,9 +1,9 @@
 ;;; indent.el --- indentation commands for XEmacs
-;; Keywords: lisp languages tools
 
 ;; Copyright (C) 1985, 1992, 1993, 1995 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
+;; Keywords: lisp languages tools
 
 ;; This file is part of XEmacs.
 
@@ -18,9 +18,9 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
 
@@ -46,17 +46,19 @@
   "Indent line in proper way for current major mode."
   (interactive "P")
   (if (eq indent-line-function 'indent-to-left-margin)
-      (insert-tab)
+      (insert-tab prefix-arg)
     (if prefix-arg
 	(funcall indent-line-function prefix-arg)
       (funcall indent-line-function))))
 
-(defun insert-tab ()
-  (if abbrev-mode
-      (expand-abbrev))
-  (if indent-tabs-mode
-      (insert ?\t)
-    (indent-to (* tab-width (1+ (/ (current-column) tab-width))))))
+(defun insert-tab (&optional prefix-arg)
+  (let ((count (prefix-numeric-value prefix-arg)))
+    (if abbrev-mode
+	(expand-abbrev))
+    (if indent-tabs-mode
+	(insert-char ?\t count)
+      ;; XEmacs: (Need the `1+')
+      (indent-to (* tab-width (1+ (/ (current-column) tab-width)))))))
 
 (defun indent-rigidly (start end arg)
   "Indent all lines starting in the region sideways by ARG columns.
@@ -78,7 +80,7 @@
 	(delete-region (point) (progn (skip-chars-forward " \t") (point))))
       (forward-line 1))
     (move-marker end nil)
-    (setq zmacs-region-stays nil)))
+    (setq zmacs-region-stays nil))) ; XEmacs
 
 (defun indent-line-to (column)
   "Indent current line to COLUMN.
@@ -207,12 +209,12 @@
     (if (bolp) (setq from (point)))
     (goto-char to)
     (setq to (point-marker)))
-  (alter-text-property from (marker-position to) 'left-margin
+  (alter-text-property from (marker-position to) 'left-margin ; XEmacs
 		       (lambda (v) (max (- left-margin) (+ inc (or v 0)))))
-  (indent-rigidly from (marker-position to) inc)
+  (indent-rigidly from (marker-position to) inc) ; XEmacs
   (if auto-fill-function
       (save-excursion
-	(fill-region from (marker-position to) nil t t)))
+	(fill-region from (marker-position to) nil t t))) ; XEmacs
   (move-marker to nil))
 
 (defun decrease-left-margin (from to inc)
@@ -270,7 +272,7 @@
 		 (buffer-substring 
 		  (point) (min (point-max) (+ (length fill-prefix) (point)))))
 	  (forward-char (length fill-prefix)))
-    (if (and adaptive-fill-mode 
+    (if (and adaptive-fill-mode adaptive-fill-regexp
 	     (looking-at adaptive-fill-regexp))
 	(goto-char (match-end 0))))
   ;; Skip centering or flushright indentation
@@ -334,8 +336,8 @@
 (defun indent-relative (&optional unindented-ok)
   "Space out to under next indent point in previous nonblank line.
 An indent point is a non-whitespace character following whitespace.
-If the previous nonblank line has no indent points beyond
-the column point starts at, `tab-to-tab-stop' is done instead."
+If the previous nonblank line has no indent points beyond the
+column point starts at, `tab-to-tab-stop' is done instead."
   (interactive "P")
   (if abbrev-mode (expand-abbrev))
   (let ((start-column (current-column))
@@ -408,6 +410,7 @@
     (while (> count 0)
       (insert "0123456789")
       (setq count (1- count))))
+  ;; XEmacs
   (insert (substitute-command-keys "\nTo install changes, type \\<edit-tab-stops-map>\\[edit-tab-stops-note-changes]"))
   (goto-char (point-min)))
 
@@ -465,4 +468,9 @@
 		    (forward-char -1))
 		  (delete-region (point) before))))))))
 
+;(define-key global-map "\t" 'indent-for-tab-command)
+;(define-key esc-map "\034" 'indent-region)
+;(define-key ctl-x-map "\t" 'indent-rigidly)
+;(define-key esc-map "i" 'tab-to-tab-stop)
+
 ;;; indent.el ends here
--- a/lisp/prim/loaddefs.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/loaddefs.el	Mon Aug 13 09:03:46 2007 +0200
@@ -321,16 +321,18 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "byte-optimize" "bytecomp/byte-optimize.el" (12823 45185))
+
+;;;***
+
+;;;### (autoloads nil "byte-optimize" "bytecomp/byte-optimize.el" (12906 7105))
 ;;; Generated autoloads from bytecomp/byte-optimize.el
 
 ;;;***
 
-;;;### (autoloads nil "bytecomp-runtime" "bytecomp/bytecomp-runtime.el" (12823 45186))
+;;;### (autoloads nil "bytecomp-runtime" "bytecomp/bytecomp-runtime.el" (12906 7112))
 ;;; Generated autoloads from bytecomp/bytecomp-runtime.el
 
-;;;### (autoloads (batch-byte-recompile-directory batch-byte-recompile-directory-norecurse batch-byte-compile display-call-tree byte-compile-sexp byte-compile compile-defun byte-compile-file byte-recompile-file byte-recompile-directory byte-force-recompile) "bytecomp" "bytecomp/bytecomp.el" (12823 45188))
+;;;### (autoloads (batch-byte-recompile-directory batch-byte-recompile-directory-norecurse batch-byte-compile display-call-tree byte-compile-sexp byte-compile compile-defun byte-compile-file byte-recompile-file byte-recompile-directory byte-force-recompile) "bytecomp" "bytecomp/bytecomp.el" (12951 48003))
 ;;; Generated autoloads from bytecomp/bytecomp.el
 
 (autoload 'byte-force-recompile "bytecomp" "\
@@ -410,7 +412,7 @@
 
 ;;;***
 
-;;;### (autoloads (disassemble) "disass" "bytecomp/disass.el" (12147 26365))
+;;;### (autoloads (disassemble) "disass" "bytecomp/disass.el" (12906 7136))
 ;;; Generated autoloads from bytecomp/disass.el
 
 (autoload 'disassemble "disass" "\
@@ -421,19 +423,23 @@
 redefine OBJECT if it is a symbol." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "appt" "calendar/appt.el" (12341 149))
+
+;;;***
+
+;;;### (autoloads nil "appt" "calendar/appt.el" (12885 60822))
 ;;; Generated autoloads from calendar/appt.el
-
-;;;### (autoloads nil "cal-french" "calendar/cal-french.el" (12147 26371))
+
+;;;***
+
+;;;### (autoloads nil "cal-french" "calendar/cal-french.el" (12677 32246))
 ;;; Generated autoloads from calendar/cal-french.el
 
 ;;;***
 
-;;;### (autoloads nil "cal-mayan" "calendar/cal-mayan.el" (12147 26370))
+;;;### (autoloads nil "cal-mayan" "calendar/cal-mayan.el" (12677 32245))
 ;;; Generated autoloads from calendar/cal-mayan.el
 
-;;;### (autoloads nil "cal-x" "calendar/cal-x.el" (12247 39168))
+;;;### (autoloads nil "cal-x" "calendar/cal-x.el" (12677 32264))
 ;;; Generated autoloads from calendar/cal-x.el
 
 (defvar calendar-setup 'one-frame "\
@@ -443,11 +449,22 @@
 frames); with any other value the current frame is used.")
 
 ;;;***
-
-;;;### (autoloads nil "cal-xemacs" "calendar/cal-xemacs.el" (12554 53321))
+
+;;;***
+
+;;;### (autoloads nil "cal-xemacs" "calendar/cal-xemacs.el" (12677 32248))
 ;;; Generated autoloads from calendar/cal-xemacs.el
 
-;;;### (autoloads (list-yahrzeit-dates calendar) "calendar" "calendar/calendar.el" (12823 45189))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (12677 32247))
+;;; Generated autoloads from calendar/cal-dst.el
+
+(put 'calendar-daylight-savings-starts 'risky-local-variable t)
+
+(put 'calendar-daylight-savings-ends 'risky-local-variable t)
+
+;;;***
+
+;;;### (autoloads (list-yahrzeit-dates calendar) "calendar" "calendar/calendar.el" (12807 53888))
 ;;; Generated autoloads from calendar/calendar.el
 
 (defvar calendar-week-start-day 0 "\
@@ -915,20 +932,13 @@
 from the cursor position." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (12147 26371))
-;;; Generated autoloads from calendar/cal-dst.el
-
-(put 'calendar-daylight-savings-starts 'risky-local-variable t)
-
-(put 'calendar-daylight-savings-ends 'risky-local-variable t)
-
-;;;***
-
-;;;### (autoloads nil "diary-ins" "calendar/diary-ins.el" (12147 26375))
+
+;;;***
+
+;;;### (autoloads nil "diary-ins" "calendar/diary-ins.el" (12677 32248))
 ;;; Generated autoloads from calendar/diary-ins.el
 
-;;;### (autoloads (diary) "diary-lib" "calendar/diary-lib.el" (12147 26376))
+;;;### (autoloads (diary) "diary-lib" "calendar/diary-lib.el" (12677 32264))
 ;;; Generated autoloads from calendar/diary-lib.el
 
 (autoload 'diary "diary-lib" "\
@@ -939,7 +949,7 @@
 
 ;;;***
 
-;;;### (autoloads (holidays) "holidays" "calendar/holidays.el" (12247 8260))
+;;;### (autoloads (holidays) "holidays" "calendar/holidays.el" (12677 32247))
 ;;; Generated autoloads from calendar/holidays.el
 
 (autoload 'holidays "holidays" "\
@@ -950,7 +960,7 @@
 
 ;;;***
 
-;;;### (autoloads (phases-of-moon) "lunar" "calendar/lunar.el" (12147 26373))
+;;;### (autoloads (phases-of-moon) "lunar" "calendar/lunar.el" (12677 32247))
 ;;; Generated autoloads from calendar/lunar.el
 
 (autoload 'phases-of-moon "lunar" "\
@@ -961,7 +971,7 @@
 
 ;;;***
 
-;;;### (autoloads (solar-equinoxes-solstices sunrise-sunset) "solar" "calendar/solar.el" (12147 26373))
+;;;### (autoloads (solar-equinoxes-solstices sunrise-sunset) "solar" "calendar/solar.el" (12677 32248))
 ;;; Generated autoloads from calendar/solar.el
 
 (defvar calendar-time-display-form '(12-hours ":" minutes am-pm (if time-zone " (") time-zone (if time-zone ")")) "\
@@ -1021,48 +1031,52 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "cl-autoload" "cl/cl-autoload.el" (12860 15636))
+
+;;;***
+
+;;;### (autoloads nil "cl-autoload" "cl/cl-autoload.el" (12885 62686))
 ;;; Generated autoloads from cl/cl-autoload.el
 
 ;;;***
 
-;;;### (autoloads nil "cl-compat" "cl/cl-compat.el" (12860 15631))
+;;;### (autoloads nil "cl-compat" "cl/cl-compat.el" (12885 62681))
 ;;; Generated autoloads from cl/cl-compat.el
-
-;;;### (autoloads nil "cl-defs" "cl/cl-defs.el" (12638 48659))
+
+;;;***
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "cl-defs" "cl/cl-defs.el" (12677 33123))
 ;;; Generated autoloads from cl/cl-defs.el
 
 ;;;***
-
-;;;***
-
-;;;***
-
-;;;### (autoloads nil "cl-extra" "cl/cl-extra.el" (12860 15632))
+
+;;;### (autoloads nil "cl-extra" "cl/cl-extra.el" (12885 62682))
 ;;; Generated autoloads from cl/cl-extra.el
 
 ;;;***
 
-;;;### (autoloads nil "cl-macs" "cl/cl-macs.el" (12860 15634))
+;;;### (autoloads nil "cl-macs" "cl/cl-macs.el" (12885 62683))
 ;;; Generated autoloads from cl/cl-macs.el
 
 ;;;***
 
-;;;### (autoloads nil "cl-seq" "cl/cl-seq.el" (12860 15635))
+;;;### (autoloads nil "cl-seq" "cl/cl-seq.el" (12885 62684))
 ;;; Generated autoloads from cl/cl-seq.el
 
 ;;;***
 
-;;;### (autoloads nil "cl" "cl/cl.el" (12860 15636))
+;;;### (autoloads nil "cl" "cl/cl.el" (12885 62685))
 ;;; Generated autoloads from cl/cl.el
-
-;;;### (autoloads nil "background" "comint/background.el" (12675 57052))
+
+;;;***
+
+;;;### (autoloads nil "background" "comint/background.el" (12967 52231))
 ;;; Generated autoloads from comint/background.el
-
-;;;***
-
-;;;### (autoloads (comint-dynamic-list-completions comint-dynamic-complete comint-run make-comint) "comint" "comint/comint.el" (12860 15481))
+
+;;;### (autoloads (comint-dynamic-list-completions comint-dynamic-complete comint-run make-comint) "comint" "comint/comint.el" (12933 37611))
 ;;; Generated autoloads from comint/comint.el
 
 (autoload 'make-comint "comint" "\
@@ -1094,11 +1108,13 @@
 Typing SPC flushes the help buffer." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "dbx" "comint/dbx.el" (12178 29434))
+
+;;;***
+
+;;;### (autoloads nil "dbx" "comint/dbx.el" (12967 52269))
 ;;; Generated autoloads from comint/dbx.el
 
-;;;### (autoloads (gdb) "gdb" "comint/gdb.el" (12727 30106))
+;;;### (autoloads (gdb) "gdb" "comint/gdb.el" (12967 52297))
 ;;; Generated autoloads from comint/gdb.el
 
 (defvar gdb-command-name "gdb" "\
@@ -1112,7 +1128,7 @@
 
 ;;;***
 
-;;;### (autoloads (gdbsrc) "gdbsrc" "comint/gdbsrc.el" (12743 11618))
+;;;### (autoloads (gdbsrc) "gdbsrc" "comint/gdbsrc.el" (12906 7187))
 ;;; Generated autoloads from comint/gdbsrc.el
 
 (autoload 'gdbsrc "gdbsrc" "\
@@ -1122,7 +1138,7 @@
 
 ;;;***
 
-;;;### (autoloads (perldb xdb dbx sdb) "gud" "comint/gud.el" (12823 45194))
+;;;### (autoloads (perldb xdb dbx sdb) "gud" "comint/gud.el" (12906 7199))
 ;;; Generated autoloads from comint/gud.el
 
 (autoload 'sdb "gud" "\
@@ -1149,11 +1165,15 @@
 and source-file directory for your debugger." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "history" "comint/history.el" (12178 29436))
+
+;;;***
+
+;;;### (autoloads nil "history" "comint/history.el" (12967 52355))
 ;;; Generated autoloads from comint/history.el
-
-;;;### (autoloads nil "inf-lisp" "comint/inf-lisp.el" (12546 37582))
+
+;;;***
+
+;;;### (autoloads nil "inf-lisp" "comint/inf-lisp.el" (12906 7214))
 ;;; Generated autoloads from comint/inf-lisp.el
 
 (add-hook 'same-window-buffer-names "*inferior-lisp*")
@@ -1162,10 +1182,10 @@
 
 ;;;***
 
-;;;### (autoloads nil "kermit" "comint/kermit.el" (12823 45193))
+;;;### (autoloads nil "kermit" "comint/kermit.el" (12906 7221))
 ;;; Generated autoloads from comint/kermit.el
 
-;;;### (autoloads (rlogin) "rlogin" "comint/rlogin.el" (12282 38441))
+;;;### (autoloads (rlogin) "rlogin" "comint/rlogin.el" (12677 32275))
 ;;; Generated autoloads from comint/rlogin.el
 
 (add-hook 'same-window-regexps "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)")
@@ -1206,7 +1226,7 @@
 
 ;;;***
 
-;;;### (autoloads (shell) "shell" "comint/shell.el" (12554 53325))
+;;;### (autoloads (shell) "shell" "comint/shell.el" (12906 7232))
 ;;; Generated autoloads from comint/shell.el
 
 (defvar shell-prompt-pattern (purecopy "^[^#$%>\n]*[#$%>] *") "\
@@ -1247,7 +1267,7 @@
 
 ;;;***
 
-;;;### (autoloads (rsh telnet) "telnet" "comint/telnet.el" (12546 37583))
+;;;### (autoloads (rsh telnet) "telnet" "comint/telnet.el" (12906 7239))
 ;;; Generated autoloads from comint/telnet.el
 
 (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)")
@@ -1269,7 +1289,7 @@
 
 ;;;***
 
-;;;### (autoloads (ange-ftp-hook-function) "ange-ftp" "dired/ange-ftp.el" (12823 45197))
+;;;### (autoloads (ange-ftp-hook-function) "ange-ftp" "dired/ange-ftp.el" (12906 7264))
 ;;; Generated autoloads from dired/ange-ftp.el
 
 (defvar ange-ftp-path-format '("^/\\(\\([^@/:]*\\)@\\)?\\([^@/:]*\\):\\(.*\\)" 3 2 4) "\
@@ -1283,13 +1303,13 @@
 (or (assoc (car ange-ftp-path-format) file-name-handler-alist) (setq file-name-handler-alist (cons (cons (car ange-ftp-path-format) 'ange-ftp-hook-function) file-name-handler-alist)))
 
 ;;;***
-
-;;;### (autoloads nil "dired-cd" "dired/dired-cd.el" (11903 15627))
+
+;;;***
+
+;;;### (autoloads nil "dired-cd" "dired/dired-cd.el" (12906 7271))
 ;;; Generated autoloads from dired/dired-cd.el
-
-;;;***
-
-;;;### (autoloads (dired-make-permissions-interactive) "dired-chmod" "dired/dired-chmod.el" (12860 15485))
+
+;;;### (autoloads (dired-make-permissions-interactive) "dired-chmod" "dired/dired-chmod.el" (12906 7278))
 ;;; Generated autoloads from dired/dired-chmod.el
 
 (autoload 'dired-make-permissions-interactive "dired-chmod" nil nil nil)
@@ -1297,40 +1317,143 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "dired-guess" "dired/dired-guess.el" (11903 15633))
+
+;;;***
+
+;;;### (autoloads nil "dired-guess" "dired/dired-guess.el" (12906 7291))
 ;;; Generated autoloads from dired/dired-guess.el
-
-;;;### (autoloads nil "dired-link" "dired/dired-link.el" (12294 55504))
+
+;;;***
+
+;;;### (autoloads nil "dired-link" "dired/dired-link.el" (12677 32276))
 ;;; Generated autoloads from dired/dired-link.el
-
-;;;### (autoloads nil "dired-lisp" "dired/dired-lisp.el" (11903 15631))
+
+;;;***
+
+;;;### (autoloads nil "dired-lisp" "dired/dired-lisp.el" (12906 7298))
 ;;; Generated autoloads from dired/dired-lisp.el
 
 ;;;***
 
-;;;### (autoloads nil "dired-nstd" "dired/dired-nstd.el" (11903 15632))
+;;;### (autoloads nil "dired-nstd" "dired/dired-nstd.el" (12906 7306))
 ;;; Generated autoloads from dired/dired-nstd.el
 
 ;;;***
 
-;;;### (autoloads nil "dired-trns" "dired/dired-trns.el" (11903 15635))
+;;;### (autoloads nil "dired-trns" "dired/dired-trns.el" (12677 32282))
 ;;; Generated autoloads from dired/dired-trns.el
 
 ;;;***
 
-;;;### (autoloads nil "dired-vms" "dired/dired-vms.el" (12147 26387))
+;;;### (autoloads nil "dired-vms" "dired/dired-vms.el" (12906 7327))
 ;;; Generated autoloads from dired/dired-vms.el
 
 ;;;***
 
-;;;### (autoloads nil "dired-xemacs-highlight" "dired/dired-xemacs-highlight.el" (12745 48557))
+;;;### (autoloads nil "dired-xemacs-highlight" "dired/dired-xemacs-highlight.el" (12906 7344))
 ;;; Generated autoloads from dired/dired-xemacs-highlight.el
 
-;;;### (autoloads nil "dired-xemacs-menu" "dired/dired-xemacs-menu.el" (12322 9364))
+;;;### (autoloads (dired-cwd-make-magic) "dired-cwd" "dired/dired-cwd.el" (12906 7285))
+;;; Generated autoloads from dired/dired-cwd.el
+
+(autoload 'dired-cwd-make-magic "dired-cwd" "\
+Modify COMMAND so that it's working directory is the current dired directory.
+This works by binding `default-directory' to `(default-directory)'s value.
+See also function `default-directory'." t nil)
+
+;;;***
+
+;;;### (autoloads (dired-do-rename-list dired-do-rename-numeric) "dired-num" "dired/dired-num.el" (12906 7312))
+;;; Generated autoloads from dired/dired-num.el
+
+(autoload 'dired-do-rename-numeric "dired-num" "\
+Rename all marked (or next ARG) files using numbers.
+You are prompted for a format string, e.g \"part_%d_of_8\", and a starting
+number, e.g. 1.  If there are 8 marked files, this example will rename them to
+
+    part_1_of_8
+    part_2_of_8
+    ...
+    part_8_of_8" t nil)
+
+(autoload 'dired-do-rename-list "dired-num" "\
+Rename all marked (or next ARG) files using elements from LIST.
+You are prompted for a format string, e.g \"x_%s\", and the list,
+e.g. '(foo bar zod).  This example will rename the marked files to
+
+    x_foo
+    x_bar
+    x_zod
+
+It is an error if LIST has not as many elements as there are files." t nil)
+
+;;;***
+
+;;;### (autoloads (dired-rcs-mark-rcs-files dired-rcs-mark-rcs-locked-files) "dired-rcs" "dired/dired-rcs.el" (12906 7318))
+;;; Generated autoloads from dired/dired-rcs.el
+
+(autoload 'dired-rcs-mark-rcs-locked-files "dired-rcs" "\
+Mark all files that are under RCS control and RCS-locked.
+With prefix argument, unflag all those files.
+Mentions RCS files for which a working file was not found in this buffer.
+Type \\[dired-why] to see them again." t nil)
+
+(autoload 'dired-rcs-mark-rcs-files "dired-rcs" "\
+Mark all files that are under RCS control.
+With prefix argument, unflag all those files.
+Mentions RCS files for which a working file was not found in this buffer.
+Type \\[dired-why] to see them again." t nil)
+
+;;;***
+
+;;;### (autoloads (dired-extra-startup) "dired-x" "dired/dired-x.el" (12906 7337))
+;;; Generated autoloads from dired/dired-x.el
+
+(autoload 'dired-extra-startup "dired-x" "\
+Automatically put on dired-mode-hook to get extra dired features:
+\\<dired-mode-map>
+  \\[dired-vm]	-- VM on folder
+  \\[dired-rmail]	-- Rmail on folder
+  \\[dired-do-insert-subdir]	-- insert all marked subdirs
+  \\[dired-do-find-file]	-- visit all marked files simultaneously
+  \\[dired-set-marker-char], \\[dired-restore-marker-char]	-- change and display dired-marker-char dynamically.
+  \\[dired-omit-toggle]	-- toggle omitting of files
+  \\[dired-mark-sexp]	-- mark by lisp expression
+  \\[dired-do-unmark]	-- replace existing marker with another.
+  \\[dired-mark-rcs-files]	-- mark all RCS controlled files
+  \\[dired-mark-files-compilation-buffer]	-- mark compilation files
+  \\[dired-copy-filename-as-kill]	-- copy the file or subdir names into the kill ring.
+  	   You can feed it to other commands using \\[yank].
+
+For more features, see variables
+
+  dired-omit-files
+  dired-omit-extenstions
+  dired-dangerous-shell-command
+  dired-mark-keys
+  dired-local-variables-file
+  dired-find-subdir
+  dired-guess-have-gnutar
+  dired-auto-shell-command-alist
+
+See also functions
+
+  dired-sort-on-size
+  dired-do-relsymlink
+  dired-flag-extension
+  dired-virtual
+  dired-jump-back
+  dired-jump-back-other-window
+" t nil)
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "dired-xemacs-menu" "dired/dired-xemacs-menu.el" (12906 7351))
 ;;; Generated autoloads from dired/dired-xemacs-menu.el
 
-;;;### (autoloads (dired-noselect dired-other-frame dired-other-window dired) "dired" "dired/dired.el" (12958 21743))
+;;;### (autoloads (dired-noselect dired-other-frame dired-other-window dired) "dired" "dired/dired.el" (12958 28079))
 ;;; Generated autoloads from dired/dired.el
 
 (defvar dired-listing-switches (purecopy "-al") "\
@@ -1418,102 +1541,7 @@
 
 ;;;***
 
-;;;### (autoloads (dired-cwd-make-magic) "dired-cwd" "dired/dired-cwd.el" (11903 15632))
-;;; Generated autoloads from dired/dired-cwd.el
-
-(autoload 'dired-cwd-make-magic "dired-cwd" "\
-Modify COMMAND so that it's working directory is the current dired directory.
-This works by binding `default-directory' to `(default-directory)'s value.
-See also function `default-directory'." t nil)
-
-;;;***
-
-;;;### (autoloads (dired-do-rename-list dired-do-rename-numeric) "dired-num" "dired/dired-num.el" (12013 11569))
-;;; Generated autoloads from dired/dired-num.el
-
-(autoload 'dired-do-rename-numeric "dired-num" "\
-Rename all marked (or next ARG) files using numbers.
-You are prompted for a format string, e.g \"part_%d_of_8\", and a starting
-number, e.g. 1.  If there are 8 marked files, this example will rename them to
-
-    part_1_of_8
-    part_2_of_8
-    ...
-    part_8_of_8" t nil)
-
-(autoload 'dired-do-rename-list "dired-num" "\
-Rename all marked (or next ARG) files using elements from LIST.
-You are prompted for a format string, e.g \"x_%s\", and the list,
-e.g. '(foo bar zod).  This example will rename the marked files to
-
-    x_foo
-    x_bar
-    x_zod
-
-It is an error if LIST has not as many elements as there are files." t nil)
-
-;;;***
-
-;;;### (autoloads (dired-rcs-mark-rcs-files dired-rcs-mark-rcs-locked-files) "dired-rcs" "dired/dired-rcs.el" (12013 11570))
-;;; Generated autoloads from dired/dired-rcs.el
-
-(autoload 'dired-rcs-mark-rcs-locked-files "dired-rcs" "\
-Mark all files that are under RCS control and RCS-locked.
-With prefix argument, unflag all those files.
-Mentions RCS files for which a working file was not found in this buffer.
-Type \\[dired-why] to see them again." t nil)
-
-(autoload 'dired-rcs-mark-rcs-files "dired-rcs" "\
-Mark all files that are under RCS control.
-With prefix argument, unflag all those files.
-Mentions RCS files for which a working file was not found in this buffer.
-Type \\[dired-why] to see them again." t nil)
-
-;;;***
-
-;;;### (autoloads (dired-extra-startup) "dired-x" "dired/dired-x.el" (12823 45197))
-;;; Generated autoloads from dired/dired-x.el
-
-(autoload 'dired-extra-startup "dired-x" "\
-Automatically put on dired-mode-hook to get extra dired features:
-\\<dired-mode-map>
-  \\[dired-vm]	-- VM on folder
-  \\[dired-rmail]	-- Rmail on folder
-  \\[dired-do-insert-subdir]	-- insert all marked subdirs
-  \\[dired-do-find-file]	-- visit all marked files simultaneously
-  \\[dired-set-marker-char], \\[dired-restore-marker-char]	-- change and display dired-marker-char dynamically.
-  \\[dired-omit-toggle]	-- toggle omitting of files
-  \\[dired-mark-sexp]	-- mark by lisp expression
-  \\[dired-do-unmark]	-- replace existing marker with another.
-  \\[dired-mark-rcs-files]	-- mark all RCS controlled files
-  \\[dired-mark-files-compilation-buffer]	-- mark compilation files
-  \\[dired-copy-filename-as-kill]	-- copy the file or subdir names into the kill ring.
-  	   You can feed it to other commands using \\[yank].
-
-For more features, see variables
-
-  dired-omit-files
-  dired-omit-extenstions
-  dired-dangerous-shell-command
-  dired-mark-keys
-  dired-local-variables-file
-  dired-find-subdir
-  dired-guess-have-gnutar
-  dired-auto-shell-command-alist
-
-See also functions
-
-  dired-sort-on-size
-  dired-do-relsymlink
-  dired-flag-extension
-  dired-virtual
-  dired-jump-back
-  dired-jump-back-other-window
-" t nil)
-
-;;;***
-
-;;;### (autoloads (find-grep-dired find-name-dired find-dired) "find-dired" "dired/find-dired.el" (12675 57053))
+;;;### (autoloads (find-grep-dired find-name-dired find-dired) "find-dired" "dired/find-dired.el" (12906 7375))
 ;;; Generated autoloads from dired/find-dired.el
 
 (defvar find-ls-option (purecopy (if (eq system-type 'berkeley-unix) '("-ls" . "-gilsb") '("-exec ls -ld {} \\;" . "-ld"))) "\
@@ -1553,53 +1581,60 @@
 Thus ARG can also contain additional grep options." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "gmhist-app" "dired/gmhist-app.el" (11903 15638))
+
+;;;***
+
+;;;### (autoloads nil "gmhist-app" "dired/gmhist-app.el" (12677 32288))
 ;;; Generated autoloads from dired/gmhist-app.el
 
 ;;;***
 
-;;;### (autoloads nil "gmhist-cmp" "dired/gmhist-cmp.el" (11903 15639))
+;;;### (autoloads nil "gmhist-cmp" "dired/gmhist-cmp.el" (12677 32288))
 ;;; Generated autoloads from dired/gmhist-cmp.el
 
 ;;;***
 
-;;;### (autoloads nil "gmhist-mh" "dired/gmhist-mh.el" (11903 15640))
+;;;### (autoloads nil "gmhist-mh" "dired/gmhist-mh.el" (12677 32288))
 ;;; Generated autoloads from dired/gmhist-mh.el
 
 ;;;***
 
-;;;### (autoloads nil "gmhist" "dired/gmhist.el" (12637 31043))
+;;;### (autoloads nil "gmhist" "dired/gmhist.el" (12906 7385))
 ;;; Generated autoloads from dired/gmhist.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "cl-read" "edebug/cl-read.el" (12823 45305))
+;;;### (autoloads nil "advise-eval-region" "edebug/advise-eval-region.el" (12864 30312))
+;;; Generated autoloads from edebug/advise-eval-region.el
+
+;;;***
+
+;;;### (autoloads nil "cl-read" "edebug/cl-read.el" (12966 27317))
 ;;; Generated autoloads from edebug/cl-read.el
-
-;;;### (autoloads nil "cl-specs" "edebug/cl-specs.el" (12546 50525))
+
+;;;***
+
+;;;### (autoloads nil "cl-specs" "edebug/cl-specs.el" (12966 27317))
 ;;; Generated autoloads from edebug/cl-specs.el
 
 ;;;***
 
-;;;### (autoloads nil "cust-print" "edebug/cust-print.el" (12546 50527))
+;;;### (autoloads nil "cust-print" "edebug/cust-print.el" (12966 27317))
 ;;; Generated autoloads from edebug/cust-print.el
 
 ;;;***
 
-;;;### (autoloads nil "edebug-cl-read" "edebug/edebug-cl-read.el" (12546 50528))
+;;;### (autoloads nil "edebug-cl-read" "edebug/edebug-cl-read.el" (12966 27317))
 ;;; Generated autoloads from edebug/edebug-cl-read.el
 
 ;;;***
 
-;;;### (autoloads nil "edebug-test" "edebug/edebug-test.el" (12546 50557))
+;;;### (autoloads nil "edebug-test" "edebug/edebug-test.el" (12677 32741))
 ;;; Generated autoloads from edebug/edebug-test.el
-
-;;;***
-
-;;;### (autoloads (edebug-eval-top-level-form def-edebug-spec) "edebug" "edebug/edebug.el" (12637 28000))
+
+;;;### (autoloads (edebug-eval-top-level-form def-edebug-spec) "edebug" "edebug/edebug.el" (12966 27317))
 ;;; Generated autoloads from edebug/edebug.el
 
 (autoload 'def-edebug-spec "edebug" "\
@@ -1616,27 +1651,31 @@
 or if an error occurs, leave point after it with mark at the original point." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "eval-reg" "edebug/eval-reg.el" (12546 50557))
+
+;;;***
+
+;;;### (autoloads nil "eval-reg" "edebug/eval-reg.el" (12966 27317))
 ;;; Generated autoloads from edebug/eval-reg.el
 
 ;;;***
 
-;;;### (autoloads nil "ediff-diff" "ediff/ediff-diff.el" (12747 30850))
+;;;### (autoloads nil "ediff-diff" "ediff/ediff-diff.el" (12748 62877))
 ;;; Generated autoloads from ediff/ediff-diff.el
-
-;;;### (autoloads nil "ediff-hook" "ediff/ediff-hook.el" (12675 57178))
+
+;;;***
+
+;;;### (autoloads nil "ediff-hook" "ediff/ediff-hook.el" (12869 1578))
 ;;; Generated autoloads from ediff/ediff-hook.el
-
-;;;### (autoloads nil "ediff-init" "ediff/ediff-init.el" (12675 57168))
+
+;;;***
+
+;;;### (autoloads nil "ediff-init" "ediff/ediff-init.el" (12677 32877))
 ;;; Generated autoloads from ediff/ediff-init.el
 
 ;;;***
 
-;;;### (autoloads nil "ediff-merg" "ediff/ediff-merg.el" (12675 57169))
+;;;### (autoloads nil "ediff-merg" "ediff/ediff-merg.el" (12677 32877))
 ;;; Generated autoloads from ediff/ediff-merg.el
-
-;;;***
 
 ;;;### (autoloads (ediff-show-registry) "ediff-mult" "ediff/ediff-mult.el" (12823 45330))
 ;;; Generated autoloads from ediff/ediff-mult.el
@@ -1647,26 +1686,186 @@
 (defalias 'eregistry 'ediff-show-registry)
 
 ;;;***
-
-;;;### (autoloads nil "ediff-ptch" "ediff/ediff-ptch.el" (12639 8398))
+
+;;;***
+
+;;;### (autoloads nil "ediff-ptch" "ediff/ediff-ptch.el" (12677 32896))
 ;;; Generated autoloads from ediff/ediff-ptch.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "ediff-util" "ediff/ediff-util.el" (12823 45327))
+;;;### (autoloads nil "ediff-util" "ediff/ediff-util.el" (12880 32735))
 ;;; Generated autoloads from ediff/ediff-util.el
-
-;;;### (autoloads nil "ediff-vers" "ediff/ediff-vers.el" (12675 57179))
+
+;;;***
+
+;;;### (autoloads nil "ediff-vers" "ediff/ediff-vers.el" (12677 32896))
 ;;; Generated autoloads from ediff/ediff-vers.el
 
 ;;;***
 
-;;;### (autoloads nil "ediff-wind" "ediff/ediff-wind.el" (12823 45327))
+;;;### (autoloads nil "ediff-wind" "ediff/ediff-wind.el" (12880 32736))
 ;;; Generated autoloads from ediff/ediff-wind.el
 
-;;;### (autoloads (electric-buffer-list) "ebuff-menu" "electric/ebuff-menu.el" (12695 11397))
+;;;### (autoloads (ediff-documentation ediff-version ediff-revision ediff-patch-buffer ediff-patch-file run-ediff-from-cvs-buffer ediff-merge-revisions-with-ancestor ediff-merge-revisions ediff-merge-buffers-with-ancestor ediff-merge-buffers ediff-merge-files-with-ancestor ediff-merge-files ediff-regions-linewise ediff-regions-wordwise ediff-windows-linewise ediff-windows-wordwise ediff-merge-directory-revisions-with-ancestor ediff-merge-directory-revisions ediff-merge-directories-with-ancestor ediff-merge-directories ediff-directories3 ediff-directory-revisions ediff-directories ediff-buffers3 ediff-buffers ediff-files3 ediff-files) "ediff" "ediff/ediff.el" (12807 57988))
+;;; Generated autoloads from ediff/ediff.el
+
+(autoload 'ediff-files "ediff" "\
+Run Ediff on a pair of files, FILE-A and FILE-B." t nil)
+
+(autoload 'ediff-files3 "ediff" "\
+Run Ediff on three files, FILE-A, FILE-B, and FILE-C." t nil)
+
+(defalias 'ediff3 'ediff-files3)
+
+(defalias 'ediff 'ediff-files)
+
+(autoload 'ediff-buffers "ediff" "\
+Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B." t nil)
+
+(defalias 'ebuffers 'ediff-buffers)
+
+(autoload 'ediff-buffers3 "ediff" "\
+Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C." t nil)
+
+(defalias 'ebuffers3 'ediff-buffers3)
+
+(autoload 'ediff-directories "ediff" "\
+Run Ediff on a pair of directories, DIR1 and DIR2, comparing files that have
+the same name in both. The third argument, REGEXP, is a regular expression that
+can be used to filter out certain file names." t nil)
+
+(defalias 'edirs 'ediff-directories)
+
+(autoload 'ediff-directory-revisions "ediff" "\
+Run Ediff on a directory, DIR1, comparing its files with their revisions.
+The second argument, REGEXP, is a regular expression that filters the file
+names. Only the files that are under revision control are taken into account." t nil)
+
+(defalias 'edir-revisions 'ediff-directory-revisions)
+
+(autoload 'ediff-directories3 "ediff" "\
+Run Ediff on three directories, DIR1, DIR2, and DIR3, comparing files that
+have the same name in all three. The last argument, REGEXP, is a regular
+expression that can be used to filter out certain file names." t nil)
+
+(defalias 'edirs3 'ediff-directories3)
+
+(autoload 'ediff-merge-directories "ediff" "\
+Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have
+the same name in both. The third argument, REGEXP, is a regular expression that
+can be used to filter out certain file names." t nil)
+
+(defalias 'edirs-merge 'ediff-merge-directories)
+
+(autoload 'ediff-merge-directories-with-ancestor "ediff" "\
+Merge files in directories DIR1 and DIR2 using files in ANCESTOR-DIR as ancestors.
+Ediff merges files that have identical names in DIR1, DIR2. If a pair of files
+in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge
+without ancestor. The fourth argument, REGEXP, is a regular expression that
+can be used to filter out certain file names." t nil)
+
+(autoload 'ediff-merge-directory-revisions "ediff" "\
+Run Ediff on a directory, DIR1, merging its files with their revisions.
+The second argument, REGEXP, is a regular expression that filters the file
+names. Only the files that are under revision control are taken into account." t nil)
+
+(defalias 'edir-merge-revisions 'ediff-merge-directory-revisions)
+
+(autoload 'ediff-merge-directory-revisions-with-ancestor "ediff" "\
+Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors.
+The second argument, REGEXP, is a regular expression that filters the file
+names. Only the files that are under revision control are taken into account." t nil)
+
+(defalias 'edir-merge-revisions-with-ancestor 'ediff-merge-directory-revisions-with-ancestor)
+
+(defalias 'edirs-merge-with-ancestor 'ediff-merge-directories-with-ancestor)
+
+(autoload 'ediff-windows-wordwise "ediff" "\
+Compare WIND-A and WIND-B, which are selected by clicking, wordwise.
+With prefix argument, DUMB-MODE, or on a non-windowing display, works as
+follows:
+If WIND-A is nil, use selected window.
+If WIND-B is nil, use window next to WIND-A." t nil)
+
+(autoload 'ediff-windows-linewise "ediff" "\
+Compare WIND-A and WIND-B, which are selected by clicking, linewise.
+With prefix argument, DUMB-MODE, or on a non-windowing display, works as
+follows:
+If WIND-A is nil, use selected window.
+If WIND-B is nil, use window next to WIND-A." t nil)
+
+(autoload 'ediff-regions-wordwise "ediff" "\
+Run Ediff on a pair of regions in two different buffers.
+Regions (i.e., point and mark) are assumed to be set in advance.
+This function is effective only for relatively small regions, up to 200
+lines. For large regions, use `ediff-regions-linewise'." t nil)
+
+(autoload 'ediff-regions-linewise "ediff" "\
+Run Ediff on a pair of regions in two different buffers.
+Regions (i.e., point and mark) are assumed to be set in advance.
+Each region is enlarged to contain full lines.
+This function is effective for large regions, over 100-200
+lines. For small regions, use `ediff-regions-wordwise'." t nil)
+
+(defalias 'ediff-merge 'ediff-merge-files)
+
+(autoload 'ediff-merge-files "ediff" "\
+Merge two files without ancestor." t nil)
+
+(autoload 'ediff-merge-files-with-ancestor "ediff" "\
+Merge two files with ancestor." t nil)
+
+(defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor)
+
+(autoload 'ediff-merge-buffers "ediff" "\
+Merge buffers without ancestor." t nil)
+
+(autoload 'ediff-merge-buffers-with-ancestor "ediff" "\
+Merge buffers with ancestor." t nil)
+
+(autoload 'ediff-merge-revisions "ediff" "\
+Run Ediff by merging two revisions of a file.
+The file is the optional FILE argument or the file visited by the current
+buffer." t nil)
+
+(autoload 'ediff-merge-revisions-with-ancestor "ediff" "\
+Run Ediff by merging two revisions of a file with a common ancestor.
+The file is the optional FILE argument or the file visited by the current
+buffer." t nil)
+
+(autoload 'run-ediff-from-cvs-buffer "ediff" "\
+Run Ediff-merge on appropriate revisions of the selected file.
+First run after `M-x cvs-update'. Then place the cursor on a lide describing a
+file and then run `run-ediff-from-cvs-buffer'." t nil)
+
+(autoload 'ediff-patch-file "ediff" "\
+Run Ediff by patching SOURCE-FILENAME." t nil)
+
+(autoload 'ediff-patch-buffer "ediff" "\
+Run Ediff by patching BUFFER-NAME." t nil)
+
+(defalias 'epatch 'ediff-patch-file)
+
+(defalias 'epatch-buffer 'ediff-patch-buffer)
+
+(autoload 'ediff-revision "ediff" "\
+Run Ediff by comparing versions of a file.
+The file is an optional FILE argument or the file visited by the current
+buffer. Use `vc.el' or `rcs.el' depending on `ediff-version-control-package'." t nil)
+
+(autoload 'ediff-version "ediff" "\
+Return string describing the version of Ediff.
+When called interactively, displays the version." t nil)
+
+(autoload 'ediff-documentation "ediff" "\
+Display Ediff's manual." t nil)
+
+;;;***
+
+;;;### (autoloads (electric-buffer-list) "ebuff-menu" "electric/ebuff-menu.el" (12966 28262))
 ;;; Generated autoloads from electric/ebuff-menu.el
 
 (autoload 'electric-buffer-list "ebuff-menu" "\
@@ -1675,31 +1874,25 @@
 listing with menuoid buffer selection.
 
 If the very next character typed is a space then the buffer list
-window disappears.  Otherwise, one may move around in the
-buffer list window, marking buffers to be selected, saved or deleted.
-
-To exit and select a new buffer, type a space when the cursor is on the
-appropriate line of the buffer-list window.
-
-Other commands are much like those of buffer-menu-mode.
+window disappears.  Otherwise, one may move around in the buffer list
+window, marking buffers to be selected, saved or deleted.
+
+To exit and select a new buffer, type a space when the cursor is on
+the appropriate line of the buffer-list window.  Other commands are
+much like those of buffer-menu-mode.
 
 Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil.
 
-Non-null optional arg FILES-ONLY means mention only file buffers.
-When called from Lisp code, FILES-ONLY may be a regular expression,
-in which case only buffers whose names match that expression are listed,
-or an arbitrary predicate function.
-
 \\{electric-buffer-menu-mode-map}" t nil)
 
 ;;;***
 
-;;;### (autoloads (electric-command-history Electric-command-history-redo-expression) "echistory" "electric/echistory.el" (12657 12773))
+;;;### (autoloads (electric-command-history Electric-command-history-redo-expression) "echistory" "electric/echistory.el" (12966 28262))
 ;;; Generated autoloads from electric/echistory.el
 
 (autoload 'Electric-command-history-redo-expression "echistory" "\
 Edit current history line in minibuffer and execute result.
-With prefix argument NOCONFIRM, execute current line as-is without editing." t nil)
+With prefix arg NOCONFIRM, execute current line as-is without editing." t nil)
 
 (autoload 'electric-command-history "echistory" "\
 \\<electric-history-map>Major mode for examining and redoing commands from `command-history'.
@@ -1711,12 +1904,6 @@
 
 The history displayed is filtered by `list-command-history-filter' if non-nil.
 
-This pops up a window with the Command History listing.  If the very
-next character typed is Space, the listing is killed and the previous
-window configuration is restored.  Otherwise, you can browse in the
-Command History with  Return  moving down and  Delete  moving up, possibly
-selecting an expression to be redone with Space or quitting with `Q'.
-
 Like Emacs-Lisp mode except that characters do not insert themselves and
 Tab and Linefeed do not indent.  Instead these commands are provided:
 \\{electric-history-map}
@@ -1726,7 +1913,7 @@
 
 ;;;***
 
-;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "electric/ehelp.el" (12657 13467))
+;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "electric/ehelp.el" (12966 28262))
 ;;; Generated autoloads from electric/ehelp.el
 
 (autoload 'with-electric-help "ehelp" "\
@@ -1757,11 +1944,13 @@
 (autoload 'electric-helpify "ehelp" nil nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "electric" "electric/electric.el" (12657 12771))
+
+;;;***
+
+;;;### (autoloads nil "electric" "electric/electric.el" (12966 28262))
 ;;; Generated autoloads from electric/electric.el
 
-;;;### (autoloads (Helper-help Helper-describe-bindings) "helper" "electric/helper.el" (12657 12774))
+;;;### (autoloads (Helper-help Helper-describe-bindings) "helper" "electric/helper.el" (12966 28263))
 ;;; Generated autoloads from electric/helper.el
 
 (autoload 'Helper-describe-bindings "helper" "\
@@ -1771,44 +1960,73 @@
 Provide help for current mode." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "edt" "emulators/edt.el" (12147 26395))
+
+;;;***
+
+;;;### (autoloads nil "crisp" "emulators/crisp.el" (12967 874))
+;;; Generated autoloads from emulators/crisp.el
+
+;;;***
+
+;;;### (autoloads nil "edt-lk201" "emulators/edt-lk201.el" (12864 33439))
+;;; Generated autoloads from emulators/edt-lk201.el
+
+;;;***
+
+;;;### (autoloads nil "edt-mapper" "emulators/edt-mapper.el" (12864 32718))
+;;; Generated autoloads from emulators/edt-mapper.el
+
+;;;***
+
+;;;### (autoloads nil "edt-pc" "emulators/edt-pc.el" (12864 33459))
+;;; Generated autoloads from emulators/edt-pc.el
+
+;;;***
+
+;;;### (autoloads nil "edt-vt100" "emulators/edt-vt100.el" (12864 33409))
+;;; Generated autoloads from emulators/edt-vt100.el
+
+;;;### (autoloads (edt-emulation-on) "edt" "emulators/edt.el" (12967 41685))
 ;;; Generated autoloads from emulators/edt.el
-
-;;;### (autoloads (evi) "evi" "emulators/evi.el" (12106 7816))
-;;; Generated autoloads from emulators/evi.el
-
-(autoload 'evi "evi" "\
-Start vi emulation in this buffer." t nil)
-
-;;;***
-
-
-;;;### (autoloads (convert-mocklisp-buffer) "mlconvert" "emulators/mlconvert.el" (12147 26396))
+
+(autoload 'edt-emulation-on "edt" "\
+Turn on EDT Emulation." t nil)
+
+;;;***
+
+
+;;;### (autoloads (convert-mocklisp-buffer) "mlconvert" "emulators/mlconvert.el" (12967 50317))
 ;;; Generated autoloads from emulators/mlconvert.el
 
 (autoload 'convert-mocklisp-buffer "mlconvert" "\
 Convert buffer of Mocklisp code to real Lisp that GNU Emacs can run." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "mlsupport" "emulators/mlsupport.el" (12546 37584))
+
+;;;***
+
+;;;### (autoloads nil "mlsupport" "emulators/mlsupport.el" (12967 50317))
 ;;; Generated autoloads from emulators/mlsupport.el
-
-;;;### (autoloads (teco-command) "teco" "emulators/teco.el" (12013 11585))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "scroll-lock" "emulators/scroll-lock.el" (12967 1005))
+;;; Generated autoloads from emulators/scroll-lock.el
+
+;;;### (autoloads (teco-command) "teco" "emulators/teco.el" (12967 50317))
 ;;; Generated autoloads from emulators/teco.el
 
 (autoload 'teco-command "teco" "\
 Read and execute a Teco command string." t nil)
 
 ;;;***
-
-;;;***
 
 ;;;### (autoloads nil "tpu-doc" "emulators/tpu-doc.el" (12823 45200))
 ;;; Generated autoloads from emulators/tpu-doc.el
 
-;;;### (autoloads (tpu-edt-on) "tpu-edt" "emulators/tpu-edt.el" (12657 14847))
+;;;### (autoloads (tpu-edt-on) "tpu-edt" "emulators/tpu-edt.el" (12967 52735))
 ;;; Generated autoloads from emulators/tpu-edt.el
 
 (fset 'tpu-edt-mode 'tpu-edt-on)
@@ -1820,94 +2038,215 @@
 
 ;;;***
 
-;;;### (autoloads nil "tpu-extras" "emulators/tpu-extras.el" (12147 26399))
+;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins) "tpu-extras" "emulators/tpu-extras.el" (12967 52775))
 ;;; Generated autoloads from emulators/tpu-extras.el
 
-;;;***
-
-;;;### (autoloads nil "tpu-mapper" "emulators/tpu-mapper.el" (12147 26401))
+(autoload 'tpu-set-scroll-margins "tpu-extras" "\
+Set scroll margins." t nil)
+
+(autoload 'tpu-set-cursor-free "tpu-extras" "\
+Allow the cursor to move freely about the screen." t nil)
+
+(autoload 'tpu-set-cursor-bound "tpu-extras" "\
+Constrain the cursor to the flow of the text." t nil)
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "tpu-mapper" "emulators/tpu-mapper.el" (12967 52815))
 ;;; Generated autoloads from emulators/tpu-mapper.el
-
-;;;***
-
-;;;### (autoloads nil "ws-mode" "emulators/ws-mode.el" (11903 15657))
+
+;;;### (autoloads (wordstar-mode) "ws-mode" "emulators/ws-mode.el" (12967 50317))
 ;;; Generated autoloads from emulators/ws-mode.el
 
-;;;***
-
-;;;### (autoloads nil "backtrace-logging" "energize/backtrace-logging.el" (11903 15662))
+(autoload 'wordstar-mode "ws-mode" "\
+Major mode with WordStar-like key bindings.
+
+BUGS:
+ - Help menus with WordStar commands (C-j just calls help-for-help)
+   are not implemented
+ - Options for search and replace
+ - Show markers (C-k h) is somewhat strange
+ - Search and replace (C-q a) is only available in forward direction
+
+No key bindings beginning with ESC are installed, they will work
+Emacs-like.
+
+The key bindings are:
+
+  C-a		backward-word
+  C-b		fill-paragraph
+  C-c		scroll-up-line
+  C-d		forward-char
+  C-e		previous-line
+  C-f		forward-word
+  C-g		delete-char
+  C-h		backward-char
+  C-i		indent-for-tab-command
+  C-j		help-for-help
+  C-k		ordstar-C-k-map
+  C-l		ws-repeat-search
+  C-n		open-line
+  C-p		quoted-insert
+  C-r		scroll-down-line
+  C-s		backward-char
+  C-t		kill-word
+  C-u		keyboard-quit
+  C-v		overwrite-mode
+  C-w		scroll-down
+  C-x		next-line
+  C-y		kill-complete-line
+  C-z		scroll-up
+
+  C-k 0		ws-set-marker-0
+  C-k 1		ws-set-marker-1
+  C-k 2		ws-set-marker-2
+  C-k 3		ws-set-marker-3
+  C-k 4		ws-set-marker-4
+  C-k 5		ws-set-marker-5
+  C-k 6		ws-set-marker-6
+  C-k 7		ws-set-marker-7
+  C-k 8		ws-set-marker-8
+  C-k 9		ws-set-marker-9
+  C-k b		ws-begin-block
+  C-k c		ws-copy-block
+  C-k d		save-buffers-kill-emacs
+  C-k f		find-file
+  C-k h		ws-show-markers
+  C-k i		ws-indent-block
+  C-k k		ws-end-block
+  C-k p		ws-print-block
+  C-k q		kill-emacs
+  C-k r		insert-file
+  C-k s		save-some-buffers
+  C-k t		ws-mark-word
+  C-k u		ws-exdent-block
+  C-k C-u	keyboard-quit
+  C-k v		ws-move-block
+  C-k w		ws-write-block
+  C-k x		kill-emacs
+  C-k y		ws-delete-block
+
+  C-o c		wordstar-center-line
+  C-o b		switch-to-buffer
+  C-o j		justify-current-line
+  C-o k		kill-buffer
+  C-o l		list-buffers
+  C-o m		auto-fill-mode
+  C-o r		set-fill-column
+  C-o C-u	keyboard-quit
+  C-o wd	delete-other-windows
+  C-o wh	split-window-horizontally
+  C-o wo	other-window
+  C-o wv	split-window-vertically
+
+  C-q 0		ws-find-marker-0
+  C-q 1		ws-find-marker-1
+  C-q 2		ws-find-marker-2
+  C-q 3		ws-find-marker-3
+  C-q 4		ws-find-marker-4
+  C-q 5		ws-find-marker-5
+  C-q 6		ws-find-marker-6
+  C-q 7		ws-find-marker-7
+  C-q 8		ws-find-marker-8
+  C-q 9		ws-find-marker-9
+  C-q a		ws-query-replace
+  C-q b		ws-to-block-begin
+  C-q c		end-of-buffer
+  C-q d		end-of-line
+  C-q f		ws-search
+  C-q k		ws-to-block-end
+  C-q l		ws-undo
+  C-q p		ws-last-cursorp
+  C-q r		beginning-of-buffer
+  C-q C-u	keyboard-quit
+  C-q w		ws-last-error
+  C-q y		ws-kill-eol
+  C-q DEL	ws-kill-bol
+" t nil)
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "backtrace-logging" "energize/backtrace-logging.el" (12885 60874))
 ;;; Generated autoloads from energize/backtrace-logging.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-advice" "energize/energize-advice.el" (12111 23959))
+;;;### (autoloads nil "energize-advice" "energize/energize-advice.el" (12677 32306))
 ;;; Generated autoloads from energize/energize-advice.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-annoprint" "energize/energize-annoprint.el" (11903 15669))
+;;;### (autoloads nil "energize-annoprint" "energize/energize-annoprint.el" (12677 32315))
 ;;; Generated autoloads from energize/energize-annoprint.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-font-lock" "energize/energize-font-lock.el" (12147 26402))
+;;;### (autoloads nil "energize-font-lock" "energize/energize-font-lock.el" (12677 32313))
 ;;; Generated autoloads from energize/energize-font-lock.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-font-size" "energize/energize-font-size.el" (12178 36802))
+;;;### (autoloads nil "energize-font-size" "energize/energize-font-size.el" (12885 60960))
 ;;; Generated autoloads from energize/energize-font-size.el
-
-;;;### (autoloads nil "energize-init" "energize/energize-init.el" (12051 23190))
+
+;;;***
+
+;;;### (autoloads nil "energize-init" "energize/energize-init.el" (12885 60902))
 ;;; Generated autoloads from energize/energize-init.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-load" "energize/energize-load.el" (12111 23959))
+;;;### (autoloads nil "energize-load" "energize/energize-load.el" (12677 32309))
 ;;; Generated autoloads from energize/energize-load.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-menus" "energize/energize-menus.el" (12142 23800))
+;;;### (autoloads nil "energize-menus" "energize/energize-menus.el" (12677 32310))
 ;;; Generated autoloads from energize/energize-menus.el
-
-;;;***
 
 ;;;### (autoloads nil "energize-mode" "energize/energize-mode.el" (12720 34134))
 ;;; Generated autoloads from energize/energize-mode.el
 
 ;;;***
-
-;;;### (autoloads nil "energize-shell" "energize/energize-shell.el" (12110 33408))
+
+;;;***
+
+;;;### (autoloads nil "energize-shell" "energize/energize-shell.el" (12677 32311))
 ;;; Generated autoloads from energize/energize-shell.el
-
-;;;### (autoloads nil "energize-uimx" "energize/energize-uimx.el" (12147 26403))
+
+;;;***
+
+;;;### (autoloads nil "energize-uimx" "energize/energize-uimx.el" (12677 32314))
 ;;; Generated autoloads from energize/energize-uimx.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-vi" "energize/energize-vi.el" (12122 13994))
+;;;### (autoloads nil "energize-vi" "energize/energize-vi.el" (12885 60894))
 ;;; Generated autoloads from energize/energize-vi.el
-
-;;;### (autoloads nil "energize-visit-use" "energize/energize-visit-use.el" (12008 37450))
+
+;;;***
+
+;;;### (autoloads nil "energize-visit-use" "energize/energize-visit-use.el" (12677 32312))
 ;;; Generated autoloads from energize/energize-visit-use.el
 
 ;;;***
 
-;;;### (autoloads nil "energize-windows" "energize/energize-windows.el" (12008 37451))
+;;;### (autoloads nil "energize-windows" "energize/energize-windows.el" (12677 32313))
 ;;; Generated autoloads from energize/energize-windows.el
 
 ;;;***
 
-;;;### (autoloads nil "ostore" "energize/ostore.el" (11903 15667))
+;;;### (autoloads nil "ostore" "energize/ostore.el" (12677 32313))
 ;;; Generated autoloads from energize/ostore.el
 
 ;;;***
 
-;;;### (autoloads nil "write-file" "energize/write-file.el" (11903 15661))
+;;;### (autoloads nil "write-file" "energize/write-file.el" (12677 32307))
 ;;; Generated autoloads from energize/write-file.el
-
-;;;***
 
 ;;;### (autoloads nil "eos" "eos/eos.el" (12738 54604))
 ;;; Generated autoloads from eos/eos.el
@@ -1915,24 +2254,26 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "loaddefs-eos" "eos/loaddefs-eos.el" (12823 45323))
+
+;;;***
+
+;;;### (autoloads nil "loaddefs-eos" "eos/loaddefs-eos.el" (12906 8239))
 ;;; Generated autoloads from eos/loaddefs-eos.el
-
-;;;***
 
 ;;;### (autoloads nil "sun-eos-browser" "eos/sun-eos-browser.el" (12738 54603))
 ;;; Generated autoloads from eos/sun-eos-browser.el
 
 ;;;***
-
-;;;### (autoloads nil "sun-eos-common" "eos/sun-eos-common.el" (12345 62348))
+
+;;;***
+
+;;;### (autoloads nil "sun-eos-common" "eos/sun-eos-common.el" (12677 32831))
 ;;; Generated autoloads from eos/sun-eos-common.el
-
-;;;### (autoloads nil "sun-eos-debugger-extra" "eos/sun-eos-debugger-extra.el" (12738 54601))
+
+;;;***
+
+;;;### (autoloads nil "sun-eos-debugger-extra" "eos/sun-eos-debugger-extra.el" (12735 42266))
 ;;; Generated autoloads from eos/sun-eos-debugger-extra.el
-
-;;;***
 
 ;;;### (autoloads nil "sun-eos-debugger" "eos/sun-eos-debugger.el" (12738 54600))
 ;;; Generated autoloads from eos/sun-eos-debugger.el
@@ -1960,31 +2301,22 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "sun-eos-toolbar" "eos/sun-eos-toolbar.el" (12860 15620))
+
+;;;***
+
+;;;### (autoloads nil "sun-eos-toolbar" "eos/sun-eos-toolbar.el" (12885 62671))
 ;;; Generated autoloads from eos/sun-eos-toolbar.el
-
-;;;### (autoloads nil "sun-eos" "eos/sun-eos.el" (12738 54602))
+
+;;;***
+
+;;;### (autoloads nil "sun-eos" "eos/sun-eos.el" (12735 42368))
 ;;; Generated autoloads from eos/sun-eos.el
-
-;;;### (autoloads nil "epoch" "epoch/epoch.el" (11903 15869))
+
+;;;***
+
+;;;### (autoloads nil "epoch" "epoch/epoch.el" (12677 32621))
 ;;; Generated autoloads from epoch/epoch.el
 
-;;;### (autoloads (term make-term) "term" "eterm/term.el" (12254 10521))
-;;; Generated autoloads from eterm/term.el
-
-(autoload 'make-term "term" "\
-Make a term process NAME in a buffer, running PROGRAM.
-The name of the buffer is made by surrounding NAME with `*'s.
-If there is already a running process in that buffer, it is not restarted.
-Optional third arg STARTFILE is the name of a file to send the contents of to 
-the process.  Any more args are arguments to PROGRAM." nil nil)
-
-(autoload 'term "term" "\
-Start a terminal-emulator in a new buffer." t nil)
-
-;;;***
-
 ;;;### (autoloads (tperldb txdb tdbx tsdb tgdb) "tgud" "eterm/tgud.el" (12147 26618))
 ;;; Generated autoloads from eterm/tgud.el
 
@@ -2055,11 +2387,13 @@
 \(Type \\[describe-mode] in the shell buffer for a list of commands.)" t nil)
 
 ;;;***
-
-;;;### (autoloads nil "NeXTify" "games/NeXTify.el" (11903 15936))
+
+;;;***
+
+;;;### (autoloads nil "NeXTify" "games/NeXTify.el" (12968 62664))
 ;;; Generated autoloads from games/NeXTify.el
 
-;;;### (autoloads (blackbox) "blackbox" "games/blackbox.el" (12147 26583))
+;;;### (autoloads (blackbox) "blackbox" "games/blackbox.el" (12968 62705))
 ;;; Generated autoloads from games/blackbox.el
 
 (autoload 'blackbox "blackbox" "\
@@ -2176,7 +2510,7 @@
 
 ;;;***
 
-;;;### (autoloads (conx-load conx conx-region conx-buffer) "conx" "games/conx.el" (12013 11851))
+;;;### (autoloads (conx-load conx conx-region conx-buffer) "conx" "games/conx.el" (12968 62756))
 ;;; Generated autoloads from games/conx.el
 
 (autoload 'conx-buffer "conx" "\
@@ -2194,7 +2528,7 @@
 
 ;;;***
 
-;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie) "cookie1" "games/cookie1.el" (12147 26582))
+;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie) "cookie1" "games/cookie1.el" (12968 62793))
 ;;; Generated autoloads from games/cookie1.el
 
 (autoload 'cookie "cookie1" "\
@@ -2215,7 +2549,7 @@
 
 ;;;***
 
-;;;### (autoloads (dissociated-press) "dissociate" "games/dissociate.el" (12147 26583))
+;;;### (autoloads (dissociated-press) "dissociate" "games/dissociate.el" (12968 62826))
 ;;; Generated autoloads from games/dissociate.el
 
 (autoload 'dissociated-press "dissociate" "\
@@ -2229,7 +2563,7 @@
 
 ;;;***
 
-;;;### (autoloads (doctor) "doctor" "games/doctor.el" (12147 26585))
+;;;### (autoloads (doctor) "doctor" "games/doctor.el" (12968 62860))
 ;;; Generated autoloads from games/doctor.el
 
 (autoload 'doctor "doctor" "\
@@ -2237,7 +2571,7 @@
 
 ;;;***
 
-;;;### (autoloads (dunnet) "dunnet" "games/dunnet.el" (12147 26589))
+;;;### (autoloads (dunnet) "dunnet" "games/dunnet.el" (12968 62898))
 ;;; Generated autoloads from games/dunnet.el
 
 (autoload 'dunnet "dunnet" "\
@@ -2245,7 +2579,7 @@
 
 ;;;***
 
-;;;### (autoloads (flame) "flame" "games/flame.el" (12142 23857))
+;;;### (autoloads (flame) "flame" "games/flame.el" (12968 62939))
 ;;; Generated autoloads from games/flame.el
 
 (autoload 'flame "flame" "\
@@ -2253,7 +2587,7 @@
 
 ;;;***
 
-;;;### (autoloads (gomoku) "gomoku" "games/gomoku.el" (12546 37634))
+;;;### (autoloads (gomoku) "gomoku" "games/gomoku.el" (12906 6724))
 ;;; Generated autoloads from games/gomoku.el
 
 (autoload 'gomoku "gomoku" "\
@@ -2270,7 +2604,7 @@
 
 ;;;***
 
-;;;### (autoloads (hanoi) "hanoi" "games/hanoi.el" (12546 37635))
+;;;### (autoloads (hanoi) "hanoi" "games/hanoi.el" (12968 62966))
 ;;; Generated autoloads from games/hanoi.el
 
 (autoload 'hanoi "hanoi" "\
@@ -2278,7 +2612,7 @@
 
 ;;;***
 
-;;;### (autoloads (life) "life" "games/life.el" (12742 53079))
+;;;### (autoloads (life) "life" "games/life.el" (12968 63002))
 ;;; Generated autoloads from games/life.el
 
 (autoload 'life "life" "\
@@ -2289,7 +2623,7 @@
 
 ;;;***
 
-;;;### (autoloads (mpuz) "mpuz" "games/mpuz.el" (12546 37635))
+;;;### (autoloads (mpuz) "mpuz" "games/mpuz.el" (12968 63029))
 ;;; Generated autoloads from games/mpuz.el
 
 (autoload 'mpuz "mpuz" "\
@@ -2297,7 +2631,7 @@
 
 ;;;***
 
-;;;### (autoloads (snarf-spooks spook) "spook" "games/spook.el" (12546 37636))
+;;;### (autoloads (snarf-spooks spook) "spook" "games/spook.el" (12968 63064))
 ;;; Generated autoloads from games/spook.el
 
 (autoload 'spook "spook" "\
@@ -2307,11 +2641,15 @@
 Return a vector containing the lines from `spook-phrases-file'." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "studly" "games/studly.el" (11903 15936))
+
+;;;***
+
+;;;### (autoloads nil "studly" "games/studly.el" (12968 63094))
 ;;; Generated autoloads from games/studly.el
-
-;;;### (autoloads (psychoanalyze-pinhead insert-zippyism yow) "yow" "games/yow.el" (12546 37637))
+
+;;;***
+
+;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism yow) "yow" "games/yow.el" (12968 63133))
 ;;; Generated autoloads from games/yow.el
 
 (autoload 'yow "yow" "\
@@ -2320,6 +2658,10 @@
 (autoload 'insert-zippyism "yow" "\
 Prompt with completion for a known Zippy quotation, and insert it at point." t nil)
 
+(autoload 'apropos-zippy "yow" "\
+Return a list of all Zippy quotes matching REGEXP.
+If called interactively, display a list of matches." t nil)
+
 (autoload 'psychoanalyze-pinhead "yow" "\
 Zippy goes to the analyst." t nil)
 
@@ -2327,15 +2669,15 @@
 
 ;;;***
 
-;;;### (autoloads nil "custom" "gnus/custom.el" (12823 45985))
+;;;### (autoloads nil "custom" "gnus/custom.el" (12860 33794))
 ;;; Generated autoloads from gnus/custom.el
 
 ;;;***
 
-;;;### (autoloads nil "dgnushack" "gnus/dgnushack.el" (12823 45985))
+;;;### (autoloads nil "dgnushack" "gnus/dgnushack.el" (12860 33794))
 ;;; Generated autoloads from gnus/dgnushack.el
 
-;;;### (autoloads (gnus-earcon-display) "earcon" "gnus/earcon.el" (12823 45575))
+;;;### (autoloads (gnus-earcon-display) "earcon" "gnus/earcon.el" (12860 33990))
 ;;; Generated autoloads from gnus/earcon.el
 
 (autoload 'gnus-earcon-display "earcon" "\
@@ -2343,7 +2685,7 @@
 
 ;;;***
 
-;;;### (autoloads (gnus-cache-generate-nov-databases gnus-cache-generate-active gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (12823 45986))
+;;;### (autoloads (gnus-cache-generate-nov-databases gnus-cache-generate-active gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (12860 33801))
 ;;; Generated autoloads from gnus/gnus-cache.el
 
 (autoload 'gnus-jog-cache "gnus-cache" "\
@@ -2358,70 +2700,82 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "gnus-cite" "gnus/gnus-cite.el" (12823 45985))
+
+;;;***
+
+;;;### (autoloads nil "gnus-cite" "gnus/gnus-cite.el" (12860 33795))
 ;;; Generated autoloads from gnus/gnus-cite.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-cus" "gnus/gnus-cus.el" (12823 45985))
+;;;### (autoloads nil "gnus-cus" "gnus/gnus-cus.el" (12860 33797))
 ;;; Generated autoloads from gnus/gnus-cus.el
-
-;;;### (autoloads nil "gnus-demon" "gnus/gnus-demon.el" (12740 29837))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "gnus-demon" "gnus/gnus-demon.el" (12748 62769))
 ;;; Generated autoloads from gnus/gnus-demon.el
-
-;;;***
-
-;;;***
 
 ;;;### (autoloads nil "gnus-edit" "gnus/gnus-edit.el" (12823 45217))
 ;;; Generated autoloads from gnus/gnus-edit.el
 
 ;;;***
-
-;;;### (autoloads nil "gnus-ems" "gnus/gnus-ems.el" (12823 45986))
+
+;;;***
+
+;;;### (autoloads nil "gnus-ems" "gnus/gnus-ems.el" (12860 33799))
 ;;; Generated autoloads from gnus/gnus-ems.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-gl" "gnus/gnus-gl.el" (12823 45219))
+;;;### (autoloads nil "gnus-gl" "gnus/gnus-gl.el" (12880 32726))
 ;;; Generated autoloads from gnus/gnus-gl.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-kill" "gnus/gnus-kill.el" (12727 30137))
+;;;### (autoloads nil "gnus-kill" "gnus/gnus-kill.el" (12730 9665))
 ;;; Generated autoloads from gnus/gnus-kill.el
-
-;;;### (autoloads nil "gnus-mh" "gnus/gnus-mh.el" (12740 29832))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "gnus-mh" "gnus/gnus-mh.el" (12748 62756))
 ;;; Generated autoloads from gnus/gnus-mh.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "gnus-msg" "gnus/gnus-msg.el" (12823 45986))
+
+;;;### (autoloads nil "gnus-msg" "gnus/gnus-msg.el" (12860 33802))
 ;;; Generated autoloads from gnus/gnus-msg.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-nocem" "gnus/gnus-nocem.el" (12823 45988))
+;;;### (autoloads nil "gnus-nocem" "gnus/gnus-nocem.el" (12860 33814))
 ;;; Generated autoloads from gnus/gnus-nocem.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-picon" "gnus/gnus-picon.el" (12823 45989))
+;;;### (autoloads nil "gnus-picon" "gnus/gnus-picon.el" (12860 33815))
 ;;; Generated autoloads from gnus/gnus-picon.el
-
-;;;### (autoloads nil "gnus-salt" "gnus/gnus-salt.el" (12745 38029))
+
+;;;***
+
+;;;### (autoloads nil "gnus-salt" "gnus/gnus-salt.el" (12748 62771))
 ;;; Generated autoloads from gnus/gnus-salt.el
-
-;;;### (autoloads nil "gnus-score" "gnus/gnus-score.el" (12823 45982))
+
+;;;***
+
+;;;### (autoloads nil "gnus-score" "gnus/gnus-score.el" (12860 33782))
 ;;; Generated autoloads from gnus/gnus-score.el
-
-;;;### (autoloads nil "gnus-setup" "gnus/gnus-setup.el" (12727 30250))
+
+;;;***
+
+;;;### (autoloads nil "gnus-setup" "gnus/gnus-setup.el" (12731 38138))
 ;;; Generated autoloads from gnus/gnus-setup.el
 
-;;;### (autoloads (gnus-sound-play) "gnus-sound" "gnus/gnus-sound.el" (12823 45576))
+;;;### (autoloads (gnus-sound-play) "gnus-sound" "gnus/gnus-sound.el" (12860 33989))
 ;;; Generated autoloads from gnus/gnus-sound.el
 
 (autoload 'gnus-sound-play "gnus-sound" "\
@@ -2429,7 +2783,7 @@
 
 ;;;***
 
-;;;### (autoloads (gnus-batch-brew-soup) "gnus-soup" "gnus/gnus-soup.el" (12743 11653))
+;;;### (autoloads (gnus-batch-brew-soup) "gnus-soup" "gnus/gnus-soup.el" (12748 62772))
 ;;; Generated autoloads from gnus/gnus-soup.el
 
 (autoload 'gnus-batch-brew-soup "gnus-soup" "\
@@ -2443,38 +2797,40 @@
 $ emacs -batch -f gnus-batch-brew-soup ^nnml \".*emacs.*\"" t nil)
 
 ;;;***
-
-;;;### (autoloads nil "gnus-srvr" "gnus/gnus-srvr.el" (12744 54656))
+
+;;;***
+
+;;;### (autoloads nil "gnus-srvr" "gnus/gnus-srvr.el" (12748 62773))
 ;;; Generated autoloads from gnus/gnus-srvr.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "gnus-topic" "gnus/gnus-topic.el" (12823 45988))
+;;;### (autoloads nil "gnus-topic" "gnus/gnus-topic.el" (12860 33814))
 ;;; Generated autoloads from gnus/gnus-topic.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-uu" "gnus/gnus-uu.el" (12823 45987))
+;;;### (autoloads nil "gnus-uu" "gnus/gnus-uu.el" (12860 33803))
 ;;; Generated autoloads from gnus/gnus-uu.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-vis" "gnus/gnus-vis.el" (12823 45987))
+;;;### (autoloads nil "gnus-vis" "gnus/gnus-vis.el" (12860 33805))
 ;;; Generated autoloads from gnus/gnus-vis.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-vm" "gnus/gnus-vm.el" (12727 30143))
+;;;### (autoloads nil "gnus-vm" "gnus/gnus-vm.el" (12730 9676))
 ;;; Generated autoloads from gnus/gnus-vm.el
 
 ;;;***
 
-;;;### (autoloads nil "gnus-xmas" "gnus/gnus-xmas.el" (12823 45989))
+;;;### (autoloads nil "gnus-xmas" "gnus/gnus-xmas.el" (12860 33816))
 ;;; Generated autoloads from gnus/gnus-xmas.el
 
-;;;### (autoloads (gnus-batch-score gnus-fetch-group gnus gnus-other-frame gnus-slave gnus-no-server gnus-slave-no-server gnus-add-configuration gnus-update-format) "gnus" "gnus/gnus.el" (12851 23291))
+;;;### (autoloads (gnus-batch-score gnus-fetch-group gnus gnus-other-frame gnus-slave gnus-no-server gnus-slave-no-server gnus-add-configuration gnus-update-format) "gnus" "gnus/gnus.el" (12885 60950))
 ;;; Generated autoloads from gnus/gnus.el
 
 (autoload 'gnus-update-format "gnus" "\
@@ -2520,11 +2876,15 @@
 score the alt hierarchy, you'd say \"!alt.all\"." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "mailheader" "gnus/mailheader.el" (12727 30254))
+
+;;;***
+
+;;;### (autoloads nil "mailheader" "gnus/mailheader.el" (12731 38141))
 ;;; Generated autoloads from gnus/mailheader.el
-
-;;;### (autoloads (unbold-region bold-region message-news-other-frame message-news-other-window message-mail-other-frame message-mail-other-window message-bounce message-resend message-forward message-recover message-supersede message-cancel-news message-followup message-wide-reply message-reply message-news message-mail message-mode) "message" "gnus/message.el" (12851 23288))
+
+;;;***
+
+;;;### (autoloads (unbold-region bold-region message-news-other-frame message-news-other-window message-mail-other-frame message-mail-other-window message-bounce message-resend message-forward message-recover message-supersede message-cancel-news message-followup message-wide-reply message-reply message-news message-mail message-mode) "message" "gnus/message.el" (12860 33818))
 ;;; Generated autoloads from gnus/message.el
 
 (defvar message-fcc-handler-function 'rmail-output "\
@@ -2782,43 +3142,49 @@
 
 ;;;***
 
-;;;### (autoloads nil "messagexmas" "gnus/messagexmas.el" (12823 45989))
+;;;### (autoloads nil "messagexmas" "gnus/messagexmas.el" (12860 33819))
 ;;; Generated autoloads from gnus/messagexmas.el
 
 ;;;***
 
-;;;### (autoloads nil "messcompat" "gnus/messcompat.el" (12852 5837))
+;;;### (autoloads nil "messcompat" "gnus/messcompat.el" (12860 33990))
 ;;; Generated autoloads from gnus/messcompat.el
 
 ;;;***
 
-;;;### (autoloads nil "nnbabyl" "gnus/nnbabyl.el" (12823 45987))
+;;;### (autoloads nil "nnbabyl" "gnus/nnbabyl.el" (12860 33806))
 ;;; Generated autoloads from gnus/nnbabyl.el
-
-;;;### (autoloads nil "nndb" "gnus/nndb.el" (12740 29838))
+
+;;;***
+
+;;;### (autoloads nil "nndb" "gnus/nndb.el" (12748 62778))
 ;;; Generated autoloads from gnus/nndb.el
 
 ;;;***
 
-;;;### (autoloads nil "nndir" "gnus/nndir.el" (12823 45987))
+;;;### (autoloads nil "nndir" "gnus/nndir.el" (12860 33806))
 ;;; Generated autoloads from gnus/nndir.el
 
 ;;;***
 
-;;;### (autoloads nil "nndoc" "gnus/nndoc.el" (12851 23285))
+;;;### (autoloads nil "nndoc" "gnus/nndoc.el" (12860 33807))
 ;;; Generated autoloads from gnus/nndoc.el
-
-;;;### (autoloads nil "nndraft" "gnus/nndraft.el" (12727 30258))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "nndraft" "gnus/nndraft.el" (12731 38143))
 ;;; Generated autoloads from gnus/nndraft.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "nneething" "gnus/nneething.el" (12823 45987))
+
+;;;### (autoloads nil "nneething" "gnus/nneething.el" (12860 33808))
 ;;; Generated autoloads from gnus/nneething.el
-
-;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el" (12823 45988))
+
+;;;***
+
+;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el" (12860 33809))
 ;;; Generated autoloads from gnus/nnfolder.el
 
 (autoload 'nnfolder-generate-active-file "nnfolder" "\
@@ -2828,13 +3194,17 @@
 
 ;;;***
 
-;;;### (autoloads nil "nnheader" "gnus/nnheader.el" (12823 45988))
+;;;### (autoloads nil "nnheader" "gnus/nnheader.el" (12860 33810))
 ;;; Generated autoloads from gnus/nnheader.el
-
-;;;### (autoloads nil "nnheaderxm" "gnus/nnheaderxm.el" (12740 29470))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "nnheaderxm" "gnus/nnheaderxm.el" (12748 62973))
 ;;; Generated autoloads from gnus/nnheaderxm.el
 
-;;;### (autoloads (nnkiboze-generate-groups) "nnkiboze" "gnus/nnkiboze.el" (12727 30150))
+;;;### (autoloads (nnkiboze-generate-groups) "nnkiboze" "gnus/nnkiboze.el" (12730 9692))
 ;;; Generated autoloads from gnus/nnkiboze.el
 
 (autoload 'nnkiboze-generate-groups "nnkiboze" "\
@@ -2845,31 +3215,35 @@
 
 ;;;***
 
-;;;### (autoloads nil "nnmail" "gnus/nnmail.el" (12823 45988))
+;;;### (autoloads nil "nnmail" "gnus/nnmail.el" (12860 33811))
 ;;; Generated autoloads from gnus/nnmail.el
 
 ;;;***
 
-;;;### (autoloads nil "nnmbox" "gnus/nnmbox.el" (12823 45988))
+;;;### (autoloads nil "nnmbox" "gnus/nnmbox.el" (12860 33812))
 ;;; Generated autoloads from gnus/nnmbox.el
 
 ;;;***
 
-;;;### (autoloads nil "nnmh" "gnus/nnmh.el" (12823 45988))
+;;;### (autoloads nil "nnmh" "gnus/nnmh.el" (12860 33813))
 ;;; Generated autoloads from gnus/nnmh.el
 
-;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el" (12745 38029))
+;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el" (12748 62768))
 ;;; Generated autoloads from gnus/nnml.el
 
 (autoload 'nnml-generate-nov-databases "nnml" "\
 Generate nov databases in all nnml directories." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "nnoo" "gnus/nnoo.el" (12727 30260))
+
+;;;***
+
+;;;### (autoloads nil "nnoo" "gnus/nnoo.el" (12731 38144))
 ;;; Generated autoloads from gnus/nnoo.el
-
-;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies) "nnsoup" "gnus/nnsoup.el" (12727 30260))
+
+;;;***
+
+;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies) "nnsoup" "gnus/nnsoup.el" (12885 60986))
 ;;; Generated autoloads from gnus/nnsoup.el
 
 (autoload 'nnsoup-pack-replies "nnsoup" "\
@@ -2885,20 +3259,20 @@
 
 ;;;***
 
-;;;### (autoloads nil "nnspool" "gnus/nnspool.el" (12823 45985))
+;;;### (autoloads nil "nnspool" "gnus/nnspool.el" (12860 33796))
 ;;; Generated autoloads from gnus/nnspool.el
 
 ;;;***
 
-;;;### (autoloads nil "nntp" "gnus/nntp.el" (12823 45986))
+;;;### (autoloads nil "nntp" "gnus/nntp.el" (12860 33799))
 ;;; Generated autoloads from gnus/nntp.el
 
 ;;;***
 
-;;;### (autoloads nil "nnvirtual" "gnus/nnvirtual.el" (12740 29836))
+;;;### (autoloads nil "nnvirtual" "gnus/nnvirtual.el" (12748 62768))
 ;;; Generated autoloads from gnus/nnvirtual.el
 
-;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el" (12823 45989))
+;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el" (12860 33991))
 ;;; Generated autoloads from gnus/score-mode.el
 
 (autoload 'gnus-score-mode "score-mode" "\
@@ -2909,7 +3283,7 @@
 
 ;;;***
 
-;;;### (autoloads (gnus-smiley-display smiley-buffer smiley-region) "smiley" "gnus/smiley.el" (12823 45989))
+;;;### (autoloads (gnus-smiley-display smiley-buffer smiley-region) "smiley" "gnus/smiley.el" (12860 33819))
 ;;; Generated autoloads from gnus/smiley.el
 
 (autoload 'smiley-region "smiley" "\
@@ -2922,36 +3296,42 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "adapt" "hm--html-menus/adapt.el" (12851 23327))
+
+;;;***
+
+;;;### (autoloads nil "adapt" "hm--html-menus/adapt.el" (12860 33888))
 ;;; Generated autoloads from hm--html-menus/adapt.el
 
 ;;;***
 
-;;;### (autoloads nil "hm--date" "hm--html-menus/hm--date.el" (12851 23329))
+;;;### (autoloads nil "hm--date" "hm--html-menus/hm--date.el" (12860 33889))
 ;;; Generated autoloads from hm--html-menus/hm--date.el
 
 ;;;***
 
-;;;### (autoloads nil "hm--html-configuration" "hm--html-menus/hm--html-configuration.el" (12851 23333))
+;;;### (autoloads nil "hm--html-configuration" "hm--html-menus/hm--html-configuration.el" (12860 33894))
 ;;; Generated autoloads from hm--html-menus/hm--html-configuration.el
 
 ;;;***
 
-;;;### (autoloads nil "hm--html-drag-and-drop" "hm--html-menus/hm--html-drag-and-drop.el" (12851 23386))
+;;;### (autoloads nil "hm--html-drag-and-drop" "hm--html-menus/hm--html-drag-and-drop.el" (12860 33992))
 ;;; Generated autoloads from hm--html-menus/hm--html-drag-and-drop.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "hm--html-keys" "hm--html-menus/hm--html-keys.el" (12861 22552))
+;;;### (autoloads nil "hm--html-keys" "hm--html-menus/hm--html-keys.el" (12885 62679))
 ;;; Generated autoloads from hm--html-menus/hm--html-keys.el
-
-;;;### (autoloads nil "hm--html-menu" "hm--html-menus/hm--html-menu.el" (12851 23329))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "hm--html-menu" "hm--html-menus/hm--html-menu.el" (12860 33890))
 ;;; Generated autoloads from hm--html-menus/hm--html-menu.el
 
-;;;### (autoloads (hm--html-minor-mode hm--html-mode) "hm--html-mode" "hm--html-menus/hm--html-mode.el" (12851 23385))
+;;;### (autoloads (hm--html-minor-mode hm--html-mode) "hm--html-mode" "hm--html-menus/hm--html-mode.el" (12860 33992))
 ;;; Generated autoloads from hm--html-menus/hm--html-mode.el
 
 (autoload 'hm--html-mode "hm--html-mode" "\
@@ -2968,13 +3348,12 @@
 
 ;;;***
 
-;;;### (autoloads nil "hm--html" "hm--html-menus/hm--html.el" (12851 23333))
+;;;### (autoloads nil "hm--html" "hm--html-menus/hm--html.el" (12860 33893))
 ;;; Generated autoloads from hm--html-menus/hm--html.el
-
-;;;### (autoloads nil "html-mode" "hm--html-menus/html-mode.el" (12638 48648))
-;;; Generated autoloads from hm--html-menus/html-mode.el
-
-;;;### (autoloads (html-view-get-display html-view-goto-url html-view-view-buffer html-view-view-file html-view-start-mosaic) "html-view" "hm--html-menus/html-view.el" (12318 54261))
+
+;;;***
+
+;;;### (autoloads (html-view-get-display html-view-goto-url html-view-view-buffer html-view-view-file html-view-start-mosaic) "html-view" "hm--html-menus/html-view.el" (12677 32973))
 ;;; Generated autoloads from hm--html-menus/html-view.el
 
 (autoload 'html-view-start-mosaic "html-view" "\
@@ -2997,78 +3376,80 @@
 
 ;;;***
 
-;;;### (autoloads nil "internal-drag-and-drop" "hm--html-menus/internal-drag-and-drop.el" (12851 23387))
+;;;### (autoloads nil "internal-drag-and-drop" "hm--html-menus/internal-drag-and-drop.el" (12860 33992))
 ;;; Generated autoloads from hm--html-menus/internal-drag-and-drop.el
 
 ;;;***
 
-;;;### (autoloads nil "tmpl-minor-mode" "hm--html-menus/tmpl-minor-mode.el" (12852 6134))
+;;;### (autoloads nil "tmpl-minor-mode" "hm--html-menus/tmpl-minor-mode.el" (12860 33895))
 ;;; Generated autoloads from hm--html-menus/tmpl-minor-mode.el
-
-;;;### (autoloads nil "hact" "hyperbole/hact.el" (12178 36891))
+
+;;;***
+
+;;;### (autoloads nil "hact" "hyperbole/hact.el" (12677 32925))
 ;;; Generated autoloads from hyperbole/hact.el
 
 ;;;***
 
-;;;### (autoloads nil "hactypes" "hyperbole/hactypes.el" (12558 62953))
+;;;### (autoloads nil "hactypes" "hyperbole/hactypes.el" (12677 32926))
 ;;; Generated autoloads from hyperbole/hactypes.el
-
-;;;### (autoloads nil "hargs" "hyperbole/hargs.el" (12378 2532))
+
+;;;***
+
+;;;### (autoloads nil "hargs" "hyperbole/hargs.el" (12677 32928))
 ;;; Generated autoloads from hyperbole/hargs.el
 
 ;;;***
 
-;;;### (autoloads nil "hbdata" "hyperbole/hbdata.el" (12178 36894))
+;;;### (autoloads nil "hbdata" "hyperbole/hbdata.el" (12677 32928))
 ;;; Generated autoloads from hyperbole/hbdata.el
 
 ;;;***
 
-;;;### (autoloads nil "hbmap" "hyperbole/hbmap.el" (12558 62954))
+;;;### (autoloads nil "hbmap" "hyperbole/hbmap.el" (12677 32927))
 ;;; Generated autoloads from hyperbole/hbmap.el
 
 ;;;***
 
-;;;### (autoloads nil "hbut" "hyperbole/hbut.el" (12558 62955))
+;;;### (autoloads nil "hbut" "hyperbole/hbut.el" (12677 32928))
 ;;; Generated autoloads from hyperbole/hbut.el
 
 ;;;***
 
-;;;### (autoloads nil "hgnus" "hyperbole/hgnus.el" (12558 62955))
+;;;### (autoloads nil "hgnus" "hyperbole/hgnus.el" (12677 32928))
 ;;; Generated autoloads from hyperbole/hgnus.el
 
 ;;;***
 
-;;;### (autoloads nil "hhist" "hyperbole/hhist.el" (12178 36897))
+;;;### (autoloads nil "hhist" "hyperbole/hhist.el" (12677 32929))
 ;;; Generated autoloads from hyperbole/hhist.el
 
 ;;;***
 
-;;;### (autoloads nil "hib-doc-id" "hyperbole/hib-doc-id.el" (12178 36897))
+;;;### (autoloads nil "hib-doc-id" "hyperbole/hib-doc-id.el" (12677 32931))
 ;;; Generated autoloads from hyperbole/hib-doc-id.el
 
 ;;;***
 
-;;;### (autoloads nil "hib-kbd" "hyperbole/hib-kbd.el" (12558 62956))
+;;;### (autoloads nil "hib-kbd" "hyperbole/hib-kbd.el" (12677 32933))
 ;;; Generated autoloads from hyperbole/hib-kbd.el
 
 ;;;***
 
-;;;### (autoloads nil "hibtypes" "hyperbole/hibtypes.el" (12558 62957))
+;;;### (autoloads nil "hibtypes" "hyperbole/hibtypes.el" (12677 32934))
 ;;; Generated autoloads from hyperbole/hibtypes.el
 
 ;;;***
 
-;;;### (autoloads nil "hinit" "hyperbole/hinit.el" (12558 62958))
+;;;### (autoloads nil "hinit" "hyperbole/hinit.el" (12677 32934))
 ;;; Generated autoloads from hyperbole/hinit.el
 
 ;;;***
 
-;;;### (autoloads nil "hlvar" "hyperbole/hlvar.el" (12264 40810))
+;;;### (autoloads nil "hlvar" "hyperbole/hlvar.el" (12677 32934))
 ;;; Generated autoloads from hyperbole/hlvar.el
-
-;;;***
-
-;;;### (autoloads (hmail:compose) "hmail" "hyperbole/hmail.el" (12558 62959))
+
+;;;### (autoloads (hmail:compose) "hmail" "hyperbole/hmail.el" (12677 32934))
 ;;; Generated autoloads from hyperbole/hmail.el
 
 (autoload 'hmail:compose "hmail" "\
@@ -3076,18 +3457,18 @@
 Optional SUBJECT and HELP message may also be given." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "hmh" "hyperbole/hmh.el" (12222 24177))
+
+;;;***
+
+;;;### (autoloads nil "hmh" "hyperbole/hmh.el" (12677 32934))
 ;;; Generated autoloads from hyperbole/hmh.el
 
 ;;;***
 
-;;;### (autoloads nil "hmoccur" "hyperbole/hmoccur.el" (12178 36902))
+;;;### (autoloads nil "hmoccur" "hyperbole/hmoccur.el" (12677 32935))
 ;;; Generated autoloads from hyperbole/hmoccur.el
-
-;;;***
-
-;;;### (autoloads (Info-handle-in-note smart-info-assist smart-info) "hmous-info" "hyperbole/hmous-info.el" (12558 62960))
+
+;;;### (autoloads (Info-handle-in-note smart-info-assist smart-info) "hmous-info" "hyperbole/hmous-info.el" (12677 32937))
 ;;; Generated autoloads from hyperbole/hmous-info.el
 
 (autoload 'smart-info "hmous-info" "\
@@ -3132,27 +3513,33 @@
 cross-reference and returns t; otherwise returns nil." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "hmouse-drv" "hyperbole/hmouse-drv.el" (12558 62962))
+
+;;;***
+
+;;;### (autoloads nil "hmouse-drv" "hyperbole/hmouse-drv.el" (12677 32938))
 ;;; Generated autoloads from hyperbole/hmouse-drv.el
-
-;;;### (autoloads nil "hmouse-key" "hyperbole/hmouse-key.el" (12378 2537))
+
+;;;***
+
+;;;### (autoloads nil "hmouse-key" "hyperbole/hmouse-key.el" (12677 32940))
 ;;; Generated autoloads from hyperbole/hmouse-key.el
 
 ;;;***
 
-;;;### (autoloads nil "hmouse-mod" "hyperbole/hmouse-mod.el" (12178 36905))
+;;;### (autoloads nil "hmouse-mod" "hyperbole/hmouse-mod.el" (12677 32940))
 ;;; Generated autoloads from hyperbole/hmouse-mod.el
-
-;;;### (autoloads nil "hmouse-reg" "hyperbole/hmouse-reg.el" (12378 2537))
+
+;;;***
+
+;;;### (autoloads nil "hmouse-reg" "hyperbole/hmouse-reg.el" (12677 32939))
 ;;; Generated autoloads from hyperbole/hmouse-reg.el
 
 ;;;***
 
-;;;### (autoloads nil "hmouse-sh" "hyperbole/hmouse-sh.el" (12378 2538))
+;;;### (autoloads nil "hmouse-sh" "hyperbole/hmouse-sh.el" (12677 32940))
 ;;; Generated autoloads from hyperbole/hmouse-sh.el
 
-;;;### (autoloads (smart-tags-file smart-tags-file-path smart-objc-oobr smart-objc smart-fortran-at-tag-p smart-c++-oobr smart-c++ smart-c-at-tag-p smart-asm-at-tag-p) "hmouse-tag" "hyperbole/hmouse-tag.el" (12378 2539))
+;;;### (autoloads (smart-tags-file smart-tags-file-path smart-objc-oobr smart-objc smart-fortran-at-tag-p smart-c++-oobr smart-c++ smart-c-at-tag-p smart-asm-at-tag-p) "hmouse-tag" "hyperbole/hmouse-tag.el" (12677 32941))
 ;;; Generated autoloads from hyperbole/hmouse-tag.el
 
 (autoload 'smart-asm-at-tag-p "hmouse-tag" "\
@@ -3243,103 +3630,103 @@
 Return appropriate tags file name for CURR-FILENAME or 'tags-file-name'." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "hpath" "hyperbole/hpath.el" (12558 62962))
+
+;;;***
+
+;;;### (autoloads nil "hpath" "hyperbole/hpath.el" (12677 32942))
 ;;; Generated autoloads from hyperbole/hpath.el
 
 ;;;***
 
-;;;### (autoloads nil "hrmail" "hyperbole/hrmail.el" (12222 24179))
+;;;### (autoloads nil "hrmail" "hyperbole/hrmail.el" (12677 32941))
 ;;; Generated autoloads from hyperbole/hrmail.el
 
 ;;;***
 
-;;;### (autoloads nil "hsite-ex" "hyperbole/hsite-ex.el" (12558 62963))
+;;;### (autoloads nil "hsite-ex" "hyperbole/hsite-ex.el" (12677 32943))
 ;;; Generated autoloads from hyperbole/hsite-ex.el
 
 ;;;***
 
-;;;### (autoloads nil "hsite" "hyperbole/hsite.el" (12558 62974))
+;;;### (autoloads nil "hsite" "hyperbole/hsite.el" (12677 32961))
 ;;; Generated autoloads from hyperbole/hsite.el
 
 ;;;***
 
-;;;### (autoloads nil "hsmail" "hyperbole/hsmail.el" (12331 54478))
+;;;### (autoloads nil "hsmail" "hyperbole/hsmail.el" (12677 32943))
 ;;; Generated autoloads from hyperbole/hsmail.el
 
 ;;;***
 
-;;;### (autoloads nil "hsys-hbase" "hyperbole/hsys-hbase.el" (12558 62963))
+;;;### (autoloads nil "hsys-hbase" "hyperbole/hsys-hbase.el" (12677 32943))
 ;;; Generated autoloads from hyperbole/hsys-hbase.el
 
 ;;;***
 
-;;;### (autoloads nil "hsys-w3" "hyperbole/hsys-w3.el" (12558 62964))
+;;;### (autoloads nil "hsys-w3" "hyperbole/hsys-w3.el" (12677 32943))
 ;;; Generated autoloads from hyperbole/hsys-w3.el
 
 ;;;***
 
-;;;### (autoloads nil "hsys-wais" "hyperbole/hsys-wais.el" (12558 62965))
+;;;### (autoloads nil "hsys-wais" "hyperbole/hsys-wais.el" (12677 32943))
 ;;; Generated autoloads from hyperbole/hsys-wais.el
 
 ;;;***
 
-;;;### (autoloads nil "hsys-www" "hyperbole/hsys-www.el" (12178 36913))
+;;;### (autoloads nil "hsys-www" "hyperbole/hsys-www.el" (12677 32944))
 ;;; Generated autoloads from hyperbole/hsys-www.el
 
 ;;;***
 
-;;;### (autoloads nil "htz" "hyperbole/htz.el" (12285 55426))
+;;;### (autoloads nil "htz" "hyperbole/htz.el" (12677 32944))
 ;;; Generated autoloads from hyperbole/htz.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-em19-b" "hyperbole/hui-em19-b.el" (12558 62965))
+;;;### (autoloads nil "hui-em19-b" "hyperbole/hui-em19-b.el" (12677 32945))
 ;;; Generated autoloads from hyperbole/hui-em19-b.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-ep-but" "hyperbole/hui-ep-but.el" (12178 36916))
+;;;### (autoloads nil "hui-ep-but" "hyperbole/hui-ep-but.el" (12677 32945))
 ;;; Generated autoloads from hyperbole/hui-ep-but.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-epV4-b" "hyperbole/hui-epV4-b.el" (12178 36916))
+;;;### (autoloads nil "hui-epV4-b" "hyperbole/hui-epV4-b.el" (12677 32945))
 ;;; Generated autoloads from hyperbole/hui-epV4-b.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-menu" "hyperbole/hui-menu.el" (12558 62975))
+;;;### (autoloads nil "hui-menu" "hyperbole/hui-menu.el" (12677 32961))
 ;;; Generated autoloads from hyperbole/hui-menu.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-mini" "hyperbole/hui-mini.el" (12558 63020))
+;;;### (autoloads nil "hui-mini" "hyperbole/hui-mini.el" (12677 32946))
 ;;; Generated autoloads from hyperbole/hui-mini.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-mouse" "hyperbole/hui-mouse.el" (12558 62966))
+;;;### (autoloads nil "hui-mouse" "hyperbole/hui-mouse.el" (12677 32948))
 ;;; Generated autoloads from hyperbole/hui-mouse.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-window" "hyperbole/hui-window.el" (12558 62968))
+;;;### (autoloads nil "hui-window" "hyperbole/hui-window.el" (12677 32954))
 ;;; Generated autoloads from hyperbole/hui-window.el
 
 ;;;***
 
-;;;### (autoloads nil "hui-xe-but" "hyperbole/hui-xe-but.el" (12558 62969))
+;;;### (autoloads nil "hui-xe-but" "hyperbole/hui-xe-but.el" (12677 32954))
 ;;; Generated autoloads from hyperbole/hui-xe-but.el
 
 ;;;***
 
-;;;### (autoloads nil "hui" "hyperbole/hui.el" (12351 16413))
+;;;### (autoloads nil "hui" "hyperbole/hui.el" (12677 32954))
 ;;; Generated autoloads from hyperbole/hui.el
-
-;;;***
-
-;;;### (autoloads (var:append) "hvar" "hyperbole/hvar.el" (12178 36921))
+
+;;;### (autoloads (var:append) "hvar" "hyperbole/hvar.el" (12677 32954))
 ;;; Generated autoloads from hyperbole/hvar.el
 
 (autoload 'var:append "hvar" "\
@@ -3348,16 +3735,18 @@
 Often used to append to 'hook' variables." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "hversion" "hyperbole/hversion.el" (12558 62969))
+
+;;;***
+
+;;;### (autoloads nil "hversion" "hyperbole/hversion.el" (12677 32954))
 ;;; Generated autoloads from hyperbole/hversion.el
 
 ;;;***
 
-;;;### (autoloads nil "hvm" "hyperbole/hvm.el" (12285 55427))
+;;;### (autoloads nil "hvm" "hyperbole/hvm.el" (12677 32956))
 ;;; Generated autoloads from hyperbole/hvm.el
 
-;;;### (autoloads (hypb:configuration) "hypb" "hyperbole/hypb.el" (12558 62970))
+;;;### (autoloads (hypb:configuration) "hypb" "hyperbole/hypb.el" (12677 32956))
 ;;; Generated autoloads from hyperbole/hypb.el
 
 (autoload 'hypb:configuration "hypb" "\
@@ -3365,7 +3754,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "hyperbole" "hyperbole/hyperbole.el" (12558 62971))
+;;;### (autoloads nil "hyperbole" "hyperbole/hyperbole.el" (12677 32957))
 ;;; Generated autoloads from hyperbole/hyperbole.el
 
 (defvar action-key-url-function 'w3-fetch "\
@@ -3409,11 +3798,13 @@
    .aug  - imported as an Augment post-numbered outline.")
 
 ;;;***
-
-;;;### (autoloads nil "set" "hyperbole/set.el" (12178 36925))
+
+;;;***
+
+;;;### (autoloads nil "set" "hyperbole/set.el" (12677 32957))
 ;;; Generated autoloads from hyperbole/set.el
 
-;;;### (autoloads (wconfig-yank-pop wconfig-ring-save wconfig-delete-pop wconfig-restore-by-name wconfig-delete-by-name wconfig-add-by-name) "wconfig" "hyperbole/wconfig.el" (12178 36925))
+;;;### (autoloads (wconfig-yank-pop wconfig-ring-save wconfig-delete-pop wconfig-restore-by-name wconfig-delete-by-name wconfig-add-by-name) "wconfig" "hyperbole/wconfig.el" (12677 32958))
 ;;; Generated autoloads from hyperbole/wconfig.el
 
 (autoload 'wconfig-add-by-name "wconfig" "\
@@ -3445,7 +3836,7 @@
 
 ;;;***
 
-;;;### (autoloads (rolo-logic) "wrolo-logic" "hyperbole/wrolo-logic.el" (12178 36926))
+;;;### (autoloads (rolo-logic) "wrolo-logic" "hyperbole/wrolo-logic.el" (12677 32957))
 ;;; Generated autoloads from hyperbole/wrolo-logic.el
 
 (autoload 'rolo-logic "wrolo-logic" "\
@@ -3461,13 +3852,13 @@
 FUNC that return non-nil." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "wrolo-menu" "hyperbole/wrolo-menu.el" (12558 62975))
+
+;;;***
+
+;;;### (autoloads nil "wrolo-menu" "hyperbole/wrolo-menu.el" (12677 32961))
 ;;; Generated autoloads from hyperbole/wrolo-menu.el
-
-;;;***
-
-;;;### (autoloads (rolo-yank rolo-sort rolo-kill rolo-grep rolo-fgrep rolo-edit rolo-display-matches rolo-add) "wrolo" "hyperbole/wrolo.el" (12558 62972))
+
+;;;### (autoloads (rolo-yank rolo-sort rolo-kill rolo-grep rolo-fgrep rolo-edit rolo-display-matches rolo-add) "wrolo" "hyperbole/wrolo.el" (12677 32960))
 ;;; Generated autoloads from hyperbole/wrolo.el
 
 (autoload 'rolo-add "wrolo" "\
@@ -3537,300 +3928,361 @@
 of a string." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "bridge" "ilisp/bridge.el" (12071 49092))
+
+;;;***
+
+;;;### (autoloads nil "bridge" "ilisp/bridge.el" (12930 49948))
 ;;; Generated autoloads from ilisp/bridge.el
 
 ;;;***
 
-;;;### (autoloads nil "comint-ipc" "ilisp/comint-ipc.el" (12071 49086))
+;;;### (autoloads nil "comint-ipc" "ilisp/comint-ipc.el" (12930 51131))
 ;;; Generated autoloads from ilisp/comint-ipc.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "comint-v18" "ilisp/comint-v18.el" (12823 45220))
+;;;### (autoloads nil "comint-v18" "ilisp/comint-v18.el" (12930 51160))
 ;;; Generated autoloads from ilisp/comint-v18.el
-
-;;;### (autoloads nil "completer" "ilisp/completer.el" (12666 32964))
+
+;;;***
+
+;;;### (autoloads nil "completer" "ilisp/completer.el" (12930 51342))
 ;;; Generated autoloads from ilisp/completer.el
 
 ;;;***
 
-;;;### (autoloads nil "ilcompat" "ilisp/ilcompat.el" (12071 49152))
+;;;### (autoloads nil "completer.new" "ilisp/completer.new.el" (12930 51637))
+;;; Generated autoloads from ilisp/completer.new.el
+
+;;;***
+
+;;;### (autoloads nil "completer.no-fun" "ilisp/completer.no-fun.el" (12930 51677))
+;;; Generated autoloads from ilisp/completer.no-fun.el
+
+;;;***
+
+;;;### (autoloads nil "ilcompat" "ilisp/ilcompat.el" (12930 49377))
 ;;; Generated autoloads from ilisp/ilcompat.el
-
-;;;### (autoloads nil "ilfsf18" "ilisp/ilfsf18.el" (12071 49153))
+
+;;;***
+
+;;;### (autoloads nil "ilfsf18" "ilisp/ilfsf18.el" (12930 49388))
 ;;; Generated autoloads from ilisp/ilfsf18.el
 
 ;;;***
 
-;;;### (autoloads nil "ilfsf19" "ilisp/ilfsf19.el" (12071 49154))
+;;;### (autoloads nil "ilfsf19" "ilisp/ilfsf19.el" (12930 49394))
 ;;; Generated autoloads from ilisp/ilfsf19.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-acl" "ilisp/ilisp-acl.el" (12071 49099))
+;;;### (autoloads nil "ilisp-acl" "ilisp/ilisp-acl.el" (12930 49400))
 ;;; Generated autoloads from ilisp/ilisp-acl.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-aut" "ilisp/ilisp-aut.el" (12071 49100))
+;;;### (autoloads nil "ilisp-aut" "ilisp/ilisp-aut.el" (12930 49405))
 ;;; Generated autoloads from ilisp/ilisp-aut.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-bat" "ilisp/ilisp-bat.el" (12071 49087))
+;;;### (autoloads nil "ilisp-bat" "ilisp/ilisp-bat.el" (12930 49411))
 ;;; Generated autoloads from ilisp/ilisp-bat.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-bug" "ilisp/ilisp-bug.el" (12071 49097))
+;;;### (autoloads nil "ilisp-bug" "ilisp/ilisp-bug.el" (12930 49417))
 ;;; Generated autoloads from ilisp/ilisp-bug.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-chs" "ilisp/ilisp-chs.el" (12071 49154))
+;;;### (autoloads nil "ilisp-chs" "ilisp/ilisp-chs.el" (12930 49423))
 ;;; Generated autoloads from ilisp/ilisp-chs.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-cl" "ilisp/ilisp-cl.el" (12071 49099))
+;;;### (autoloads nil "ilisp-cl" "ilisp/ilisp-cl.el" (12930 49429))
 ;;; Generated autoloads from ilisp/ilisp-cl.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-cmp" "ilisp/ilisp-cmp.el" (12106 7817))
+;;;### (autoloads nil "ilisp-cmp" "ilisp/ilisp-cmp.el" (12930 49436))
 ;;; Generated autoloads from ilisp/ilisp-cmp.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-cmt" "ilisp/ilisp-cmt.el" (12071 49100))
+;;;### (autoloads nil "ilisp-cmt" "ilisp/ilisp-cmt.el" (12930 49442))
 ;;; Generated autoloads from ilisp/ilisp-cmt.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-cmu" "ilisp/ilisp-cmu.el" (12071 49104))
+;;;### (autoloads nil "ilisp-cmu" "ilisp/ilisp-cmu.el" (12930 49447))
 ;;; Generated autoloads from ilisp/ilisp-cmu.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-cpat" "ilisp/ilisp-cpat.el" (12071 49094))
+;;;### (autoloads nil "ilisp-cpat" "ilisp/ilisp-cpat.el" (12930 49453))
 ;;; Generated autoloads from ilisp/ilisp-cpat.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-def" "ilisp/ilisp-def.el" (12071 49103))
+;;;### (autoloads nil "ilisp-def" "ilisp/ilisp-def.el" (12930 49460))
 ;;; Generated autoloads from ilisp/ilisp-def.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-dia" "ilisp/ilisp-dia.el" (12071 49102))
+;;;### (autoloads nil "ilisp-dia" "ilisp/ilisp-dia.el" (12930 49466))
 ;;; Generated autoloads from ilisp/ilisp-dia.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-doc" "ilisp/ilisp-doc.el" (12071 49101))
+;;;### (autoloads nil "ilisp-doc" "ilisp/ilisp-doc.el" (12930 49473))
 ;;; Generated autoloads from ilisp/ilisp-doc.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-el" "ilisp/ilisp-el.el" (12071 49104))
+;;;### (autoloads nil "ilisp-el" "ilisp/ilisp-el.el" (12930 49479))
 ;;; Generated autoloads from ilisp/ilisp-el.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-ext" "ilisp/ilisp-ext.el" (12071 49088))
+;;;### (autoloads nil "ilisp-ext" "ilisp/ilisp-ext.el" (12930 49485))
 ;;; Generated autoloads from ilisp/ilisp-ext.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-hi" "ilisp/ilisp-hi.el" (12071 49106))
+;;;### (autoloads nil "ilisp-hi" "ilisp/ilisp-hi.el" (12930 49492))
 ;;; Generated autoloads from ilisp/ilisp-hi.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-hlw" "ilisp/ilisp-hlw.el" (12071 49154))
+;;;### (autoloads nil "ilisp-hlw" "ilisp/ilisp-hlw.el" (12930 49498))
 ;;; Generated autoloads from ilisp/ilisp-hlw.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-hnd" "ilisp/ilisp-hnd.el" (12071 49106))
+;;;### (autoloads nil "ilisp-hnd" "ilisp/ilisp-hnd.el" (12930 49503))
 ;;; Generated autoloads from ilisp/ilisp-hnd.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-ind" "ilisp/ilisp-ind.el" (12071 49107))
+;;;### (autoloads nil "ilisp-ind" "ilisp/ilisp-ind.el" (12930 49509))
 ;;; Generated autoloads from ilisp/ilisp-ind.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-inp" "ilisp/ilisp-inp.el" (12071 49107))
+;;;### (autoloads nil "ilisp-inp" "ilisp/ilisp-inp.el" (12930 49515))
 ;;; Generated autoloads from ilisp/ilisp-inp.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-kcl" "ilisp/ilisp-kcl.el" (12071 49110))
+;;;### (autoloads nil "ilisp-kcl" "ilisp/ilisp-kcl.el" (12930 49521))
 ;;; Generated autoloads from ilisp/ilisp-kcl.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-key" "ilisp/ilisp-key.el" (12071 49109))
+;;;### (autoloads nil "ilisp-key" "ilisp/ilisp-key.el" (12930 49527))
 ;;; Generated autoloads from ilisp/ilisp-key.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-kil" "ilisp/ilisp-kil.el" (12071 49108))
+;;;### (autoloads nil "ilisp-kil" "ilisp/ilisp-kil.el" (12930 49533))
 ;;; Generated autoloads from ilisp/ilisp-kil.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-low" "ilisp/ilisp-low.el" (12071 49109))
+;;;### (autoloads nil "ilisp-low" "ilisp/ilisp-low.el" (12930 49540))
 ;;; Generated autoloads from ilisp/ilisp-low.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-luc" "ilisp/ilisp-luc.el" (12071 49110))
+;;;### (autoloads nil "ilisp-luc" "ilisp/ilisp-luc.el" (12930 49549))
 ;;; Generated autoloads from ilisp/ilisp-luc.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-mak" "ilisp/ilisp-mak.el" (12071 49096))
+;;;### (autoloads nil "ilisp-mak" "ilisp/ilisp-mak.el" (12930 49555))
 ;;; Generated autoloads from ilisp/ilisp-mak.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-menu" "ilisp/ilisp-menu.el" (12071 49089))
+;;;### (autoloads nil "ilisp-menu" "ilisp/ilisp-menu.el" (12930 49561))
 ;;; Generated autoloads from ilisp/ilisp-menu.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-mnb" "ilisp/ilisp-mnb.el" (12071 49155))
+;;;### (autoloads nil "ilisp-mnb" "ilisp/ilisp-mnb.el" (12930 49567))
 ;;; Generated autoloads from ilisp/ilisp-mnb.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-mod" "ilisp/ilisp-mod.el" (12554 53331))
+;;;### (autoloads nil "ilisp-mod" "ilisp/ilisp-mod.el" (12930 49573))
 ;;; Generated autoloads from ilisp/ilisp-mod.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-mov" "ilisp/ilisp-mov.el" (12071 49112))
+;;;### (autoloads nil "ilisp-mov" "ilisp/ilisp-mov.el" (12930 49579))
 ;;; Generated autoloads from ilisp/ilisp-mov.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-out" "ilisp/ilisp-out.el" (12142 23804))
+;;;### (autoloads nil "ilisp-out" "ilisp/ilisp-out.el" (12930 49586))
 ;;; Generated autoloads from ilisp/ilisp-out.el
-
-;;;### (autoloads nil "ilisp-prc" "ilisp/ilisp-prc.el" (12071 49113))
+
+;;;***
+
+;;;### (autoloads nil "ilisp-prc" "ilisp/ilisp-prc.el" (12930 49354))
 ;;; Generated autoloads from ilisp/ilisp-prc.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-prn" "ilisp/ilisp-prn.el" (12071 49112))
+;;;### (autoloads nil "ilisp-prn" "ilisp/ilisp-prn.el" (12930 49340))
 ;;; Generated autoloads from ilisp/ilisp-prn.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-rng" "ilisp/ilisp-rng.el" (12071 49114))
+;;;### (autoloads nil "ilisp-rng" "ilisp/ilisp-rng.el" (12930 49593))
 ;;; Generated autoloads from ilisp/ilisp-rng.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-s2c" "ilisp/ilisp-s2c.el" (12071 49152))
+;;;### (autoloads nil "ilisp-s2c" "ilisp/ilisp-s2c.el" (12930 49599))
 ;;; Generated autoloads from ilisp/ilisp-s2c.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-sch" "ilisp/ilisp-sch.el" (12071 49115))
+;;;### (autoloads nil "ilisp-sch" "ilisp/ilisp-sch.el" (12930 49605))
 ;;; Generated autoloads from ilisp/ilisp-sch.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-snd" "ilisp/ilisp-snd.el" (12071 49117))
+;;;### (autoloads nil "ilisp-snd" "ilisp/ilisp-snd.el" (12930 49117))
 ;;; Generated autoloads from ilisp/ilisp-snd.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-src" "ilisp/ilisp-src.el" (12071 49090))
+;;;### (autoloads nil "ilisp-src" "ilisp/ilisp-src.el" (12930 49614))
 ;;; Generated autoloads from ilisp/ilisp-src.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-sym" "ilisp/ilisp-sym.el" (12071 49117))
+;;;### (autoloads nil "ilisp-sym" "ilisp/ilisp-sym.el" (12930 49620))
 ;;; Generated autoloads from ilisp/ilisp-sym.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-utl" "ilisp/ilisp-utl.el" (12071 49117))
+;;;### (autoloads nil "ilisp-utl" "ilisp/ilisp-utl.el" (12930 49625))
 ;;; Generated autoloads from ilisp/ilisp-utl.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-val" "ilisp/ilisp-val.el" (12071 49117))
+;;;### (autoloads nil "ilisp-val" "ilisp/ilisp-val.el" (12930 49255))
 ;;; Generated autoloads from ilisp/ilisp-val.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp-xfr" "ilisp/ilisp-xfr.el" (12071 49119))
+;;;### (autoloads nil "ilisp-xfr" "ilisp/ilisp-xfr.el" (12930 49632))
 ;;; Generated autoloads from ilisp/ilisp-xfr.el
 
 ;;;***
 
-;;;### (autoloads nil "ilisp" "ilisp/ilisp.el" (12071 49091))
+;;;### (autoloads nil "ilisp-xls" "ilisp/ilisp-xls.el" (12930 51400))
+;;; Generated autoloads from ilisp/ilisp-xls.el
+
+;;;***
+
+;;;### (autoloads nil "ilisp" "ilisp/ilisp.el" (12930 49230))
 ;;; Generated autoloads from ilisp/ilisp.el
 
 ;;;***
 
-;;;### (autoloads nil "illuc19" "ilisp/illuc19.el" (12071 49156))
+;;;### (autoloads nil "illuc19" "ilisp/illuc19.el" (12930 49638))
 ;;; Generated autoloads from ilisp/illuc19.el
 
 ;;;***
 
-;;;### (autoloads nil "ilxemacs" "ilisp/ilxemacs.el" (12657 15247))
+;;;### (autoloads nil "ilxemacs" "ilisp/ilxemacs.el" (12930 49644))
 ;;; Generated autoloads from ilisp/ilxemacs.el
-
-;;;***
-
-;;;### (autoloads nil "iso-ascii" "iso/iso-ascii.el" (12860 15621))
+
+;;;### (autoloads (iso-accents-mode) "iso-acc" "iso/iso-acc.el" (12913 6471))
+;;; Generated autoloads from iso/iso-acc.el
+
+(autoload 'iso-accents-mode "iso-acc" "\
+Toggle ISO Accents mode, in which accents modify the following letter.
+This permits easy insertion of accented characters according to ISO-8859-1.
+When Iso-accents mode is enabled, accent character keys
+\(`, ', \", ^, / and ~) do not self-insert; instead, they modify the following
+letter key so that it inserts an ISO accented letter.
+
+You can customize ISO Accents mode to a particular language
+with the command `iso-accents-customize'.
+
+Special combinations: ~c gives a c with cedilla,
+~d gives an Icelandic eth (d with dash).
+~t gives an Icelandic thorn.
+\"s gives German sharp s.
+/a gives a with ring.
+/e gives an a-e ligature.
+~< and ~> give guillemots.
+~! gives an inverted exclamation mark.
+~? gives an inverted question mark.
+
+With an argument, a positive argument enables ISO Accents mode, 
+and a negative argument disables it." t nil)
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "iso-ascii" "iso/iso-ascii.el" (12885 62672))
 ;;; Generated autoloads from iso/iso-ascii.el
 
 ;;;***
 
-;;;### (autoloads nil "iso-cvt" "iso/iso-cvt.el" (12860 15621))
+;;;### (autoloads nil "iso-cvt" "iso/iso-cvt.el" (12885 62672))
 ;;; Generated autoloads from iso/iso-cvt.el
 
 ;;;***
 
-;;;### (autoloads nil "iso-insert" "iso/iso-insert.el" (12860 15622))
+;;;### (autoloads nil "iso-insert" "iso/iso-insert.el" (12885 62673))
 ;;; Generated autoloads from iso/iso-insert.el
 
 ;;;***
 
-;;;### (autoloads nil "iso-swed" "iso/iso-swed.el" (12860 15623))
+;;;### (autoloads nil "iso-swed" "iso/iso-swed.el" (12885 62674))
 ;;; Generated autoloads from iso/iso-swed.el
 
 ;;;***
 
-;;;### (autoloads nil "iso-syntax" "iso/iso-syntax.el" (12860 15624))
+;;;### (autoloads nil "iso-syntax" "iso/iso-syntax.el" (12885 62674))
 ;;; Generated autoloads from iso/iso-syntax.el
-
-;;;### (autoloads nil "iso8859-1" "iso/iso8859-1.el" (12147 26518))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "iso8859-1" "iso/iso8859-1.el" (12677 32833))
 ;;; Generated autoloads from iso/iso8859-1.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "swedish" "iso/swedish.el" (12860 15624))
+
+;;;### (autoloads nil "swedish" "iso/swedish.el" (12885 62675))
 ;;; Generated autoloads from iso/swedish.el
 
+;;;### (autoloads nil "ChangeLog" "lisp/ChangeLog" (12968 63140))
+;;; Generated autoloads from lisp/ChangeLog
+
+;;;***
+
+;;;### (autoloads nil "ChangeLog~" "lisp/ChangeLog~" (12967 2939))
+;;; Generated autoloads from lisp/ChangeLog~
+
 ;;;### (autoloads nil "site-start" "lisp/site-start.el" (12354 5512))
 ;;; Generated autoloads from lisp/site-start.el
 
-;;;### (autoloads (mc-deactivate-passwd mc-install-write-mode mc-install-read-mode) "mailcrypt" "mailcrypt/mailcrypt.el" (12675 57163))
+;;;### (autoloads (mc-deactivate-passwd mc-install-write-mode mc-install-read-mode) "mailcrypt" "mailcrypt/mailcrypt.el" (12677 32839))
 ;;; Generated autoloads from mailcrypt/mailcrypt.el
 
 (autoload 'mc-install-read-mode "mailcrypt" nil t nil)
@@ -3842,7 +4294,7 @@
 
 ;;;***
 
-;;;### (autoloads (mc-pgp-fetch-key mc-scheme-pgp) "mc-pgp" "mailcrypt/mc-pgp.el" (12639 8334))
+;;;### (autoloads (mc-pgp-fetch-key mc-scheme-pgp) "mc-pgp" "mailcrypt/mc-pgp.el" (12677 32841))
 ;;; Generated autoloads from mailcrypt/mc-pgp.el
 
 (autoload 'mc-scheme-pgp "mc-pgp" nil nil nil)
@@ -3861,7 +4313,7 @@
 
 ;;;***
 
-;;;### (autoloads (mc-remailer-insert-response-block mc-remailer-encrypt-for-chain mc-remailer-insert-pseudonym) "mc-remail" "mailcrypt/mc-remail.el" (12639 8334))
+;;;### (autoloads (mc-remailer-insert-response-block mc-remailer-encrypt-for-chain mc-remailer-insert-pseudonym) "mc-remail" "mailcrypt/mc-remail.el" (12677 32842))
 ;;; Generated autoloads from mailcrypt/mc-remail.el
 
 (autoload 'mc-remailer-insert-pseudonym "mc-remail" "\
@@ -3883,7 +4335,7 @@
 
 ;;;***
 
-;;;### (autoloads (mc-mh-snarf-keys mc-mh-verify-signature mc-mh-decrypt-message mc-gnus-decrypt-message mc-gnus-snarf-keys mc-gnus-verify-signature mc-vm-snarf-keys mc-vm-decrypt-message mc-vm-verify-signature mc-rmail-decrypt-message mc-rmail-verify-signature mc-rmail-summary-snarf-keys mc-rmail-summary-decrypt-message mc-rmail-summary-verify-signature mc-snarf-keys mc-snarf mc-insert-public-key mc-verify-signature mc-verify mc-sign-message mc-sign mc-decrypt-message mc-decrypt mc-encrypt-message mc-encrypt mc-cleanup-recipient-headers) "mc-toplev" "mailcrypt/mc-toplev.el" (12860 15628))
+;;;### (autoloads (mc-mh-snarf-keys mc-mh-verify-signature mc-mh-decrypt-message mc-gnus-decrypt-message mc-gnus-snarf-keys mc-gnus-verify-signature mc-vm-snarf-keys mc-vm-decrypt-message mc-vm-verify-signature mc-rmail-decrypt-message mc-rmail-verify-signature mc-rmail-summary-snarf-keys mc-rmail-summary-decrypt-message mc-rmail-summary-verify-signature mc-snarf-keys mc-snarf mc-insert-public-key mc-verify-signature mc-verify mc-sign-message mc-sign mc-decrypt-message mc-decrypt mc-encrypt-message mc-encrypt mc-cleanup-recipient-headers) "mc-toplev" "mailcrypt/mc-toplev.el" (12885 62678))
 ;;; Generated autoloads from mailcrypt/mc-toplev.el
 
 (autoload 'mc-cleanup-recipient-headers "mc-toplev" nil nil nil)
@@ -3986,8 +4438,33 @@
 (autoload 'mc-mh-snarf-keys "mc-toplev" nil t nil)
 
 ;;;***
-
-;;;### (autoloads (mh-letter-mode mh-smail-other-window mh-smail-batch mh-smail) "mh-comp" "mh-e/mh-comp.el" (12657 40619))
+
+;;;***
+
+;;;### (autoloads nil "mel-b" "mel/mel-b.el" (12913 42363))
+;;; Generated autoloads from mel/mel-b.el
+
+;;;***
+
+;;;### (autoloads nil "mel-g" "mel/mel-g.el" (12913 42367))
+;;; Generated autoloads from mel/mel-g.el
+
+;;;***
+
+;;;### (autoloads nil "mel-q" "mel/mel-q.el" (12926 37203))
+;;; Generated autoloads from mel/mel-q.el
+
+;;;***
+
+;;;### (autoloads nil "mel-u" "mel/mel-u.el" (12913 42366))
+;;; Generated autoloads from mel/mel-u.el
+
+;;;***
+
+;;;### (autoloads nil "mel" "mel/mel.el" (12913 42362))
+;;; Generated autoloads from mel/mel.el
+
+;;;### (autoloads (mh-letter-mode mh-smail-other-window mh-smail-batch mh-smail) "mh-comp" "mh-e/mh-comp.el" (12906 8313))
 ;;; Generated autoloads from mh-e/mh-comp.el
 
 (autoload 'mh-smail "mh-comp" "\
@@ -4045,7 +4522,7 @@
 
 ;;;***
 
-;;;### (autoloads (mh-version mh-rmail) "mh-e" "mh-e/mh-e.el" (12747 30151))
+;;;### (autoloads (mh-version mh-rmail) "mh-e" "mh-e/mh-e.el" (12906 8320))
 ;;; Generated autoloads from mh-e/mh-e.el
 
 (autoload 'mh-rmail "mh-e" "\
@@ -4057,27 +4534,33 @@
 Display version information about mh-e and the MH mail handling system." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "mh-funcs" "mh-e/mh-funcs.el" (12657 40621))
+
+;;;***
+
+;;;### (autoloads nil "mh-funcs" "mh-e/mh-funcs.el" (12906 8327))
 ;;; Generated autoloads from mh-e/mh-funcs.el
 
-;;;### (autoloads nil "mh-mime" "mh-e/mh-mime.el" (12657 40622))
+;;;### (autoloads nil "mh-mime" "mh-e/mh-mime.el" (12906 8333))
 ;;; Generated autoloads from mh-e/mh-mime.el
 
 (defvar mh-mime-content-types '(("text/plain") ("text/richtext") ("multipart/mixed") ("multipart/alternative") ("multipart/digest") ("multipart/parallel") ("message/rfc822") ("message/partial") ("message/external-body") ("application/octet-stream") ("application/postscript") ("image/jpeg") ("image/gif") ("audio/basic") ("video/mpeg")) "\
 Legal MIME content types.  See documentation for \\[mh-edit-mhn].")
 
 ;;;***
-
-;;;### (autoloads nil "mh-pick" "mh-e/mh-pick.el" (12657 40622))
+
+;;;***
+
+;;;### (autoloads nil "mh-pick" "mh-e/mh-pick.el" (12906 8338))
 ;;; Generated autoloads from mh-e/mh-pick.el
 
 ;;;***
 
-;;;### (autoloads nil "mh-seq" "mh-e/mh-seq.el" (12657 40624))
+;;;### (autoloads nil "mh-seq" "mh-e/mh-seq.el" (12906 8344))
 ;;; Generated autoloads from mh-e/mh-seq.el
-
-;;;### (autoloads nil "mh-utils" "mh-e/mh-utils.el" (12860 15630))
+
+;;;***
+
+;;;### (autoloads nil "mh-utils" "mh-e/mh-utils.el" (12885 62680))
 ;;; Generated autoloads from mh-e/mh-utils.el
 
 (put 'mh-progs 'risky-local-variable t)
@@ -4088,10 +4571,10 @@
 
 ;;;***
 
-;;;### (autoloads nil "abbrev" "modes/abbrev.el" (12860 15488))
+;;;### (autoloads nil "abbrev" "modes/abbrev.el" (12885 62548))
 ;;; Generated autoloads from modes/abbrev.el
 
-;;;### (autoloads (ada-make-filename-from-adaname ada-mode) "ada-mode" "modes/ada-mode.el" (12860 15512))
+;;;### (autoloads (ada-make-filename-from-adaname ada-mode) "ada-mode" "modes/ada-mode.el" (12885 62968))
 ;;; Generated autoloads from modes/ada-mode.el
 
 (autoload 'ada-mode "ada-mode" "\
@@ -4149,7 +4632,7 @@
 
 ;;;***
 
-;;;### (autoloads (archive-mode) "arc-mode" "modes/arc-mode.el" (12860 15517))
+;;;### (autoloads (archive-mode) "arc-mode" "modes/arc-mode.el" (12885 62573))
 ;;; Generated autoloads from modes/arc-mode.el
 
 (autoload 'archive-mode "arc-mode" "\
@@ -4167,7 +4650,7 @@
 
 ;;;***
 
-;;;### (autoloads (asm-mode) "asm-mode" "modes/asm-mode.el" (12860 15505))
+;;;### (autoloads (asm-mode) "asm-mode" "modes/asm-mode.el" (12885 62568))
 ;;; Generated autoloads from modes/asm-mode.el
 
 (autoload 'asm-mode "asm-mode" "\
@@ -4194,11 +4677,15 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "auto-show" "modes/auto-show.el" (12861 45400))
+
+;;;***
+
+;;;### (autoloads nil "auto-show" "modes/auto-show.el" (12885 62574))
 ;;; Generated autoloads from modes/auto-show.el
-
-;;;### (autoloads (awk-mode) "awk-mode" "modes/awk-mode.el" (12860 15487))
+
+;;;***
+
+;;;### (autoloads (awk-mode) "awk-mode" "modes/awk-mode.el" (12885 62547))
 ;;; Generated autoloads from modes/awk-mode.el
 
 (autoload 'awk-mode "awk-mode" "\
@@ -4214,10 +4701,10 @@
 
 ;;;***
 
-;;;### (autoloads nil "bib-mode" "modes/bib-mode.el" (12860 15489))
+;;;### (autoloads nil "bib-mode" "modes/bib-mode.el" (12885 62549))
 ;;; Generated autoloads from modes/bib-mode.el
 
-;;;### (autoloads (bibtex-mode) "bibtex" "modes/bibtex.el" (12823 45223))
+;;;### (autoloads (bibtex-mode) "bibtex" "modes/bibtex.el" (12906 6783))
 ;;; Generated autoloads from modes/bibtex.el
 
 (autoload 'bibtex-mode "bibtex" "\
@@ -4322,45 +4809,49 @@
 
 ;;;### (autoloads nil "c-comment" "modes/c-comment.el" (12689 65199))
 ;;; Generated autoloads from modes/c-comment.el
-
-;;;### (autoloads nil "c-fill" "modes/c-fill.el" (12559 35044))
+
+;;;***
+
+;;;### (autoloads nil "c-fill" "modes/c-fill.el" (12677 32378))
 ;;; Generated autoloads from modes/c-fill.el
 
 ;;;***
 
-;;;### (autoloads nil "c-style" "modes/c-style.el" (12559 35045))
+;;;### (autoloads nil "c-style" "modes/c-style.el" (12906 6792))
 ;;; Generated autoloads from modes/c-style.el
 
 ;;;***
 
-;;;### (autoloads nil "cc-compat" "modes/cc-compat.el" (12559 35048))
+;;;### (autoloads nil "cc-compat" "modes/cc-compat.el" (12936 63268))
 ;;; Generated autoloads from modes/cc-compat.el
 
 ;;;***
 
-;;;### (autoloads nil "cc-guess" "modes/cc-guess.el" (12559 35050))
+;;;### (autoloads nil "cc-guess" "modes/cc-guess.el" (12936 63329))
 ;;; Generated autoloads from modes/cc-guess.el
 
 ;;;***
 
-;;;### (autoloads nil "cc-lobotomy" "modes/cc-lobotomy.el" (12559 35048))
+;;;### (autoloads nil "cc-lobotomy" "modes/cc-lobotomy.el" (12936 63305))
 ;;; Generated autoloads from modes/cc-lobotomy.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "cc-mode" "modes/cc-mode.el" (12851 27450))
+
+;;;### (autoloads nil "cc-mode" "modes/cc-mode.el" (12964 17751))
 ;;; Generated autoloads from modes/cc-mode.el
-
-;;;### (autoloads (common-lisp-indent-function) "cl-indent" "modes/cl-indent.el" (12860 15491))
+
+(fset 'set-c-style           'c-set-style)
+
+;;;***
+
+;;;### (autoloads (common-lisp-indent-function) "cl-indent" "modes/cl-indent.el" (12885 62552))
 ;;; Generated autoloads from modes/cl-indent.el
 
 (autoload 'common-lisp-indent-function "cl-indent" nil nil nil)
 
 ;;;***
 
-;;;### (autoloads (c-macro-expand) "cmacexp" "modes/cmacexp.el" (12860 15492))
+;;;### (autoloads (c-macro-expand) "cmacexp" "modes/cmacexp.el" (12885 62553))
 ;;; Generated autoloads from modes/cmacexp.el
 
 (autoload 'c-macro-expand "cmacexp" "\
@@ -4378,11 +4869,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "cperl-mode" "modes/cperl-mode.el" (12823 45235))
+
+;;;***
+
+;;;### (autoloads nil "cperl-mode" "modes/cperl-mode.el" (12947 52528))
 ;;; Generated autoloads from modes/cperl-mode.el
 
-;;;### (autoloads (enriched-decode enriched-encode enriched-mode) "enriched" "modes/enriched.el" (12860 15518))
+;;;### (autoloads (enriched-decode enriched-encode enriched-mode) "enriched" "modes/enriched.el" (12885 63004))
 ;;; Generated autoloads from modes/enriched.el
 
 (autoload 'enriched-mode "enriched" "\
@@ -4404,7 +4897,7 @@
 
 ;;;***
 
-;;;### (autoloads (executable-self-display executable-set-magic) "executable" "modes/executable.el" (12860 38184))
+;;;### (autoloads (executable-self-display executable-set-magic) "executable" "modes/executable.el" (12885 62722))
 ;;; Generated autoloads from modes/executable.el
 
 (autoload 'executable-set-magic "executable" "\
@@ -4420,7 +4913,7 @@
 
 ;;;***
 
-;;;### (autoloads (f90-mode) "f90" "modes/f90.el" (12860 15515))
+;;;### (autoloads (f90-mode) "f90" "modes/f90.el" (12885 62571))
 ;;; Generated autoloads from modes/f90.el
 
 (autoload 'f90-mode "f90" "\
@@ -4484,7 +4977,7 @@
 
 ;;;***
 
-;;;### (autoloads (follow-delete-other-windows-and-split follow-mode turn-off-follow-mode turn-on-follow-mode) "follow" "modes/follow.el" (12860 15510))
+;;;### (autoloads (follow-delete-other-windows-and-split follow-mode turn-off-follow-mode turn-on-follow-mode) "follow" "modes/follow.el" (12885 62560))
 ;;; Generated autoloads from modes/follow.el
 
 (add-minor-mode 'follow-mode nil 'follow-mode-map)
@@ -4551,11 +5044,13 @@
     (global-set-key [f7] 'follow-delete-other-windows-and-split)" t nil)
 
 ;;;***
-
-;;;### (autoloads nil "fortran-misc" "modes/fortran-misc.el" (11903 15745))
+
+;;;***
+
+;;;### (autoloads nil "fortran-misc" "modes/fortran-misc.el" (12906 6838))
 ;;; Generated autoloads from modes/fortran-misc.el
 
-;;;### (autoloads (fortran-mode) "fortran" "modes/fortran.el" (12860 15494))
+;;;### (autoloads (fortran-mode) "fortran" "modes/fortran.el" (12885 62555))
 ;;; Generated autoloads from modes/fortran.el
 
 (defvar fortran-tab-mode-default nil "\
@@ -4637,7 +5132,7 @@
 
 ;;;***
 
-;;;### (autoloads (hide-ifdef-mode) "hideif" "modes/hideif.el" (12860 15495))
+;;;### (autoloads (hide-ifdef-mode) "hideif" "modes/hideif.el" (12885 62556))
 ;;; Generated autoloads from modes/hideif.el
 
 (add-minor-mode 'hide-ifdef-mode " Ifdef")
@@ -4685,7 +5180,7 @@
 
 ;;;***
 
-;;;### (autoloads (hs-minor-mode hs-hide-block hs-hide-all) "hideshow" "modes/hideshow.el" (12860 15515))
+;;;### (autoloads (hs-minor-mode hs-hide-block hs-hide-all) "hideshow" "modes/hideshow.el" (12885 62575))
 ;;; Generated autoloads from modes/hideshow.el
 
 (defvar hs-minor-mode nil "\
@@ -4718,7 +5213,7 @@
 
 ;;;***
 
-;;;### (autoloads (icon-mode) "icon" "modes/icon.el" (12860 15492))
+;;;### (autoloads (icon-mode) "icon" "modes/icon.el" (12885 62554))
 ;;; Generated autoloads from modes/icon.el
 
 (autoload 'icon-mode "icon" "\
@@ -4756,7 +5251,7 @@
 
 ;;;***
 
-;;;### (autoloads (imenu imenu-add-to-menubar) "imenu" "modes/imenu.el" (12860 15672))
+;;;### (autoloads (imenu imenu-add-to-menubar) "imenu" "modes/imenu.el" (12885 62722))
 ;;; Generated autoloads from modes/imenu.el
 
 (defvar imenu-generic-expression nil "\
@@ -4800,11 +5295,11 @@
 
 ;;;***
 
-;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el" (12860 15508))
+;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el" (12906 6853))
 ;;; Generated autoloads from modes/ksh-mode.el
 
 (autoload 'ksh-mode "ksh-mode" "\
-ksh-mode $Revision: 1.1.1.1 $ - Major mode for editing (Bourne, Korn or Bourne again)
+ksh-mode $Revision: 1.1.1.2 $ - Major mode for editing (Bourne, Korn or Bourne again)
 shell scripts.
 Special key bindings and commands:
 \\{ksh-mode-map}
@@ -4916,21 +5411,33 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "lisp-mnt" "modes/lisp-mnt.el" (12860 15511))
+
+;;;***
+
+;;;### (autoloads nil "lisp-mnt" "modes/lisp-mnt.el" (12885 62569))
 ;;; Generated autoloads from modes/lisp-mnt.el
 
 ;;;***
 
-;;;### (autoloads nil "lisp-mode" "modes/lisp-mode.el" (12860 15496))
+;;;### (autoloads nil "lisp-mode" "modes/lisp-mode.el" (12885 62557))
 ;;; Generated autoloads from modes/lisp-mode.el
 
 ;;;***
 
-;;;### (autoloads nil "list-mode" "modes/list-mode.el" (12851 27101))
+;;;### (autoloads nil "list-mode" "modes/list-mode.el" (12906 6864))
 ;;; Generated autoloads from modes/list-mode.el
 
-;;;### (autoloads (makefile-mode) "make-mode" "modes/make-mode.el" (12860 15486))
+;;;### (autoloads (m4-mode) "m4-mode" "modes/m4-mode.el" (12949 7770))
+;;; Generated autoloads from modes/m4-mode.el
+
+(autoload 'm4-mode "m4-mode" "\
+A major-mode to edit m4 macro files
+\\{m4-mode-map}
+" t nil)
+
+;;;***
+
+;;;### (autoloads (makefile-mode) "make-mode" "modes/make-mode.el" (12885 62547))
 ;;; Generated autoloads from modes/make-mode.el
 
 (autoload 'makefile-mode "make-mode" "\
@@ -5008,16 +5515,18 @@
    at the beginning of a line in Makefile mode." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "old-c++-mode" "modes/old-c++-mode.el" (12211 28119))
+
+;;;***
+
+;;;### (autoloads nil "old-c++-mode" "modes/old-c++-mode.el" (12906 6888))
 ;;; Generated autoloads from modes/old-c++-mode.el
 
 ;;;***
 
-;;;### (autoloads nil "old-c-mode" "modes/old-c-mode.el" (12546 37597))
+;;;### (autoloads nil "old-c-mode" "modes/old-c-mode.el" (12906 6898))
 ;;; Generated autoloads from modes/old-c-mode.el
 
-;;;### (autoloads (python-mode) "python-mode" "modes/python-mode.el" (12849 46013))
+;;;### (autoloads (py-shell python-mode) "python-mode" "modes/python-mode.el" (12912 14823))
 ;;; Generated autoloads from modes/python-mode.el
 
 (eval-when-compile (condition-case nil (progn (require 'cl) (require 'imenu)) (error nil)))
@@ -5043,9 +5552,36 @@
 py-temp-directory		directory used for temp files (if needed)
 py-beep-if-tab-change		ring the bell if tab-width is changed" t nil)
 
-;;;***
-
-;;;### (autoloads (rexx-mode) "rexx-mode" "modes/rexx-mode.el" (12554 53343))
+(autoload 'py-shell "python-mode" "\
+Start an interactive Python interpreter in another window.
+This is like Shell mode, except that Python is running in the window
+instead of a shell.  See the `Interactive Shell' and `Shell Mode'
+sections of the Emacs manual for details, especially for the key
+bindings active in the `*Python*' buffer.
+
+See the docs for variable `py-scroll-buffer' for info on scrolling
+behavior in the process window.
+
+Warning: Don't use an interactive Python if you change sys.ps1 or
+sys.ps2 from their default values, or if you're running code that
+prints `>>> ' or `... ' at the start of a line.  `python-mode' can't
+distinguish your output from Python's output, and assumes that `>>> '
+at the start of a line is a prompt from Python.  Similarly, the Emacs
+Shell mode code assumes that both `>>> ' and `... ' at the start of a
+line are Python prompts.  Bad things can happen if you fool either
+mode.
+
+Warning:  If you do any editing *in* the process buffer *while* the
+buffer is accepting output from Python, do NOT attempt to `undo' the
+changes.  Some of the output (nowhere near the parts you changed!) may
+be lost if you do.  This appears to be an Emacs bug, an unfortunate
+interaction between undo and process filters; the same problem exists in
+non-Python process buffers using the default (Emacs-supplied) process
+filter." t nil)
+
+;;;***
+
+;;;### (autoloads (rexx-mode) "rexx-mode" "modes/rexx-mode.el" (12906 6961))
 ;;; Generated autoloads from modes/rexx-mode.el
 
 (autoload 'rexx-mode "rexx-mode" "\
@@ -5095,7 +5631,7 @@
 
 ;;;***
 
-;;;### (autoloads (define-mail-alias build-mail-aliases mail-aliases-setup) "mail-abbrevs" "modes/mail-abbrevs.el" (12399 59968))
+;;;### (autoloads (define-mail-alias build-mail-aliases mail-aliases-setup) "mail-abbrevs" "modes/mail-abbrevs.el" (12906 6872))
 ;;; Generated autoloads from modes/mail-abbrevs.el
 
 (defvar mail-abbrev-mailrc-file nil "\
@@ -5118,7 +5654,7 @@
 
 ;;;***
 
-;;;### (autoloads (modula-2-mode) "modula2" "modes/modula2.el" (12860 15497))
+;;;### (autoloads (modula-2-mode) "modula2" "modes/modula2.el" (12885 62558))
 ;;; Generated autoloads from modes/modula2.el
 
 (autoload 'modula-2-mode "modula2" "\
@@ -5147,7 +5683,7 @@
 
 ;;;***
 
-;;;### (autoloads (electric-nroff-mode nroff-mode) "nroff-mode" "modes/nroff-mode.el" (12860 15502))
+;;;### (autoloads (electric-nroff-mode nroff-mode) "nroff-mode" "modes/nroff-mode.el" (12885 62562))
 ;;; Generated autoloads from modes/nroff-mode.el
 
 (autoload 'nroff-mode "nroff-mode" "\
@@ -5171,7 +5707,7 @@
 
 ;;;***
 
-;;;### (autoloads (outl-mouse-minor-mode outl-mouse-mode) "outl-mouse" "modes/outl-mouse.el" (12235 18865))
+;;;### (autoloads (outl-mouse-minor-mode outl-mouse-mode) "outl-mouse" "modes/outl-mouse.el" (12906 6906))
 ;;; Generated autoloads from modes/outl-mouse.el
 
 (autoload 'outl-mouse-mode "outl-mouse" "\
@@ -5182,7 +5718,7 @@
 
 ;;;***
 
-;;;### (autoloads (outline-minor-mode outline-mode) "outline" "modes/outline.el" (12860 15490))
+;;;### (autoloads (outline-minor-mode outline-mode) "outline" "modes/outline.el" (12885 62550))
 ;;; Generated autoloads from modes/outline.el
 
 (defvar outline-minor-mode nil "\
@@ -5241,7 +5777,7 @@
 
 ;;;***
 
-;;;### (autoloads (pascal-mode) "pascal" "modes/pascal.el" (12698 34037))
+;;;### (autoloads (pascal-mode) "pascal" "modes/pascal.el" (12906 6918))
 ;;; Generated autoloads from modes/pascal.el
 
 (autoload 'pascal-mode "pascal" "\
@@ -5289,7 +5825,7 @@
 
 ;;;***
 
-;;;### (autoloads (perl-mode) "perl-mode" "modes/perl-mode.el" (12568 8627))
+;;;### (autoloads (perl-mode) "perl-mode" "modes/perl-mode.el" (12906 6926))
 ;;; Generated autoloads from modes/perl-mode.el
 
 (autoload 'perl-mode "perl-mode" "\
@@ -5340,7 +5876,7 @@
 
 ;;;***
 
-;;;### (autoloads (picture-mode) "picture" "modes/picture.el" (12637 39889))
+;;;### (autoloads (picture-mode) "picture" "modes/picture.el" (12906 6934))
 ;;; Generated autoloads from modes/picture.el
 
 (autoload 'picture-mode "picture" "\
@@ -5404,7 +5940,7 @@
 
 ;;;***
 
-;;;### (autoloads (postscript-mode) "postscript" "modes/postscript.el" (12554 53338))
+;;;### (autoloads (postscript-mode) "postscript" "modes/postscript.el" (12906 6941))
 ;;; Generated autoloads from modes/postscript.el
 
 (autoload 'postscript-mode "postscript" "\
@@ -5427,7 +5963,7 @@
 
 ;;;***
 
-;;;### (autoloads (run-prolog inferior-prolog-mode prolog-mode) "prolog" "modes/prolog.el" (12860 15503))
+;;;### (autoloads (run-prolog inferior-prolog-mode prolog-mode) "prolog" "modes/prolog.el" (12906 6949))
 ;;; Generated autoloads from modes/prolog.el
 
 (autoload 'prolog-mode "prolog" "\
@@ -5468,7 +6004,7 @@
 
 ;;;***
 
-;;;### (autoloads (resize-minibuffer-mode) "rsz-minibuf" "modes/rsz-minibuf.el" (12546 37599))
+;;;### (autoloads (resize-minibuffer-mode) "rsz-minibuf" "modes/rsz-minibuf.el" (12677 32424))
 ;;; Generated autoloads from modes/rsz-minibuf.el
 
 (defvar resize-minibuffer-mode nil "\
@@ -5524,7 +6060,7 @@
 
 ;;;***
 
-;;;### (autoloads (scheme-mode) "scheme" "modes/scheme.el" (12860 15504))
+;;;### (autoloads (scheme-mode) "scheme" "modes/scheme.el" (12885 62563))
 ;;; Generated autoloads from modes/scheme.el
 
 (autoload 'scheme-mode "scheme" "\
@@ -5547,7 +6083,7 @@
 
 ;;;***
 
-;;;### (autoloads (scribe-mode) "scribe" "modes/scribe.el" (12078 45205))
+;;;### (autoloads (scribe-mode) "scribe" "modes/scribe.el" (12677 32396))
 ;;; Generated autoloads from modes/scribe.el
 
 (autoload 'scribe-mode "scribe" "\
@@ -5569,7 +6105,7 @@
 
 ;;;***
 
-;;;### (autoloads (mail-other-frame mail-other-window mail mail-mode) "sendmail" "modes/sendmail.el" (12686 31726))
+;;;### (autoloads (mail-other-frame mail-other-window mail mail-mode) "sendmail" "modes/sendmail.el" (12906 6973))
 ;;; Generated autoloads from modes/sendmail.el
 
 (defvar mail-from-style 'angles "\
@@ -5708,7 +6244,7 @@
 
 ;;;***
 
-;;;### (autoloads (sh-mode) "sh-script" "modes/sh-script.el" (12860 38184))
+;;;### (autoloads (sh-mode) "sh-script" "modes/sh-script.el" (12885 62722))
 ;;; Generated autoloads from modes/sh-script.el
 
 (put 'sh-mode 'mode-class 'special)
@@ -5761,11 +6297,13 @@
 (defalias 'shell-script-mode 'sh-mode)
 
 ;;;***
-
-;;;### (autoloads nil "simula" "modes/simula.el" (12546 37593))
+
+;;;***
+
+;;;### (autoloads nil "simula" "modes/simula.el" (12906 6984))
 ;;; Generated autoloads from modes/simula.el
 
-;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl" "modes/tcl.el" (12823 45232))
+;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl" "modes/tcl.el" (12906 6993))
 ;;; Generated autoloads from modes/tcl.el
 
 (autoload 'tcl-mode "tcl" "\
@@ -5816,7 +6354,7 @@
 
 ;;;***
 
-;;;### (autoloads (latex-mode plain-tex-mode tex-mode) "tex-mode" "modes/tex-mode.el" (12147 26435))
+;;;### (autoloads (latex-mode plain-tex-mode tex-mode) "tex-mode" "modes/tex-mode.el" (12906 7001))
 ;;; Generated autoloads from modes/tex-mode.el
 
 (autoload 'tex-mode "tex-mode" "\
@@ -5917,7 +6455,7 @@
 
 ;;;***
 
-;;;### (autoloads (texinfo-mode) "texinfo" "modes/texinfo.el" (12554 53342))
+;;;### (autoloads (texinfo-mode) "texinfo" "modes/texinfo.el" (12906 7010))
 ;;; Generated autoloads from modes/texinfo.el
 
 (autoload 'texinfo-mode "texinfo" "\
@@ -5990,11 +6528,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "text-mode" "modes/text-mode.el" (12860 15506))
+
+;;;***
+
+;;;### (autoloads nil "text-mode" "modes/text-mode.el" (12885 62564))
 ;;; Generated autoloads from modes/text-mode.el
 
-;;;### (autoloads (tc-recenter tc-scroll-down tc-scroll-up tc-scroll-line tc-associated-buffer tc-merge tc-dissociate tc-split tc-associate-buffer tc-two-columns) "two-column" "modes/two-column.el" (12648 2852))
+;;;### (autoloads (tc-recenter tc-scroll-down tc-scroll-up tc-scroll-line tc-associated-buffer tc-merge tc-dissociate tc-split tc-associate-buffer tc-two-columns) "two-column" "modes/two-column.el" (12906 7019))
 ;;; Generated autoloads from modes/two-column.el
 
 (defvar tc-mode-map nil "\
@@ -6114,7 +6654,7 @@
 
 ;;;***
 
-;;;### (autoloads (auto-view-mode view-major-mode view-mode view-minor-mode view-buffer-other-window view-file-other-window view-buffer view-file) "view-less" "modes/view-less.el" (12742 53066))
+;;;### (autoloads (auto-view-mode view-major-mode view-mode view-minor-mode view-buffer-other-window view-file-other-window view-buffer view-file) "view-less" "modes/view-less.el" (12906 7026))
 ;;; Generated autoloads from modes/view-less.el
 
 (autoload 'view-file "view-less" "\
@@ -6180,11 +6720,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "view" "modes/view.el" (12860 15506))
+
+;;;***
+
+;;;### (autoloads nil "view" "modes/view.el" (12885 62565))
 ;;; Generated autoloads from modes/view.el
 
-;;;### (autoloads (vrml-mode) "vrml-mode" "modes/vrml-mode.el" (12823 45230))
+;;;### (autoloads (vrml-mode) "vrml-mode" "modes/vrml-mode.el" (12906 7036))
 ;;; Generated autoloads from modes/vrml-mode.el
 
 (autoload 'vrml-mode "vrml-mode" "\
@@ -6216,7 +6758,7 @@
 
 ;;;***
 
-;;;### (autoloads (xpm-mode) "xpm-mode" "modes/xpm-mode.el" (12860 15517))
+;;;### (autoloads (xpm-mode) "xpm-mode" "modes/xpm-mode.el" (12912 29983))
 ;;; Generated autoloads from modes/xpm-mode.el
 
 (autoload 'xpm-mode "xpm-mode" "\
@@ -6237,53 +6779,78 @@
 \\{xpm-mode-map}" t nil)
 
 ;;;***
-
-;;;### (autoloads nil "ns-init" "ns/ns-init.el" (12528 15474))
+
+;;;***
+
+;;;### (autoloads nil "mu-bbdb" "mu/mu-bbdb.el" (12913 42375))
+;;; Generated autoloads from mu/mu-bbdb.el
+
+;;;***
+
+;;;### (autoloads nil "mu-cite" "mu/mu-cite.el" (12913 42374))
+;;; Generated autoloads from mu/mu-cite.el
+
+;;;***
+
+;;;### (autoloads nil "std11-parse" "mu/std11-parse.el" (12913 42371))
+;;; Generated autoloads from mu/std11-parse.el
+
+;;;***
+
+;;;### (autoloads nil "std11" "mu/std11.el" (12947 53231))
+;;; Generated autoloads from mu/std11.el
+
+;;;***
+
+;;;### (autoloads nil "tl-822" "mu/tl-822.el" (12913 42373))
+;;; Generated autoloads from mu/tl-822.el
+
+;;;***
+
+;;;### (autoloads nil "ns-init" "ns/ns-init.el" (12677 33112))
 ;;; Generated autoloads from ns/ns-init.el
 
 ;;;***
 
-;;;### (autoloads nil "br-c++-ft" "oobr/br-c++-ft.el" (12202 46025))
+;;;### (autoloads nil "br-c++-ft" "oobr/br-c++-ft.el" (12677 33004))
 ;;; Generated autoloads from oobr/br-c++-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-c++" "oobr/br-c++.el" (12558 62979))
+;;;### (autoloads nil "br-c++" "oobr/br-c++.el" (12677 33004))
 ;;; Generated autoloads from oobr/br-c++.el
 
 ;;;***
 
-;;;### (autoloads nil "br-c-ft" "oobr/br-c-ft.el" (12558 62993))
+;;;### (autoloads nil "br-c-ft" "oobr/br-c-ft.el" (12677 33023))
 ;;; Generated autoloads from oobr/br-c-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-clos-ft" "oobr/br-clos-ft.el" (12351 16429))
+;;;### (autoloads nil "br-clos-ft" "oobr/br-clos-ft.el" (12677 33005))
 ;;; Generated autoloads from oobr/br-clos-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-clos" "oobr/br-clos.el" (12558 62980))
+;;;### (autoloads nil "br-clos" "oobr/br-clos.el" (12677 33006))
 ;;; Generated autoloads from oobr/br-clos.el
 
 ;;;***
 
-;;;### (autoloads nil "br-compl" "oobr/br-compl.el" (12202 46027))
+;;;### (autoloads nil "br-compl" "oobr/br-compl.el" (12677 33006))
 ;;; Generated autoloads from oobr/br-compl.el
 
 ;;;***
 
-;;;### (autoloads nil "br-eif-ft" "oobr/br-eif-ft.el" (12212 18736))
+;;;### (autoloads nil "br-eif-ft" "oobr/br-eif-ft.el" (12677 33006))
 ;;; Generated autoloads from oobr/br-eif-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-eif" "oobr/br-eif.el" (12558 62980))
+;;;### (autoloads nil "br-eif" "oobr/br-eif.el" (12677 33007))
 ;;; Generated autoloads from oobr/br-eif.el
-
-;;;***
-
-;;;### (autoloads (br-env-load br-env-browse) "br-env" "oobr/br-env.el" (12714 11760))
+
+;;;### (autoloads (br-env-load br-env-browse) "br-env" "oobr/br-env.el" (12718 1297))
 ;;; Generated autoloads from oobr/br-env.el
 
 (autoload 'br-env-browse "br-env" "\
@@ -6296,69 +6863,73 @@
 Return t if load is successful, else nil." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "br-ftr" "oobr/br-ftr.el" (12355 23867))
+
+;;;***
+
+;;;### (autoloads nil "br-ftr" "oobr/br-ftr.el" (12677 33009))
 ;;; Generated autoloads from oobr/br-ftr.el
 
 ;;;***
 
-;;;### (autoloads nil "br-info" "oobr/br-info.el" (12558 62982))
+;;;### (autoloads nil "br-info" "oobr/br-info.el" (12677 33009))
 ;;; Generated autoloads from oobr/br-info.el
 
 ;;;***
 
-;;;### (autoloads nil "br-init" "oobr/br-init.el" (12714 11761))
+;;;### (autoloads nil "br-init" "oobr/br-init.el" (12718 1298))
 ;;; Generated autoloads from oobr/br-init.el
-
-;;;### (autoloads nil "br-java-ft" "oobr/br-java-ft.el" (12558 62996))
+
+;;;***
+
+;;;### (autoloads nil "br-java-ft" "oobr/br-java-ft.el" (12677 33023))
 ;;; Generated autoloads from oobr/br-java-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-java" "oobr/br-java.el" (12558 62996))
+;;;### (autoloads nil "br-java" "oobr/br-java.el" (12677 33024))
 ;;; Generated autoloads from oobr/br-java.el
 
 ;;;***
 
-;;;### (autoloads nil "br-lib" "oobr/br-lib.el" (12558 62984))
+;;;### (autoloads nil "br-lib" "oobr/br-lib.el" (12677 33012))
 ;;; Generated autoloads from oobr/br-lib.el
 
 ;;;***
 
-;;;### (autoloads nil "br-menu" "oobr/br-menu.el" (12558 62984))
+;;;### (autoloads nil "br-menu" "oobr/br-menu.el" (12677 33022))
 ;;; Generated autoloads from oobr/br-menu.el
 
 ;;;***
 
-;;;### (autoloads nil "br-objc-ft" "oobr/br-objc-ft.el" (12202 46031))
+;;;### (autoloads nil "br-objc-ft" "oobr/br-objc-ft.el" (12677 33012))
 ;;; Generated autoloads from oobr/br-objc-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-objc" "oobr/br-objc.el" (12558 62985))
+;;;### (autoloads nil "br-objc" "oobr/br-objc.el" (12677 33012))
 ;;; Generated autoloads from oobr/br-objc.el
 
 ;;;***
 
-;;;### (autoloads nil "br-python-ft" "oobr/br-python-ft.el" (12714 11806))
+;;;### (autoloads nil "br-python-ft" "oobr/br-python-ft.el" (12718 1533))
 ;;; Generated autoloads from oobr/br-python-ft.el
 
 ;;;***
 
-;;;### (autoloads nil "br-python" "oobr/br-python.el" (12714 11806))
+;;;### (autoloads nil "br-python" "oobr/br-python.el" (12718 1530))
 ;;; Generated autoloads from oobr/br-python.el
-
-;;;### (autoloads nil "br-site" "oobr/br-site.el" (12351 16433))
+
+;;;***
+
+;;;### (autoloads nil "br-site" "oobr/br-site.el" (12677 33013))
 ;;; Generated autoloads from oobr/br-site.el
 
 ;;;***
 
-;;;### (autoloads nil "br-smt" "oobr/br-smt.el" (12558 62986))
+;;;### (autoloads nil "br-smt" "oobr/br-smt.el" (12677 33013))
 ;;; Generated autoloads from oobr/br-smt.el
-
-;;;***
-
-;;;### (autoloads (oo-browser) "br-start" "oobr/br-start.el" (12558 62986))
+
+;;;### (autoloads (oo-browser) "br-start" "oobr/br-start.el" (12677 33013))
 ;;; Generated autoloads from oobr/br-start.el
 
 (fset 'oobr 'oo-browser)
@@ -6369,16 +6940,18 @@
 if any, without prompting." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "br-tree" "oobr/br-tree.el" (12294 59327))
+
+;;;***
+
+;;;### (autoloads nil "br-tree" "oobr/br-tree.el" (12677 33013))
 ;;; Generated autoloads from oobr/br-tree.el
 
 ;;;***
 
-;;;### (autoloads nil "br-vers" "oobr/br-vers.el" (12714 11762))
+;;;### (autoloads nil "br-vers" "oobr/br-vers.el" (12718 1299))
 ;;; Generated autoloads from oobr/br-vers.el
 
-;;;### (autoloads (br-to-from-viewer br-add-class-file) "br" "oobr/br.el" (12714 11763))
+;;;### (autoloads (br-to-from-viewer br-add-class-file) "br" "oobr/br.el" (12718 1315))
 ;;; Generated autoloads from oobr/br.el
 
 (autoload 'br-add-class-file "br" "\
@@ -6395,7 +6968,7 @@
 
 ;;;***
 
-;;;### (autoloads (c++-browse) "c++-browse" "oobr/c++-browse.el" (12558 62989))
+;;;### (autoloads (c++-browse) "c++-browse" "oobr/c++-browse.el" (12677 33015))
 ;;; Generated autoloads from oobr/c++-browse.el
 
 (autoload 'c++-browse "c++-browse" "\
@@ -6407,7 +6980,7 @@
 
 ;;;***
 
-;;;### (autoloads (clos-browse) "clos-brows" "oobr/clos-brows.el" (12558 62989))
+;;;### (autoloads (clos-browse) "clos-brows" "oobr/clos-brows.el" (12677 33015))
 ;;; Generated autoloads from oobr/clos-brows.el
 
 (autoload 'clos-browse "clos-brows" "\
@@ -6419,7 +6992,7 @@
 
 ;;;***
 
-;;;### (autoloads (eif-browse) "eif-browse" "oobr/eif-browse.el" (12558 62989))
+;;;### (autoloads (eif-browse) "eif-browse" "oobr/eif-browse.el" (12677 33015))
 ;;; Generated autoloads from oobr/eif-browse.el
 
 (autoload 'eif-browse "eif-browse" "\
@@ -6430,31 +7003,33 @@
 file name.  See also the file \"br-help\"." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "eif-calls" "oobr/eif-calls.el" (12356 62998))
+
+;;;***
+
+;;;### (autoloads nil "eif-calls" "oobr/eif-calls.el" (12677 33018))
 ;;; Generated autoloads from oobr/eif-calls.el
 
 ;;;***
 
-;;;### (autoloads nil "eif-ise-er" "oobr/eif-ise-er.el" (12193 28644))
+;;;### (autoloads nil "eif-ise-er" "oobr/eif-ise-er.el" (12677 33018))
 ;;; Generated autoloads from oobr/eif-ise-er.el
 
 ;;;***
 
-;;;### (autoloads nil "hash-test" "oobr/hash-test.el" (12178 36955))
+;;;### (autoloads nil "hash-test" "oobr/hash-test.el" (12677 33018))
 ;;; Generated autoloads from oobr/hash-test.el
 
 ;;;***
 
-;;;### (autoloads nil "hasht" "oobr/hasht.el" (12558 62990))
+;;;### (autoloads nil "hasht" "oobr/hasht.el" (12677 33019))
 ;;; Generated autoloads from oobr/hasht.el
 
 ;;;***
 
-;;;### (autoloads nil "hmouse-br" "oobr/hmouse-br.el" (12558 62991))
+;;;### (autoloads nil "hmouse-br" "oobr/hmouse-br.el" (12677 33019))
 ;;; Generated autoloads from oobr/hmouse-br.el
 
-;;;### (autoloads (info-browse) "info-brows" "oobr/info-brows.el" (12558 62991))
+;;;### (autoloads (info-browse) "info-brows" "oobr/info-brows.el" (12677 33019))
 ;;; Generated autoloads from oobr/info-brows.el
 
 (autoload 'info-browse "info-brows" "\
@@ -6466,7 +7041,7 @@
 
 ;;;***
 
-;;;### (autoloads (java-browse) "java-brows" "oobr/java-brows.el" (12558 62998))
+;;;### (autoloads (java-browse) "java-brows" "oobr/java-brows.el" (12677 33025))
 ;;; Generated autoloads from oobr/java-brows.el
 
 (autoload 'java-browse "java-brows" "\
@@ -6478,7 +7053,7 @@
 
 ;;;***
 
-;;;### (autoloads (objc-browse) "objc-brows" "oobr/objc-brows.el" (12558 62992))
+;;;### (autoloads (objc-browse) "objc-brows" "oobr/objc-brows.el" (12677 33019))
 ;;; Generated autoloads from oobr/objc-brows.el
 
 (autoload 'objc-browse "objc-brows" "\
@@ -6490,7 +7065,7 @@
 
 ;;;***
 
-;;;### (autoloads (python-browse) "python-browse" "oobr/python-browse.el" (12714 11806))
+;;;### (autoloads (python-browse) "python-browse" "oobr/python-browse.el" (12718 1532))
 ;;; Generated autoloads from oobr/python-browse.el
 
 (autoload 'python-browse "python-browse" "\
@@ -6502,7 +7077,7 @@
 
 ;;;***
 
-;;;### (autoloads (smt-browse) "smt-browse" "oobr/smt-browse.el" (12558 62993))
+;;;### (autoloads (smt-browse) "smt-browse" "oobr/smt-browse.el" (12677 33020))
 ;;; Generated autoloads from oobr/smt-browse.el
 
 (autoload 'smt-browse "smt-browse" "\
@@ -6514,7 +7089,7 @@
 
 ;;;***
 
-;;;### (autoloads (add-log-current-defun change-log-mode add-change-log-entry-other-window add-change-log-entry find-change-log prompt-for-change-log-name) "add-log" "packages/add-log.el" (12860 15522))
+;;;### (autoloads (add-log-current-defun change-log-mode add-change-log-entry-other-window add-change-log-entry find-change-log prompt-for-change-log-name) "add-log" "packages/add-log.el" (12906 7433))
 ;;; Generated autoloads from packages/add-log.el
 
 (defvar change-log-default-name nil "\
@@ -6588,7 +7163,7 @@
 
 ;;;***
 
-;;;### (autoloads (apropos-documentation apropos-value apropos apropos-command) "apropos" "packages/apropos.el" (12860 15525))
+;;;### (autoloads (apropos-documentation apropos-value apropos apropos-command) "apropos" "packages/apropos.el" (12966 26384))
 ;;; Generated autoloads from packages/apropos.el
 
 (fset 'command-apropos 'apropos-command)
@@ -6622,16 +7197,18 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "array" "packages/array.el" (12860 15523))
+
+;;;***
+
+;;;### (autoloads nil "array" "packages/array.el" (12906 7444))
 ;;; Generated autoloads from packages/array.el
 
 ;;;***
 
-;;;### (autoloads nil "auto-save" "packages/auto-save.el" (12178 28935))
+;;;### (autoloads nil "auto-save" "packages/auto-save.el" (12906 7452))
 ;;; Generated autoloads from packages/auto-save.el
 
-;;;### (autoloads (define-auto-insert auto-insert) "autoinsert" "packages/autoinsert.el" (12860 15525))
+;;;### (autoloads (define-auto-insert auto-insert) "autoinsert" "packages/autoinsert.el" (12966 31016))
 ;;; Generated autoloads from packages/autoinsert.el
 
 (autoload 'auto-insert "autoinsert" "\
@@ -6645,7 +7222,7 @@
 
 ;;;***
 
-;;;### (autoloads (mouse-avoidance-mode) "avoid" "packages/avoid.el" (12860 15565))
+;;;### (autoloads (mouse-avoidance-mode) "avoid" "packages/avoid.el" (12885 63020))
 ;;; Generated autoloads from packages/avoid.el
 
 (autoload 'mouse-avoidance-mode "avoid" "\
@@ -6676,18 +7253,20 @@
 (add-minor-mode 'mouse-avoidance-mode " Avoid")
 
 ;;;***
-
-;;;### (autoloads nil "balloon-help" "packages/balloon-help.el" (12547 41272))
+
+;;;***
+
+;;;### (autoloads nil "balloon-help" "packages/balloon-help.el" (12906 7467))
 ;;; Generated autoloads from packages/balloon-help.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "big-menubar" "packages/big-menubar.el" (12851 23299))
+;;;### (autoloads nil "big-menubar" "packages/big-menubar.el" (12906 7475))
 ;;; Generated autoloads from packages/big-menubar.el
 
-;;;### (autoloads (blink-cursor-mode) "blink-cursor" "packages/blink-cursor.el" (12637 24293))
+;;;### (autoloads (blink-cursor-mode) "blink-cursor" "packages/blink-cursor.el" (12906 7481))
 ;;; Generated autoloads from packages/blink-cursor.el
 
 (autoload 'blink-cursor-mode "blink-cursor" "\
@@ -6699,11 +7278,13 @@
 each TIMEOUT secs (can be a float)." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "blink-paren" "packages/blink-paren.el" (12178 36812))
+
+;;;***
+
+;;;### (autoloads nil "blink-paren" "packages/blink-paren.el" (12906 7488))
 ;;; Generated autoloads from packages/blink-paren.el
 
-;;;### (autoloads (bookmark-menu-delete bookmark-menu-rename bookmark-menu-locate bookmark-menu-jump bookmark-menu-insert bookmark-bmenu-list bookmark-load bookmark-save bookmark-write bookmark-delete bookmark-insert bookmark-rename bookmark-insert-location bookmark-relocate bookmark-jump bookmark-set) "bookmark" "packages/bookmark.el" (12823 45244))
+;;;### (autoloads (bookmark-menu-delete bookmark-menu-rename bookmark-menu-locate bookmark-menu-jump bookmark-menu-insert bookmark-bmenu-list bookmark-load bookmark-save bookmark-write bookmark-delete bookmark-insert bookmark-rename bookmark-insert-location bookmark-relocate bookmark-jump bookmark-set) "bookmark" "packages/bookmark.el" (12906 7498))
 ;;; Generated autoloads from packages/bookmark.el
 
 (if (symbolp (key-binding "r")) nil (progn (define-key ctl-x-map "rb" 'bookmark-jump) (define-key ctl-x-map "rm" 'bookmark-set) (define-key ctl-x-map "rl" 'bookmark-bmenu-list)))
@@ -6921,11 +7502,13 @@
 \"-menu-\" in its name)." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "buff-menu" "packages/buff-menu.el" (12731 19095))
+
+;;;***
+
+;;;### (autoloads nil "buff-menu" "packages/buff-menu.el" (12966 31818))
 ;;; Generated autoloads from packages/buff-menu.el
 
-;;;### (autoloads (command-history-mode list-command-history repeat-matching-complex-command) "chistory" "packages/chistory.el" (12860 15528))
+;;;### (autoloads (command-history-mode list-command-history repeat-matching-complex-command) "chistory" "packages/chistory.el" (12906 7515))
 ;;; Generated autoloads from packages/chistory.el
 
 (autoload 'repeat-matching-complex-command "chistory" "\
@@ -6957,14 +7540,14 @@
 
 ;;;***
 
-;;;### (autoloads nil "cmuscheme" "packages/cmuscheme.el" (12861 45241))
+;;;### (autoloads nil "cmuscheme" "packages/cmuscheme.el" (12906 7523))
 ;;; Generated autoloads from packages/cmuscheme.el
 
 (add-hook 'same-window-buffer-names "*scheme*")
 
 ;;;***
 
-;;;### (autoloads (display-column-mode) "column" "packages/column.el" (12657 15255))
+;;;### (autoloads (display-column-mode) "column" "packages/column.el" (12966 31482))
 ;;; Generated autoloads from packages/column.el
 
 (autoload 'display-column-mode "column" "\
@@ -6976,7 +7559,7 @@
 
 ;;;***
 
-;;;### (autoloads (compare-windows) "compare-w" "packages/compare-w.el" (12860 15529))
+;;;### (autoloads (compare-windows) "compare-w" "packages/compare-w.el" (12906 7531))
 ;;; Generated autoloads from packages/compare-w.el
 
 (autoload 'compare-windows "compare-w" "\
@@ -6996,7 +7579,7 @@
 
 ;;;***
 
-;;;### (autoloads (first-error previous-error next-error compilation-minor-mode grep compile) "compile" "packages/compile.el" (12860 15527))
+;;;### (autoloads (first-error previous-error next-error compilation-minor-mode grep compile) "compile" "packages/compile.el" (12912 27388))
 ;;; Generated autoloads from packages/compile.el
 
 (defvar compilation-mode-hook nil "\
@@ -7089,16 +7672,18 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "completion" "packages/completion.el" (12860 15571))
+
+;;;***
+
+;;;### (autoloads nil "completion" "packages/completion.el" (12885 62622))
 ;;; Generated autoloads from packages/completion.el
-
-;;;### (autoloads nil "crypt" "packages/crypt.el" (12743 22072))
+
+;;;***
+
+;;;### (autoloads nil "crypt" "packages/crypt.el" (12906 7545))
 ;;; Generated autoloads from packages/crypt.el
-
-;;;***
-
-;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "packages/dabbrev.el" (12860 15531))
+
+;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "packages/dabbrev.el" (12885 62588))
 ;;; Generated autoloads from packages/dabbrev.el
 
 (define-key global-map [(meta /)] 'dabbrev-expand)
@@ -7146,16 +7731,18 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "desktop" "packages/desktop.el" (12860 15558))
+
+;;;***
+
+;;;### (autoloads nil "desktop" "packages/desktop.el" (12885 62613))
 ;;; Generated autoloads from packages/desktop.el
 
 ;;;***
 
-;;;### (autoloads nil "detexinfo" "packages/detexinfo.el" (12285 55375))
+;;;### (autoloads nil "detexinfo" "packages/detexinfo.el" (12906 7556))
 ;;; Generated autoloads from packages/detexinfo.el
 
-;;;### (autoloads (diff-backup diff) "diff" "packages/diff.el" (12860 15530))
+;;;### (autoloads (diff-backup diff) "diff" "packages/diff.el" (12885 62587))
 ;;; Generated autoloads from packages/diff.el
 
 (defvar diff-switches (purecopy "-c") "\
@@ -7174,11 +7761,13 @@
 The backup file is the first file given to `diff'." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "doctex" "packages/doctex.el" (12073 20620))
+
+;;;***
+
+;;;### (autoloads nil "doctex" "packages/doctex.el" (12677 32456))
 ;;; Generated autoloads from packages/doctex.el
 
-;;;### (autoloads (edit-faces) "edit-faces" "packages/edit-faces.el" (12860 15569))
+;;;### (autoloads (edit-faces) "edit-faces" "packages/edit-faces.el" (12906 7566))
 ;;; Generated autoloads from packages/edit-faces.el
 
 (autoload 'edit-faces "edit-faces" "\
@@ -7191,7 +7780,7 @@
 
 ;;;***
 
-;;;### (autoloads (report-xemacs-bug) "emacsbug" "packages/emacsbug.el" (12860 15533))
+;;;### (autoloads (report-xemacs-bug) "emacsbug" "packages/emacsbug.el" (12885 62589))
 ;;; Generated autoloads from packages/emacsbug.el
 
 (autoload 'report-xemacs-bug "emacsbug" "\
@@ -7200,7 +7789,7 @@
 
 ;;;***
 
-;;;### (autoloads (emerge-merge-directories emerge-revisions-with-ancestor emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor emerge-buffers emerge-files-with-ancestor emerge-files) "emerge" "packages/emerge.el" (12547 41220))
+;;;### (autoloads (emerge-merge-directories emerge-revisions-with-ancestor emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor emerge-buffers emerge-files-with-ancestor emerge-files) "emerge" "packages/emerge.el" (12677 32460))
 ;;; Generated autoloads from packages/emerge.el
 
 (autoload 'emerge-files "emerge" "\
@@ -7235,7 +7824,7 @@
 
 ;;;***
 
-;;;### (autoloads (tags-apropos list-tags tags-query-replace tags-search tags-loop-continue next-file find-tag-other-window find-tag visit-tags-table) "etags" "packages/etags.el" (12860 15534))
+;;;### (autoloads (tags-apropos list-tags tags-query-replace tags-search tags-loop-continue next-file find-tag-other-window find-tag visit-tags-table) "etags" "packages/etags.el" (12885 62590))
 ;;; Generated autoloads from packages/etags.el
 
 (defvar tags-build-completion-table 'ask "\
@@ -7400,7 +7989,7 @@
 ;;;### (autoloads nil "fa-extras" "packages/fa-extras.el" (12547 41264))
 ;;; Generated autoloads from packages/fa-extras.el
 
-;;;### (autoloads (turn-on-fast-lock fast-lock-mode) "fast-lock" "packages/fast-lock.el" (12860 15546))
+;;;### (autoloads (turn-on-fast-lock fast-lock-mode) "fast-lock" "packages/fast-lock.el" (12885 62610))
 ;;; Generated autoloads from packages/fast-lock.el
 
 (defvar fast-lock-mode nil)
@@ -7439,14 +8028,14 @@
 
 ;;;***
 
-;;;### (autoloads (feedmail-send-it) "feedmail" "packages/feedmail.el" (12695 9732))
+;;;### (autoloads (feedmail-send-it) "feedmail" "packages/feedmail.el" (12701 8611))
 ;;; Generated autoloads from packages/feedmail.el
 
 (autoload 'feedmail-send-it "feedmail" nil nil nil)
 
 ;;;***
 
-;;;### (autoloads (make-file-part) "file-part" "packages/file-part.el" (12637 25166))
+;;;### (autoloads (make-file-part) "file-part" "packages/file-part.el" (12906 7580))
 ;;; Generated autoloads from packages/file-part.el
 
 (autoload 'make-file-part "file-part" "\
@@ -7463,13 +8052,13 @@
 BUFFER's name, and the current buffer, respectively." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "filladapt" "packages/filladapt.el" (12731 26117))
+
+;;;***
+
+;;;### (autoloads nil "filladapt" "packages/filladapt.el" (12906 7588))
 ;;; Generated autoloads from packages/filladapt.el
-
-;;;***
-
-;;;### (autoloads (font-lock-fontify-buffer turn-off-font-lock turn-on-font-lock font-lock-mode) "font-lock" "packages/font-lock.el" (12823 45243))
+
+;;;### (autoloads (font-lock-fontify-buffer turn-off-font-lock turn-on-font-lock font-lock-mode) "font-lock" "packages/font-lock.el" (12906 7601))
 ;;; Generated autoloads from packages/font-lock.el
 
 (defvar font-lock-auto-fontify t "\
@@ -7689,16 +8278,18 @@
 (add-minor-mode 'font-lock-mode " Font")
 
 ;;;***
-
-;;;### (autoloads nil "fontl-hooks" "packages/fontl-hooks.el" (12554 42334))
+
+;;;***
+
+;;;### (autoloads nil "fontl-hooks" "packages/fontl-hooks.el" (12933 37447))
 ;;; Generated autoloads from packages/fontl-hooks.el
 
 ;;;***
 
-;;;### (autoloads nil "func-menu" "packages/func-menu.el" (12721 2451))
+;;;### (autoloads nil "func-menu" "packages/func-menu.el" (12906 7620))
 ;;; Generated autoloads from packages/func-menu.el
 
-;;;### (autoloads (sc-mode) "generic-sc" "packages/generic-sc.el" (12860 15522))
+;;;### (autoloads (sc-mode) "generic-sc" "packages/generic-sc.el" (12906 7633))
 ;;; Generated autoloads from packages/generic-sc.el
 
 (autoload 'sc-mode "generic-sc" "\
@@ -7755,7 +8346,7 @@
 
 ;;;***
 
-;;;### (autoloads (gnuserv-start) "gnuserv" "packages/gnuserv.el" (12860 15561))
+;;;### (autoloads (gnuserv-start) "gnuserv" "packages/gnuserv.el" (12885 63113))
 ;;; Generated autoloads from packages/gnuserv.el
 
 (autoload 'gnuserv-start "gnuserv" "\
@@ -7768,7 +8359,7 @@
 
 ;;;***
 
-;;;### (autoloads (gopher-atpoint gopher) "gopher" "packages/gopher.el" (12073 20627))
+;;;### (autoloads (gopher-atpoint gopher) "gopher" "packages/gopher.el" (12885 61102))
 ;;; Generated autoloads from packages/gopher.el
 
 (autoload 'gopher "gopher" "\
@@ -7780,7 +8371,7 @@
 
 ;;;***
 
-;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl" "packages/hexl.el" (12860 15536))
+;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl" "packages/hexl.el" (12885 63122))
 ;;; Generated autoloads from packages/hexl.el
 
 (autoload 'hexl-mode "hexl" "\
@@ -7865,7 +8456,7 @@
 
 ;;;***
 
-;;;### (autoloads (hypropos-popup-menu hypropos-set-variable hyper-describe-function hyper-describe-variable hyper-apropos) "hyper-apropos" "packages/hyper-apropos.el" (12606 7439))
+;;;### (autoloads (hypropos-popup-menu hypropos-set-variable hyper-describe-function hyper-describe-variable hyper-apropos) "hyper-apropos" "packages/hyper-apropos.el" (12906 7940))
 ;;; Generated autoloads from packages/hyper-apropos.el
 
 (defvar hypropos-show-brief-docs t "\
@@ -7894,7 +8485,7 @@
 
 ;;;***
 
-;;;### (autoloads (icomplete-minibuffer-setup icomplete-mode) "icomplete" "packages/icomplete.el" (12860 15553))
+;;;### (autoloads (icomplete-minibuffer-setup icomplete-mode) "icomplete" "packages/icomplete.el" (12966 26690))
 ;;; Generated autoloads from packages/icomplete.el
 
 (autoload 'icomplete-mode "icomplete" "\
@@ -7907,7 +8498,7 @@
 
 ;;;***
 
-;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-query info) "info" "packages/info.el" (12860 15521))
+;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-query info) "info" "packages/info.el" (12906 7954))
 ;;; Generated autoloads from packages/info.el
 
 (autoload 'info "info" "\
@@ -7960,7 +8551,7 @@
 
 ;;;***
 
-;;;### (autoloads (batch-info-validate Info-validate Info-split Info-tagify) "informat" "packages/informat.el" (12860 15537))
+;;;### (autoloads (batch-info-validate Info-validate Info-split Info-tagify) "informat" "packages/informat.el" (12885 62593))
 ;;; Generated autoloads from packages/informat.el
 
 (autoload 'Info-tagify "informat" "\
@@ -7991,7 +8582,7 @@
 
 ;;;***
 
-;;;### (autoloads (ispell-message ispell-minor-mode ispell-complete-word-interior-frag ispell-complete-word ispell-continue ispell-buffer ispell-region ispell-change-dictionary ispell-kill-ispell ispell-help ispell-word) "ispell" "packages/ispell.el" (12860 15540))
+;;;### (autoloads (ispell-message ispell-minor-mode ispell-complete-word-interior-frag ispell-complete-word ispell-continue ispell-buffer ispell-region ispell-change-dictionary ispell-kill-ispell ispell-help ispell-word) "ispell" "packages/ispell.el" (12885 62595))
 ;;; Generated autoloads from packages/ispell.el
 
 (defvar ispell-personal-dictionary nil "\
@@ -8174,7 +8765,7 @@
 
 ;;;***
 
-;;;### (autoloads (jka-compr-install toggle-auto-compression jka-compr-load) "jka-compr" "packages/jka-compr.el" (12860 15568))
+;;;### (autoloads (jka-compr-install toggle-auto-compression jka-compr-load) "jka-compr" "packages/jka-compr.el" (12885 62618))
 ;;; Generated autoloads from packages/jka-compr.el
 
 (autoload 'jka-compr-load "jka-compr" "\
@@ -8194,7 +8785,7 @@
 
 ;;;***
 
-;;;### (autoloads (turn-on-lazy-lock lazy-lock-mode) "lazy-lock" "packages/lazy-lock.el" (12823 45256))
+;;;### (autoloads (turn-on-lazy-lock lazy-lock-mode) "lazy-lock" "packages/lazy-lock.el" (12906 7968))
 ;;; Generated autoloads from packages/lazy-lock.el
 
 (defvar lazy-lock-mode nil)
@@ -8229,7 +8820,7 @@
 
 ;;;***
 
-;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "packages/ledit.el" (12860 15542))
+;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "packages/ledit.el" (12885 62597))
 ;;; Generated autoloads from packages/ledit.el
 
 (defconst ledit-save-files t "\
@@ -8257,11 +8848,15 @@
 (autoload 'ledit-from-lisp-mode "ledit" nil nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "lispm-fonts" "packages/lispm-fonts.el" (12147 26460))
+
+;;;***
+
+;;;### (autoloads nil "lispm-fonts" "packages/lispm-fonts.el" (12906 7978))
 ;;; Generated autoloads from packages/lispm-fonts.el
-
-;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer) "lpr" "packages/lpr.el" (12860 15544))
+
+;;;***
+
+;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer) "lpr" "packages/lpr.el" (12885 62598))
 ;;; Generated autoloads from packages/lpr.el
 
 (defvar lpr-switches nil "\
@@ -8291,10 +8886,10 @@
 
 ;;;***
 
-;;;### (autoloads nil "makeinfo" "packages/makeinfo.el" (12860 15535))
+;;;### (autoloads nil "makeinfo" "packages/makeinfo.el" (12885 62591))
 ;;; Generated autoloads from packages/makeinfo.el
 
-;;;### (autoloads (make-command-summary) "makesum" "packages/makesum.el" (12860 15526))
+;;;### (autoloads (make-command-summary) "makesum" "packages/makesum.el" (12885 62583))
 ;;; Generated autoloads from packages/makesum.el
 
 (autoload 'make-command-summary "makesum" "\
@@ -8302,28 +8897,28 @@
 Previous contents of that buffer are killed first." t nil)
 
 ;;;***
-
-;;;### (autoloads (manual-entry) "man" "packages/man.el" (12860 15541))
+
+;;;***
+
+;;;### (autoloads nil "man-xref" "packages/man-xref.el" (12968 61833))
+;;; Generated autoloads from packages/man-xref.el
+
+;;;### (autoloads (man) "man" "packages/man.el" (12968 61736))
 ;;; Generated autoloads from packages/man.el
 
-(autoload 'manual-entry "man" "\
-Display the Unix manual entry (or entries) for TOPIC.
-If prefix arg is given, modify the search according to the value:
-  2 = complement default exact matching of the TOPIC name;
-      exact matching default is specified by `Manual-match-topic-exactly'
-  3 = force a search of the unformatted man directories
-  4 = both 2 and 3
-The manual entries are searched according to the variable
-Manual-directory-list, which should be a list of directories.  If
-Manual-directory-list is nil, \\[Manual-directory-list-init] is
-invoked to create this list from the MANPATH environment variable.
-See the variable Manual-topic-buffer which controls how the buffer
-is named.  See also the variables Manual-match-topic-exactly,
-Manual-query-multiple-pages, and Manual-buffer-view-mode." t nil)
-
-;;;***
-
-;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body metamail-interpret-header) "metamail" "packages/metamail.el" (12860 15560))
+(defalias 'manual-entry 'man)
+
+(autoload 'man "man" "\
+Get a Un*x manual page and put it in a buffer.
+This command is the top-level command in the man package.  It runs a Un*x
+command to retrieve and clean a manpage in the background and places the
+results in a Man mode (manpage browsing) buffer.  See variable
+`Man-notify-method' for what happens when the buffer is ready.
+If a buffer already exists for this man page, it will display immediately." t nil)
+
+;;;***
+
+;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body metamail-interpret-header) "metamail" "packages/metamail.el" (12885 62612))
 ;;; Generated autoloads from packages/metamail.el
 
 (autoload 'metamail-interpret-header "metamail" "\
@@ -8357,30 +8952,37 @@
 redisplayed as output is inserted." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "mime-compose" "packages/mime-compose.el" (12727 30161))
+
+;;;***
+
+;;;### (autoloads nil "mic-paren" "packages/mic-paren.el" (12861 33586))
+;;; Generated autoloads from packages/mic-paren.el
+
+;;;***
+
+;;;### (autoloads nil "mime-compose" "packages/mime-compose.el" (12906 7649))
 ;;; Generated autoloads from packages/mime-compose.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "mode-motion+" "packages/mode-motion+.el" (12860 15567))
+;;;### (autoloads nil "mode-motion+" "packages/mode-motion+.el" (12906 7659))
 ;;; Generated autoloads from packages/mode-motion+.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "netunam" "packages/netunam.el" (12547 2100))
+;;;### (autoloads nil "netunam" "packages/netunam.el" (12906 7668))
 ;;; Generated autoloads from packages/netunam.el
 
 ;;;***
 
-;;;### (autoloads nil "page-ext" "packages/page-ext.el" (12860 15545))
+;;;### (autoloads nil "page-ext" "packages/page-ext.el" (12885 62599))
 ;;; Generated autoloads from packages/page-ext.el
 
-;;;### (autoloads (blink-paren paren-set-mode) "paren" "packages/paren.el" (12648 2860))
+;;;### (autoloads (blink-paren paren-set-mode) "paren" "packages/paren.el" (12906 7676))
 ;;; Generated autoloads from packages/paren.el
 
 (defvar paren-mode nil "\
@@ -8409,7 +9011,7 @@
 
 ;;;***
 
-;;;### (autoloads (pending-delete pending-delete-off pending-delete-on) "pending-del" "packages/pending-del.el" (12547 41228))
+;;;### (autoloads (pending-delete pending-delete-off pending-delete-on) "pending-del" "packages/pending-del.el" (12906 7684))
 ;;; Generated autoloads from packages/pending-del.el
 
 (autoload 'pending-delete-on "pending-del" "\
@@ -8430,7 +9032,7 @@
 
 ;;;***
 
-;;;### (autoloads (ps-despool ps-spool-region-with-faces ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces ps-print-buffer) "ps-print" "packages/ps-print.el" (12860 15563))
+;;;### (autoloads (ps-despool ps-spool-region-with-faces ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces ps-print-buffer) "ps-print" "packages/ps-print.el" (12885 62615))
 ;;; Generated autoloads from packages/ps-print.el
 
 (defvar ps-paper-type 'ps-letter "\
@@ -8511,7 +9113,7 @@
 
 ;;;***
 
-;;;### (autoloads (remote-compile) "rcompile" "packages/rcompile.el" (12860 15556))
+;;;### (autoloads (remote-compile) "rcompile" "packages/rcompile.el" (12885 62608))
 ;;; Generated autoloads from packages/rcompile.el
 
 (autoload 'remote-compile "rcompile" "\
@@ -8519,8 +9121,10 @@
 See \\[compile]." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "recent-files" "packages/recent-files.el" (12554 42318))
+
+;;;***
+
+;;;### (autoloads nil "recent-files" "packages/recent-files.el" (12906 7696))
 ;;; Generated autoloads from packages/recent-files.el
 
 ;;;***
@@ -8529,20 +9133,20 @@
 
 ;;;***
 
-;;;### (autoloads nil "refbib" "packages/refbib.el" (12860 15547))
+;;;### (autoloads nil "refbib" "packages/refbib.el" (12885 62600))
 ;;; Generated autoloads from packages/refbib.el
-
-;;;### (autoloads nil "remote" "packages/remote.el" (12547 2116))
+
+;;;***
+
+;;;### (autoloads nil "remote" "packages/remote.el" (12677 32480))
 ;;; Generated autoloads from packages/remote.el
 
 ;;;***
 
-;;;### (autoloads nil "reportmail" "packages/reportmail.el" (12743 22072))
+;;;### (autoloads nil "reportmail" "packages/reportmail.el" (12748 62790))
 ;;; Generated autoloads from packages/reportmail.el
-
-;;;***
-
-;;;### (autoloads (resume-suspend-hook) "resume" "packages/resume.el" (12860 15549))
+
+;;;### (autoloads (resume-suspend-hook) "resume" "packages/resume.el" (12885 62602))
 ;;; Generated autoloads from packages/resume.el
 
 (autoload 'resume-suspend-hook "resume" "\
@@ -8559,26 +9163,32 @@
 ;;; Generated autoloads from packages/rnewspost.el
 
 ;;;***
-
-;;;### (autoloads nil "saveconf" "packages/saveconf.el" (12860 15550))
+
+;;;***
+
+;;;### (autoloads nil "saveconf" "packages/saveconf.el" (12906 7708))
 ;;; Generated autoloads from packages/saveconf.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "saveplace" "packages/saveplace.el" (12860 15532))
+;;;### (autoloads nil "saveplace" "packages/saveplace.el" (12885 63159))
 ;;; Generated autoloads from packages/saveplace.el
-
-;;;### (autoloads nil "sccs" "packages/sccs.el" (12547 2102))
+
+;;;***
+
+;;;### (autoloads nil "sccs" "packages/sccs.el" (12885 61171))
 ;;; Generated autoloads from packages/sccs.el
 
 ;;;***
 
-;;;### (autoloads nil "scroll-in-place" "packages/scroll-in-place.el" (12547 2167))
+;;;### (autoloads nil "scroll-in-place" "packages/scroll-in-place.el" (12906 7720))
 ;;; Generated autoloads from packages/scroll-in-place.el
-
-;;;### (autoloads nil "server" "packages/server.el" (12860 15551))
+
+;;;***
+
+;;;### (autoloads nil "server" "packages/server.el" (12885 62603))
 ;;; Generated autoloads from packages/server.el
 
 (make-obsolete 'server-start 'gnuserv-start)
@@ -8587,10 +9197,10 @@
 
 ;;;***
 
-;;;### (autoloads nil "session" "packages/session.el" (12547 2134))
+;;;### (autoloads nil "session" "packages/session.el" (12677 32488))
 ;;; Generated autoloads from packages/session.el
 
-;;;### (autoloads (install-shell-fonts) "shell-font" "packages/shell-font.el" (12547 2123))
+;;;### (autoloads (install-shell-fonts) "shell-font" "packages/shell-font.el" (12906 7729))
 ;;; Generated autoloads from packages/shell-font.el
 
 (autoload 'install-shell-fonts "shell-font" "\
@@ -8601,7 +9211,7 @@
 
 ;;;***
 
-;;;### (autoloads (spell-string spell-region spell-word spell-buffer) "spell" "packages/spell.el" (12860 15548))
+;;;### (autoloads (spell-string spell-region spell-word spell-buffer) "spell" "packages/spell.el" (12885 62601))
 ;;; Generated autoloads from packages/spell.el
 
 (put 'spell-filter 'risky-local-variable t)
@@ -8628,11 +9238,13 @@
 Check spelling of string supplied as argument." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "supercite" "packages/supercite.el" (12637 31054))
+
+;;;***
+
+;;;### (autoloads nil "supercite" "packages/supercite.el" (12906 7742))
 ;;; Generated autoloads from packages/supercite.el
 
-;;;### (autoloads (tar-mode) "tar-mode" "packages/tar-mode.el" (12547 41240))
+;;;### (autoloads (tar-mode) "tar-mode" "packages/tar-mode.el" (12906 7753))
 ;;; Generated autoloads from packages/tar-mode.el
 
 (autoload 'tar-mode "tar-mode" "\
@@ -8652,7 +9264,7 @@
 
 ;;;***
 
-;;;### (autoloads (terminal-emulator) "terminal" "packages/terminal.el" (12743 11661))
+;;;### (autoloads (terminal-emulator) "terminal" "packages/terminal.el" (12906 7762))
 ;;; Generated autoloads from packages/terminal.el
 
 (autoload 'terminal-emulator "terminal" "\
@@ -8688,13 +9300,13 @@
 work with `terminfo' we will try to use it." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "tex-latin1" "packages/tex-latin1.el" (12698 34039))
+
+;;;***
+
+;;;### (autoloads nil "tex-latin1" "packages/tex-latin1.el" (12906 7771))
 ;;; Generated autoloads from packages/tex-latin1.el
-
-;;;***
-
-;;;### (autoloads (batch-texinfo-format texinfo-format-region texinfo-format-buffer) "texinfmt" "packages/texinfmt.el" (12860 15556))
+
+;;;### (autoloads (batch-texinfo-format texinfo-format-region texinfo-format-buffer) "texinfmt" "packages/texinfmt.el" (12885 62607))
 ;;; Generated autoloads from packages/texinfmt.el
 
 (autoload 'texinfo-format-buffer "texinfmt" "\
@@ -8720,11 +9332,13 @@
   \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "texnfo-tex" "packages/texnfo-tex.el" (12657 15256))
+
+;;;***
+
+;;;### (autoloads nil "texnfo-tex" "packages/texnfo-tex.el" (12906 7781))
 ;;; Generated autoloads from packages/texnfo-tex.el
 
-;;;### (autoloads (texinfo-sequential-node-update texinfo-every-node-update texinfo-update-node) "texnfo-upd" "packages/texnfo-upd.el" (12860 15557))
+;;;### (autoloads (texinfo-sequential-node-update texinfo-every-node-update texinfo-update-node) "texnfo-upd" "packages/texnfo-upd.el" (12885 62610))
 ;;; Generated autoloads from packages/texnfo-upd.el
 
 (autoload 'texinfo-update-node "texnfo-upd" "\
@@ -8770,21 +9384,31 @@
 
 ;;;***
 
-;;;### (autoloads (time-stamp) "time-stamp" "packages/time-stamp.el" (12547 41218))
+;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp" "packages/time-stamp.el" (12966 31795))
 ;;; Generated autoloads from packages/time-stamp.el
 
 (autoload 'time-stamp "time-stamp" "\
 Update the time stamp string in the buffer.
+If you put a time stamp template anywhere in the first 8 lines of a file,
+it can be updated every time you save the file.  See the top of
+`time-stamp.el' for a sample.  The template looks like one of the following:
+    Time-stamp: <>
+    Time-stamp: \" \"
+The time stamp is written between the brackets or quotes, resulting in
+    Time-stamp: <95/01/18 10:20:51 gildea>
 Only does its thing if the variable  time-stamp-active  is non-nil.
 Typically used on  write-file-hooks  for automatic time-stamping.
-The format of the time stamp is determined by the variable
-time-stamp-format.  The first  time-stamp-line-limit  lines of the
-buffer (normally 8) are searched for the time stamp template,
-and if it is found, a new time stamp is written into it." t nil)
-
-;;;***
-
-;;;### (autoloads (display-time) "time" "packages/time.el" (12860 15542))
+The format of the time stamp is determined by the variable  time-stamp-format.
+The variables time-stamp-line-limit, time-stamp-start, and time-stamp-end
+control finding the template." t nil)
+
+(autoload 'time-stamp-toggle-active "time-stamp" "\
+Toggle time-stamp-active, setting whether \\[time-stamp] updates a buffer.
+With arg, turn time stamping on if and only if arg is positive." t nil)
+
+;;;***
+
+;;;### (autoloads (display-time) "time" "packages/time.el" (12885 62597))
 ;;; Generated autoloads from packages/time.el
 
 (defvar display-time-day-and-date nil "\
@@ -8802,11 +9426,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "uncompress" "packages/uncompress.el" (12860 15552))
+
+;;;***
+
+;;;### (autoloads nil "uncompress" "packages/uncompress.el" (12885 62604))
 ;;; Generated autoloads from packages/uncompress.el
 
-;;;### (autoloads (ununderline-and-unoverstrike-region overstrike-region unoverstrike-region ununderline-region underline-region) "underline" "packages/underline.el" (12860 15552))
+;;;### (autoloads (ununderline-and-unoverstrike-region overstrike-region unoverstrike-region ununderline-region underline-region) "underline" "packages/underline.el" (12885 62605))
 ;;; Generated autoloads from packages/underline.el
 
 (autoload 'underline-region "underline" "\
@@ -8836,7 +9462,7 @@
 
 ;;;***
 
-;;;### (autoloads (ask-to-update-copyright update-copyright) "upd-copyr" "packages/upd-copyr.el" (12546 37615))
+;;;### (autoloads (ask-to-update-copyright update-copyright) "upd-copyr" "packages/upd-copyr.el" (12906 7802))
 ;;; Generated autoloads from packages/upd-copyr.el
 
 (defvar copyright-do-not-disturb "Free Software Foundation, Inc." "\
@@ -8869,11 +9495,13 @@
 Put this on write-file-hooks." nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "vc-hooks" "packages/vc-hooks.el" (12728 13773))
+
+;;;***
+
+;;;### (autoloads nil "vc-hooks" "packages/vc-hooks.el" (12906 7811))
 ;;; Generated autoloads from packages/vc-hooks.el
 
-;;;### (autoloads (vc-update-change-log vc-rename-file vc-cancel-version vc-revert-buffer vc-print-log vc-retrieve-snapshot vc-create-snapshot vc-directory vc-insert-headers vc-version-other-window vc-version-diff vc-diff vc-register vc-next-action vc-file-status) "vc" "packages/vc.el" (12823 45238))
+;;;### (autoloads (vc-update-change-log vc-rename-file vc-cancel-version vc-revert-buffer vc-print-log vc-retrieve-snapshot vc-create-snapshot vc-directory vc-insert-headers vc-version-other-window vc-version-diff vc-diff vc-register vc-next-action vc-file-status) "vc" "packages/vc.el" (12906 7826))
 ;;; Generated autoloads from packages/vc.el
 
 (defvar vc-checkin-hook nil "\
@@ -9001,11 +9629,13 @@
 From a program, any arguments are passed to the `rcs2log' script." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "webster-ucb" "packages/webster-ucb.el" (12547 41248))
+
+;;;***
+
+;;;### (autoloads nil "webster-ucb" "packages/webster-ucb.el" (12677 32498))
 ;;; Generated autoloads from packages/webster-ucb.el
 
-;;;### (autoloads (webster-spell webster-endings webster) "webster" "packages/webster.el" (12547 41251))
+;;;### (autoloads (webster-spell webster-endings webster) "webster" "packages/webster.el" (12677 32499))
 ;;; Generated autoloads from packages/webster.el
 
 (autoload 'webster "webster" "\
@@ -9025,7 +9655,7 @@
 
 ;;;***
 
-;;;### (autoloads (run-scheme) "xscheme" "packages/xscheme.el" (12823 45251))
+;;;### (autoloads (run-scheme) "xscheme" "packages/xscheme.el" (12906 7838))
 ;;; Generated autoloads from packages/xscheme.el
 
 (defvar scheme-program-name "scheme" "\
@@ -9053,40 +9683,40 @@
 
 ;;;### (autoloads nil "cookie" "pcl-cvs/cookie.el" (12823 45288))
 ;;; Generated autoloads from pcl-cvs/cookie.el
-
-;;;### (autoloads nil "dll-debug" "pcl-cvs/dll-debug.el" (12675 57104))
+
+;;;***
+
+;;;### (autoloads nil "dll-debug" "pcl-cvs/dll-debug.el" (12677 32609))
 ;;; Generated autoloads from pcl-cvs/dll-debug.el
 
 ;;;***
 
-;;;### (autoloads nil "dll" "pcl-cvs/dll.el" (12675 57108))
+;;;### (autoloads nil "dll" "pcl-cvs/dll.el" (12677 32610))
 ;;; Generated autoloads from pcl-cvs/dll.el
 
 ;;;***
 
-;;;### (autoloads nil "elib-node" "pcl-cvs/elib-node.el" (12675 57109))
+;;;### (autoloads nil "elib-node" "pcl-cvs/elib-node.el" (12677 32611))
 ;;; Generated autoloads from pcl-cvs/elib-node.el
-
-;;;***
 
 ;;;### (autoloads nil "pcl-cvs-lucid" "pcl-cvs/pcl-cvs-lucid.el" (12675 57113))
 ;;; Generated autoloads from pcl-cvs/pcl-cvs-lucid.el
 
 ;;;***
-
-;;;### (autoloads nil "pcl-cvs-startup" "pcl-cvs/pcl-cvs-startup.el" (12675 57106))
+
+;;;***
+
+;;;### (autoloads nil "pcl-cvs-startup" "pcl-cvs/pcl-cvs-startup.el" (12677 32609))
 ;;; Generated autoloads from pcl-cvs/pcl-cvs-startup.el
-
-;;;***
-
-;;;### (autoloads (pcl-cvs-fontify) "pcl-cvs-xemacs" "pcl-cvs/pcl-cvs-xemacs.el" (12686 31809))
+
+;;;### (autoloads (pcl-cvs-fontify) "pcl-cvs-xemacs" "pcl-cvs/pcl-cvs-xemacs.el" (12692 4201))
 ;;; Generated autoloads from pcl-cvs/pcl-cvs-xemacs.el
 
 (autoload 'pcl-cvs-fontify "pcl-cvs-xemacs" nil nil nil)
 
 ;;;***
 
-;;;### (autoloads (cvs-update-other-window cvs-update) "pcl-cvs" "pcl-cvs/pcl-cvs.el" (12686 31737))
+;;;### (autoloads (cvs-update-other-window cvs-update) "pcl-cvs" "pcl-cvs/pcl-cvs.el" (12692 3840))
 ;;; Generated autoloads from pcl-cvs/pcl-cvs.el
 
 (autoload 'cvs-update "pcl-cvs" "\
@@ -9102,20 +9732,20 @@
 If optional prefix argument LOCAL is non-nil, 'cvs update -l' is run." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "string" "pcl-cvs/string.el" (12675 57116))
+
+;;;***
+
+;;;### (autoloads nil "string" "pcl-cvs/string.el" (12677 32615))
 ;;; Generated autoloads from pcl-cvs/string.el
-
-;;;***
-
-;;;### (autoloads (about-xemacs) "about" "prim/about.el" (12823 45280))
+
+;;;### (autoloads (about-xemacs) "about" "prim/about.el" (12906 11271))
 ;;; Generated autoloads from prim/about.el
 
 (autoload 'about-xemacs "about" nil t nil)
 
 ;;;***
 
-;;;### (autoloads (all-hail-emacs all-hail-xemacs praise-be-unto-emacs praise-be-unto-xemacs) "advocacy" "prim/advocacy.el" (12860 15586))
+;;;### (autoloads (all-hail-emacs all-hail-xemacs praise-be-unto-emacs praise-be-unto-xemacs) "advocacy" "prim/advocacy.el" (12906 11381))
 ;;; Generated autoloads from prim/advocacy.el
 
 (defvar xemacs-praise-sound-file "sounds/im_so_happy.au" "\
@@ -9138,16 +9768,22 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "backquote" "prim/backquote.el" (12677 32599))
+
+;;;***
+
+;;;### (autoloads nil "backquote" "prim/backquote.el" (12906 11324))
 ;;; Generated autoloads from prim/backquote.el
 
 ;;;***
 
-;;;### (autoloads nil "buffer" "prim/buffer.el" (12677 32606))
+;;;### (autoloads nil "buffer" "prim/buffer.el" (12966 32424))
 ;;; Generated autoloads from prim/buffer.el
-
-;;;### (autoloads (describe-buffer-case-table) "case-table" "prim/case-table.el" (12849 46023))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads (describe-buffer-case-table) "case-table" "prim/case-table.el" (12906 11075))
 ;;; Generated autoloads from prim/case-table.el
 
 (autoload 'describe-buffer-case-table "case-table" "\
@@ -9156,34 +9792,33 @@
 ;;;***
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "cmdloop" "prim/cmdloop.el" (12849 46028))
+
+;;;### (autoloads nil "cmdloop" "prim/cmdloop.el" (12906 11250))
 ;;; Generated autoloads from prim/cmdloop.el
-
-;;;### (autoloads nil "cmdloop1" "prim/cmdloop1.el" (12677 32593))
+
+;;;***
+
+;;;### (autoloads nil "cmdloop1" "prim/cmdloop1.el" (12906 11276))
 ;;; Generated autoloads from prim/cmdloop1.el
 
 ;;;***
 
-;;;### (autoloads nil "console" "prim/console.el" (12677 32604))
+;;;### (autoloads nil "console" "prim/console.el" (12906 11349))
 ;;; Generated autoloads from prim/console.el
-
-;;;### (autoloads nil "curmudgeon" "prim/curmudgeon.el" (12648 4996))
-;;; Generated autoloads from prim/curmudgeon.el
-
-;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug" "prim/debug.el" (12677 32548))
+
+;;;***
+
+;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug" "prim/debug.el" (12966 28664))
 ;;; Generated autoloads from prim/debug.el
 
 (autoload 'debug "debug" "\
 Enter debugger.  To return, type \\<debugger-mode-map>`\\[debugger-continue]'.
-Arguments are mainly for use when this is called
- from the internals of the evaluator.
-You may call with no args, or you may
- pass nil as the first arg and any other args you like.
- In that case, the list of args after the first will 
- be printed into the backtrace buffer." t nil)
+Arguments are mainly for use when this is called from the internals
+of the evaluator.
+
+You may call with no args, or you may pass nil as the first arg and
+any other args you like.  In that case, the list of args after the
+first will be printed into the backtrace buffer." t nil)
 
 (autoload 'debug-on-entry "debug" "\
 Request FUNCTION to invoke debugger each time it is called.
@@ -9201,15 +9836,15 @@
 
 ;;;***
 
-;;;### (autoloads nil "device" "prim/device.el" (12677 32599))
+;;;### (autoloads nil "device" "prim/device.el" (12906 11332))
 ;;; Generated autoloads from prim/device.el
 
 ;;;***
 
-;;;### (autoloads nil "dialog" "prim/dialog.el" (12677 32597))
+;;;### (autoloads nil "dialog" "prim/dialog.el" (12906 11302))
 ;;; Generated autoloads from prim/dialog.el
 
-;;;### (autoloads (standard-display-european standard-display-underline standard-display-graphic standard-display-g1 standard-display-ascii standard-display-default standard-display-8bit make-display-table describe-current-display-table) "disp-table" "prim/disp-table.el" (12849 46029))
+;;;### (autoloads (standard-display-european standard-display-underline standard-display-graphic standard-display-g1 standard-display-ascii standard-display-default standard-display-8bit make-display-table describe-current-display-table) "disp-table" "prim/disp-table.el" (12906 11306))
 ;;; Generated autoloads from prim/disp-table.el
 
 (autoload 'describe-current-display-table "disp-table" "\
@@ -9248,7 +9883,7 @@
 
 ;;;***
 
-;;;### (autoloads (setenv) "env" "prim/env.el" (12860 15585))
+;;;### (autoloads (setenv) "env" "prim/env.el" (12906 11290))
 ;;; Generated autoloads from prim/env.el
 
 (autoload 'setenv "env" "\
@@ -9263,8 +9898,10 @@
 This function works by modifying `process-environment'." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "events" "prim/events.el" (12723 42162))
+
+;;;***
+
+;;;### (autoloads nil "events" "prim/events.el" (12906 11353))
 ;;; Generated autoloads from prim/events.el
 
 ;;;***
@@ -9273,116 +9910,126 @@
 
 ;;;***
 
-;;;### (autoloads nil "extents" "prim/extents.el" (12823 45284))
+;;;### (autoloads nil "extents" "prim/extents.el" (12906 11328))
 ;;; Generated autoloads from prim/extents.el
 
 ;;;***
 
-;;;### (autoloads nil "faces" "prim/faces.el" (12849 46018))
+;;;### (autoloads nil "faces" "prim/faces.el" (12906 11019))
 ;;; Generated autoloads from prim/faces.el
-
-;;;### (autoloads nil "files-nomule" "prim/files-nomule.el" (12677 32601))
+
+;;;***
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "files-nomule" "prim/files-nomule.el" (12906 11341))
 ;;; Generated autoloads from prim/files-nomule.el
 
 ;;;***
-
-;;;***
-
-;;;***
-
-;;;### (autoloads nil "files" "prim/files.el" (12860 15576))
+
+;;;### (autoloads nil "files" "prim/files.el" (12933 37170))
 ;;; Generated autoloads from prim/files.el
 
 ;;;***
 
-;;;### (autoloads nil "fill" "prim/fill.el" (12860 15577))
+;;;### (autoloads nil "fill" "prim/fill.el" (12906 11051))
 ;;; Generated autoloads from prim/fill.el
 
 ;;;***
 
-;;;### (autoloads nil "float-sup" "prim/float-sup.el" (12860 15579))
+;;;### (autoloads nil "float-sup" "prim/float-sup.el" (12906 11080))
 ;;; Generated autoloads from prim/float-sup.el
-
-;;;### (autoloads nil "format" "prim/format.el" (12677 32604))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "format" "prim/format.el" (12966 30158))
 ;;; Generated autoloads from prim/format.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "frame" "prim/frame.el" (12823 45284))
+
+;;;### (autoloads nil "frame" "prim/frame.el" (12964 18200))
 ;;; Generated autoloads from prim/frame.el
 
 ;;;***
 
-;;;### (autoloads nil "glyphs" "prim/glyphs.el" (12738 54594))
+;;;### (autoloads nil "glyphs" "prim/glyphs.el" (12906 11412))
 ;;; Generated autoloads from prim/glyphs.el
-
-;;;### (autoloads nil "gui" "prim/gui.el" (12677 32607))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "gui" "prim/gui.el" (12906 11378))
 ;;; Generated autoloads from prim/gui.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "help" "prim/help.el" (12849 46022))
+
+;;;### (autoloads nil "help" "prim/help.el" (12966 32284))
 ;;; Generated autoloads from prim/help.el
-
-;;;### (autoloads nil "inc-vers" "prim/inc-vers.el" (12677 32555))
+
+;;;***
+
+;;;### (autoloads nil "inc-vers" "prim/inc-vers.el" (12906 11139))
 ;;; Generated autoloads from prim/inc-vers.el
 
 ;;;***
 
-;;;### (autoloads nil "indent" "prim/indent.el" (12677 32539))
+;;;### (autoloads nil "indent" "prim/indent.el" (12966 29741))
 ;;; Generated autoloads from prim/indent.el
-
-;;;### (autoloads nil "isearch-mode" "prim/isearch-mode.el" (12713 64141))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "isearch-mode" "prim/isearch-mode.el" (12906 11036))
 ;;; Generated autoloads from prim/isearch-mode.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "itimer" "prim/itimer.el" (12677 32589))
+
+;;;### (autoloads nil "itimer" "prim/itimer.el" (12906 11260))
 ;;; Generated autoloads from prim/itimer.el
 
 ;;;***
 
-;;;### (autoloads nil "keydefs" "prim/keydefs.el" (12677 32584))
+;;;### (autoloads nil "keydefs" "prim/keydefs.el" (12906 11222))
 ;;; Generated autoloads from prim/keydefs.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "keymap" "prim/keymap.el" (12823 45279))
+;;;### (autoloads nil "keymap" "prim/keymap.el" (12906 11265))
 ;;; Generated autoloads from prim/keymap.el
 
 ;;;***
 
-;;;### (autoloads nil "lisp" "prim/lisp.el" (12860 15579))
+;;;### (autoloads nil "lisp" "prim/lisp.el" (12906 11066))
 ;;; Generated autoloads from prim/lisp.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "loaddefs" "prim/loaddefs.el" (12861 37863))
+;;;### (autoloads nil "loaddefs" "prim/loaddefs.el" (12958 26695))
 ;;; Generated autoloads from prim/loaddefs.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "loadup-el" "prim/loadup-el.el" (12637 27959))
+;;;### (autoloads nil "loadup-el" "prim/loadup-el.el" (12906 11294))
 ;;; Generated autoloads from prim/loadup-el.el
 
 ;;;***
 
-;;;### (autoloads nil "loadup" "prim/loadup.el" (12860 15576))
+;;;### (autoloads nil "loadup" "prim/loadup.el" (12933 37130))
 ;;; Generated autoloads from prim/loadup.el
 
-;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro name-last-kbd-macro) "macros" "prim/macros.el" (12542 34430))
+;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro name-last-kbd-macro) "macros" "prim/macros.el" (12906 11061))
 ;;; Generated autoloads from prim/macros.el
 
 (autoload 'name-last-kbd-macro "macros" "\
@@ -9461,36 +10108,44 @@
 " t nil)
 
 ;;;***
-
-;;;### (autoloads nil "menubar" "prim/menubar.el" (12677 32542))
+
+;;;***
+
+;;;### (autoloads nil "menubar" "prim/menubar.el" (12906 11085))
 ;;; Generated autoloads from prim/menubar.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "minibuf" "prim/minibuf.el" (12823 45266))
+;;;### (autoloads nil "minibuf" "prim/minibuf.el" (12906 11127))
 ;;; Generated autoloads from prim/minibuf.el
 
 ;;;***
 
-;;;### (autoloads nil "misc" "prim/misc.el" (12860 15580))
+;;;### (autoloads nil "misc" "prim/misc.el" (12906 11115))
 ;;; Generated autoloads from prim/misc.el
-
-;;;### (autoloads nil "mode-motion" "prim/mode-motion.el" (12677 32547))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "mode-motion" "prim/mode-motion.el" (12906 11105))
 ;;; Generated autoloads from prim/mode-motion.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "modeline" "prim/modeline.el" (12860 15586))
+
+;;;### (autoloads nil "modeline" "prim/modeline.el" (12933 36959))
 ;;; Generated autoloads from prim/modeline.el
-
-;;;### (autoloads nil "mouse" "prim/mouse.el" (12748 62808))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "mouse" "prim/mouse.el" (12906 11092))
 ;;; Generated autoloads from prim/mouse.el
 
-;;;### (autoloads (disable-command enable-command disabled-command-hook) "novice" "prim/novice.el" (12677 32578))
+;;;### (autoloads (disable-command enable-command disabled-command-hook) "novice" "prim/novice.el" (12966 30527))
 ;;; Generated autoloads from prim/novice.el
 
 (autoload 'disabled-command-hook "novice" nil nil nil)
@@ -9509,15 +10164,17 @@
 
 ;;;***
 
-;;;### (autoloads nil "objects" "prim/objects.el" (12677 32598))
+;;;### (autoloads nil "objects" "prim/objects.el" (12906 11319))
 ;;; Generated autoloads from prim/objects.el
 
 ;;;***
 
-;;;### (autoloads nil "obsolete" "prim/obsolete.el" (12701 8652))
+;;;### (autoloads nil "obsolete" "prim/obsolete.el" (12906 11311))
 ;;; Generated autoloads from prim/obsolete.el
-
-;;;### (autoloads (edit-options list-options) "options" "prim/options.el" (12677 32546))
+
+;;;***
+
+;;;### (autoloads (edit-options list-options) "options" "prim/options.el" (12966 30561))
 ;;; Generated autoloads from prim/options.el
 
 (autoload 'list-options "options" "\
@@ -9533,30 +10190,33 @@
 
 ;;;***
 
-;;;### (autoloads nil "page" "prim/page.el" (12677 32535))
+;;;### (autoloads nil "page" "prim/page.el" (12966 30592))
 ;;; Generated autoloads from prim/page.el
 
 ;;;***
 
-;;;### (autoloads nil "paragraphs" "prim/paragraphs.el" (12677 32580))
+;;;### (autoloads nil "paragraphs" "prim/paragraphs.el" (12966 30622))
 ;;; Generated autoloads from prim/paragraphs.el
-
-;;;### (autoloads nil "process" "prim/process.el" (12723 42161))
+
+;;;***
+
+;;;### (autoloads nil "process" "prim/process.el" (12906 11315))
 ;;; Generated autoloads from prim/process.el
 
 ;;;***
 
-;;;### (autoloads nil "profile" "prim/profile.el" (12677 32606))
+;;;### (autoloads nil "profile" "prim/profile.el" (12906 11369))
 ;;; Generated autoloads from prim/profile.el
-
-;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle delete-rectangle) "rect" "prim/rect.el" (12677 32555))
+
+;;;***
+
+;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle delete-rectangle) "rect" "prim/rect.el" (12966 30358))
 ;;; Generated autoloads from prim/rect.el
 
 (autoload 'delete-rectangle "rect" "\
 Delete (don't save) text in rectangle with point and mark as corners.
-The same range of columns is deleted in each line
-starting with the line where the region begins
-and ending with the line where the region ends." t nil)
+The same range of columns is deleted in each line starting with the line
+where the region begins and ending with the line where the region ends." t nil)
 
 (autoload 'delete-extract-rectangle "rect" "\
 Delete contents of rectangle and return it as a list of strings.
@@ -9580,8 +10240,8 @@
 
 (autoload 'insert-rectangle "rect" "\
 Insert text of RECTANGLE with upper left corner at point.
-RECTANGLE's first line is inserted at point,
-its second line is inserted at a point vertically under point, etc.
+RECTANGLE's first line is inserted at point, its second
+line is inserted at a point vertically under point, etc.
 RECTANGLE should be a list of strings.
 After this command, the mark is at the upper left corner
 and point is at the lower right corner." nil nil)
@@ -9607,19 +10267,17 @@
 
 ;;;***
 
-;;;### (autoloads nil "register" "prim/register.el" (12677 32547))
+;;;### (autoloads nil "register" "prim/register.el" (12966 29769))
 ;;; Generated autoloads from prim/register.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "replace" "prim/replace.el" (12823 45264))
+;;;### (autoloads nil "replace" "prim/replace.el" (12967 11006))
 ;;; Generated autoloads from prim/replace.el
-
-;;;***
-
-;;;### (autoloads (reposition-window) "reposition" "prim/reposition.el" (12542 36921))
+
+;;;### (autoloads (reposition-window) "reposition" "prim/reposition.el" (12966 30125))
 ;;; Generated autoloads from prim/reposition.el
 
 (autoload 'reposition-window "reposition" "\
@@ -9647,11 +10305,13 @@
 ;;; Generated autoloads from prim/scrollbar.el
 
 ;;;***
-
-;;;### (autoloads nil "simple" "prim/simple.el" (12860 15584))
+
+;;;***
+
+;;;### (autoloads nil "simple" "prim/simple.el" (12966 29111))
 ;;; Generated autoloads from prim/simple.el
 
-;;;### (autoloads (reverse-region sort-columns sort-regexp-fields sort-fields sort-float-fields sort-numeric-fields sort-pages sort-paragraphs sort-lines sort-subr) "sort" "prim/sort.el" (12542 34435))
+;;;### (autoloads (reverse-region sort-columns sort-regexp-fields sort-fields sort-float-fields sort-numeric-fields sort-pages sort-paragraphs sort-lines sort-subr) "sort" "prim/sort.el" (12966 30391))
 ;;; Generated autoloads from prim/sort.el
 
 (autoload 'sort-subr "sort" "\
@@ -9765,7 +10425,7 @@
 
 ;;;***
 
-;;;### (autoloads (load-default-sounds load-sound-file) "sound" "prim/sound.el" (12677 32584))
+;;;### (autoloads (load-default-sounds load-sound-file) "sound" "prim/sound.el" (12906 11236))
 ;;; Generated autoloads from prim/sound.el
 
 (or sound-alist (setq sound-alist '((ready nil) (warp nil))))
@@ -9787,33 +10447,35 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "specifier" "prim/specifier.el" (12849 46031))
+
+;;;***
+
+;;;### (autoloads nil "specifier" "prim/specifier.el" (12906 11337))
 ;;; Generated autoloads from prim/specifier.el
 
 ;;;***
 
-;;;### (autoloads nil "startup" "prim/startup.el" (12849 46024))
+;;;### (autoloads nil "startup" "prim/startup.el" (12968 22156))
 ;;; Generated autoloads from prim/startup.el
 
 ;;;***
 
-;;;### (autoloads nil "subr" "prim/subr.el" (12849 46026))
+;;;### (autoloads nil "subr" "prim/subr.el" (12966 33838))
 ;;; Generated autoloads from prim/subr.el
-
-;;;### (autoloads nil "symbols" "prim/symbols.el" (12677 32605))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "symbols" "prim/symbols.el" (12906 11356))
 ;;; Generated autoloads from prim/symbols.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "syntax" "prim/syntax.el" (12823 45281))
+
+;;;### (autoloads nil "syntax" "prim/syntax.el" (12958 28151))
 ;;; Generated autoloads from prim/syntax.el
-
-;;;***
-
-;;;### (autoloads (tabify untabify) "tabify" "prim/tabify.el" (12860 15584))
+
+;;;### (autoloads (tabify untabify) "tabify" "prim/tabify.el" (12906 11245))
 ;;; Generated autoloads from prim/tabify.el
 
 (autoload 'untabify "tabify" "\
@@ -9831,21 +10493,27 @@
 The variable `tab-width' controls the spacing of tab stops." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "toolbar" "prim/toolbar.el" (12677 32580))
+
+;;;***
+
+;;;### (autoloads nil "toolbar" "prim/toolbar.el" (12906 11201))
 ;;; Generated autoloads from prim/toolbar.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "undo-stack" "prim/undo-stack.el" (12823 45287))
+;;;### (autoloads nil "undo-stack" "prim/undo-stack.el" (12906 11374))
 ;;; Generated autoloads from prim/undo-stack.el
-
-;;;### (autoloads nil "update-elc" "prim/update-elc.el" (12677 32597))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "update-elc" "prim/update-elc.el" (12906 11297))
 ;;; Generated autoloads from prim/update-elc.el
 
-;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock) "userlock" "prim/userlock.el" (12677 32588))
+;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock) "userlock" "prim/userlock.el" (12966 30758))
 ;;; Generated autoloads from prim/userlock.el
 
 (autoload 'ask-user-about-lock "userlock" "\
@@ -9870,54 +10538,58 @@
 
 ;;;***
 
-;;;### (autoloads nil "window" "prim/window.el" (12677 32584))
+;;;### (autoloads nil "window" "prim/window.el" (12906 11232))
 ;;; Generated autoloads from prim/window.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "iso-sgml" "psgml/iso-sgml.el" (12851 23340))
+;;;### (autoloads nil "iso-sgml" "psgml/iso-sgml.el" (12860 33913))
 ;;; Generated autoloads from psgml/iso-sgml.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "nefarious" "psgml/nefarious.el" (12860 15648))
+;;;### (autoloads nil "nefarious" "psgml/nefarious.el" (12885 62695))
 ;;; Generated autoloads from psgml/nefarious.el
-
-;;;### (autoloads nil "psgml-api" "psgml/psgml-api.el" (12851 23341))
+
+;;;***
+
+;;;### (autoloads nil "psgml-api" "psgml/psgml-api.el" (12860 33914))
 ;;; Generated autoloads from psgml/psgml-api.el
 
 ;;;***
 
-;;;### (autoloads nil "psgml-charent" "psgml/psgml-charent.el" (12851 23342))
+;;;### (autoloads nil "psgml-charent" "psgml/psgml-charent.el" (12860 33915))
 ;;; Generated autoloads from psgml/psgml-charent.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "psgml-debug" "psgml/psgml-debug.el" (12860 15640))
+;;;### (autoloads nil "psgml-debug" "psgml/psgml-debug.el" (12885 62689))
 ;;; Generated autoloads from psgml/psgml-debug.el
-
-;;;### (autoloads nil "psgml-dtd" "psgml/psgml-dtd.el" (12851 23344))
+
+;;;***
+
+;;;### (autoloads nil "psgml-dtd" "psgml/psgml-dtd.el" (12860 33917))
 ;;; Generated autoloads from psgml/psgml-dtd.el
 
 ;;;***
 
-;;;### (autoloads nil "psgml-edit" "psgml/psgml-edit.el" (12851 23345))
+;;;### (autoloads nil "psgml-edit" "psgml/psgml-edit.el" (12860 33918))
 ;;; Generated autoloads from psgml/psgml-edit.el
 
-;;;### (autoloads (style-format) "psgml-fs" "psgml/psgml-fs.el" (12851 23339))
+;;;### (autoloads (style-format) "psgml-fs" "psgml/psgml-fs.el" (12860 33912))
 ;;; Generated autoloads from psgml/psgml-fs.el
 
 (autoload 'style-format "psgml-fs" nil t nil)
 
 ;;;***
 
-;;;### (autoloads nil "psgml-html" "psgml/psgml-html.el" (12851 23346))
+;;;### (autoloads nil "psgml-html" "psgml/psgml-html.el" (12860 33919))
 ;;; Generated autoloads from psgml/psgml-html.el
 
 (autoload 'html-mode "psgml-html" "\
@@ -9931,37 +10603,39 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "psgml-info" "psgml/psgml-info.el" (12851 23347))
+
+;;;***
+
+;;;### (autoloads nil "psgml-info" "psgml/psgml-info.el" (12860 33920))
 ;;; Generated autoloads from psgml/psgml-info.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "psgml-lfix" "psgml/psgml-lfix.el" (12860 15649))
+;;;### (autoloads nil "psgml-lfix" "psgml/psgml-lfix.el" (12885 62696))
 ;;; Generated autoloads from psgml/psgml-lfix.el
-
-;;;### (autoloads nil "psgml-other" "psgml/psgml-other.el" (12851 23347))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "psgml-other" "psgml/psgml-other.el" (12860 33921))
 ;;; Generated autoloads from psgml/psgml-other.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "psgml-parse" "psgml/psgml-parse.el" (12860 15643))
+
+;;;### (autoloads nil "psgml-parse" "psgml/psgml-parse.el" (12951 48578))
 ;;; Generated autoloads from psgml/psgml-parse.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "psgml-xemacs" "psgml/psgml-xemacs.el" (12851 23353))
+;;;### (autoloads nil "psgml-xemacs" "psgml/psgml-xemacs.el" (12860 33924))
 ;;; Generated autoloads from psgml/psgml-xemacs.el
-
-;;;***
-
-;;;### (autoloads (sgml-mode) "psgml" "psgml/psgml.el" (12860 15647))
+
+;;;### (autoloads (sgml-mode) "psgml" "psgml/psgml.el" (12885 62695))
 ;;; Generated autoloads from psgml/psgml.el
 
 (autoload 'sgml-mode "psgml" "\
@@ -10041,21 +10715,25 @@
 ;;; Generated autoloads from psgml/tempo.el
 
 ;;;***
-
-;;;### (autoloads nil "rmail-kill" "rmail/rmail-kill.el" (12677 32616))
+
+;;;***
+
+;;;### (autoloads nil "rmail-kill" "rmail/rmail-kill.el" (12967 52151))
 ;;; Generated autoloads from rmail/rmail-kill.el
-
-;;;***
 
 ;;;### (autoloads nil "rmail-lucid" "rmail/rmail-lucid.el" (12677 32616))
 ;;; Generated autoloads from rmail/rmail-lucid.el
 
 ;;;***
-
-;;;### (autoloads nil "rmail-xemacs" "rmail/rmail-xemacs.el" (12860 15674))
+
+;;;***
+
+;;;### (autoloads nil "rmail-xemacs" "rmail/rmail-xemacs.el" (12967 52190))
 ;;; Generated autoloads from rmail/rmail-xemacs.el
-
-;;;### (autoloads (rmail-input rmail-mode rmail) "rmail" "rmail/rmail.el" (12860 15588))
+
+;;;***
+
+;;;### (autoloads (rmail-input rmail-mode rmail) "rmail" "rmail/rmail.el" (12906 8059))
 ;;; Generated autoloads from rmail/rmail.el
 
 (defvar rmail-dont-reply-to-names nil "\
@@ -10150,20 +10828,22 @@
 
 ;;;***
 
-;;;### (autoloads nil "rmailedit" "rmail/rmailedit.el" (12677 32616))
+;;;### (autoloads nil "rmailedit" "rmail/rmailedit.el" (12906 8067))
 ;;; Generated autoloads from rmail/rmailedit.el
 
 ;;;***
 
-;;;### (autoloads nil "rmailkwd" "rmail/rmailkwd.el" (12677 32619))
+;;;### (autoloads nil "rmailkwd" "rmail/rmailkwd.el" (12906 8076))
 ;;; Generated autoloads from rmail/rmailkwd.el
 
 ;;;***
 
-;;;### (autoloads nil "rmailmsc" "rmail/rmailmsc.el" (12677 32619))
+;;;### (autoloads nil "rmailmsc" "rmail/rmailmsc.el" (12906 8084))
 ;;; Generated autoloads from rmail/rmailmsc.el
-
-;;;### (autoloads (rmail-file-p) "rmailout" "rmail/rmailout.el" (12677 32620))
+
+;;;***
+
+;;;### (autoloads (rmail-file-p) "rmailout" "rmail/rmailout.el" (12906 8093))
 ;;; Generated autoloads from rmail/rmailout.el
 
 (autoload 'rmail-file-p "rmailout" nil nil nil)
@@ -10172,20 +10852,24 @@
 
 ;;;***
 
-;;;### (autoloads nil "rmailsort" "rmail/rmailsort.el" (12677 32620))
+;;;### (autoloads nil "rmailsort" "rmail/rmailsort.el" (12906 8103))
 ;;; Generated autoloads from rmail/rmailsort.el
 
 ;;;***
 
-;;;### (autoloads nil "rmailsum" "rmail/rmailsum.el" (12677 32620))
+;;;### (autoloads nil "rmailsum" "rmail/rmailsum.el" (12906 8113))
 ;;; Generated autoloads from rmail/rmailsum.el
 
 ;;;***
 
-;;;### (autoloads nil "undigest" "rmail/undigest.el" (12677 32621))
+;;;### (autoloads nil "undigest" "rmail/undigest.el" (12906 8122))
 ;;; Generated autoloads from rmail/undigest.el
-
-;;;### (autoloads (unrmail batch-unrmail) "unrmail" "rmail/unrmail.el" (12677 32621))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads (unrmail batch-unrmail) "unrmail" "rmail/unrmail.el" (12906 8129))
 ;;; Generated autoloads from rmail/unrmail.el
 
 (autoload 'batch-unrmail "unrmail" "\
@@ -10201,16 +10885,14 @@
 ;;;***
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "sunpro-init" "sunpro/sunpro-init.el" (12823 45304))
+
+;;;### (autoloads nil "sunpro-init" "sunpro/sunpro-init.el" (12906 11939))
 ;;; Generated autoloads from sunpro/sunpro-init.el
+
+;;;***
 
 ;;;### (autoloads nil "sunpro-keys" "sunpro/sunpro-keys.el" (12677 32713))
 ;;; Generated autoloads from sunpro/sunpro-keys.el
-
-;;;***
 
 ;;;### (autoloads nil "sunpro-load" "sunpro/sunpro-load.el" (12688 9300))
 ;;; Generated autoloads from sunpro/sunpro-load.el
@@ -10294,11 +10976,11 @@
 ;;; Generated autoloads from term/sup-mouse.el
 
 ;;;***
-
-;;;### (autoloads nil "tty-init" "term/tty-init.el" (12701 8657))
+
+;;;***
+
+;;;### (autoloads nil "tty-init" "term/tty-init.el" (12933 36919))
 ;;; Generated autoloads from term/tty-init.el
-
-;;;***
 
 ;;;### (autoloads nil "tvi970" "term/tvi970.el" (12677 32628))
 ;;; Generated autoloads from term/tvi970.el
@@ -10382,6 +11064,375 @@
 
 ;;;### (autoloads nil "xterm" "term/xterm.el" (12677 32630))
 ;;; Generated autoloads from term/xterm.el
+
+;;;***
+
+;;;### (autoloads nil "cless" "tl/cless.el" (12913 42359))
+;;; Generated autoloads from tl/cless.el
+
+;;;***
+
+;;;### (autoloads nil "emu-x20" "tl/emu-x20.el" (12951 48622))
+;;; Generated autoloads from tl/emu-x20.el
+
+;;;***
+
+;;;### (autoloads nil "emu-xemacs" "tl/emu-xemacs.el" (12958 21634))
+;;; Generated autoloads from tl/emu-xemacs.el
+
+;;;***
+
+;;;### (autoloads nil "emu" "tl/emu.el" (12913 42340))
+;;; Generated autoloads from tl/emu.el
+
+;;;***
+
+;;;### (autoloads nil "file-detect" "tl/file-detect.el" (12913 42352))
+;;; Generated autoloads from tl/file-detect.el
+
+;;;***
+
+;;;### (autoloads nil "mime-setup" "tl/mime-setup.el" (12942 40875))
+;;; Generated autoloads from tl/mime-setup.el
+
+;;;***
+
+;;;### (autoloads nil "range" "tl/range.el" (12913 42346))
+;;; Generated autoloads from tl/range.el
+
+;;;***
+
+;;;### (autoloads nil "richtext" "tl/richtext.el" (12913 42360))
+;;; Generated autoloads from tl/richtext.el
+
+;;;***
+
+;;;### (autoloads nil "texi-util" "tl/texi-util.el" (12913 42357))
+;;; Generated autoloads from tl/texi-util.el
+
+;;;***
+
+;;;### (autoloads nil "tl-atype" "tl/tl-atype.el" (12913 42353))
+;;; Generated autoloads from tl/tl-atype.el
+
+;;;***
+
+;;;### (autoloads nil "tl-list" "tl/tl-list.el" (12913 42345))
+;;; Generated autoloads from tl/tl-list.el
+
+;;;***
+
+;;;### (autoloads nil "tl-misc" "tl/tl-misc.el" (12913 42350))
+;;; Generated autoloads from tl/tl-misc.el
+
+;;;***
+
+;;;### (autoloads nil "tl-num" "tl/tl-num.el" (12913 42343))
+;;; Generated autoloads from tl/tl-num.el
+
+;;;***
+
+;;;### (autoloads nil "tl-seq" "tl/tl-seq.el" (12913 42348))
+;;; Generated autoloads from tl/tl-seq.el
+
+;;;***
+
+;;;### (autoloads nil "tl-str" "tl/tl-str.el" (12913 42342))
+;;; Generated autoloads from tl/tl-str.el
+
+;;;***
+
+;;;### (autoloads nil "tu-comment" "tl/tu-comment.el" (12913 42356))
+;;; Generated autoloads from tl/tu-comment.el
+
+;;;***
+
+;;;### (autoloads nil "tu-replace" "tl/tu-replace.el" (12913 42355))
+;;; Generated autoloads from tl/tu-replace.el
+
+;;;***
+
+;;;### (autoloads nil "gnus-art-mime" "tm/gnus-art-mime.el" (12942 40830))
+;;; Generated autoloads from tm/gnus-art-mime.el
+
+;;;***
+
+;;;### (autoloads nil "gnus-charset" "tm/gnus-charset.el" (12918 33865))
+;;; Generated autoloads from tm/gnus-charset.el
+
+;;;***
+
+;;;### (autoloads nil "gnus-mime-old" "tm/gnus-mime-old.el" (12913 42320))
+;;; Generated autoloads from tm/gnus-mime-old.el
+
+;;;***
+
+;;;### (autoloads nil "gnus-mime" "tm/gnus-mime.el" (12942 40817))
+;;; Generated autoloads from tm/gnus-mime.el
+
+;;;***
+
+;;;### (autoloads nil "gnus-sum-mime" "tm/gnus-sum-mime.el" (12913 42326))
+;;; Generated autoloads from tm/gnus-sum-mime.el
+
+;;;***
+
+;;;### (autoloads nil "message-mime" "tm/message-mime.el" (12913 42328))
+;;; Generated autoloads from tm/message-mime.el
+
+;;;***
+
+;;;### (autoloads nil "sc-setup" "tm/sc-setup.el" (12913 42311))
+;;; Generated autoloads from tm/sc-setup.el
+
+;;;***
+
+;;;### (autoloads nil "signature" "tm/signature.el" (12913 42276))
+;;; Generated autoloads from tm/signature.el
+
+;;;***
+
+;;;### (autoloads nil "tm-bbdb" "tm/tm-bbdb.el" (12947 52265))
+;;; Generated autoloads from tm/tm-bbdb.el
+
+;;;***
+
+;;;### (autoloads nil "tm-def" "tm/tm-def.el" (12926 37080))
+;;; Generated autoloads from tm/tm-def.el
+
+;;;***
+
+;;;### (autoloads nil "tm-edit-mc" "tm/tm-edit-mc.el" (12942 25940))
+;;; Generated autoloads from tm/tm-edit-mc.el
+
+;;;### (autoloads (mime/editor-mode) "tm-edit" "tm/tm-edit.el" (12942 40804))
+;;; Generated autoloads from tm/tm-edit.el
+
+(autoload 'mime/editor-mode "tm-edit" "\
+MIME minor mode for editing the tagged MIME message.
+
+In this mode, basically, the message is composed in the tagged MIME
+format. The message tag looks like:
+
+	`--[[text/plain; charset=ISO-2022-JP][7bit]]'.
+
+The tag specifies the MIME content type, subtype, optional parameters
+and transfer encoding of the message following the tag. Messages
+without any tag are treated as `text/plain' by default. Charset and
+transfer encoding are automatically defined unless explicitly
+specified. Binary messages such as audio and image are usually hidden.
+The messages in the tagged MIME format are automatically translated
+into a MIME compliant message when exiting this mode.
+
+Available charsets depend on Emacs version being used. The following
+lists the available charsets of each emacs.
+
+EMACS 18:	US-ASCII is only available.
+NEmacs:		US-ASCII and ISO-2022-JP are available.
+EMACS 19:	US-ASCII and ISO-8859-1 (or other charset) are available.
+XEmacs 19:	US-ASCII and ISO-8859-1 (or other charset) are available.
+Mule:		US-ASCII, ISO-8859-* (except for ISO-8859-5), KOI8-R,
+		ISO-2022-JP, ISO-2022-JP-2, ISO-2022-KR, BIG5 and
+		ISO-2022-INT-1 are available.
+
+ISO-2022-JP-2 and ISO-2022-INT-1 charsets used in mule is expected to
+be used to represent multilingual text in intermixed manner. Any
+languages that has no registered charset are represented as either
+ISO-2022-JP-2 or ISO-2022-INT-1 in mule.
+
+If you want to use non-ISO-8859-1 charset in EMACS 19 or XEmacs 19,
+please set variable `default-mime-charset'. This variable must be
+symbol of which name is a MIME charset.
+
+If you want to add more charsets in mule, please set variable
+`charsets-mime-charset-alist'. This variable must be alist of which
+key is list of leading-char/charset and value is symbol of MIME
+charset. (leading-char is a term of MULE 1.* and 2.*. charset is a
+term of XEmacs/mule, mule merged EMACS and MULE 3.*) If name of
+coding-system is different as MIME charset, please set variable
+`mime-charset-coding-system-alist'. This variable must be alist of
+which key is MIME charset and value is coding-system.
+
+Following commands are available in addition to major mode commands:
+\\[mime-editor/insert-text]	insert a text message.
+\\[mime-editor/insert-file]	insert a (binary) file.
+\\[mime-editor/insert-external]	insert a reference to external body.
+\\[mime-editor/insert-voice]	insert a voice message.
+\\[mime-editor/insert-message]	insert a mail or news message.
+\\[mime-editor/insert-mail]	insert a mail message.
+\\[mime-editor/insert-signature]	insert a signature file at end.
+\\[mime-editor/insert-tag]	insert a new MIME tag.
+\\[mime-editor/enclose-alternative-region]	enclose as multipart/alternative.
+\\[mime-editor/enclose-parallel-region]	enclose as multipart/parallel.
+\\[mime-editor/enclose-mixed-region]	enclose as multipart/mixed.
+\\[mime-editor/enclose-digest-region]	enclose as multipart/digest.
+\\[mime-editor/enclose-signed-region]	enclose as PGP signed.
+\\[mime-editor/enclose-encrypted-region]	enclose as PGP encrypted.
+\\[mime-editor/insert-key]	insert PGP public key.
+\\[mime-editor/preview-message]	preview editing MIME message.
+\\[mime-editor/exit]	exit and translate into a MIME compliant message.
+\\[mime-editor/maybe-translate]	exit and translate if in MIME mode, then split.
+\\[mime-editor/help]	show this help.
+
+Additional commands are available in some major modes:
+C-c C-c		exit, translate and run the original command.
+C-c C-s		exit, translate and run the original command.
+
+The following is a message example written in the tagged MIME format.
+TABs at the beginning of the line are not a part of the message:
+
+	This is a conventional plain text.  It should be translated
+	into text/plain.
+	--[[text/plain]]
+	This is also a plain text.  But, it is explicitly specified as
+	is.
+	--[[text/plain; charset=ISO-2022-JP]]
+	$B$3$l$O(B charset $B$r(B ISO-2022-JP $B$K;XDj$7$?F|K8l$N(B plain $B/home/mrb/e/w/editor/lisp/tm/SCCS/s.tm-edit.el-%9(B
+	$B%H$G$9(B.
+	--[[text/richtext]]
+	<center>This is a richtext.</center>
+	--[[image/gif][base64]]^M...image encoded in base64 here...
+	--[[audio/basic][base64]]^M...audio encoded in base64 here...
+
+User customizable variables (not documented all of them):
+ mime-prefix
+    Specifies a key prefix for MIME minor mode commands.
+
+ mime-ignore-preceding-spaces
+    Preceding white spaces in a message body are ignored if non-nil.
+
+ mime-ignore-trailing-spaces
+    Trailing white spaces in a message body are ignored if non-nil.
+
+ mime-auto-fill-header
+    Fill header fields that contain encoded-words if non-nil.
+
+ mime-auto-hide-body
+    Hide a non-textual body message encoded in base64 after insertion
+    if non-nil.
+
+ mime-editor/voice-recorder
+    Specifies a function to record a voice message and encode it.
+    The function `mime-editor/voice-recorder-for-sun' is for Sun
+    SparcStations.
+
+ mime/editor-mode-hook
+    Turning on MIME mode calls the value of mime/editor-mode-hook, if
+    it is non-nil.
+
+ mime-editor/translate-hook
+    The value of mime-editor/translate-hook is called just before translating
+    the tagged MIME format into a MIME compliant message if it is
+    non-nil.  If the hook call the function mime-editor/insert-signature,
+    the signature file will be inserted automatically.
+
+ mime-editor/exit-hook
+    Turning off MIME mode calls the value of mime-editor/exit-hook, if it is
+    non-nil." t nil)
+
+(defalias 'edit-mime 'mime/editor-mode)
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "tm-ew-d" "tm/tm-ew-d.el" (12913 42280))
+;;; Generated autoloads from tm/tm-ew-d.el
+
+;;;***
+
+;;;### (autoloads nil "tm-ew-e" "tm/tm-ew-e.el" (12913 42297))
+;;; Generated autoloads from tm/tm-ew-e.el
+
+;;;***
+
+;;;### (autoloads nil "tm-file" "tm/tm-file.el" (12913 42296))
+;;; Generated autoloads from tm/tm-file.el
+
+;;;***
+
+;;;### (autoloads nil "tm-ftp" "tm/tm-ftp.el" (12913 42304))
+;;; Generated autoloads from tm/tm-ftp.el
+
+;;;***
+
+;;;### (autoloads nil "tm-html" "tm/tm-html.el" (12913 42293))
+;;; Generated autoloads from tm/tm-html.el
+
+;;;***
+
+;;;### (autoloads nil "tm-image" "tm/tm-image.el" (12913 42309))
+;;; Generated autoloads from tm/tm-image.el
+
+;;;***
+
+;;;### (autoloads nil "tm-latex" "tm/tm-latex.el" (12913 42292))
+;;; Generated autoloads from tm/tm-latex.el
+
+;;;***
+
+;;;### (autoloads nil "tm-mail" "tm/tm-mail.el" (12913 42330))
+;;; Generated autoloads from tm/tm-mail.el
+
+;;;***
+
+;;;### (autoloads nil "tm-mh-e" "tm/tm-mh-e.el" (12913 42315))
+;;; Generated autoloads from tm/tm-mh-e.el
+
+;;;***
+
+;;;### (autoloads nil "tm-parse" "tm/tm-parse.el" (12926 37035))
+;;; Generated autoloads from tm/tm-parse.el
+
+;;;***
+
+;;;### (autoloads nil "tm-partial" "tm/tm-partial.el" (12913 42290))
+;;; Generated autoloads from tm/tm-partial.el
+
+;;;***
+
+;;;### (autoloads nil "tm-pgp" "tm/tm-pgp.el" (12913 42306))
+;;; Generated autoloads from tm/tm-pgp.el
+
+;;;***
+
+;;;### (autoloads nil "tm-play" "tm/tm-play.el" (12913 42287))
+;;; Generated autoloads from tm/tm-play.el
+
+;;;***
+
+;;;### (autoloads nil "tm-rmail" "tm/tm-rmail.el" (12913 42333))
+;;; Generated autoloads from tm/tm-rmail.el
+
+;;;***
+
+;;;### (autoloads nil "tm-setup" "tm/tm-setup.el" (12913 42302))
+;;; Generated autoloads from tm/tm-setup.el
+
+;;;***
+
+;;;### (autoloads nil "tm-tar" "tm/tm-tar.el" (12913 42295))
+;;; Generated autoloads from tm/tm-tar.el
+
+;;;***
+
+;;;### (autoloads nil "tm-text" "tm/tm-text.el" (12913 42285))
+;;; Generated autoloads from tm/tm-text.el
+
+;;;***
+
+;;;### (autoloads nil "tm-view" "tm/tm-view.el" (12913 42283))
+;;; Generated autoloads from tm/tm-view.el
+
+;;;***
+
+;;;### (autoloads nil "tm-vm" "tm/tm-vm.el" (12942 40846))
+;;; Generated autoloads from tm/tm-vm.el
+
+;;;***
+
+;;;### (autoloads nil "tmh-comp" "tm/tmh-comp.el" (12913 42318))
+;;; Generated autoloads from tm/tmh-comp.el
 
 ;;;### (autoloads nil "tooltalk-init" "tooltalk/tooltalk-init.el" (12713 64143))
 ;;; Generated autoloads from tooltalk/tooltalk-init.el
@@ -10414,49 +11465,55 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "mm" "url/mm.el" (12823 49284))
+
+;;;***
+
+;;;### (autoloads nil "mm" "url/mm.el" (12860 33901))
 ;;; Generated autoloads from url/mm.el
+
+;;;***
+
+;;;***
 
 ;;;### (autoloads nil "ssl" "url/ssl.el" (12718 1318))
 ;;; Generated autoloads from url/ssl.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "url-cookie" "url/url-cookie.el" (12823 49285))
+
+;;;### (autoloads nil "url-cookie" "url/url-cookie.el" (12860 33910))
 ;;; Generated autoloads from url/url-cookie.el
 
 ;;;***
 
-;;;### (autoloads nil "url-file" "url/url-file.el" (12823 49284))
+;;;### (autoloads nil "url-file" "url/url-file.el" (12860 33904))
 ;;; Generated autoloads from url/url-file.el
+
+;;;***
+
+;;;***
 
 ;;;### (autoloads nil "url-gopher" "url/url-gopher.el" (12677 33103))
 ;;; Generated autoloads from url/url-gopher.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "url-hash" "url/url-hash.el" (12823 49284))
+
+;;;### (autoloads nil "url-hash" "url/url-hash.el" (12860 33904))
 ;;; Generated autoloads from url/url-hash.el
 
 ;;;***
 
-;;;### (autoloads nil "url-http" "url/url-http.el" (12823 49285))
+;;;### (autoloads nil "url-http" "url/url-http.el" (12860 33905))
 ;;; Generated autoloads from url/url-http.el
 
 ;;;***
 
-;;;### (autoloads nil "url-irc" "url/url-irc.el" (12823 49284))
+;;;### (autoloads nil "url-irc" "url/url-irc.el" (12860 33902))
 ;;; Generated autoloads from url/url-irc.el
+
+;;;***
 
 ;;;### (autoloads nil "url-mail" "url/url-mail.el" (12731 38036))
 ;;; Generated autoloads from url/url-mail.el
-
-;;;***
 
 ;;;### (autoloads nil "url-misc" "url/url-misc.el" (12748 62902))
 ;;; Generated autoloads from url/url-misc.el
@@ -10464,14 +11521,16 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "url-news" "url/url-news.el" (12823 49285))
+
+;;;***
+
+;;;### (autoloads nil "url-news" "url/url-news.el" (12860 33906))
 ;;; Generated autoloads from url/url-news.el
+
+;;;***
 
 ;;;### (autoloads nil "url-nfs" "url/url-nfs.el" (12748 62975))
 ;;; Generated autoloads from url/url-nfs.el
-
-;;;***
 
 ;;;### (autoloads nil "url-parse" "url/url-parse.el" (12677 33107))
 ;;; Generated autoloads from url/url-parse.el
@@ -10484,23 +11543,23 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "url-sysdp" "url/url-sysdp.el" (12823 49285))
+
+;;;***
+
+;;;### (autoloads nil "url-sysdp" "url/url-sysdp.el" (12926 20431))
 ;;; Generated autoloads from url/url-sysdp.el
 
 ;;;***
 
-;;;### (autoloads nil "url-vars" "url/url-vars.el" (12823 49285))
+;;;### (autoloads nil "url-vars" "url/url-vars.el" (12951 48551))
 ;;; Generated autoloads from url/url-vars.el
 
 ;;;***
 
-;;;### (autoloads nil "url-wais" "url/url-wais.el" (12823 49285))
+;;;### (autoloads nil "url-wais" "url/url-wais.el" (12860 33909))
 ;;; Generated autoloads from url/url-wais.el
-
-;;;***
-
-;;;### (autoloads (url-retrieve url-cache-expired url-popup-info url-get-url-at-point url-buffer-visiting url-normalize-url url-file-attributes) "url" "url/url.el" (12823 49283))
+
+;;;### (autoloads (url-retrieve url-cache-expired url-popup-info url-get-url-at-point url-buffer-visiting url-normalize-url url-file-attributes) "url" "url/url.el" (12951 48538))
 ;;; Generated autoloads from url/url.el
 
 (autoload 'url-file-attributes "url" "\
@@ -10558,11 +11617,18 @@
 ;;; Generated autoloads from url/urlauth.el
 
 ;;;***
-
-;;;### (autoloads nil "abbrevlist" "utils/abbrevlist.el" (12860 15589))
+
+;;;***
+
+;;;### (autoloads nil "urlauth" "url/urlauth.el" (12677 33101))
+;;; Generated autoloads from url/urlauth.el
+
+;;;***
+
+;;;### (autoloads nil "abbrevlist" "utils/abbrevlist.el" (12885 62645))
 ;;; Generated autoloads from utils/abbrevlist.el
 
-;;;### (autoloads (defadvice ad-add-advice) "advice" "utils/advice.el" (12860 15594))
+;;;### (autoloads (defadvice ad-add-advice) "advice" "utils/advice.el" (12885 62649))
 ;;; Generated autoloads from utils/advice.el
 
 (defvar ad-redefinition-action 'warn "\
@@ -10651,7 +11717,7 @@
 
 ;;;***
 
-;;;### (autoloads (all-annotations annotation-list annotations-at annotations-in-region annotation-at annotationp delete-annotation make-annotation) "annotations" "utils/annotations.el" (12559 34624))
+;;;### (autoloads (all-annotations annotation-list annotations-at annotations-in-region annotation-at annotationp delete-annotation make-annotation) "annotations" "utils/annotations.el" (12906 6309))
 ;;; Generated autoloads from utils/annotations.el
 
 (defvar make-annotation-hook nil "\
@@ -10702,16 +11768,18 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "assoc" "utils/assoc.el" (12860 15600))
+
+;;;***
+
+;;;### (autoloads nil "assoc" "utils/assoc.el" (12885 62656))
 ;;; Generated autoloads from utils/assoc.el
-
-;;;### (autoloads nil "atomic-extents" "utils/atomic-extents.el" (12677 32653))
+
+;;;***
+
+;;;### (autoloads nil "atomic-extents" "utils/atomic-extents.el" (12906 6317))
 ;;; Generated autoloads from utils/atomic-extents.el
-
-;;;***
-
-;;;### (autoloads (batch-update-autoloads update-directory-autoloads update-autoloads-here update-file-autoloads generate-file-autoloads) "autoload" "utils/autoload.el" (12677 32640))
+
+;;;### (autoloads (batch-update-autoloads update-directory-autoloads update-autoloads-here update-file-autoloads generate-file-autoloads) "autoload" "utils/autoload.el" (12906 6323))
 ;;; Generated autoloads from utils/autoload.el
 
 (autoload 'generate-file-autoloads "autoload" "\
@@ -10741,13 +11809,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "blessmail" "utils/blessmail.el" (12860 15603))
+
+;;;***
+
+;;;### (autoloads nil "blessmail" "utils/blessmail.el" (12885 62660))
 ;;; Generated autoloads from utils/blessmail.el
-
-;;;***
-
-;;;### (autoloads (browse-url-lynx-emacs browse-url-lynx-xterm browse-url-w3 browse-url-iximosaic browse-url-grail browse-url-mosaic browse-url-netscape) "browse-url" "utils/browse-url.el" (12745 43111))
+
+;;;### (autoloads (browse-url-lynx-emacs browse-url-lynx-xterm browse-url-w3 browse-url-iximosaic browse-url-grail browse-url-mosaic browse-url-netscape) "browse-url" "utils/browse-url.el" (12906 6331))
 ;;; Generated autoloads from utils/browse-url.el
 
 (defvar browse-url-browser-function 'browse-url-w3 "\
@@ -10797,11 +11865,11 @@
 an Emacs buffer." t nil)
 
 ;;;***
-
-;;;### (autoloads nil "crontab" "utils/crontab.el" (12677 32660))
+
+;;;***
+
+;;;### (autoloads nil "crontab" "utils/crontab.el" (12906 6337))
 ;;; Generated autoloads from utils/crontab.el
-
-;;;***
 
 ;;;### (autoloads nil "delbackspace" "utils/delbackspace.el" (12748 62831))
 ;;; Generated autoloads from utils/delbackspace.el
@@ -10809,11 +11877,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "derived" "utils/derived.el" (12860 15590))
+
+;;;***
+
+;;;### (autoloads nil "derived" "utils/derived.el" (12885 62646))
 ;;; Generated autoloads from utils/derived.el
 
-;;;### (autoloads (docref-setup) "docref" "utils/docref.el" (12860 15605))
+;;;### (autoloads (docref-setup) "docref" "utils/docref.el" (12885 62662))
 ;;; Generated autoloads from utils/docref.el
 
 (autoload 'docref-setup "docref" "\
@@ -10822,7 +11892,7 @@
 
 ;;;***
 
-;;;### (autoloads (easy-menu-define) "easymenu" "utils/easymenu.el" (12860 15607))
+;;;### (autoloads (easy-menu-define) "easymenu" "utils/easymenu.el" (12933 36427))
 ;;; Generated autoloads from utils/easymenu.el
 
 (autoload 'easy-menu-define "easymenu" "\
@@ -10891,7 +11961,7 @@
 
 ;;;***
 
-;;;### (autoloads (elp-submit-bug-report elp-results elp-instrument-package elp-instrument-list elp-restore-function elp-instrument-function) "elp" "utils/elp.el" (12677 32656))
+;;;### (autoloads (elp-submit-bug-report elp-results elp-instrument-package elp-instrument-list elp-restore-function elp-instrument-function) "elp" "utils/elp.el" (12912 14855))
 ;;; Generated autoloads from utils/elp.el
 
 (autoload 'elp-instrument-function "elp" "\
@@ -10923,7 +11993,7 @@
 
 ;;;***
 
-;;;### (autoloads (list-colors-display facemenu-read-color list-text-properties-at facemenu-remove-special facemenu-remove-props facemenu-set-read-only facemenu-set-intangible facemenu-set-invisible facemenu-make-much-smaller facemenu-make-much-larger facemenu-make-smaller facemenu-make-larger facemenu-set-size-default facemenu-set-face-from-menu facemenu-set-background facemenu-set-foreground facemenu-set-face) "facemenu" "utils/facemenu.el" (12677 32647))
+;;;### (autoloads (list-colors-display facemenu-read-color list-text-properties-at facemenu-remove-special facemenu-remove-props facemenu-set-read-only facemenu-set-intangible facemenu-set-invisible facemenu-make-much-smaller facemenu-make-much-larger facemenu-make-smaller facemenu-make-larger facemenu-set-size-default facemenu-set-face-from-menu facemenu-set-background facemenu-set-foreground facemenu-set-face) "facemenu" "utils/facemenu.el" (12906 6360))
 ;;; Generated autoloads from utils/facemenu.el
 
 (defvar facemenu-menu nil "\
@@ -11025,11 +12095,11 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "find-gc" "utils/find-gc.el" (12677 32658))
+
+;;;***
+
+;;;### (autoloads nil "find-gc" "utils/find-gc.el" (12906 6367))
 ;;; Generated autoloads from utils/find-gc.el
-
-;;;***
 
 ;;;### (autoloads nil "finder-inf" "utils/finder-inf.el" (12677 32657))
 ;;; Generated autoloads from utils/finder-inf.el
@@ -11037,13 +12107,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "finder" "utils/finder.el" (12860 15601))
+
+;;;***
+
+;;;### (autoloads nil "finder" "utils/finder.el" (12885 62657))
 ;;; Generated autoloads from utils/finder.el
-
-;;;***
-
-;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl" "utils/flow-ctrl.el" (12823 45292))
+
+;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl" "utils/flow-ctrl.el" (12966 31941))
 ;;; Generated autoloads from utils/flow-ctrl.el
 
 (autoload 'enable-flow-control "flow-ctrl" "\
@@ -11067,43 +12137,44 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "foldout" "utils/foldout.el" (12860 15602))
+
+;;;***
+
+;;;### (autoloads nil "foldout" "utils/foldout.el" (12885 62659))
 ;;; Generated autoloads from utils/foldout.el
 
 ;;;***
 
-;;;### (autoloads nil "forms-d2" "utils/forms-d2.el" (12860 15598))
+;;;### (autoloads nil "forms-d2" "utils/forms-d2.el" (12885 62654))
 ;;; Generated autoloads from utils/forms-d2.el
 
 ;;;***
 
-;;;### (autoloads nil "forms-pass" "utils/forms-pass.el" (12860 15599))
+;;;### (autoloads nil "forms-pass" "utils/forms-pass.el" (12885 62654))
 ;;; Generated autoloads from utils/forms-pass.el
-
-;;;***
-
-;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode) "forms" "utils/forms.el" (12559 34621))
+
+;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode) "forms" "utils/forms.el" (12966 31970))
 ;;; Generated autoloads from utils/forms.el
 
 (autoload 'forms-mode "forms" "\
 Major mode to visit files in a field-structured manner using a form.
 
 Commands:                        Equivalent keys in read-only mode:
-
- TAB          forms-next-field           TAB
- C-c TAB      forms-next-field
- C-c <        forms-first-record         <
- C-c >        forms-last-record          >
- C-c ?        describe-mode              ?
- C-c C-k      forms-delete-record
- C-c C-q      forms-toggle-read-only     q
- C-c C-o      forms-insert-record
- C-c C-l      forms-jump-record          l
- C-c C-n      forms-next-record          n
- C-c C-p      forms-prev-record          p
- C-c C-s      forms-search               s
- C-c C-x      forms-exit                 x" t nil)
+ TAB            forms-next-field          TAB
+ \\C-c TAB       forms-next-field          
+ \\C-c <         forms-first-record         <
+ \\C-c >         forms-last-record          >
+ \\C-c ?         describe-mode              ?
+ \\C-c \\C-k      forms-delete-record
+ \\C-c \\C-q      forms-toggle-read-only     q
+ \\C-c \\C-o      forms-insert-record
+ \\C-c \\C-l      forms-jump-record          l
+ \\C-c \\C-n      forms-next-record          n
+ \\C-c \\C-p      forms-prev-record          p
+ \\C-c \\C-r      forms-search-backward      r
+ \\C-c \\C-s      forms-search-forward       s
+ \\C-c \\C-x      forms-exit                 x
+" t nil)
 
 (autoload 'forms-find-file "forms" "\
 Visit a file in Forms mode." t nil)
@@ -11116,7 +12187,7 @@
 ;;;### (autoloads nil "hide-copyleft" "utils/hide-copyleft.el" (12748 62974))
 ;;; Generated autoloads from utils/hide-copyleft.el
 
-;;;### (autoloads (highlight-headers-follow-url highlight-headers-follow-url-mosaic highlight-headers-follow-url-netscape highlight-headers) "highlight-headers" "utils/highlight-headers.el" (12823 45291))
+;;;### (autoloads (highlight-headers-follow-url highlight-headers-follow-url-mosaic highlight-headers-follow-url-netscape highlight-headers) "highlight-headers" "utils/highlight-headers.el" (12906 6398))
 ;;; Generated autoloads from utils/highlight-headers.el
 
 (autoload 'highlight-headers "highlight-headers" "\
@@ -11148,15 +12219,52 @@
 
 ;;;***
 
-;;;### (autoloads nil "lib-complete" "utils/lib-complete.el" (12677 32661))
+;;;### (autoloads (id-select-double-click-hook id-select-and-kill-thing id-select-and-copy-thing id-select-goto-matching-tag id-select-thing-with-mouse id-select-thing) "id-select" "utils/id-select.el" (12967 2888))
+;;; Generated autoloads from utils/id-select.el
+
+(autoload 'id-select-thing "id-select" "\
+Mark the region selected by the syntax of the thing at point.
+If invoked repeatedly, selects bigger and bigger things.
+If `id-select-display-type' is non-nil, the type of selection is displayed in
+the minibuffer." t nil)
+
+(autoload 'id-select-thing-with-mouse "id-select" "\
+Select a region based on the syntax of the character from a mouse click.
+If the click occurs at the same point as the last click, select
+the next larger syntactic structure.  If `id-select-display-type' is non-nil,
+the type of selection is displayed in the minibuffer." t nil)
+
+(autoload 'id-select-goto-matching-tag "id-select" "\
+If in a major mode listed in `id-select-markup-modes,' moves point to the start of the tag paired with the closest tag that point is within or precedes.
+Returns t if point is moved, else nil.
+Signals an error if no tag is found following point or if the closing tag
+does not have a `>' terminator character." t nil)
+
+(autoload 'id-select-and-copy-thing "id-select" "\
+Copy the region surrounding the syntactical unit at point." t nil)
+
+(autoload 'id-select-and-kill-thing "id-select" "\
+Kill the region surrounding the syntactical unit at point." t nil)
+
+(autoload 'id-select-double-click-hook "id-select" "\
+Select a region based on the syntax of the character wherever the mouse is double-clicked.
+If the double-click occurs at the same point as the last double-click, select
+the next larger syntactic structure.  If `id-select-display-type' is non-nil,
+the type of selection is displayed in the minibuffer." nil nil)
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "lib-complete" "utils/lib-complete.el" (12906 6406))
 ;;; Generated autoloads from utils/lib-complete.el
 
 ;;;***
 
-;;;### (autoloads nil "live-icon" "utils/live-icon.el" (12677 32663))
+;;;### (autoloads nil "live-icon" "utils/live-icon.el" (12906 6413))
 ;;; Generated autoloads from utils/live-icon.el
 
-;;;### (autoloads (unload-feature) "loadhist" "utils/loadhist.el" (12860 15604))
+;;;### (autoloads (unload-feature) "loadhist" "utils/loadhist.el" (12885 62661))
 ;;; Generated autoloads from utils/loadhist.el
 
 (autoload 'unload-feature "loadhist" "\
@@ -11166,7 +12274,7 @@
 
 ;;;***
 
-;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr" "utils/mail-extr.el" (12823 45293))
+;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr" "utils/mail-extr.el" (12906 6423))
 ;;; Generated autoloads from utils/mail-extr.el
 
 (autoload 'mail-extract-address-components "mail-extr" "\
@@ -11187,7 +12295,7 @@
 
 ;;;***
 
-;;;### (autoloads (mail-fetch-field mail-file-babyl-p) "mail-utils" "utils/mail-utils.el" (12748 62828))
+;;;### (autoloads (mail-fetch-field mail-file-babyl-p) "mail-utils" "utils/mail-utils.el" (12906 6430))
 ;;; Generated autoloads from utils/mail-utils.el
 
 (defvar mail-use-rfc822 nil "\
@@ -11208,21 +12316,25 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "mailpost" "utils/mailpost.el" (12860 15591))
+
+;;;***
+
+;;;### (autoloads nil "mailpost" "utils/mailpost.el" (12885 62646))
 ;;; Generated autoloads from utils/mailpost.el
-
-;;;### (autoloads nil "map-ynp" "utils/map-ynp.el" (12748 62829))
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "map-ynp" "utils/map-ynp.el" (12906 6438))
 ;;; Generated autoloads from utils/map-ynp.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "meese" "utils/meese.el" (12860 15591))
+
+;;;### (autoloads nil "meese" "utils/meese.el" (12885 62647))
 ;;; Generated autoloads from utils/meese.el
 
-;;;### (autoloads (read-passwd) "passwd" "utils/passwd.el" (12559 34616))
+;;;### (autoloads (read-passwd) "passwd" "utils/passwd.el" (12906 6446))
 ;;; Generated autoloads from utils/passwd.el
 
 (autoload 'read-passwd "passwd" "\
@@ -11281,7 +12393,7 @@
 
 ;;;***
 
-;;;### (autoloads (pp-eval-last-sexp pp-eval-expression pp) "pp" "utils/pp.el" (12860 15600))
+;;;### (autoloads (pp-eval-last-sexp pp-eval-expression pp) "pp" "utils/pp.el" (12885 62655))
 ;;; Generated autoloads from utils/pp.el
 
 (defalias 'pprint 'pp)
@@ -11308,25 +12420,25 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "regi" "utils/regi.el" (12860 15597))
+
+;;;***
+
+;;;### (autoloads nil "regi" "utils/regi.el" (12885 62653))
 ;;; Generated autoloads from utils/regi.el
-
-;;;***
-
-;;;### (autoloads (reporter-submit-bug-report) "reporter" "utils/reporter.el" (12860 15595))
+
+;;;### (autoloads (reporter-submit-bug-report) "reporter" "utils/reporter.el" (12885 62651))
 ;;; Generated autoloads from utils/reporter.el
 
 (autoload 'reporter-submit-bug-report "reporter" nil nil nil)
 
 ;;;***
-
-;;;### (autoloads nil "rfc822" "utils/rfc822.el" (12677 32635))
+
+;;;***
+
+;;;### (autoloads nil "rfc822" "utils/rfc822.el" (12906 6456))
 ;;; Generated autoloads from utils/rfc822.el
-
-;;;***
-
-;;;### (autoloads (make-ring ringp) "ring" "utils/ring.el" (12860 15596))
+
+;;;### (autoloads (make-ring ringp) "ring" "utils/ring.el" (12885 62653))
 ;;; Generated autoloads from utils/ring.el
 
 (autoload 'ringp "ring" "\
@@ -11340,13 +12452,13 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "shadowfile" "utils/shadowfile.el" (12860 15606))
+
+;;;***
+
+;;;### (autoloads nil "shadowfile" "utils/shadowfile.el" (12885 63184))
 ;;; Generated autoloads from utils/shadowfile.el
-
-;;;***
-
-;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy skeleton-proxy-new define-skeleton) "skeleton" "utils/skeleton.el" (12860 15609))
+
+;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy skeleton-proxy-new define-skeleton) "skeleton" "utils/skeleton.el" (12885 62658))
 ;;; Generated autoloads from utils/skeleton.el
 
 (defvar skeleton-filter 'identity "\
@@ -11452,34 +12564,45 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "soundex" "utils/soundex.el" (12860 15606))
+
+;;;***
+
+;;;### (autoloads nil "smtpmail" "utils/smtpmail.el" (12871 64617))
+;;; Generated autoloads from utils/smtpmail.el
+
+;;;***
+
+;;;### (autoloads nil "soundex" "utils/soundex.el" (12885 62663))
 ;;; Generated autoloads from utils/soundex.el
-
-;;;### (autoloads nil "symbol-syntax" "utils/symbol-syntax.el" (12677 32631))
+
+;;;***
+
+;;;### (autoloads nil "symbol-syntax" "utils/symbol-syntax.el" (12906 6497))
 ;;; Generated autoloads from utils/symbol-syntax.el
 
 ;;;***
 
-;;;### (autoloads nil "sysdep" "utils/sysdep.el" (12718 987))
+;;;### (autoloads nil "sysdep" "utils/sysdep.el" (12926 20471))
 ;;; Generated autoloads from utils/sysdep.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "text-props" "utils/text-props.el" (12823 45294))
+;;;### (autoloads nil "text-props" "utils/text-props.el" (12906 6514))
 ;;; Generated autoloads from utils/text-props.el
-
-;;;### (autoloads nil "thing" "utils/thing.el" (12677 32660))
+
+;;;***
+
+;;;### (autoloads nil "thing" "utils/thing.el" (12906 6520))
 ;;; Generated autoloads from utils/thing.el
 
 ;;;***
 
-;;;### (autoloads nil "timezone" "utils/timezone.el" (12677 32663))
+;;;### (autoloads nil "timezone" "utils/timezone.el" (12906 6528))
 ;;; Generated autoloads from utils/timezone.el
 
-;;;### (autoloads (tq-create) "tq" "utils/tq.el" (12860 15594))
+;;;### (autoloads (tq-create) "tq" "utils/tq.el" (12885 62650))
 ;;; Generated autoloads from utils/tq.el
 
 (autoload 'tq-create "tq" "\
@@ -11490,7 +12613,7 @@
 
 ;;;***
 
-;;;### (autoloads (trace-function-background trace-function) "trace" "utils/trace.el" (12860 15596))
+;;;### (autoloads (trace-function-background trace-function) "trace" "utils/trace.el" (12885 62651))
 ;;; Generated autoloads from utils/trace.el
 
 (defvar trace-buffer "*trace-output*" "\
@@ -11516,16 +12639,18 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "tree-menu" "utils/tree-menu.el" (12677 32657))
+
+;;;***
+
+;;;### (autoloads nil "tree-menu" "utils/tree-menu.el" (12906 6537))
 ;;; Generated autoloads from utils/tree-menu.el
 
 ;;;***
 
-;;;### (autoloads nil "uniquify" "utils/uniquify.el" (12860 15676))
+;;;### (autoloads nil "uniquify" "utils/uniquify.el" (12885 62723))
 ;;; Generated autoloads from utils/uniquify.el
 
-;;;### (autoloads (y-or-n-p-with-timeout yes-or-no-p-with-timeout with-timeout with-timeout-internal) "with-timeout" "utils/with-timeout.el" (12677 32636))
+;;;### (autoloads (y-or-n-p-with-timeout yes-or-no-p-with-timeout with-timeout with-timeout-internal) "with-timeout" "utils/with-timeout.el" (12906 6556))
 ;;; Generated autoloads from utils/with-timeout.el
 
 (autoload 'with-timeout-internal "with-timeout" nil nil nil)
@@ -11548,7 +12673,7 @@
 
 ;;;***
 
-;;;### (autoloads (xbm-button-create) "xbm-button" "utils/xbm-button.el" (12677 32665))
+;;;### (autoloads (xbm-button-create) "xbm-button" "utils/xbm-button.el" (12906 6465))
 ;;; Generated autoloads from utils/xbm-button.el
 
 (autoload 'xbm-button-create "xbm-button" "\
@@ -11564,7 +12689,7 @@
 
 ;;;***
 
-;;;### (autoloads (xpm-button-create) "xpm-button" "utils/xpm-button.el" (12677 32648))
+;;;### (autoloads (xpm-button-create) "xpm-button" "utils/xpm-button.el" (12906 6472))
 ;;; Generated autoloads from utils/xpm-button.el
 
 (autoload 'xpm-button-create "xpm-button" "\
@@ -11584,11 +12709,11 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "viper-ex" "viper/viper-ex.el" (12808 12348))
+
+;;;***
+
+;;;### (autoloads nil "viper-ex" "viper/viper-ex.el" (12880 32737))
 ;;; Generated autoloads from viper/viper-ex.el
-
-;;;***
 
 ;;;### (autoloads nil "viper-keym" "viper/viper-keym.el" (12677 32983))
 ;;; Generated autoloads from viper/viper-keym.el
@@ -11630,28 +12755,30 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "vm-autoload" "vm/vm-autoload.el" (12861 28947))
+
+;;;***
+
+;;;### (autoloads nil "vm-autoload" "vm/vm-autoload.el" (12964 19421))
 ;;; Generated autoloads from vm/vm-autoload.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "vm-byteopts" "vm/vm-byteopts.el" (12244 51680))
+;;;### (autoloads nil "vm-byteopts" "vm/vm-byteopts.el" (12677 32690))
 ;;; Generated autoloads from vm/vm-byteopts.el
-
-;;;### (autoloads nil "vm-delete" "vm/vm-delete.el" (12823 45295))
+
+;;;***
+
+;;;### (autoloads nil "vm-delete" "vm/vm-delete.el" (12807 56781))
 ;;; Generated autoloads from vm/vm-delete.el
 
 ;;;***
 
-;;;### (autoloads nil "vm-digest" "vm/vm-digest.el" (12860 15611))
+;;;### (autoloads nil "vm-digest" "vm/vm-digest.el" (12885 62665))
 ;;; Generated autoloads from vm/vm-digest.el
-
-;;;***
-
-;;;### (autoloads (vm-easy-menu-create-keymaps vm-easy-menu-define) "vm-easymenu" "vm/vm-easymenu.el" (12312 61359))
+
+;;;### (autoloads (vm-easy-menu-create-keymaps vm-easy-menu-define) "vm-easymenu" "vm/vm-easymenu.el" (12677 32693))
 ;;; Generated autoloads from vm/vm-easymenu.el
 
 (autoload 'vm-easy-menu-define "vm-easymenu" "\
@@ -11783,19 +12910,21 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "vm-reply" "vm/vm-reply.el" (12860 15612))
+
+;;;***
+
+;;;### (autoloads nil "vm-reply" "vm/vm-reply.el" (12885 62666))
 ;;; Generated autoloads from vm/vm-reply.el
+
+;;;***
 
 ;;;### (autoloads nil "vm-save" "vm/vm-save.el" (12677 32678))
 ;;; Generated autoloads from vm/vm-save.el
 
 ;;;***
 
-;;;### (autoloads nil "vm-search" "vm/vm-search.el" (12749 3230))
+;;;### (autoloads nil "vm-search" "vm/vm-search.el" (12964 19236))
 ;;; Generated autoloads from vm/vm-search.el
-
-;;;***
 
 ;;;### (autoloads nil "vm-search18" "vm/vm-search18.el" (12677 32686))
 ;;; Generated autoloads from vm/vm-search18.el
@@ -11838,19 +12967,21 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "vm-vars" "vm/vm-vars.el" (12860 15615))
+
+;;;***
+
+;;;### (autoloads nil "vm-vars" "vm/vm-vars.el" (12885 62668))
 ;;; Generated autoloads from vm/vm-vars.el
 
 ;;;***
 
-;;;### (autoloads nil "vm-version" "vm/vm-version.el" (12740 28352))
+;;;### (autoloads nil "vm-version" "vm/vm-version.el" (12748 62841))
 ;;; Generated autoloads from vm/vm-version.el
+
+;;;***
 
 ;;;### (autoloads nil "vm-virtual" "vm/vm-virtual.el" (12677 32684))
 ;;; Generated autoloads from vm/vm-virtual.el
-
-;;;***
 
 ;;;### (autoloads nil "vm-window" "vm/vm-window.el" (12748 62841))
 ;;; Generated autoloads from vm/vm-window.el
@@ -11858,60 +12989,60 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "docomp" "w3/docomp.el" (12823 48898))
+
+;;;***
+
+;;;### (autoloads nil "docomp" "w3/docomp.el" (12860 33851))
 ;;; Generated autoloads from w3/docomp.el
 
 ;;;***
 
-;;;### (autoloads nil "font" "w3/font.el" (12823 48898))
+;;;### (autoloads nil "font" "w3/font.el" (12860 33853))
 ;;; Generated autoloads from w3/font.el
 
 ;;;***
 
-;;;### (autoloads nil "images" "w3/images.el" (12823 48898))
+;;;### (autoloads nil "images" "w3/images.el" (12860 33851))
 ;;; Generated autoloads from w3/images.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-about" "w3/w3-about.el" (12823 48902))
+;;;### (autoloads nil "w3-about" "w3/w3-about.el" (12860 33867))
 ;;; Generated autoloads from w3/w3-about.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-annotat" "w3/w3-annotat.el" (12823 48903))
+;;;### (autoloads nil "w3-annotat" "w3/w3-annotat.el" (12860 33871))
 ;;; Generated autoloads from w3/w3-annotat.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-auto" "w3/w3-auto.el" (12823 48904))
+;;;### (autoloads nil "w3-auto" "w3/w3-auto.el" (12860 33873))
 ;;; Generated autoloads from w3/w3-auto.el
 
 ;;;***
 
 ;;;***
 
-;;;### (autoloads nil "w3-draw" "w3/w3-draw.el" (12851 23323))
+;;;### (autoloads nil "w3-draw" "w3/w3-draw.el" (12860 33866))
 ;;; Generated autoloads from w3/w3-draw.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-e19" "w3/w3-e19.el" (12823 48899))
+;;;### (autoloads nil "w3-e19" "w3/w3-e19.el" (12860 33854))
 ;;; Generated autoloads from w3/w3-e19.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-emulate" "w3/w3-emulate.el" (12823 48905))
+;;;### (autoloads nil "w3-emulate" "w3/w3-emulate.el" (12860 33878))
 ;;; Generated autoloads from w3/w3-emulate.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-forms" "w3/w3-forms.el" (12823 48904))
+;;;### (autoloads nil "w3-forms" "w3/w3-forms.el" (12860 33874))
 ;;; Generated autoloads from w3/w3-forms.el
-
-;;;***
-
-;;;### (autoloads (w3-use-hotlist) "w3-hot" "w3/w3-hot.el" (12823 48904))
+
+;;;### (autoloads (w3-use-hotlist) "w3-hot" "w3/w3-hot.el" (12860 33872))
 ;;; Generated autoloads from w3/w3-hot.el
 
 (autoload 'w3-use-hotlist "w3-hot" "\
@@ -11923,93 +13054,93 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "w3-imap" "w3/w3-imap.el" (12823 48904))
+
+;;;***
+
+;;;### (autoloads nil "w3-imap" "w3/w3-imap.el" (12860 33876))
 ;;; Generated autoloads from w3/w3-imap.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-keyword" "w3/w3-keyword.el" (12823 48905))
+;;;### (autoloads nil "w3-keyword" "w3/w3-keyword.el" (12860 33879))
 ;;; Generated autoloads from w3/w3-keyword.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-latex" "w3/w3-latex.el" (12823 48905))
+;;;### (autoloads nil "w3-latex" "w3/w3-latex.el" (12860 33881))
 ;;; Generated autoloads from w3/w3-latex.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-menu" "w3/w3-menu.el" (12823 48904))
+;;;### (autoloads nil "w3-menu" "w3/w3-menu.el" (12860 33876))
 ;;; Generated autoloads from w3/w3-menu.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-mouse" "w3/w3-mouse.el" (12823 48905))
+;;;### (autoloads nil "w3-mouse" "w3/w3-mouse.el" (12860 33879))
 ;;; Generated autoloads from w3/w3-mouse.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-mule" "w3/w3-mule.el" (12823 48900))
+;;;### (autoloads nil "w3-mule" "w3/w3-mule.el" (12860 33861))
 ;;; Generated autoloads from w3/w3-mule.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-parse" "w3/w3-parse.el" (12823 48903))
+;;;### (autoloads nil "w3-parse" "w3/w3-parse.el" (12860 33870))
 ;;; Generated autoloads from w3/w3-parse.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-prefs" "w3/w3-prefs.el" (12823 48906))
+;;;### (autoloads nil "w3-prefs" "w3/w3-prefs.el" (12860 33882))
 ;;; Generated autoloads from w3/w3-prefs.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-print" "w3/w3-print.el" (12823 48904))
+;;;### (autoloads nil "w3-print" "w3/w3-print.el" (12860 33874))
 ;;; Generated autoloads from w3/w3-print.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-speak" "w3/w3-speak.el" (12823 48906))
+;;;### (autoloads nil "w3-speak" "w3/w3-speak.el" (12860 33883))
 ;;; Generated autoloads from w3/w3-speak.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-style" "w3/w3-style.el" (12851 23323))
+;;;### (autoloads nil "w3-style" "w3/w3-style.el" (12860 33869))
 ;;; Generated autoloads from w3/w3-style.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-sysdp" "w3/w3-sysdp.el" (12823 48901))
+;;;### (autoloads nil "w3-sysdp" "w3/w3-sysdp.el" (12926 20450))
 ;;; Generated autoloads from w3/w3-sysdp.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-toolbar" "w3/w3-toolbar.el" (12823 48899))
+;;;### (autoloads nil "w3-toolbar" "w3/w3-toolbar.el" (12860 33855))
 ;;; Generated autoloads from w3/w3-toolbar.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-vars" "w3/w3-vars.el" (12851 23316))
+;;;### (autoloads nil "w3-vars" "w3/w3-vars.el" (12860 33857))
 ;;; Generated autoloads from w3/w3-vars.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-widget" "w3/w3-widget.el" (12823 48900))
+;;;### (autoloads nil "w3-widget" "w3/w3-widget.el" (12860 33860))
 ;;; Generated autoloads from w3/w3-widget.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-xem20" "w3/w3-xem20.el" (12823 48736))
+;;;### (autoloads nil "w3-xem20" "w3/w3-xem20.el" (12860 33991))
 ;;; Generated autoloads from w3/w3-xem20.el
 
 ;;;***
 
-;;;### (autoloads nil "w3-xemac" "w3/w3-xemac.el" (12823 48901))
+;;;### (autoloads nil "w3-xemac" "w3/w3-xemac.el" (12860 33864))
 ;;; Generated autoloads from w3/w3-xemac.el
-
-;;;***
-
-;;;### (autoloads (w3-follow-link w3-follow-link-other-frame w3-do-setup w3 w3-preview-this-buffer w3-batch-fetch w3-follow-url-at-point w3-follow-url-at-point-other-frame w3-maybe-follow-link w3-maybe-follow-link-mouse w3-fetch w3-fetch-other-frame w3-find-file w3-open-local) "w3" "w3/w3.el" (12851 23319))
+
+;;;### (autoloads (w3-follow-link w3-follow-link-other-frame w3-do-setup w3 w3-preview-this-buffer w3-batch-fetch w3-follow-url-at-point w3-follow-url-at-point-other-frame w3-maybe-follow-link w3-maybe-follow-link-mouse w3-fetch w3-fetch-other-frame w3-find-file w3-open-local) "w3" "w3/w3.el" (12860 33859))
 ;;; Generated autoloads from w3/w3.el
 
 (autoload 'w3-open-local "w3" "\
@@ -12101,24 +13232,34 @@
 ;;;***
 
 ;;;***
-
-;;;### (autoloads nil "widget-edit" "w3/widget-edit.el" (12823 48905))
+
+;;;***
+
+;;;### (autoloads nil "widget-edit" "w3/widget-edit.el" (12860 33881))
 ;;; Generated autoloads from w3/widget-edit.el
+
+;;;***
+
+;;;***
 
 ;;;### (autoloads nil "widget" "w3/widget.el" (12721 20262))
 ;;; Generated autoloads from w3/widget.el
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "x-compose" "x11/x-compose.el" (12823 45299))
+
+;;;### (autoloads nil "x-compose" "x11/x-compose.el" (12906 6136))
 ;;; Generated autoloads from x11/x-compose.el
-
-;;;### (autoloads nil "x-faces" "x11/x-faces.el" (12701 8661))
+
+;;;***
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "x-faces" "x11/x-faces.el" (12906 6058))
 ;;; Generated autoloads from x11/x-faces.el
 
-;;;### (autoloads (font-menu-weight-constructor font-menu-size-constructor font-menu-family-constructor reset-device-font-menus) "x-font-menu" "x11/x-font-menu.el" (12823 45300))
+;;;### (autoloads (font-menu-weight-constructor font-menu-size-constructor font-menu-family-constructor reset-device-font-menus) "x-font-menu" "x11/x-font-menu.el" (12906 6025))
 ;;; Generated autoloads from x11/x-font-menu.el
 
 (defvar font-menu-ignore-scaled-fonts t "\
@@ -12147,50 +13288,52 @@
 ;;;***
 
 ;;;***
-
-;;;***
-
-;;;### (autoloads nil "x-init" "x11/x-init.el" (12823 45302))
+
+;;;### (autoloads nil "x-init" "x11/x-init.el" (12933 36407))
 ;;; Generated autoloads from x11/x-init.el
-
-;;;### (autoloads nil "x-iso8859-1" "x11/x-iso8859-1.el" (12677 32698))
+
+;;;***
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "x-iso8859-1" "x11/x-iso8859-1.el" (12906 6146))
 ;;; Generated autoloads from x11/x-iso8859-1.el
 
 ;;;***
-
-;;;***
-
-;;;***
-
-;;;### (autoloads nil "x-menubar" "x11/x-menubar.el" (12860 15618))
+
+;;;### (autoloads nil "x-menubar" "x11/x-menubar.el" (12906 5965))
 ;;; Generated autoloads from x11/x-menubar.el
 
 ;;;***
 
-;;;### (autoloads nil "x-misc" "x11/x-misc.el" (12637 27990))
+;;;### (autoloads nil "x-misc" "x11/x-misc.el" (12906 5898))
 ;;; Generated autoloads from x11/x-misc.el
-
-;;;### (autoloads nil "x-mouse" "x11/x-mouse.el" (12701 8664))
+
+;;;***
+
+;;;### (autoloads nil "x-mouse" "x11/x-mouse.el" (12906 6155))
 ;;; Generated autoloads from x11/x-mouse.el
 
 ;;;***
 
-;;;### (autoloads nil "x-scrollbar" "x11/x-scrollbar.el" (12677 32708))
+;;;### (autoloads nil "x-scrollbar" "x11/x-scrollbar.el" (12906 6161))
 ;;; Generated autoloads from x11/x-scrollbar.el
 
 ;;;***
 
-;;;### (autoloads nil "x-select" "x11/x-select.el" (12677 32696))
+;;;### (autoloads nil "x-select" "x11/x-select.el" (12906 6169))
 ;;; Generated autoloads from x11/x-select.el
-
-;;;### (autoloads nil "x-toolbar" "x11/x-toolbar.el" (12713 64142))
+
+;;;***
+
+;;;***
+
+;;;***
+
+;;;### (autoloads nil "x-toolbar" "x11/x-toolbar.el" (12906 6177))
 ;;; Generated autoloads from x11/x-toolbar.el
-
-;;;***
-
-;;;***
-
-;;;***
 
 ;;;### (autoloads nil "x-win-sun" "x11/x-win-sun.el" (12823 45303))
 ;;; Generated autoloads from x11/x-win-sun.el
--- a/lisp/prim/novice.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/novice.el	Mon Aug 13 09:03:46 2007 +0200
@@ -19,11 +19,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -79,6 +79,12 @@
 	(set-buffer standard-output)
 	(help-mode)))
      (message "Type y, n or Space: ")
+;     (let ((cursor-in-echo-area t))
+;       (while (not (memq (setq char (downcase (read-char)))
+;			 '(?  ?y ?n)))
+;	 (ding)
+;	 (message "Please type y, n or Space: "))))
+     ;; XEmacs version
      (let ((cursor-in-echo-area t)
 	   (inhibit-quit t)
 	   event)
@@ -110,7 +116,7 @@
 		 (not (string= "" user-init-file))
 		 (y-or-n-p "Enable command for future editing sessions also? "))
 	    (enable-command this-command)
-            (put this-command 'disabled nil)))
+	  (put this-command 'disabled nil)))
     (if (/= char ?n)
 	(call-interactively this-command))))
 
--- a/lisp/prim/options.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/options.el	Mon Aug 13 09:03:46 2007 +0200
@@ -17,11 +17,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -42,7 +42,7 @@
     (Edit-options-mode))
   (with-output-to-temp-buffer "*List Options*"
     (let (vars)
-      (mapatoms #'(lambda (sym)
+      (mapatoms #'(lambda (sym) ; XEmacs
 		    (if (user-variable-p sym)
 			(setq vars (cons sym vars)))))
       (setq vars (sort vars 'string-lessp))
@@ -51,7 +51,7 @@
 	  (princ ";; ")
 	  (prin1 sym)
 	  (princ ":\n\t")
-	  (if (boundp sym)
+	  (if (boundp sym) ; XEmacs
 	      (prin1 (symbol-value sym))
               (princ "#<unbound>"))
 	  (terpri)
@@ -109,12 +109,12 @@
   (setq paragraph-start "\t")
   (setq truncate-lines t)
   (setq major-mode 'Edit-options-mode)
-  (setq mode-name (gettext "Options"))
+  (setq mode-name (gettext "Options")) ; XEmacs
   (run-hooks 'Edit-options-mode-hook))
 
 (defun Edit-options-set () (interactive)
   (Edit-options-modify
-   '(lambda (var) (eval-minibuffer (format "New %s:" (symbol-name var))))))
+   '(lambda (var) (eval-minibuffer (concat "New " (symbol-name var) ": ")))))
 
 (defun Edit-options-toggle () (interactive)
   (Edit-options-modify '(lambda (var) (not (symbol-value var)))))
@@ -132,14 +132,14 @@
      (forward-char 3)
      (setq pos (point))
      (save-restriction
-      (narrow-to-region pos (progn (end-of-line) (1- (point))))
-      (goto-char pos)
-      (setq var (read (current-buffer))))
+       (narrow-to-region pos (progn (end-of-line) (1- (point))))
+       (goto-char pos)
+       (setq var (read (current-buffer))))
      (goto-char pos)
      (forward-line 1)
      (forward-char 1)
      (save-excursion
-      (set var (funcall modfun var)))
+       (set var (funcall modfun var)))
      (kill-sexp 1)
      (prin1 (symbol-value var) (current-buffer)))))
 
--- a/lisp/prim/page.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/page.el	Mon Aug 13 09:03:46 2007 +0200
@@ -17,11 +17,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -34,7 +34,7 @@
   "Move forward to page boundary.  With arg, repeat, or go back if negative.
 A page boundary is any line whose beginning matches the regexp
 `page-delimiter'."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (or count (setq count 1))
   (while (and (> count 0) (not (eobp)))
     ;; In case the page-delimiter matches the null string,
@@ -45,26 +45,24 @@
       (goto-char (point-max)))
     (setq count (1- count)))
   (while (and (< count 0) (not (bobp)))
+    ;; In case the page-delimiter matches the null string,
+    ;; don't find a match without moving.
+    (and (save-excursion (re-search-backward page-delimiter nil t))
+	 (= (match-end 0) (point))
+	 (goto-char (match-beginning 0)))
     (forward-char -1)
-    (let (result (end (point)))
-      ;; If we find a match that ends where we started searching,
-      ;; look for another one.
-      (while (and (setq result (re-search-backward page-delimiter nil t))
-		  (= (match-end 0) end))
-	;; Just search again.
-	)
-      (if result
-	  ;; We found one--move to the end of it.
-	  (goto-char (match-end 0))
-	;; We found nothing--go to beg of buffer.
-	(goto-char (point-min))))
+    (if (re-search-backward page-delimiter nil t)
+	;; We found one--move to the end of it.
+	(goto-char (match-end 0))
+      ;; We found nothing--go to beg of buffer.
+      (goto-char (point-min)))
     (setq count (1+ count))))
 
 (defun backward-page (&optional count)
   "Move backward to page boundary.  With arg, repeat, or go fwd if negative.
 A page boundary is any line whose beginning matches the regexp
 `page-delimiter'."
-  (interactive "p")
+  (interactive "_p") ; XEmacs
   (or count (setq count 1))
   (forward-page (- count)))
 
@@ -114,10 +112,11 @@
 			(if (and (eolp) (not (bobp)))
 			    (forward-line 1))
 			(point)))))
+(put 'narrow-to-page 'disabled t)
 
 (defun count-lines-page ()
   "Report number of lines on current page, and how many are before or after point."
-  (interactive "_")
+  (interactive "_") ; XEmacs
   (save-excursion
     (let ((opoint (point)) beg end
 	  total before after)
@@ -135,7 +134,7 @@
 
 (defun what-page ()
   "Print page and line number of point."
-  (interactive "_")
+  (interactive "_") ; XEmacs
   (save-restriction
     (widen)
     (save-excursion
--- a/lisp/prim/paragraphs.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/paragraphs.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,7 +1,6 @@
 ;;; paragraphs.el --- paragraph and sentence parsing.
 
-;; Copyright (C) 1985, 1986, 1987, 1991, 1993, 1994, 1995
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 87, 91, 94, 95 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: wp
@@ -19,11 +18,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -44,6 +43,7 @@
 Each buffer has its own value of this variable.")
 (make-variable-buffer-local 'use-hard-newlines)
 
+;; XEmacs - use purecopy
 (defconst paragraph-start (purecopy "[ \t\n\f]") "\
 *Regexp for beginning of a line that starts OR separates paragraphs.
 This regexp should match lines that separate paragraphs
@@ -67,6 +67,7 @@
 ;; something very minimal, even including "." (which makes every hard newline
 ;; start a new paragraph).
 
+;; XEmacs -- use purecopy
 (defconst paragraph-separate (purecopy "[ \t\f]*$") "\
 *Regexp for beginning of a line that separates paragraphs.
 If you change this, you may have to change paragraph-start also.
@@ -76,6 +77,7 @@
 ensures that the paragraph functions will work equally within a region of
 text indented by a margin setting.")
 
+;; XEmacs -- use purecopy
 (defconst sentence-end (purecopy "[.?!][]\"')}]*\\($\\| $\\|\t\\|  \\)[ \t\n]*") "\
 *Regexp describing the end of a sentence.
 All paragraph boundaries also end sentences, regardless.
@@ -84,6 +86,7 @@
 question mark, or exclamation point must be followed by two spaces,
 unless it's inside some sort of quotes or parenthesis.")
 
+;; XEmacs -- use purecopy
 (defconst page-delimiter (purecopy "^\014") "\
 *Regexp describing line-beginnings that separate pages.")
 
@@ -99,7 +102,7 @@
 \(if `paragraph-separate' matches it also) or is the first line of a paragraph.
 A paragraph end is the beginning of a line which is not part of the paragraph
 to which the end of the previous line belongs, or the end of the buffer."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (or arg (setq arg 1))
   (let* ((fill-prefix-regexp
 	  (and fill-prefix (not (equal fill-prefix ""))
@@ -140,12 +143,11 @@
 	  (forward-line -1)) 
 	(if (bobp)
 	    nil
-          (progn
-            ;; Go to end of the previous (non-separating) line.
-            (end-of-line)
-            ;; Search back for line that starts or separates paragraphs.
-            (if (if fill-prefix-regexp
-                    ;; There is a fill prefix; it overrides paragraph-start.
+	  ;; Go to end of the previous (non-separating) line.
+	  (end-of-line)
+	  ;; Search back for line that starts or separates paragraphs.
+	  (if (if fill-prefix-regexp
+		  ;; There is a fill prefix; it overrides paragraph-start.
 		  (let (multiple-lines)
 		    (while (and (progn (beginning-of-line) (not (bobp)))
 				(progn (move-to-left-margin)
@@ -175,15 +177,15 @@
 							     'hard)))))
 		  (goto-char start))
 		(> (point) (point-min)))
-                ;; Found one.
-                (progn
-                  ;; Move forward over paragraph separators.
-                  ;; We know this cannot reach the place we started
-                  ;; because we know we moved back over a non-separator.
+	      ;; Found one.
+	      (progn
+		;; Move forward over paragraph separators.
+		;; We know this cannot reach the place we started
+		;; because we know we moved back over a non-separator.
 		(while (and (not (eobp))
 			    (progn (move-to-left-margin)
 				   (looking-at paragraph-separate)))
-                    (forward-line 1))
+		  (forward-line 1))
 		;; If line before paragraph is just margin, back up to there.
 		(end-of-line 0)
 		(if (> (current-column) (current-left-margin))
@@ -191,10 +193,11 @@
 		  (skip-chars-backward " \t")
 		  (if (not (bolp))
 		      (forward-line 1))))
-                ;; No starter or separator line => use buffer beg.
-                (goto-char (point-min))))))
+	    ;; No starter or separator line => use buffer beg.
+	    (goto-char (point-min)))))
       (setq arg (1+ arg)))
     (while (and (> arg 0) (not (eobp)))
+      ;; Move forward over separator lines, and one more line.
       (while (prog1 (and (not (eobp))
 			 (progn (move-to-left-margin) (not (eobp)))
 			 (looking-at paragraph-separate))
@@ -231,7 +234,7 @@
 blank line.
 
 See `forward-paragraph' for more information."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (or arg (setq arg 1))
   (forward-paragraph (- arg)))
 
@@ -247,14 +250,14 @@
   "Kill forward to end of paragraph.
 With arg N, kill forward to Nth end of paragraph;
 negative arg -N means kill backward to Nth start of paragraph."
-  (interactive "*p")
+  (interactive "*p") ; XEmacs
   (kill-region (point) (progn (forward-paragraph arg) (point))))
 
 (defun backward-kill-paragraph (arg)
   "Kill back to start of paragraph.
 With arg N, kill back to Nth start of paragraph;
 negative arg -N means kill forward to Nth end of paragraph."
-  (interactive "*p")
+  (interactive "*p") ; XEmacs
   (kill-region (point) (progn (backward-paragraph arg) (point))))
 
 (defun transpose-paragraphs (arg)
@@ -291,10 +294,9 @@
   "Move forward to next `sentence-end'.  With argument, repeat.
 With negative argument, move backward repeatedly to `sentence-beginning'.
 
-The variable `sentence-end' is a regular expression that matches ends
-of sentences.  Also, every paragraph boundary terminates sentences as
-well."
-  (interactive "_p")
+The variable `sentence-end' is a regular expression that matches ends of
+sentences.  Also, every paragraph boundary terminates sentences as well."
+  (interactive "_p") ; XEmacs
   (or arg (setq arg 1))
   (while (< arg 0)
     (let ((par-beg (save-excursion (start-of-paragraph-text) (point))))
@@ -312,25 +314,31 @@
 (defun backward-sentence (&optional arg)
   "Move backward to start of sentence.  With arg, do it arg times.
 See `forward-sentence' for more information."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (or arg (setq arg 1))
   (forward-sentence (- arg)))
 
 (defun kill-sentence (&optional arg)
   "Kill from point to end of sentence.
 With arg, repeat; negative arg -N means kill back to Nth start of sentence."
-  (interactive "p")
+  (interactive "*p") ; XEmacs
   (kill-region (point) (progn (forward-sentence arg) (point))))
 
 (defun backward-kill-sentence (&optional arg)
   "Kill back from point to start of sentence.
 With arg, repeat, or kill forward to Nth end of sentence if negative arg -N."
-  (interactive "p")
+  (interactive "*p") ; XEmacs
   (kill-region (point) (progn (backward-sentence arg) (point))))
 
 (defun mark-end-of-sentence (arg)
   "Put mark at end of sentence.  Arg works as in `forward-sentence'."
   (interactive "p")
+  ;; FSF Version:
+;  (push-mark
+;   (save-excursion
+;     (forward-sentence arg)
+;     (point))
+;   nil t))
   (mark-something 'mark-end-of-sentence 'forward-sentence arg))
 
 (defun transpose-sentences (arg)
@@ -339,4 +347,3 @@
   (transpose-subr 'forward-sentence arg))
 
 ;;; paragraphs.el ends here
-
--- a/lisp/prim/rect.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/rect.el	Mon Aug 13 09:03:46 2007 +0200
@@ -18,11 +18,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -54,22 +54,23 @@
      (forward-line 1)
      (setq endlinepos (point-marker)))
     (if (< endcol startcol)
+	;; XEmacs
 	(let ((tem startcol))
 	  (setq startcol endcol endcol tem)))
     (save-excursion
       (goto-char startlinepos)
       (while (< (point) endlinepos)
-        (let (startpos begextra endextra)
-          (move-to-column startcol coerce-tabs)
-          (setq begextra (- (current-column) startcol))
-          (setq startpos (point))
-          (move-to-column endcol coerce-tabs)
-          (setq endextra (- endcol (current-column)))
-          (if (< begextra 0)
-              (setq endextra (+ endextra begextra)
-                    begextra 0))
+	(let (startpos begextra endextra)
+	  (move-to-column startcol coerce-tabs)
+	  (setq begextra (- (current-column) startcol))
+	  (setq startpos (point))
+	  (move-to-column endcol coerce-tabs)
+	  (setq endextra (- endcol (current-column)))
+	  (if (< begextra 0)
+	      (setq endextra (+ endextra begextra)
+		    begextra 0))
           (apply function startpos begextra endextra extra-args))
-        (forward-line 1)))
+	(forward-line 1)))
     (- endcol startcol)))
 
 (defun delete-rectangle-line (startdelpos ignore ignore)
@@ -97,7 +98,7 @@
 	(setq line (concat (spaces-string begextra)
 			   line
 			   (spaces-string endextra))))
-    (setcdr lines (cons line (cdr lines)))))
+    (setcdr lines (cons line (cdr lines))))) ; XEmacs
 
 (defconst spaces-strings
   (purecopy '["" " " "  " "   " "    " "     " "      " "       " "        "]))
@@ -113,9 +114,8 @@
 ;;;###autoload
 (defun delete-rectangle (start end)
   "Delete (don't save) text in rectangle with point and mark as corners.
-The same range of columns is deleted in each line
-starting with the line where the region begins
-and ending with the line where the region ends."
+The same range of columns is deleted in each line starting with the line
+where the region begins and ending with the line where the region ends."
   (interactive "r")
   (operate-on-rectangle 'delete-rectangle-line start end t))
 
@@ -162,8 +162,8 @@
 ;;;###autoload
 (defun insert-rectangle (rectangle)
   "Insert text of RECTANGLE with upper left corner at point.
-RECTANGLE's first line is inserted at point,
-its second line is inserted at a point vertically under point, etc.
+RECTANGLE's first line is inserted at point, its second
+line is inserted at a point vertically under point, etc.
 RECTANGLE should be a list of strings.
 After this command, the mark is at the upper left corner
 and point is at the lower right corner."
@@ -213,7 +213,7 @@
 
 Called from a program, takes three args; START, END and STRING."
   (interactive "r\nsString rectangle: ")
-  (operate-on-rectangle 'string-rectangle-line start end t string))
+  (operate-on-rectangle 'string-rectangle-line start end t string)) ; XEmacs
 
 ;; XEmacs: add string arg
 (defun string-rectangle-line (startpos begextra endextra string)
@@ -250,13 +250,6 @@
     ;; Reindent out to same column that we were at.
     (indent-to column)))
 
-;(defun rectangle-coerce-tab (column)
-;  (let ((aftercol (current-column))
-;	(indent-tabs-mode nil))
-;    (delete-char -1)
-;    (indent-to aftercol)
-;    (backward-char (- aftercol column))))
-
 (provide 'rect)
 
 ;;; rect.el ends here
--- a/lisp/prim/register.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/register.el	Mon Aug 13 09:03:46 2007 +0200
@@ -18,11 +18,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -63,18 +63,18 @@
   (set-register register
 		(if arg (current-frame-configuration) (point-marker))))
 
-(defun window-configuration-to-register (register)
+(defun window-configuration-to-register (register &optional arg)
   "Store the window configuration of the selected frame in register REGISTER.
 Use \\[jump-to-register] to restore the configuration.
 Argument is a character, naming the register."
-  (interactive "cWindow configuration to register: ")
+  (interactive "cWindow configuration to register: \nP")
   (set-register register (current-window-configuration)))
 
 (defun frame-configuration-to-register (register &optional arg)
   "Store the window configuration of all frames in register REGISTER.
 Use \\[jump-to-register] to restore the configuration.
 Argument is a character, naming the register."
-  (interactive "cFrame configuration to register: ")
+  (interactive "cFrame configuration to register: \nP")
   (set-register register (current-frame-configuration)))
 
 (defalias 'register-to-point 'jump-to-register)
@@ -106,8 +106,6 @@
      (t
       (error "Register doesn't contain a buffer position or configuration")))))
 
-; In FSFmacs, these are commented out, too.
-
 ;(defun number-to-register (arg char)
 ;  "Store a number in a register.
 ;Two args, NUMBER and REGISTER (a character, naming the register).
@@ -142,23 +140,22 @@
   (interactive "cView register: ")
   (let ((val (get-register register)))
     (if (null val)
-	(message "Register %s is empty"
-		 (single-key-description register))
+	(message "Register %s is empty" (single-key-description register))
       (with-output-to-temp-buffer "*Output*"
 	(princ (format "Register %s contains "
 		       (single-key-description register)))
 	(cond 
-          ((integerp val)
-           (princ val))
+	 ((integerp val)
+	  (princ val))
 
-          ((markerp val)
-           (let ((buf (marker-buffer val)))
-             (if (null buf)
-                 (princ "a marker in no buffer")
-                 (princ (format
-                          "a buffer position:\nbuff %s, position %s"
-                          (buffer-name (marker-buffer val))
-                          (marker-position val))))))
+	 ((markerp val)
+	  (let ((buf (marker-buffer val)))
+	    (if (null buf)
+		(princ "a marker in no buffer")
+	      (princ (format
+		      "a buffer position:\nbuff %s, position %s"
+		      (buffer-name (marker-buffer val))
+		      (marker-position val))))))
 
 	 ((window-configuration-p val)
 	  (princ "a window configuration."))
@@ -172,47 +169,46 @@
 	  (prin1 (cdr val))
 	  (princ "."))
 
-         ((consp val)
-          (princ "the rectangle:\n")
+	 ((consp val)
+	  (princ "the rectangle:\n")
           (while val
-            (princ (car val))
-            (terpri)
-            (setq val (cdr val))))
+	    (princ (car val))
+	    (terpri)
+	    (setq val (cdr val))))
 
 	 ((stringp val)
 	  (princ "the text:\n")
 	  (princ val))
 
-         (t
+	 (t
 	  (princ "Garbage:\n")
 	  (prin1 val)))))))
 
 (defun insert-register (register &optional arg)
-  "Insert contents of register REGISTER.  REGISTER is a character.
+  "Insert contents of register REGISTER.  (REGISTER is a character).
 Normally puts point before and mark after the inserted text.
 If optional second arg is non-nil, puts mark before and point after.
 Interactively, second arg is non-nil if prefix arg is supplied."
   (interactive "*cInsert register: \nP")
   (push-mark)
   (let ((val (get-register register)))
-    (cond ((consp val)
-           (insert-rectangle val))
-          ((stringp val)
-           (insert val))
-          ((integerp val)
-           (princ val (current-buffer)))
-          ((and (markerp val) (marker-position val))
-           (princ (marker-position val) (current-buffer)))
-          (t
-           (error "Register does not contain text"))))
+    (cond
+     ((consp val)
+      (insert-rectangle val))
+     ((stringp val)
+      (insert val))
+     ((integerp val)
+      (princ val (current-buffer)))
+     ((and (markerp val) (marker-position val))
+      (princ (marker-position val) (current-buffer)))
+     (t
+      (error "Register does not contain text"))))
   ;; XEmacs: don't activate the region.  It's annoying.
   (if (not arg) (exchange-point-and-mark t)))
 
 (defun copy-to-register (register start end &optional delete-flag)
-  "Copy region into register REGISTER.
-With prefix arg, delete as well.
-Called from program, takes four args:
-REGISTER, START, END and DELETE-FLAG.
+  "Copy region into register REGISTER.  With prefix arg, delete as well.
+Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
 START and END are buffer positions indicating what to copy."
   (interactive "cCopy to register: \nr\nP")
   (set-register register (buffer-substring start end))
@@ -221,8 +217,7 @@
 (defun append-to-register (register start end &optional delete-flag)
   "Append region to text in register REGISTER.
 With prefix arg, delete as well.
-Called from program, takes four args:
-REGISTER, START, END and DELETE-FLAG.
+Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
 START and END are buffer positions indicating what to append."
   (interactive "cAppend to register: \nr\nP")
   (or (stringp (get-register register))
@@ -234,8 +229,7 @@
 (defun prepend-to-register (register start end &optional delete-flag)
   "Prepend region to text in register REGISTER.
 With prefix arg, delete as well.
-Called from program, takes four args:
-REGISTER, START, END and DELETE-FLAG.
+Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
 START and END are buffer positions indicating what to prepend."
   (interactive "cPrepend to register: \nr\nP")
   (or (stringp (get-register register))
@@ -247,8 +241,7 @@
 (defun copy-rectangle-to-register (register start end &optional delete-flag)
   "Copy rectangular region into register REGISTER.
 With prefix arg, delete as well.
-Called from program, takes four args:
-REGISTER, START, END and DELETE-FLAG.
+Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
 START and END are buffer positions giving two corners of rectangle."
   (interactive "cCopy rectangle to register: \nr\nP")
   (set-register register
--- a/lisp/prim/replace.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/replace.el	Mon Aug 13 09:03:46 2007 +0200
@@ -15,20 +15,22 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34 [Partially].
 
 ;;; Commentary:
 
 ;; This package supplies the string and regular-expression replace functions
 ;; documented in the XEmacs Reference Manual.
 
+;; All the gettext calls are for XEmacs I18N3 message catalog support.
+
 ;;; Code:
 
-(defvar case-replace t "\
+(defconst case-replace t "\
 *Non-nil means `query-replace' should preserve case in replacements.
 What this means is that `query-replace' will change the case of the
 replacement text so that it matches the text that was replaced.
@@ -145,6 +147,9 @@
   "Replace occurrences of FROM-STRING with TO-STRING.
 Preserve case in each match if `case-replace' and `case-fold-search'
 are non-nil and FROM-STRING has no uppercase letters.
+\(Preserving case means that if the string matched is all caps, or capitalized,
+then its replacement is upcased or capitalized.)
+
 Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
 only matches surrounded by word boundaries.
 
@@ -252,8 +257,8 @@
 (if occur-mode-map
     ()
   (setq occur-mode-map (make-sparse-keymap))
-  (set-keymap-name occur-mode-map 'occur-mode-map)
-  (define-key occur-mode-map 'button2 'occur-mode-mouse-goto)
+  (set-keymap-name occur-mode-map 'occur-mode-map) ; XEmacs
+  (define-key occur-mode-map [mouse-2] 'occur-mode-mouse-goto)
   (define-key occur-mode-map "\C-c\C-c" 'occur-mode-goto-occurrence)
   (define-key occur-mode-map "\C-m" 'occur-mode-goto-occurrence))
 
@@ -271,15 +276,26 @@
   (kill-all-local-variables)
   (use-local-map occur-mode-map)
   (setq major-mode 'occur-mode)
-  (setq mode-name (gettext "Occur"))
+  (setq mode-name (gettext "Occur")) ; XEmacs
   (make-local-variable 'occur-buffer)
   (make-local-variable 'occur-nlines)
   (make-local-variable 'occur-pos-list)
-  (require 'mode-motion)
-  (setq mode-motion-hook 'mode-motion-highlight-line)
+  (require 'mode-motion) ; XEmacs
+  (setq mode-motion-hook 'mode-motion-highlight-line) ; XEmacs
   (run-hooks 'occur-mode-hook))
 
-(defun occur-mode-mouse-goto (e)
+;; FSF Version of next function:
+;  (let (buffer pos)
+;    (save-excursion
+;      (set-buffer (window-buffer (posn-window (event-end event))))
+;      (save-excursion
+;       (goto-char (posn-point (event-end event)))
+;       (setq pos (occur-mode-find-occurrence))
+;       (setq buffer occur-buffer)))
+;    (pop-to-buffer buffer)
+;    (goto-char (marker-position pos))))
+
+(defun occur-mode-mouse-goto (event)
   "Go to the occurrence highlighted by mouse.
 This function is only reasonable when bound to a mouse key in the occur buffer"
   (interactive "e")
@@ -293,6 +309,7 @@
       (select-frame frame-save)
       (select-window window-save))))
 
+;; Called occur-mode-find-occurrence in FSF
 (defun occur-mode-goto-occurrence ()
   "Go to the occurrence the current line describes."
   (interactive)
@@ -323,7 +340,7 @@
 	(error "No occurrence on this line"))
     (or pos
 	(error "No occurrence on this line"))
-    ;; don't raise window unless it isn't visible
+    ;; XEmacs: don't raise window unless it isn't visible
     ;; allow for the possibility that the occur buffer is on another frame
     (or (and window
 	     (window-live-p window)
@@ -344,7 +361,7 @@
 ;;; Damn you Jamie, this is utter trash.
 (defvar list-matching-lines-whole-buffer t
   "If t, occur operates on whole buffer, otherwise occur starts from point.
-default is nil.")
+default is t.")
 
 (define-function 'occur 'list-matching-lines)
 (defun list-matching-lines (regexp &optional nlines)
@@ -355,8 +372,8 @@
 If variable `list-matching-lines-whole-buffer' is non-nil, the entire buffer is
 searched, otherwise search begins at point.
 
-Each line is displayed with NLINES lines before and after,
-or -NLINES before if NLINES is negative.
+Each line is displayed with NLINES lines before and after, or -NLINES
+before if NLINES is negative.
 NLINES defaults to `list-matching-lines-default-context-lines'.
 Interactively it is the prefix arg.
 
@@ -364,6 +381,7 @@
 It serves as a menu to find any of the occurrences in this buffer.
 \\[describe-mode] in that buffer will explain how."
   (interactive
+   ;; XEmacs change
    (list (let* ((default (or (symbol-near-point)
 			     (and regexp-history
 				  (car regexp-history))))
@@ -396,6 +414,8 @@
 	(buffer (current-buffer))
 	(linenum 1)
 	(prevpos (point-min))
+	;; The rest of this function is very different from FSF.
+	;; Presumably that's due to Jamie's misfeature
         (final-context-start (make-marker)))
     (if (not list-matching-lines-whole-buffer)
 	(save-excursion
@@ -420,7 +440,7 @@
       (save-excursion
 	(if list-matching-lines-whole-buffer
 	    (beginning-of-buffer))
-	(message "Searching for %s ..." regexp)
+	(message (format "Searching for %s ..." regexp))
 	;; Find next match, but give up if prev match was at end of buffer.
 	(while (and (not (= prevpos (point-max)))
 		    (re-search-forward regexp nil t))
@@ -498,24 +518,27 @@
 
 ;; It would be nice to use \\[...], but there is no reasonable way
 ;; to make that display both SPC and Y.
-(defvar query-replace-help (purecopy
-  "Type Space or `y' to replace one match, Delete or `n' to skip to next,
+(defconst query-replace-help
+  (purecopy
+   "Type Space or `y' to replace one match, Delete or `n' to skip to next,
 RET or `q' to exit, Period to replace one match and exit,
 Comma to replace but not move point immediately,
 C-r to enter recursive edit (\\[exit-recursive-edit] to get out again),
 C-w to delete match and recursive edit,
 C-l to clear the frame, redisplay, and offer same replacement again,
 ! to replace all remaining matches with no more questions,
-^ to move point back to previous match.")
+^ to move point back to previous match."
+)
   "Help message while in query-replace")
 
-(defvar	query-replace-map nil
+(defvar query-replace-map nil
   "Keymap that defines the responses to questions in `query-replace'.
 The \"bindings\" in this map are not commands; they are answers.
 The valid answers include `act', `skip', `act-and-show',
 `exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
 `automatic', `backup', `exit-prefix', and `help'.")
 
+;; Why does it seem that ever file has a different method of doing this?
 (if query-replace-map
     nil
     (let ((map (make-sparse-keymap)))
@@ -552,6 +575,7 @@
 
 (autoload 'isearch-highlight "isearch")
 
+;; XEmacs
 (defun perform-replace-next-event (event)
   (if isearch-highlight
       (let ((aborted t))
@@ -575,8 +599,8 @@
   (or map (setq map query-replace-map))
   (let* ((event (make-event))
 	 (nocasify (not (and case-fold-search case-replace
-			     (string-equal from-string
-					   (downcase from-string)))))
+			    (string-equal from-string
+					  (downcase from-string)))))
 	 (literal (not regexp-flag))
 	 (search-function (if regexp-flag 're-search-forward 'search-forward))
 	 (search-string from-string)
@@ -609,186 +633,195 @@
 				    "\\b")))
     (push-mark)
     (undo-boundary)
-    ;; Loop finding occurrences that perhaps should be replaced.
-    (while (and keep-going
-		(not (eobp))
-		(let ((case-fold-search qr-case-fold-search))
-		  (funcall search-function search-string nil t))
-		;; If the search string matches immediately after
-		;; the previous match, but it did not match there
-		;; before the replacement was done, ignore the match.
-		(if (or (eq lastrepl (point))
-			(and regexp-flag
-			     (eq lastrepl (match-beginning 0))
-			     (not match-again)))
+    (unwind-protect
+	;; Loop finding occurrences that perhaps should be replaced.
+	(while (and keep-going
+		    (not (eobp))
+		    (let ((case-fold-search qr-case-fold-search))
+		      (funcall search-function search-string nil t))
+		    ;; If the search string matches immediately after
+		    ;; the previous match, but it did not match there
+		    ;; before the replacement was done, ignore the match.
+		    (if (or (eq lastrepl (point))
+			    (and regexp-flag
+				 (eq lastrepl (match-beginning 0))
+				 (not match-again)))
+			(if (eobp)
+			    nil
+			  ;; Don't replace the null string 
+			  ;; right after end of previous replacement.
+			  (forward-char 1)
+			  (let ((case-fold-search qr-case-fold-search))
+			    (funcall search-function search-string nil t)))
+		      t))
 
-		    (if (eobp)
-			nil
-		      ;; Don't replace the null string 
-		      ;; right after end of previous replacement.
-		      (forward-char 1)
-		      (let ((case-fold-search qr-case-fold-search))
-			(funcall search-function search-string nil t)))
-		  t))
-      ;; Save the data associated with the real match.
-      (setq real-match-data (match-data))
-
-      ;; Before we make the replacement, decide whether the search string
-      ;; can match again just after this match.
-      (if regexp-flag
-	  (progn 
-            (setq match-again (looking-at search-string))
-            (store-match-data real-match-data)))
+	  ;; Save the data associated with the real match.
+	  (setq real-match-data (match-data))
 
-      ;; If time for a change, advance to next replacement string.
-      (if (and (listp replacements)
-	       (= next-rotate-count replace-count))
-	  (progn
-	    (setq next-rotate-count
-		  (+ next-rotate-count repeat-count))
-	    (setq next-replacement (nth replacement-index replacements))
-	    (setq replacement-index (% (1+ replacement-index) (length replacements)))))
-      (if (not query-flag)
-	  (progn
-	    (store-match-data real-match-data)
-	    (replace-match next-replacement nocasify literal)
-	    (setq replace-count (1+ replace-count)))
-	(undo-boundary)
-	(let ((help-form
-	       '(concat (format "Query replacing %s%s with %s.\n\n"
-				(if regexp-flag (gettext "regexp ") "")
-				from-string next-replacement)
-                           (substitute-command-keys query-replace-help)))
-              (done nil)
-              (replaced nil)
-              def)
-          ;; Loop reading commands until one of them sets done,
-	  ;; which means it has finished handling this occurrence.
-	  (while (not done)
-	    ;; Don't fill up the message log
-	    ;; with a bunch of identical messages.
-	    (display-message 'prompt
-			     (format message from-string next-replacement))
-            (perform-replace-next-event event)
-            (setq def (lookup-key map (vector event)))
-	    ;; Restore the match data while we process the command.
-	    (store-match-data real-match-data)
-	    (cond ((eq def 'help)
-		   (with-output-to-temp-buffer (gettext "*Help*")
-		     (princ (concat
-			     (format "Query replacing %s%s with %s.\n\n"
-				     (if regexp-flag "regexp " "")
-				     from-string next-replacement)
-			      (substitute-command-keys
-				   query-replace-help)))
+	  ;; Before we make the replacement, decide whether the search string
+	  ;; can match again just after this match.
+	  (if regexp-flag
+	      (progn 
+		(setq match-again (looking-at search-string))
+		;; XEmacs addition
+		(store-match-data real-match-data)))
+	  ;; If time for a change, advance to next replacement string.
+	  (if (and (listp replacements)
+		   (= next-rotate-count replace-count))
+	      (progn
+		(setq next-rotate-count
+		      (+ next-rotate-count repeat-count))
+		(setq next-replacement (nth replacement-index replacements))
+		(setq replacement-index (% (1+ replacement-index) (length replacements)))))
+	  (if (not query-flag)
+	      (progn
+		(store-match-data real-match-data)
+		(replace-match next-replacement nocasify literal)
+		(setq replace-count (1+ replace-count)))
+	    (undo-boundary)
+	    (let ((help-form
+		   '(concat (format "Query replacing %s%s with %s.\n\n"
+				    (if regexp-flag (gettext "regexp ") "")
+				    from-string next-replacement)
+			    (substitute-command-keys query-replace-help)))
+		  done replaced def)
+	      ;; Loop reading commands until one of them sets done,
+	      ;; which means it has finished handling this occurrence.
+	      (while (not done)
+		;; Don't fill up the message log
+		;; with a bunch of identical messages.
+		;; XEmacs change
+		(display-message 'prompt
+				 (format message from-string next-replacement))
+		(perform-replace-next-event event)
+		(setq def (lookup-key map (vector event)))
+		;; Restore the match data while we process the command.
+		(store-match-data real-match-data)
+		(cond ((eq def 'help)
+		       (with-output-to-temp-buffer (gettext "*Help*")
+			 (princ (concat
+				 (format "Query replacing %s%s with %s.\n\n"
+					 (if regexp-flag "regexp " "")
+					 from-string next-replacement)
+				 (substitute-command-keys
+				  query-replace-help)))
 			 (save-excursion
 			   (set-buffer standard-output)
 			   (help-mode))))
-		  ((eq def 'exit)
-		   (setq keep-going nil)
-		   (setq done t))
-		  ((eq def 'backup)
-                   (if stack
-                       (let ((elt (car stack)))
-                         (goto-char (car elt))
-                         (setq replaced (eq t (cdr elt)))
-                         (or replaced
-                             (store-match-data (cdr elt)))
-                         (setq stack (cdr stack)))
-                       (progn
+		      ((eq def 'exit)
+		       (setq keep-going nil)
+		       (setq done t))
+		      ((eq def 'backup)
+		       (if stack
+			   (let ((elt (car stack)))
+			     (goto-char (car elt))
+			     (setq replaced (eq t (cdr elt)))
+			     (or replaced
+				 (store-match-data (cdr elt)))
+			     (setq stack (cdr stack)))
 			 (message "No previous match")
 			 (ding 'no-terminate)
-			 (sit-for 1))))
-		  ((eq def 'act)
-		   (or replaced
-		       (replace-match next-replacement nocasify literal))
-		   (setq done t replaced t))
-		  ((eq def 'act-and-exit)
-		   (or replaced
-		       (replace-match next-replacement nocasify literal))
-		   (setq keep-going nil)
-		   (setq done t replaced t))
-		  ((eq def 'act-and-show)
-		   (if (not replaced)
-		       (progn
-			 (replace-match next-replacement nocasify literal)
-			 (setq replaced t))))
-		  ((eq def 'automatic)
-		   (or replaced
-		       (replace-match next-replacement nocasify literal))
-		   (setq done t query-flag nil replaced t))
-		  ((eq def 'skip)
-		   (setq done t))
-		  ((eq def 'recenter)
-		   (recenter nil))
-		  ((eq def 'edit)
-		   (store-match-data
-		    (prog1 (match-data)
-		      (save-excursion (recursive-edit))))
-		   ;; Before we make the replacement,
-		   ;; decide whether the search string
-		   ;; can match again just after this match.
-		   (if regexp-flag
-		       (setq match-again (looking-at search-string))))
-		  ((eq def 'delete-and-edit)
-		   (delete-region (match-beginning 0) (match-end 0))
-		   (store-match-data (prog1 (match-data)
-		      (save-excursion (recursive-edit))))
-		   (setq replaced t))
-		  ;; Note: we do not need to treat `exit-prefix'
-		  ;; specially here, since we reread
-		  ;; any unrecognized character.
-		  (t
-		   (setq this-command 'mode-exited)
-		   (setq keep-going nil)
-		   (setq unread-command-events
-			 (cons event unread-command-events))
-		   (setq done t))))
-	  ;; Record previous position for ^ when we move on.
-	  ;; Change markers to numbers in the match data
-	  ;; since lots of markers slow down editing.
-	  (setq stack
-		(cons (cons (point)
-			    (or replaced
-				(mapcar
-				 #'(lambda (elt)
-				     (if (markerp elt)
-					 (prog1 (marker-position elt)
-					   (set-marker elt nil))
-				       elt))
-				 (match-data))))
-		      stack))
-	  (if replaced (setq replace-count (1+ replace-count)))))
-      (setq lastrepl (point)))
+			 (sit-for 1)))
+		      ((eq def 'act)
+		       (or replaced
+			   (replace-match next-replacement nocasify literal))
+		       (setq done t replaced t))
+		      ((eq def 'act-and-exit)
+		       (or replaced
+			   (replace-match next-replacement nocasify literal))
+		       (setq keep-going nil)
+		       (setq done t replaced t))
+		      ((eq def 'act-and-show)
+		       (if (not replaced)
+			   (progn
+			     (replace-match next-replacement nocasify literal)
+			     (setq replaced t))))
+		      ((eq def 'automatic)
+		       (or replaced
+			   (replace-match next-replacement nocasify literal))
+		       (setq done t query-flag nil replaced t))
+		      ((eq def 'skip)
+		       (setq done t))
+		      ((eq def 'recenter)
+		       (recenter nil))
+		      ((eq def 'edit)
+		       (store-match-data
+			(prog1 (match-data)
+			  (save-excursion (recursive-edit))))
+		       ;; Before we make the replacement,
+		       ;; decide whether the search string
+		       ;; can match again just after this match.
+		       (if regexp-flag
+			   (setq match-again (looking-at search-string))))
+		      ((eq def 'delete-and-edit)
+		       (delete-region (match-beginning 0) (match-end 0))
+		       (store-match-data (prog1 (match-data)
+					   (save-excursion (recursive-edit))))
+		       (setq replaced t))
+		      ;; Note: we do not need to treat `exit-prefix'
+		      ;; specially here, since we reread
+		      ;; any unrecognized character.
+		      (t
+		       (setq this-command 'mode-exited)
+		       (setq keep-going nil)
+		       (setq unread-command-events
+			     (cons event unread-command-events))
+		       (setq done t))))
+	      ;; Record previous position for ^ when we move on.
+	      ;; Change markers to numbers in the match data
+	      ;; since lots of markers slow down editing.
+	      (setq stack
+		    (cons (cons (point)
+				(or replaced
+				    (mapcar
+				     #'(lambda (elt)
+					 (if (markerp elt)
+					     (prog1 (marker-position elt)
+					       (set-marker elt nil))
+					   elt))
+				     (match-data))))
+			  stack))
+	      (if replaced (setq replace-count (1+ replace-count)))))
+	  (setq lastrepl (point)))
+      (replace-dehighlight))
     (or unread-command-events
 	(message "Replaced %d occurrence%s"
 		 replace-count
 		 (if (= replace-count 1) "" "s")))
     (and keep-going stack)))
 
-; FSF 19.30 original:
-; (defun match-string (num &optional string)
-;   "Return string of text matched by last search.
-; NUM specifies which parenthesized expression in the last regexp.
-;  Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
-; Zero means the entire text matched by the whole regexp or whole string.
-; STRING should be given if the last search was by `string-match' on STRING."
-;   (if (match-beginning num)
-;       (if string
-;           (substring string (match-beginning num) (match-end num))
-;         (buffer-substring (match-beginning num) (match-end num)))))
+(defvar query-replace-highlight nil
+  "*Non-nil means to highlight words during query replacement.")
+
+(defvar replace-overlay nil)
+
+(defun replace-dehighlight ()
+  (and replace-overlay
+       (progn
+	 (delete-overlay replace-overlay)
+	 (setq replace-overlay nil))))
 
-;; #### - this could stand to be in C...
-(defmacro match-string (n &optional string)
-  "Returns the Nth subexpression matched by the last regular expression
-search.  The second argument, STRING, must be specified if the last
-regular expression search was done with `string-match'."
-  ;; #### - note that match-beginning is byte coded, so it's more efficient
-  ;; to just call it twice than it is to let-bind its return value... --Stig
-  `(and (match-beginning ,n)
-	,(if string
-	     `(substring ,string (match-beginning ,n) (match-end ,n))
-	   `(buffer-substring (match-beginning ,n) (match-end ,n)))))
+(defun replace-highlight (start end)
+  (and query-replace-highlight
+       (progn
+	 (or replace-overlay
+	     (progn
+	       (setq replace-overlay (make-overlay start end))
+	       (overlay-put replace-overlay 'face
+			    (if (internal-find-face 'query-replace)
+				'query-replace 'region))))
+	 (move-overlay replace-overlay start end (current-buffer)))))
+
+(defun match-string (num &optional string)
+  "Return string of text matched by last search.
+NUM specifies which parenthesized expression in the last regexp.
+ Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
+Zero means the entire text matched by the whole regexp or whole string.
+STRING should be given if the last search was by `string-match' on STRING."
+  (if (match-beginning num)
+      (if string
+          (substring string (match-beginning num) (match-end num))
+        (buffer-substring (match-beginning num) (match-end num)))))
 
 (defmacro save-match-data (&rest body)
   "Execute BODY forms, restoring the global value of the match data."
--- a/lisp/prim/reposition.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/reposition.el	Mon Aug 13 09:03:46 2007 +0200
@@ -19,25 +19,25 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
-;;; Reposition-window makes an entire function definition or comment visible,
-;;; or, if it is already visible, places it at the top of the window;
-;;; additional invocations toggle the visibility of comments preceding the
-;;; code.  For the gory details, see the documentation for reposition-window;
-;;; rather than reading that, you may just want to play with it.
+;; Reposition-window makes an entire function definition or comment visible,
+;; or, if it is already visible, places it at the top of the window;
+;; additional invocations toggle the visibility of comments preceding the
+;; code.  For the gory details, see the documentation for reposition-window;
+;; rather than reading that, you may just want to play with it.
 
-;;; This tries pretty hard to do the recentering correctly; the precise
-;;; action depends on what the buffer looks like.  If you find a situation
-;;; where it doesn't behave well, let me know.  This function is modeled
-;;; after one of the same name in ZMACS, but the code is all-new and the
-;;; behavior in some situations differs.
+;; This tries pretty hard to do the recentering correctly; the precise
+;; action depends on what the buffer looks like.  If you find a situation
+;; where it doesn't behave well, let me know.  This function is modeled
+;; after one of the same name in ZMACS, but the code is all-new and the
+;; behavior in some situations differs.
 
 ;;; Code:
 
@@ -74,13 +74,13 @@
 		;; the beginning of the preceding comment
 		(save-excursion
 		  (if (not (eobp)) (forward-char 1))
-		  (end-of-defun -1) 
+		  (end-of-defun -1)
 		  ;; Skip whitespace, newlines, and form feeds.
 		  (if (re-search-forward "[^ \t\n\f]" nil t)
 		      (backward-char 1))
 		  (point))
 		here)))
-	 (defun-height 
+	 (defun-height
 	   (repos-count-screen-lines-signed
 	    (save-excursion
 	      (end-of-defun 1) ; so comments associate with following defuns
@@ -122,16 +122,16 @@
 	   ;; whose first line is offscreen.
 	   ;; Avoid moving definition up even if defun runs offscreen;
 	   ;; we care more about getting the comment onscreen.
-	   
+
 	   (cond ((= line ht)
 		  ;; cursor on last screen line (and so in a comment)
 		  (if arg (progn (end-of-defun) (beginning-of-defun)))
 		  (recenter 0)
 		  ;;(repos-debug-macro "2a")
 		  )
-		 
+
 		 ;; This condition, copied from case 4, may not be quite right
-		 
+
 		 ((and arg (< ht comment-height))
 		  ;; Can't get first comment line onscreen.
 		  ;; Go there and try again.
--- a/lisp/prim/simple.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/simple.el	Mon Aug 13 09:03:46 2007 +0200
@@ -16,41 +16,41 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34 [But not very closely].
 
 ;;; Commentary:
 
 ;; A grab-bag of basic XEmacs commands not specifically related to some
 ;; major mode or to file-handling.
 
-;;; Changes for zmacs-style active-regions:
-;;;
-;;; beginning-of-buffer, end-of-buffer, count-lines-region, 
-;;; count-lines-buffer, what-line, what-cursor-position, set-goal-column,
-;;; set-fill-column, prefix-arg-internal, and line-move (which is used by
-;;; next-line and previous-line) set zmacs-region-stays to t, so that they
-;;; don't affect the current region-hilighting state.
-;;;
-;;; mark-whole-buffer, mark-word, exchange-point-and-mark, and
-;;; set-mark-command (without an argument) call zmacs-activate-region.
-;;;
-;;; mark takes an optional arg like the new Fmark_marker() does.  When 
-;;; the region is not active, mark returns nil unless the optional arg is true.
-;;;
-;;; push-mark, pop-mark, exchange-point-and-mark, and set-marker, and
-;;; set-mark-command use (mark t) so that they can access the mark whether
-;;; the region is active or not.  
-;;;
-;;; shell-command, shell-command-on-region, yank, and yank-pop (which all
-;;; push a mark) have been altered to call exchange-point-and-mark with an
-;;; argument, meaning "don't activate the region".  These commands  only use
-;;; exchange-point-and-mark to position the newly-pushed mark correctly, so
-;;; this isn't a user-visible change.  These functions have also been altered
-;;; to use (mark t) for the same reason.
+;; Changes for zmacs-style active-regions:
+;;
+;; beginning-of-buffer, end-of-buffer, count-lines-region, 
+;; count-lines-buffer, what-line, what-cursor-position, set-goal-column,
+;; set-fill-column, prefix-arg-internal, and line-move (which is used by
+;; next-line and previous-line) set zmacs-region-stays to t, so that they
+;; don't affect the current region-hilighting state.
+;;
+;; mark-whole-buffer, mark-word, exchange-point-and-mark, and
+;; set-mark-command (without an argument) call zmacs-activate-region.
+;;
+;; mark takes an optional arg like the new Fmark_marker() does.  When 
+;; the region is not active, mark returns nil unless the optional arg is true.
+;;
+;; push-mark, pop-mark, exchange-point-and-mark, and set-marker, and
+;; set-mark-command use (mark t) so that they can access the mark whether
+;; the region is active or not.  
+;;
+;; shell-command, shell-command-on-region, yank, and yank-pop (which all
+;; push a mark) have been altered to call exchange-point-and-mark with an
+;; argument, meaning "don't activate the region".  These commands  only use
+;; exchange-point-and-mark to position the newly-pushed mark correctly, so
+;; this isn't a user-visible change.  These functions have also been altered
+;; to use (mark t) for the same reason.
 
 ;;; Code:
 
@@ -67,6 +67,14 @@
   ;; the end of the previous line.
   (let ((flag (and (not (bobp)) 
 		   (bolp)
+		   ;; Make sure the newline before point isn't intangible.
+		   (not (get-char-property (1- (point)) 'intangible))
+		   ;; Make sure the newline before point isn't read-only.
+		   (not (get-char-property (1- (point)) 'read-only))
+		   ;; Make sure the newline before point isn't invisible.
+		   (not (get-char-property (1- (point)) 'invisible))
+		   ;; Make sure the newline before point has the same
+		   ;; properties as the char before it (if any).
 		   (< (or (previous-extent-change (point)) -2) 
 		      (- (point) 2))))
 	(was-page-start (and (bolp)
@@ -89,11 +97,11 @@
     ;; Mark the newline(s) `hard'.
     (if use-hard-newlines
 	(let* ((from (- (point) (if arg (prefix-numeric-value arg) 1)))
-	       (sticky (get-text-property from 'end-open)))
+	       (sticky (get-text-property from 'end-open))) ; XEmacs
 	  (put-text-property from (point) 'hard 't)
 	  ;; If end-open is not "t", add 'hard to end-open list
 	  (if (and (listp sticky) (not (memq 'hard sticky)))
-	      (put-text-property from (point) 'end-open
+	      (put-text-property from (point) 'end-open ; XEmacs
 				 (cons 'hard sticky)))))
     ;; If the newline leaves the previous line blank,
     ;; and we have a left margin, delete that from the blank line.
@@ -117,14 +125,8 @@
 If there is a fill prefix and/or a left-margin, insert them on the new line
 if the line would have been blank.
 With arg N, insert N newlines."
-;;   "Insert a newline and leave point before it.
-;; If there is a fill prefix, insert the fill prefix on the new line
-;; if the line would have been empty.
-;; With arg N, insert N newlines."
   (interactive "*p")
   (let* ((do-fill-prefix (and fill-prefix (bolp)))
-	 ;well, I'm going to re-enable this.  --ben
-	 ;(do-fill-prefix nil)  ;; screw this -- says JWZ
 	 (do-left-margin (and (bolp) (> (current-left-margin) 0)))
 	 (loc (point)))
     (newline arg)
@@ -214,7 +216,7 @@
 (defun just-one-space ()
   "Delete all spaces and tabs around point, leaving one space."
   (interactive "*")
-  (if abbrev-mode
+  (if abbrev-mode ; XEmacs
       (expand-abbrev))
   (skip-chars-backward " \t")
   (if (= (following-char) ? )
@@ -264,6 +266,7 @@
 
 (defun back-to-indentation ()
   "Move point to the first non-whitespace character on this line."
+  ;; XEmacs change
   (interactive "_")
   (beginning-of-line 1)
   (skip-chars-forward " \t"))
@@ -323,7 +326,7 @@
 	(forward-char -1)
 	(setq count (1- count)))))
   (delete-backward-char arg killp)
-  ;; In overwrite mode, back over columns while clearing them out,
+  ;; XEmacs: In overwrite mode, back over columns while clearing them out,
   ;; unless at end of line.
   (and overwrite-mode (not (eolp))
        (save-excursion (insert-char ?\  arg))))
@@ -346,6 +349,7 @@
 
 Don't use this command in Lisp programs!
 \(goto-char (point-min)) is faster and avoids clobbering the mark."
+  ;; XEmacs change
   (interactive "_P")
   (push-mark)
   (let ((size (- (point-max) (point-min))))
@@ -368,6 +372,7 @@
 
 Don't use this command in Lisp programs!
 \(goto-char (point-max)) is faster and avoids clobbering the mark."
+  ;; XEmacs change
   (interactive "_P")
   (push-mark)
   ;; XEmacs changes here.
@@ -385,11 +390,13 @@
            ;; If we went to a place in the middle of the buffer,
            ;; adjust it to the beginning of a line.
            (forward-line 1))
+	  ;; XEmacs change
 	  (scroll-to-end
            ;; If the end of the buffer is not already on the screen,
            ;; then scroll specially to put it near, but not at, the bottom.
            (recenter -3)))))
 
+;; XEmacs (not in FSF)
 (defun mark-beginning-of-buffer (&optional arg)
   "Push a mark at the beginning of the buffer; leave point where it is.
 With arg N, push mark N/10 of the way from the true beginning."
@@ -405,6 +412,7 @@
              t))
 (define-function 'mark-bob 'mark-beginning-of-buffer)
 
+;; XEmacs (not in FSF)
 (defun mark-end-of-buffer (&optional arg)
   "Push a mark at the end of the buffer; leave point where it is.
 With arg N, push mark N/10 of the way from the true end."
@@ -431,6 +439,7 @@
   (push-mark (point-max) nil t)
   (goto-char (point-min)))
 
+;; XEmacs
 (defun eval-current-buffer (&optional printflag)
   "Evaluate the current buffer as Lisp code.
 Programs can pass argument PRINTFLAG which controls printing of output:
@@ -438,6 +447,7 @@
   (interactive)
   (eval-buffer (current-buffer) printflag))
 
+;; XEmacs
 (defun count-words-buffer (b)
   (interactive "b")
   (save-excursion
@@ -446,6 +456,7 @@
       (message "Buffer has %d words"
 	       (count-words-region (point-min) (point-max))))))
 
+;; XEmacs
 (defun count-words-region (start end)
   (interactive "r")
   (save-excursion
@@ -459,12 +470,12 @@
 
 (defun count-lines-region (start end)
   "Print number of lines and characters in the region."
+  ;; XEmacs change
   (interactive "_r")
-  (let ((n (count-lines start end)))
-    (message "Region has %d lines, %d characters"
-	     n (- end start))
-    n))
+  (message "Region has %d lines, %d characters"
+	   (count-lines start end) (- end start)))
 
+;; XEmacs
 (defun count-lines-buffer (b)
   "Print number of lines and charcters in the specified buffer."
   (interactive "_b")
@@ -473,12 +484,13 @@
           cnt)
       (set-buffer buf)
       (setq cnt (count-lines (point-min) (point-max)))
-      (message "Region has %d lines, %d characters"
+      (message "Buffer has %d lines, %d characters"
                cnt (- (point-max) (point-min)))
       cnt)))
 
 (defun what-line ()
   "Print the current buffer line number and narrowed line number of point."
+  ;; XEmacs change
   (interactive "_")
   (let ((opoint (point)) start)
     (save-excursion
@@ -521,6 +533,7 @@
 
 (defun what-cursor-position ()
   "Print info on cursor position (on screen and within buffer)."
+  ;; XEmacs change
   (interactive "_")
   (let* ((char (following-char))
 	 (beg (point-min))
@@ -541,6 +554,7 @@
 		     pos total percent beg end col hscroll)
 	  (message "point=%d of %d(%d%%)  column %d %s"
 		   pos total percent col hscroll))
+      ;; XEmacs: don't use single-key-description
       (if (or (/= beg 1) (/= end (1+ total)))
 	  (message "Char: %s (0%o, %d, 0x%x)  point=%d of %d(%d%%) <%d - %d>  column %d %s"
 		   (text-char-description char) char char char pos total
@@ -555,16 +569,29 @@
   (interactive)
   (kill-all-local-variables))
 
+;; XEmacs the following are declared elsewhere
+;(defvar read-expression-map (cons 'keymap minibuffer-local-map)
+;  "Minibuffer keymap used for reading Lisp expressions.")
+;(define-key read-expression-map "\M-\t" 'lisp-complete-symbol)
+
+;(put 'eval-expression 'disabled t)
+
+;(defvar read-expression-history nil)
 
 ;; We define this, rather than making `eval' interactive,
 ;; for the sake of completion of names like eval-region, eval-current-buffer.
 (defun eval-expression (expression)
   "Evaluate EXPRESSION and print value in minibuffer.
 Value is also consed on to front of the variable `values'."
-  (interactive "xEval: ")
+  ;(interactive "xEval: ")
+  (interactive
+   (list (read-from-minibuffer "Eval: "
+			       nil read-expression-map t
+			       'read-expression-history)))
   (setq values (cons (eval expression) values))
   (prin1 (car values) t))
 
+;; XEmacs -- extra parameter (variant, but equivalent logic)
 (defun edit-and-eval-command (prompt command &optional history)
   "Prompting with PROMPT, let user edit COMMAND and eval result.
 COMMAND is a Lisp expression.  Let user edit that expression in
@@ -603,11 +630,20 @@
 You can use the minibuffer history commands \\<minibuffer-local-map>\\[next-history-element] and \\[previous-history-element]
 to get different commands to edit and resubmit."
   (interactive "p")
+  ;; XEmacs: It looks like our version is better -sb
   (let ((print-level nil))
     (edit-and-eval-command "Redo: "
 			   (or (nth (1- arg) command-history)
 			       (error ""))
 			   (cons 'command-history arg))))
+
+;; XEmacs: Functions moved to minibuf.el
+;; previous-matching-history-element
+;; next-matching-history-element
+;; next-history-element
+;; previous-history-element
+;; next-complete-history-element
+;; previous-complete-history-element
 
 (defun goto-line (arg)
   "Goto line ARG, counting from line 1 at beginning of buffer."
@@ -636,7 +672,7 @@
     (or (eq (selected-window) (minibuffer-window))
 	(message "Undo!"))
     (or (and (eq last-command 'undo)
-	     (eq (current-buffer) last-undo-buffer))
+	     (eq (current-buffer) last-undo-buffer)) ; XEmacs
 	(progn (undo-start)
 	       (undo-more 1)))
     (undo-more (or arg 1))
@@ -658,7 +694,7 @@
 (defvar pending-undo-list nil
   "Within a run of consecutive undo commands, list remaining to be undone.")
 
-(defvar last-undo-buffer nil)
+(defvar last-undo-buffer nil)	; XEmacs
 
 (defun undo-start ()
   "Set `pending-undo-list' to the front of the undo list.
@@ -674,8 +710,9 @@
   (or pending-undo-list
       (error "No further undo information"))
   (setq pending-undo-list (primitive-undo count pending-undo-list)
-	last-undo-buffer (current-buffer)))
+	last-undo-buffer (current-buffer)))	; XEmacs
 
+;; XEmacs
 (defun call-with-transparent-undo (fn &rest args)
   "Apply FN to ARGS, and then undo all changes made by FN to the current
 buffer.  The undo records are processed even if FN returns non-locally.
@@ -702,23 +739,31 @@
 	      (while tail
 		(setq tail (primitive-undo (length tail) tail))))))))))
 
+;; XEmacs: The following are in other files
+;; shell-command-history
+;; shell-command-switch
+;; shell-command
+;; shell-command-sentinel
+
 
 (defconst universal-argument-map
   (let ((map (make-sparse-keymap)))
     (set-keymap-default-binding map 'universal-argument-other-key)
     ;FSFmacs (define-key map [switch-frame] nil)
+    (define-key map [(t)] 'universal-argument-other-key)
+    (define-key map [(meta t)] 'universal-argument-other-key)
     (define-key map [(control u)] 'universal-argument-more)
-    (define-key map ?- 'universal-argument-minus)
-    (define-key map ?0 'digit-argument)
-    (define-key map ?1 'digit-argument)
-    (define-key map ?2 'digit-argument)
-    (define-key map ?3 'digit-argument)
-    (define-key map ?4 'digit-argument)
-    (define-key map ?5 'digit-argument)
-    (define-key map ?6 'digit-argument)
-    (define-key map ?7 'digit-argument)
-    (define-key map ?8 'digit-argument)
-    (define-key map ?9 'digit-argument)
+    (define-key map [?-] 'universal-argument-minus)
+    (define-key map [?0] 'digit-argument)
+    (define-key map [?1] 'digit-argument)
+    (define-key map [?2] 'digit-argument)
+    (define-key map [?3] 'digit-argument)
+    (define-key map [?4] 'digit-argument)
+    (define-key map [?5] 'digit-argument)
+    (define-key map [?6] 'digit-argument)
+    (define-key map [?7] 'digit-argument)
+    (define-key map [?8] 'digit-argument)
+    (define-key map [?9] 'digit-argument)
     map)
   "Keymap used while processing \\[universal-argument].")
 
@@ -736,7 +781,7 @@
  multiplies the argument by 4 each time."
   (interactive)
   (setq prefix-arg (list 4))
-  (setq zmacs-region-stays t)
+  (setq zmacs-region-stays t)	; XEmacs
   (setq universal-argument-num-events (length (this-command-keys)))
   (setq overriding-terminal-local-map universal-argument-map))
 
@@ -748,7 +793,7 @@
       (setq prefix-arg (list (* 4 (car arg))))
     (setq prefix-arg arg)
     (setq overriding-terminal-local-map nil))
-  (setq zmacs-region-stays t)
+  (setq zmacs-region-stays t)	; XEmacs
   (setq universal-argument-num-events (length (this-command-keys))))
 
 (defun negative-argument (arg)
@@ -761,10 +806,11 @@
 	  (setq prefix-arg nil))
 	 (t
 	  (setq prefix-arg '-)))
-  (setq zmacs-region-stays t)
+  (setq zmacs-region-stays t)	; XEmacs
   (setq universal-argument-num-events (length (this-command-keys)))
   (setq overriding-terminal-local-map universal-argument-map))
 
+;; XEmacs:  This function not synched with FSF
 (defun digit-argument (arg)
   "Part of the numeric argument for the next command.
 \\[universal-argument] following digits or minus sign ends the argument."
@@ -801,7 +847,7 @@
 (defun universal-argument-other-key (arg)
   (interactive "P")
   (setq prefix-arg arg)
-  (setq zmacs-region-stays t)
+  (setq zmacs-region-stays t)	; XEmacs
   (let* ((key (this-command-keys))
 	 ;; FSF calls silly function `listify-key-sequence' here.
 	  (keylist (append key nil)))
@@ -812,6 +858,7 @@
   (setq overriding-terminal-local-map nil))
 
 
+;; XEmacs -- shouldn't these functions keep the zmacs region active?
 (defun forward-to-indentation (arg)
   "Move forward ARG lines and position at first nonblank character."
   (interactive "p")
@@ -841,6 +888,13 @@
   (kill-region (point)
 	       ;; Don't shift point before doing the delete; that way,
 	       ;; undo will record the right position of point.
+;; FSF
+;	       ;; It is better to move point to the other end of the kill
+;	       ;; before killing.  That way, in a read-only buffer, point
+;	       ;; moves across the text that is copied to the kill ring.
+;	       ;; The choice has no effect on undo now that undo records
+;	       ;; the value of point from before the command was run.
+;              (progn
 	       (save-excursion
 		 (if arg
 		     (forward-line (prefix-numeric-value arg))
@@ -851,6 +905,7 @@
 		     (end-of-line)))
 		 (point))))
 
+;; XEmacs
 (defun backward-kill-line nil
   "Kill back to the beginning of the line."
   (interactive)
@@ -913,12 +968,15 @@
 
 (defvar kill-ring nil
   "List of killed text sequences.
-In order to maintain correct interaction with cut-and-paste facilities 
-offered by window systems, the functions `kill-new', `kill-append', and
-`current-kill' should be used to access the kill ring, instead of using
-this variable directly.")
+Since the kill ring is supposed to interact nicely with cut-and-paste
+facilities offered by window systems, use of this variable should
+interact nicely with `interprogram-cut-function' and
+`interprogram-paste-function'.  The functions `kill-new',
+`kill-append', and `current-kill' are supposed to implement this
+interaction; you may want to use them instead of manipulating the kill
+ring directly.")
 
-(defvar kill-ring-max 30
+(defconst kill-ring-max 30
   "*Maximum length of kill ring before oldest elements are thrown away.")
 
 (defvar kill-ring-yank-pointer nil
@@ -970,6 +1028,10 @@
 ;(defvar kill-read-only-ok nil
 ;  "*Non-nil means don't signal an error for killing read-only text.")
 
+;(put 'text-read-only 'error-conditions
+;     '(text-read-only buffer-read-only error))
+;(put 'text-read-only 'error-message "Text is read-only")
+
 (defun kill-region (beg end &optional verbose) ; verbose is XEmacs addition
   "Kill between point and mark.
 The text is deleted but saved in the kill ring.
@@ -1006,19 +1068,23 @@
   (cond
 
    ;; I don't like this large change in behavior -- jwz
+   ;; Read-Only text means it shouldn't be deleted, so I'm restoring
+   ;; this code, but only for text-properties and not full extents. -sb
    ;; If the buffer is read-only, we should beep, in case the person
    ;; just isn't aware of this.  However, there's no harm in putting
    ;; the region's text in the kill ring, anyway.
-   ;;((or (and buffer-read-only (not inhibit-read-only))
-   ;;	  (text-property-not-all beg end 'read-only nil))
+   ((or (and buffer-read-only (not inhibit-read-only))
+	(text-property-not-all beg end 'read-only nil))
+   ;; This is redundant.
    ;; (if verbose (message "Copying %d characters"
-   ;;		      (- (max beg end) (min beg end))))
-   ;; (copy-region-as-kill beg end)
+   ;;			 (- (max beg end) (min beg end))))
+    (copy-region-as-kill beg end)
    ;; ;; This should always barf, and give us the correct error.
    ;; (if kill-read-only-ok
    ;;	  (message "Read only text copied to kill ring")
-   ;;	(setq this-command 'kill-region)
-   ;;	(barf-if-buffer-read-only)))
+    (setq this-command 'kill-region)
+    (barf-if-buffer-read-only)
+    (signal 'text-read-only (list (current-buffer))))
 
    ;; In certain cases, we can arrange for the undo list and the kill
    ;; ring to share the same string object.  This code does that.
@@ -1027,6 +1093,7 @@
 	     ;; Use = since positions may be numbers or markers.
 	     (= beg end)))
     ;; Don't let the undo list be truncated before we can even access it.
+    ;; FSF calls this `undo-strong-limit'
     (let ((undo-high-threshold (+ (- (max beg end) (min beg end)) 100))
 	  ;(old-list buffer-undo-list)
 	  tail)
@@ -1034,7 +1101,7 @@
       ;; Search back in buffer-undo-list for this string,
       ;; in case a change hook made property changes.
       (setq tail buffer-undo-list)
-      (while (not (stringp (car-safe (car-safe tail))))
+      (while (not (stringp (car-safe (car-safe tail)))) ; XEmacs
 	(setq tail (cdr tail)))
       ;; Take the same string recorded for undo
       ;; and put it in the kill-ring.
@@ -1074,8 +1141,13 @@
 	    (inhibit-quit t))
 	(if (pos-visible-in-window-p other-end (selected-window))
 	    (progn
+	      ;; FSF (I'm not sure what this does -sb)
+;	      ;; Swap point and mark.
+;	      (set-marker (mark-marker) (point) (current-buffer))
 	      (goto-char other-end)
               (sit-for 1)
+;	      ;; Swap back.
+;	      (set-marker (mark-marker) other-end (current-buffer))
               (goto-char opoint)
               ;; If user quit, deactivate the mark
 	      ;; as C-g would as a command.
@@ -1094,6 +1166,7 @@
 
 (defun append-next-kill ()
   "Cause following command, if it kills, to append to previous kill."
+  ;; XEmacs
   (interactive "_")
   (if (interactive-p)
       (progn
@@ -1118,18 +1191,28 @@
   (if (not (eq last-command 'yank))
       (error "Previous command was not a yank"))
   (setq this-command 'yank)
-  (let ((before (< (point) (mark t))))
+  (let ((inhibit-read-only t)
+	(before (< (point) (mark t))))
     (delete-region (point) (mark t))
+    ;;(set-marker (mark-marker) (point) (current-buffer))
     (set-mark (point))
     (insert (current-kill arg))
-    (if before (exchange-point-and-mark t))))
+    (if before
+	;; This is like exchange-point-and-mark, but doesn't activate the mark.
+	;; It is cleaner to avoid activation, even though the command
+	;; loop would deactivate the mark because we inserted text.
+	(goto-char (prog1 (mark t)
+		     (set-marker (mark-marker) (point) (current-buffer))))))
+  nil)
+
 
 (defun yank (&optional arg)
   "Reinsert the last stretch of killed text.
 More precisely, reinsert the stretch of killed text most recently
 killed OR yanked.  Put point at end, and set mark at beginning.
 With just C-u as argument, same but put point at beginning (and mark at end).
-With argument N, reinsert the Nth most recently killed stretch of killed text.
+With argument N, reinsert the Nth most recently killed stretch of killed
+text.
 See also the command \\[yank-pop]."
   (interactive "*P")
   ;; If we don't get all the way through, make last-command indicate that
@@ -1141,9 +1224,14 @@
 			 ((eq arg '-) -1)
 			 (t (1- arg)))))
   (if (consp arg)
-      (exchange-point-and-mark t))
-  ;; If we do get all the way through, make this-command indicate that.
-  (setq this-command 'yank))
+      ;; This is like exchange-point-and-mark, but doesn't activate the mark.
+      ;; It is cleaner to avoid activation, even though the command
+      ;; loop would deactivate the mark because we inserted text.
+      (goto-char (prog1 (mark t)
+		   (set-marker (mark-marker) (point) (current-buffer)))))
+  ;; If we do get all the way thru, make this-command indicate that.
+  (setq this-command 'yank)
+  nil)
 
 (defun rotate-yank-pointer (arg)
   "Rotate the yanking point in the kill ring.
@@ -1156,11 +1244,14 @@
   "Insert after point the contents of BUFFER.
 Puts mark after the inserted text.
 BUFFER may be a buffer or a buffer name."
-  (interactive (list (progn (barf-if-buffer-read-only)
-			    (read-buffer "Insert buffer: " 
-					 ;; XEmacs: we have different args
-					 (other-buffer (current-buffer) nil t)
-					 t))))
+  (interactive
+   (list
+    (progn
+      (barf-if-buffer-read-only)
+      (read-buffer "Insert buffer: " 
+		   ;; XEmacs: we have different args
+		   (other-buffer (current-buffer) nil t)
+		   t))))
   (or (bufferp buffer)
       (setq buffer (get-buffer buffer)))
   (let (start end newmark)
@@ -1220,7 +1311,8 @@
 	(insert-buffer-substring oldbuf start end)))))
 
 ;FSFmacs
-;(define-error 'mark-inactive "The mark is not active now")
+;(put 'mark-inactive 'error-conditions '(mark-inactive error))
+;(put 'mark-inactive 'error-message "The mark is not active now")
 
 (defun mark (&optional force buffer)
   "Return this buffer's mark value as integer, or nil if no mark.
@@ -1272,13 +1364,25 @@
 
   (setq buffer (decode-buffer buffer))
   (set-marker (mark-marker t buffer) pos buffer))
+;; FSF
+;  (if pos
+;     (progn
+;	(setq mark-active t)
+;	(run-hooks 'activate-mark-hook)
+;	(set-marker (mark-marker) pos (current-buffer)))
+;    ;; Normally we never clear mark-active except in Transient Mark mode.
+;    ;; But when we actually clear out the mark value too,
+;    ;; we must clear mark-active in any mode.
+;    (setq mark-active nil)
+;    (run-hooks 'deactivate-mark-hook)
+;    (set-marker (mark-marker) nil)))
 
 (defvar mark-ring nil
   "The list of former marks of the current buffer, most recent first.")
 (make-variable-buffer-local 'mark-ring)
 (put 'mark-ring 'permanent-local t)
 
-(defvar mark-ring-max 16
+(defconst mark-ring-max 16
   "*Maximum size of mark ring.  Start discarding off end if gets this big.")
 
 (defvar global-mark-ring nil
@@ -1290,7 +1394,7 @@
 
 (defun set-mark-command (arg)
   "Set mark at where point is, or jump to mark.
-With no prefix argument, set mark,  push old mark position on local mark
+With no prefix argument, set mark, push old mark position on local mark
 ring, and push mark on global mark ring.
 With argument, jump to mark, and pop a new position for mark off the ring
 \(does not affect global mark ring\).
@@ -1305,6 +1409,7 @@
       (goto-char (mark t))
       (pop-mark))))
 
+;; XEmacs: Extra parameter
 (defun push-mark (&optional location nomsg activate-region buffer)
   "Set mark at LOCATION (point, by default) and push old mark on mark ring.
 If the last global mark pushed was not in the current buffer,
@@ -1314,8 +1419,8 @@
 
 Novice Emacs Lisp programmers often try to use the mark for the wrong
 purposes.  See the documentation of `set-mark' for more information."
-  (setq buffer (decode-buffer buffer))
-  (if (null (mark t buffer))
+  (setq buffer (decode-buffer buffer)) ; XEmacs
+  (if (null (mark t buffer)) ; XEmacs
       nil
     ;; The save-excursion / set-buffer is necessary because mark-ring
     ;; is a buffer local variable
@@ -1327,6 +1432,7 @@
 	    (move-marker (car (nthcdr mark-ring-max mark-ring)) nil buffer)
 	    (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil)))))
   (set-mark (or location (point buffer)) buffer)
+; (set-marker (mark-marker) (or location (point)) (current-buffer)) ; FSF
   ;; Now push the mark on the global mark ring.
   (if (or (null global-mark-ring)
           (not (eq (marker-buffer (car global-mark-ring)) buffer)))
@@ -1345,6 +1451,8 @@
       (progn
 	(setq zmacs-region-stays t)
 	(zmacs-activate-region)))
+; (if (or activate (not transient-mark-mode)) ; FSF
+;     (set-mark (mark t))) ; FSF
   nil)
 
 (defun pop-mark ()
@@ -1368,9 +1476,10 @@
 	(error "No mark set in this buffer"))
     (set-mark (point))
     (goto-char omark)
-    (or dont-activate-region (zmacs-activate-region))
+    (or dont-activate-region (zmacs-activate-region)) ; XEmacs
     nil))
 
+;; XEmacs
 (defun mark-something (mark-fn movement-fn arg)
   "internal function used by mark-sexp, mark-word, etc."
   (let (newmark (pushp t))
@@ -1447,7 +1556,7 @@
 If you are thinking of using this in a Lisp program, consider
 using `forward-line' instead.  It is usually easier to use
 and more reliable (no dependence on goal column, etc.)."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (if (and next-line-add-newlines (= arg 1))
       (let ((opoint (point)))
 	(end-of-line)
@@ -1475,7 +1584,7 @@
 If you are thinking of using this in a Lisp program, consider using
 `forward-line' with a negative argument instead.  It is usually easier
 to use and more reliable (no dependence on goal column, etc.)."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (if (interactive-p)
       (condition-case nil
 	  (line-move (- arg))
@@ -1483,7 +1592,7 @@
     (line-move (- arg)))
   nil)
 
-(defvar track-eol nil
+(defconst track-eol nil
   "*Non-nil means vertical motion starting at end of line keeps to ends of lines.
 This means moving to the end of each line moved onto.
 The beginning of a blank line does not count as the end of a line.")
@@ -1557,7 +1666,7 @@
 				  (assq prop buffer-invisibility-spec)))))
 		(if (get-text-property (point) 'invisible)
 		    (goto-char (next-single-property-change (point) 'invisible))
-		  (goto-char (next-extent-change (point)))))
+		  (goto-char (next-extent-change (point))))) ; XEmacs
 	      (setq arg (1- arg)))
 	    (while (< arg 0)
 	      (beginning-of-line)
@@ -1572,7 +1681,7 @@
 				  (assq prop buffer-invisibility-spec)))))
 		(if (get-text-property (1- (point)) 'invisible)
 		    (goto-char (previous-single-property-change (point) 'invisible))
-		  (goto-char (previous-extent-change (point)))))
+		  (goto-char (previous-extent-change (point))))) ; XEmacs
 	      (setq arg (1+ arg))))
 	  (move-to-column (or goal-column temporary-goal-column)))
       ;; Remember where we moved to, go back home,
@@ -1596,7 +1705,7 @@
 With a non-nil argument, clears out the goal column
 so that \\[next-line] and \\[previous-line] resume vertical motion.
 The goal column is stored in the variable `goal-column'."
-  (interactive "_P")
+  (interactive "_P") ; XEmacs
   (if arg
       (progn
         (setq goal-column nil)
@@ -1607,8 +1716,12 @@
 	     goal-column))
   nil)
 
-
-;;; deleted FSFmacs terminal randomness hscroll-point-visible stuff.
+;; deleted FSFmacs terminal randomness hscroll-point-visible stuff.
+;; hscroll-step
+;; hscroll-point-visible
+;; hscroll-window-column
+;; right-arrow
+;; left-arrow
 
 (defun scroll-other-window-down (lines)
   "Scroll the \"other window\" down.
@@ -1620,6 +1733,7 @@
    (if (eq lines '-) nil
      (if (null lines) '-
        (- (prefix-numeric-value lines))))))
+;(define-key esc-map [?\C-\S-v] 'scroll-other-window-down)
 
 (defun beginning-of-buffer-other-window (arg)
   "Move point to the beginning of the buffer in the other window.
@@ -1713,13 +1827,13 @@
 	    (setq end2 (point))
 	    (funcall mover -1)
 	    (setq start2 (point))
-	    (goto-char (mark t))
+	    (goto-char (mark t)) ; XEmacs
 	    (funcall mover 1)
 	    (setq end1 (point))
 	    (funcall mover -1)
 	    (setq start1 (point))
 	    (transpose-subr-1))
-	  (exchange-point-and-mark t)))
+	  (exchange-point-and-mark t))) ; XEmacs
     (while (> arg 0)
       (funcall mover -1)
       (setq start1 (point))
@@ -1758,22 +1872,22 @@
     (delete-char (length word1))
     (insert word2)))
 
-(defvar comment-column 32
+(defconst comment-column 32
   "*Column to indent right-margin comments to.
 Setting this variable automatically makes it local to the current buffer.
 Each mode establishes a different default value for this variable; you
 can set the value for a particular mode using that mode's hook.")
 (make-variable-buffer-local 'comment-column)
 
-(defvar comment-start nil
+(defconst comment-start nil
   "*String to insert to start a new comment, or nil if no comment syntax.")
 
-(defvar comment-start-skip nil
+(defconst comment-start-skip nil
   "*Regexp to match the start of a comment plus everything up to its body.
 If there are any \\(...\\) pairs, the comment delimiter text is held to begin
 at the place matched by the close of the first pair.")
 
-(defvar comment-end ""
+(defconst comment-end ""
   "*String to insert to end a new comment.
 Should be an empty string if comments are terminated by end-of-line.")
 
@@ -1783,19 +1897,19 @@
 This function is called with no args with point at the beginning of
 the comment's starting delimiter.")
 
-(defvar comment-indent-function
+(defconst comment-indent-function
   ;; XEmacs - add at least one space after the end of the text on the
   ;; current line...  
-  (lambda ()
-    (save-excursion 
-      (beginning-of-line) 
-      (let ((eol (save-excursion (end-of-line) (point))))
-	(and comment-start-skip
-	     (re-search-forward comment-start-skip eol t)
-	     (setq eol (match-beginning 0)))
-	(goto-char eol)
-	(skip-chars-backward " \t")
-	(max comment-column (1+ (current-column))))))
+  #'(lambda ()
+      (save-excursion 
+	(beginning-of-line) 
+	(let ((eol (save-excursion (end-of-line) (point))))
+	  (and comment-start-skip
+	       (re-search-forward comment-start-skip eol t)
+	       (setq eol (match-beginning 0)))
+	  (goto-char eol)
+	  (skip-chars-backward " \t")
+	  (max comment-column (1+ (current-column))))))
   "Function to compute desired indentation for a comment.
 This function is called with no args with point at the beginning of
 the comment's starting delimiter.")
@@ -1986,6 +2100,7 @@
                 (insert ce)))
             (search-forward "\n" nil 'move)))))))
 
+;; XEmacs
 (defun prefix-region (prefix)
   "Add a prefix string to each line between mark and point."
   (interactive "sPrefix string: ")
@@ -2000,11 +2115,12 @@
  	  (forward-char 1)))))
 
 
+;; XEmacs - extra parameter
 (defun backward-word (arg &optional buffer)
   "Move backward until encountering the end of a word.
 With argument, do this that many times.
 In programs, it is faster to call `forward-word' with negative arg."
-  (interactive "_p")
+  (interactive "_p") ; XEmacs
   (forward-word (- arg) buffer))
 
 (defun mark-word (arg)
@@ -2012,6 +2128,7 @@
   (interactive "p")
   (mark-something 'mark-word 'forward-word arg))
 
+;; XEmacs modified
 (defun kill-word (arg)
   "Kill characters forward until encountering the end of a word.
 With argument, do this that many times."
@@ -2021,7 +2138,7 @@
 (defun backward-kill-word (arg)
   "Kill characters backward until encountering the end of a word.
 With argument, do this that many times."
-  (interactive "*p")
+  (interactive "*p") ; XEmacs
   (kill-word (- arg)))
 
 (defun current-word (&optional strict)
@@ -2062,14 +2179,18 @@
 		 (buffer-substring start end)))
           (buffer-substring start end)))))
 
-(defvar fill-prefix nil
+(defconst fill-prefix nil
   "*String for filling to insert at front of new line, or nil for none.
 Setting this variable automatically makes it local to the current buffer.")
 (make-variable-buffer-local 'fill-prefix)
 
-(defvar auto-fill-inhibit-regexp nil
+(defconst auto-fill-inhibit-regexp nil
   "*Regexp to match lines which should not be auto-filled.")
 
+;; 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.
+;; XEmacs:  This function is totally different.
 (defun do-auto-fill ()
   (let (give-up)
     (or (and auto-fill-inhibit-regexp
@@ -2144,6 +2265,143 @@
 	      ;; No place to break => stop trying.
 	      (setq give-up t)))))))
 
+;; Put FSF one in until I can one or the other working properly, then the
+;; other one is history.
+(defun fsf:do-auto-fill ()
+  (let (fc justify bol give-up
+	   (fill-prefix fill-prefix))
+    (if (or (not (setq justify (current-justification)))
+	    (null (setq fc (current-fill-column)))
+	    (and (eq justify 'left)
+		 (<= (current-column) fc))
+	    (save-excursion (beginning-of-line) 
+			    (setq bol (point))
+			    (and auto-fill-inhibit-regexp
+				 (looking-at auto-fill-inhibit-regexp))))
+	nil ;; Auto-filling not required
+      (if (memq justify '(full center right))
+	  (save-excursion (unjustify-current-line)))
+
+      ;; Choose a fill-prefix automatically.
+      (if (and adaptive-fill-mode
+	       (or (null fill-prefix) (string= fill-prefix "")))
+	  (let ((prefix
+		 (fill-context-prefix
+		  (save-excursion (backward-paragraph 1) (point))
+		  (save-excursion (forward-paragraph 1) (point))
+		  ;; Don't accept a non-whitespace fill prefix
+		  ;; from the first line of a paragraph.
+		  "^[ \t]*$")))
+	    (and prefix (not (equal prefix ""))
+		 (setq fill-prefix prefix))))
+
+      (while (and (not give-up) (> (current-column) fc))
+	;; Determine where to split the line.
+	(let ((fill-point
+	       (let ((opoint (point))
+		     bounce
+		     (first t))
+		 (save-excursion
+		   (move-to-column (1+ fc))
+		   ;; Move back to a word boundary.
+		   (while (or first
+			      ;; If this is after period and a single space,
+			      ;; move back once more--we don't want to break
+			      ;; the line there and make it look like a
+			      ;; sentence end.
+			      (and (not (bobp))
+				   (not bounce)
+				   sentence-end-double-space
+				   (save-excursion (forward-char -1)
+						   (and (looking-at "\\. ")
+							(not (looking-at "\\.  "))))))
+		     (setq first nil)
+		     (skip-chars-backward "^ \t\n")
+		     ;; If we find nowhere on the line to break it,
+		     ;; break after one word.  Set bounce to t
+		     ;; so we will not keep going in this while loop.
+		     (if (bolp)
+			 (progn
+			   (re-search-forward "[ \t]" opoint t)
+			   (setq bounce t)))
+		     (skip-chars-backward " \t"))
+		   ;; Let fill-point be set to the place where we end up.
+		   (point)))))
+	  ;; If that place is not the beginning of the line,
+	  ;; break the line there.
+	  (if (save-excursion
+		(goto-char fill-point)
+		(not (bolp)))
+	      (let ((prev-column (current-column)))
+		;; If point is at the fill-point, do not `save-excursion'.
+		;; Otherwise, if a comment prefix or fill-prefix is inserted,
+		;; point will end up before it rather than after it.
+		(if (save-excursion
+		      (skip-chars-backward " \t")
+		      (= (point) fill-point))
+		    (indent-new-comment-line t)
+		  (save-excursion
+		    (goto-char fill-point)
+		    (indent-new-comment-line t)))
+		;; Now do justification, if required
+		(if (not (eq justify 'left))
+		    (save-excursion 
+		      (end-of-line 0)
+		      (justify-current-line justify nil t)))
+		;; If making the new line didn't reduce the hpos of
+		;; the end of the line, then give up now;
+		;; trying again will not help.
+		(if (>= (current-column) prev-column)
+		    (setq give-up t)))
+	    ;; No place to break => stop trying.
+	    (setq give-up t))))
+      ;; Justify last line.
+      (justify-current-line justify t t)
+      t))) 
+
+(defvar normal-auto-fill-function 'do-auto-fill
+  "The function to use for `auto-fill-function' if Auto Fill mode is turned on.
+Some major modes set this.")
+
+(defun auto-fill-mode (&optional arg)
+  "Toggle auto-fill mode.
+With arg, turn auto-fill mode on if and only if arg is positive.
+In Auto-Fill mode, inserting a space at a column beyond `current-fill-column'
+automatically breaks the line at a previous space.
+
+The value of `normal-auto-fill-function' specifies the function to use
+for `auto-fill-function' when turning Auto Fill mode on."
+  (interactive "P")
+  (prog1 (setq auto-fill-function
+	       (if (if (null arg)
+		       (not auto-fill-function)
+		       (> (prefix-numeric-value arg) 0))
+		   normal-auto-fill-function
+		   nil))
+    (redraw-modeline)))
+
+;; This holds a document string used to document auto-fill-mode.
+(defun auto-fill-function ()
+  "Automatically break line at a previous space, in insertion of text."
+  nil)
+
+(defun turn-on-auto-fill ()
+  "Unconditionally turn on Auto Fill mode."
+  (auto-fill-mode 1))
+
+(defun set-fill-column (arg)
+  "Set `fill-column' to current column, or to argument if given.
+The variable `fill-column' has a separate value for each buffer."
+  (interactive "_P") ; XEmacs
+  (cond ((integerp arg)
+	 (setq fill-column arg))
+	((consp arg)
+	 (setq fill-column (current-column)))
+	;; Disallow missing argument; it's probably a typo for C-x C-f.
+	(t
+	 (error "set-fill-column requires an explicit argument")))
+  (message "fill-column set to %d" fill-column))
+
 (defvar comment-multi-line t ; XEmacs - this works well with adaptive fill
   "*Non-nil means \\[indent-new-comment-line] should continue same comment
 on new line, with no new terminator or starter.
@@ -2229,35 +2487,6 @@
 	      (delete-char 1)))
 	(indent-according-to-mode)))))
 
-(defun auto-fill-mode (&optional arg)
-  "Toggle auto-fill mode.
-With arg, turn auto-fill mode on if and only if arg is positive.
-In Auto-Fill mode, inserting a space at a column beyond `current-fill-column'
-automatically breaks the line at a previous space."
-  (interactive "P")
-  (prog1 (setq auto-fill-function
-	       (if (if (null arg)
-		       (not auto-fill-function)
-		       (> (prefix-numeric-value arg) 0))
-		   'do-auto-fill
-		   nil))
-    (redraw-modeline)))
-
-;; This holds a document string used to document auto-fill-mode.
-(defun auto-fill-function ()
-  "Automatically break line at a previous space, in insertion of text."
-  nil)
-
-(defun turn-on-auto-fill ()
-  "Unconditionally turn on Auto Fill mode."
-  (auto-fill-mode 1))
-
-(defun set-fill-column (arg)
-  "Set `fill-column' to current column, or to argument if given.
-The variable `fill-column' has a separate value for each buffer."
-  (interactive "_P")
-  (setq fill-column (if (integerp arg) arg (current-column)))
-  (message "fill-column set to %d" fill-column))
 
 (defun set-selective-display (arg)
   "Set `selective-display' to ARG; clear it if no arg.
@@ -2281,6 +2510,7 @@
   (prin1 selective-display t)
   (princ "." t))
 
+;; XEmacs
 (defun nuke-selective-display ()
   "Ensure that the buffer is not in selective-display mode.
 If `selective-display' is t, then restore the buffer text to it's original
@@ -2303,10 +2533,10 @@
 
 (add-hook 'change-major-mode-hook 'nuke-selective-display)
 
-(defvar overwrite-mode-textual (purecopy " Ovwrt")
-  "The string displayed in the modeline when in overwrite mode.")
-(defvar overwrite-mode-binary (purecopy " Bin Ovwrt")
-  "The string displayed in the modeline when in binary overwrite mode.")
+(defconst overwrite-mode-textual (purecopy " Ovwrt")
+  "The string displayed in the mode line when in overwrite mode.")
+(defconst overwrite-mode-binary (purecopy " Bin Ovwrt")
+  "The string displayed in the mode line when in binary overwrite mode.")
 
 (defun overwrite-mode (arg)
   "Toggle overwrite mode.
@@ -2353,7 +2583,7 @@
   "Toggle Line Number mode.
 With arg, turn Line Number mode on iff arg is positive.
 When Line Number mode is enabled, the line number appears
-in the modeline."
+in the mode line."
   (interactive "P")
   (setq line-number-mode
 	(if (null arg) (not line-number-mode)
@@ -2361,13 +2591,13 @@
   (redraw-modeline))
 
 (defvar column-number-mode nil
-  "*Non-nil means display column number in modeline.")
+  "*Non-nil means display column number in mode line.")
 
 (defun column-number-mode (arg)
   "Toggle Column Number mode.
 With arg, turn Column Number mode on iff arg is positive.
 When Column Number mode is enabled, the column number appears
-in the modeline."
+in the mode line."
   (interactive "P")
   (setq column-number-mode
 	(if (null arg) (not column-number-mode)
@@ -2378,7 +2608,12 @@
 (defvar blink-matching-paren t
   "*Non-nil means show matching open-paren when close-paren is inserted.")
 
-(defvar blink-matching-paren-distance 12000
+(defvar blink-matching-paren-on-screen t
+  "*Non-nil means show matching open-paren when it is on screen.
+nil means don't show it (but the open-paren can still be shown
+when it is off screen.")
+
+(defconst blink-matching-paren-distance 12000
   "*If non-nil, is maximum distance to search for matching open-paren.")
 
 (defconst blink-matching-delay 1
@@ -2389,7 +2624,7 @@
 
 (defun blink-matching-open ()
   "Move cursor momentarily to the beginning of the sexp before point."
-  (interactive "_")
+  (interactive "_") ; XEmacs
   (and (> (point) (1+ (point-min)))
        blink-matching-paren
        ;; Verify an even number of quoting characters precede the close.
@@ -2426,7 +2661,8 @@
 	       (progn
 		(goto-char blinkpos)
 		(if (pos-visible-in-window-p)
-		    (sit-for blink-matching-delay)
+		    (and blink-matching-paren-on-screen
+			 (sit-for blink-matching-delay))
 		  (goto-char blinkpos)
 		  (message
 		   "Matches %s"
@@ -2441,8 +2677,8 @@
 			   (forward-char 1)
 			   (skip-chars-forward " \t")
 			   (not (eolp)))
-                         (buffer-substring blinkpos
-                                           (progn (end-of-line) (point)))
+			 (buffer-substring blinkpos
+					   (progn (end-of-line) (point)))
 		       ;; Otherwise show the previous nonblank line,
 		       ;; if there is one.
 		       (if (save-excursion
@@ -2471,6 +2707,11 @@
 
 (eval-when-compile (defvar myhelp))	; suppress compiler warning
 
+;; XEmacs: Some functions moved to cmdloop.el:
+;; keyboard-quit
+;; buffer-quit-function
+;; keyboard-escape-quit
+
 (defun set-variable (var val)
   "Set VARIABLE to VALUE.  VALUE is a Lisp object.
 When using this interactively, supply a Lisp expression for VALUE.
@@ -2510,6 +2751,7 @@
 	       (eval-minibuffer (format "Set %s to value: " var)))))))
   (set var val))
 
+;; XEmacs
 (defun activate-region ()
   "Activate the region, if `zmacs-regions' is true.
 Setting `zmacs-regions' to true causes LISPM-style active regions to be used.
@@ -2517,6 +2759,7 @@
   (interactive)
   (and zmacs-regions (zmacs-activate-region)))
 
+;; XEmacs
 (defsubst region-exists-p ()
   "Non-nil iff the region exists.
 If active regions are in use (i.e. `zmacs-regions' is true), this means that
@@ -2526,12 +2769,31 @@
  limits of the region."
   (not (null (mark))))
 
+;; XEmacs
 (defun region-active-p ()
   "Non-nil iff the region is active.
 If `zmacs-regions' is true, this is equivalent to `region-exists-p'.
 Otherwise, this function always returns false."
   (and zmacs-regions zmacs-region-extent))
 
+;; A bunch of stuff was moved elsewhere:
+;; completion-list-mode-map
+;; completion-reference-buffer
+;; completion-base-size
+;; delete-completion-window
+;; previous-completion
+;; next-completion
+;; choose-completion
+;; choose-completion-delete-max-match
+;; choose-completion-string
+;; completion-list-mode
+;; completion-fixup-function
+;; completion-setup-function
+;; switch-to-completions
+;; event stuffs
+;; keypad stuffs
+
+;; The rest of this file is not in Lisp in FSF
 (defun capitalize-region-or-word (arg)
   "Capitalize the selected region or the following word (or ARG words)."
   (interactive "p")
@@ -3134,3 +3396,5 @@
 	  (set-marker warning-marker 1 buffer)))
     (set-window-start (display-buffer buffer) warning-marker)
     (set-marker warning-marker (point-max buffer) buffer)))
+
+;;; simple.el ends here
--- a/lisp/prim/sort.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/sort.el	Mon Aug 13 09:03:46 2007 +0200
@@ -19,11 +19,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -75,42 +75,43 @@
     (save-excursion
       (if messages (message "Finding sort keys..."))
       (let* ((sort-lists (sort-build-lists nextrecfun endrecfun
-                                           startkeyfun endkeyfun))
-             (old (reverse sort-lists))
+					   startkeyfun endkeyfun))
+	     (old (reverse sort-lists))
 	     (case-fold-search sort-fold-case))
-        (if (null sort-lists)
-            ()
-          (or reverse (setq sort-lists (nreverse sort-lists)))
-          (if messages (message "Sorting records..."))
-          (setq sort-lists
-                (if (fboundp 'sortcar)
-                    (sortcar sort-lists
-                             (cond ((numberp (car (car sort-lists)))
+	(if (null sort-lists)
+	    ()
+	  (or reverse (setq sort-lists (nreverse sort-lists)))
+	  (if messages (message "Sorting records..."))
+	  (setq sort-lists
+		(if (fboundp 'sortcar)
+		    (sortcar sort-lists
+			     (cond ((numberp (car (car sort-lists)))
 				    ;; This handles both ints and floats.
-                                    '<)
-                                   ((consp (car (car sort-lists)))
+				    '<)
+				   ((consp (car (car sort-lists)))
 				    (function
 				     (lambda (a b)
 				       (> 0 (compare-buffer-substrings 
 					     nil (car a) (cdr a)
 					     nil (car b) (cdr b))))))
-                                   (t
-                                    'string<)))
-                    (sort sort-lists
-                          (cond ((numberp (car (car sort-lists)))
+				   (t
+				    'string<)))
+		  (sort sort-lists
+			(cond ((numberp (car (car sort-lists)))
 			       'car-less-than-car)
-                                ((consp (car (car sort-lists)))
-                                 (function (lambda (a b)
-                                   (> 0 (compare-buffer-substrings 
-                                          nil (car (car a)) (cdr (car a))
-                                          nil (car (car b)) (cdr (car b)))))))
-                                (t
-                                 (function
-                                  (lambda (a b)
-                                   (string< (car a) (car b)))))))))
-            (if reverse (setq sort-lists (nreverse sort-lists)))
-            (if messages (message "Reordering buffer..."))
-            (sort-reorder-buffer sort-lists old)))
+			      ((consp (car (car sort-lists)))
+			       (function
+				(lambda (a b)
+				  (> 0 (compare-buffer-substrings
+					nil (car (car a)) (cdr (car a))
+					nil (car (car b)) (cdr (car b)))))))
+			      (t
+			       (function
+				(lambda (a b)
+				  (string< (car a) (car b)))))))))
+	  (if reverse (setq sort-lists (nreverse sort-lists)))
+	  (if messages (message "Reordering buffer..."))
+	  (sort-reorder-buffer sort-lists old)))
       (if messages (message "Reordering buffer... Done"))))
   nil)
 
@@ -139,7 +140,7 @@
 		      (let ((start (point)))
 			(funcall (or endkeyfun
 				     (prog1 endrecfun (setq done t))))
-                        (cons start (point))))))
+			(cons start (point))))))
       ;; Move to end of this record (start of next one, or end of buffer).
       (cond ((prog1 done (setq done nil)))
 	    (endrecfun (funcall endrecfun))
@@ -212,9 +213,10 @@
       (narrow-to-region beg end)
       (goto-char (point-min))
       (sort-subr reverse
-		 (function (lambda ()
-                   (while (and (not (eobp)) (looking-at paragraph-separate))
-                     (forward-line 1))))
+		 (function
+		  (lambda ()
+		    (while (and (not (eobp)) (looking-at paragraph-separate))
+		      (forward-line 1))))
 		 'forward-paragraph))))
 
 ;;;###autoload
@@ -267,6 +269,7 @@
 				  (point))))))
 		 nil))
 
+;; This function is commented out of 19.34.
 ;;;###autoload
 (defun sort-float-fields (field beg end)
   "Sort lines in region numerically by the ARGth field of each line.
@@ -348,7 +351,6 @@
     ;; Position at the front of the field
     ;; even if moving backwards.
     (skip-chars-backward "^ \t\n")))
-
 
 (defvar sort-regexp-fields-regexp)
 (defvar sort-regexp-record-end)
@@ -456,12 +458,12 @@
       (setq col-start (min col-beg1 col-end1))
       (setq col-end (max col-beg1 col-end1))
       (if (search-backward "\t" beg1 t)
-	  (error
-	   "sort-columns does not work with tabs.  Use M-x untabify."))
+	  (error "sort-columns does not work with tabs.  Use M-x untabify."))
       (if (not (eq system-type 'vax-vms))
 	  ;; Use the sort utility if we can; it is 4 times as fast.
 	  (call-process-region beg1 end1 "sort" t t nil
 			       (if reverse "-rt\n" "-t\n")
+			       ;; XEmacs (use int-to-string conversion)
 			       (concat "+0." (int-to-string col-start))
 			       (concat "-0." (int-to-string col-end)))
 	;; On VMS, use Emacs's own facilities.
--- a/lisp/prim/startup.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/startup.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1129,6 +1129,11 @@
 		  (file-name-as-directory
 		   (expand-file-name "../xemacs/lock" root))
 		  )))))
+    
+    ;; 1996/12/6 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+    ;;	define `default-load-path' for file-detect.el
+    (setq default-load-path load-path)
+    
     ;; add site-lisp dir to load-path
     (when site-lisp
       ;; If the site-lisp dir isn't on the load-path, add it to the end.
@@ -1169,6 +1174,17 @@
 			 (list (file-name-as-directory file)))))
 	  (setq files (cdr files)))))
 
+    ;; 1996/12/6 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+    ;;	define `default-load-path' for file-detect.el
+    (setq default-load-path
+	  (append default-load-path
+		  (if site-lisp
+		      (list site-lisp))
+		  (if lisp
+		      (list lisp)
+		    )
+		  ))
+    
     ;; If running from the build directory, always prefer the exec-directory
     ;; that is here over to the one that came from paths.h.
     (when (or (and (null exec-directory) lib-src)
--- a/lisp/prim/subr.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/subr.el	Mon Aug 13 09:03:46 2007 +0200
@@ -17,11 +17,18 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.
 
-;;; Synched up with: FSF 19.30.
+;;; Commentary:
+
+;; There's not a whole lot in common now with the FSF version,
+;; be wary when applying differences.  I've left in a number of lines
+;; of commentary just to give diff(1) something to synch itself with to
+;; provide useful context diffs. -sb
 
 ;;; Code:
 
@@ -64,6 +71,26 @@
        nil
      (define-function ,@args)))
 
+
+;;;; Keymap support.
+;; XEmacs: removed to keymap.el
+
+;;;; The global keymap tree.  
+
+;;; global-map, esc-map, and ctl-x-map have their values set up in
+;;; keymap.c; we just give them docstrings here.
+
+;;;; Event manipulation functions.
+
+;; The call to `read' is to ensure that the value is computed at load time
+;; and not compiled into the .elc file.  The value is negative on most
+;; machines, but not on all!
+;; XEmacs: This stuff is done in C Code.
+
+;;;; Obsolescent names for functions.
+;; XEmacs: not used.
+
+;; XEmacs:
 (define-function 'not 'null)
 (define-function-when-void 'numberp 'intergerp) ; different when floats
 
@@ -77,6 +104,8 @@
 
 ;;;; Hook manipulation functions.
 
+;; (defconst run-hooks 'run-hooks ...)
+
 (defun make-local-hook (hook)
   "Make the hook HOOK local to the current buffer.
 When a hook is local, its local and global values
@@ -95,7 +124,7 @@
 buffer.
 
 Do not use `make-local-variable' to make a hook variable buffer-local."
-  (if (local-variable-p hook (current-buffer))
+  (if (local-variable-p hook (current-buffer)) ; XEmacs
       nil
     (or (boundp hook) (set hook nil))
     (make-local-variable hook)
@@ -117,7 +146,6 @@
 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."
-  ;(interactive "SAdd to hook-var (symbol): \naAdd which function to %s? ")
   (or (boundp hook) (set hook nil))
   (or (default-boundp hook) (set-default hook nil))
   ;; If the hook value is a single function, turn it into a list.
@@ -127,7 +155,7 @@
   (if (or local
 	  ;; Detect the case where make-local-variable was used on a hook
 	  ;; and do what we used to do.
-	  (and (local-variable-if-set-p hook (current-buffer))
+	  (and (local-variable-if-set-p hook (current-buffer)) ; XEmacs
 	       (not (memq t (symbol-value hook)))))
       ;; Alter the local value only.
       (or (if (consp function)
@@ -185,6 +213,7 @@
 
 (defun add-to-list (list-var element)
   "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
+The test for presence of ELEMENT is done with `equal'.
 If you want to use `add-to-list' on a variable that is not defined
 until a certain package is loaded, you should put the call to `add-to-list'
 into a hook function that will be run only after loading the package.
@@ -193,6 +222,7 @@
   (or (member element (symbol-value list-var))
       (set list-var (cons element (symbol-value list-var)))))
 
+;; XEmacs additions
 ;; called by Fkill_buffer()
 (defvar kill-buffer-hook nil
   "Function or functions to be called when a buffer is killed.
@@ -208,6 +238,7 @@
 (define-function 'rplaca 'setcar)
 (define-function 'rplacd 'setcdr)
 
+;; XEmacs
 (defun mapvector (__function __seq)
   "Apply FUNCTION to each element of SEQ, making a vector of the results.
 The result is a vector of the same length as SEQ.
@@ -224,6 +255,7 @@
 
 ;;;; String functions.
 
+;; XEmacs
 (defun replace-in-string (str regexp newtext &optional literal)
   "Replaces all matches in STR for REGEXP with NEWTEXT string.
 Optional LITERAL non-nil means do a literal replacement.
@@ -547,3 +579,5 @@
 (define-function 'set-match-data 'store-match-data)
 (define-function 'send-string-to-terminal 'external-debugging-output)
 (define-function 'buffer-string 'buffer-substring)
+
+;;; subr.el ends here
--- a/lisp/prim/userlock.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/prim/userlock.el	Mon Aug 13 09:03:46 2007 +0200
@@ -18,11 +18,11 @@
 ;; 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, 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; 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.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
@@ -33,7 +33,7 @@
 
 ;;; Code:
 
-(define-error 'file-locked "File is locked" 'file-error)
+(define-error 'file-locked "File is locked" 'file-error) ; XEmacs
 
 (defun ask-user-about-lock-minibuf (fn opponent)
   (save-window-excursion
@@ -59,7 +59,7 @@
 		   (ask-user-about-lock-help)
 		   (setq answer nil))
 		  ((eq (cdr answer) 'yield)
-		   (signal 'file-locked (list fn opponent)))))))
+		   (signal 'file-locked (list "File is locked" fn opponent)))))))
       (cdr answer))))
 
 (defun ask-user-about-lock-help ()
@@ -75,13 +75,13 @@
       (set-buffer standard-output)
       (help-mode))))
 
-(define-error 'file-supersession "File changed on disk" 'file-error)
+(define-error 'file-supersession "File changed on disk" 'file-error) ; XEmacs
 
 (defun ask-user-about-supersession-threat-minibuf (fn)
   (save-window-excursion
     (let (answer)
       (while (null answer)
-	(message "%s changed on disk; really edit the buffer? (y, n or C-h) "
+	(message "%s changed on disk; really edit the buffer? (y, n, r or C-h) "
                  (file-name-nondirectory fn))
 	(let ((tem (downcase (let ((cursor-in-echo-area t))
 			       (read-char)))))
@@ -91,17 +91,23 @@
 		  (cdr (assoc tem '((?n . yield)
 				    (?\C-g . yield)
 				    (?y . proceed)
+				    (?r . revert)
 				    (?? . help))))))
 	  (cond ((null answer)
 		 (beep)
-		 (message "Please type y or n; or ? for help")
+		 (message "Please type y, n or r; or ? for help")
 		 (sit-for 3))
 		((eq answer 'help)
 		 (ask-user-about-supersession-help)
 		 (setq answer nil))
+		((eq answer 'revert)
+		 (revert-buffer nil (not (buffer-modified-p)))
+		 ; ask confirmation iff buffer modified
+		 (signal 'file-supersession
+			 (list "File reverted" fn)))
 		((eq answer 'yield)
 		 (signal 'file-supersession
-			 (list fn))))))
+			 (list "File changed on disk" fn))))))
       (message
         "File on disk now will become a backup file if you save these changes.")
       (setq buffer-backed-up nil))))
@@ -113,6 +119,8 @@
 
 If you say `y' to go ahead and modify this buffer,
 you risk ruining the work of whoever rewrote the file.
+If you say `r' to revert, the contents of the buffer are refreshed
+from the file on disk.
 If you say `n', the change you started to make will be aborted.
 
 Usually, you should type `n' and then `M-x revert-buffer',
@@ -120,9 +128,8 @@
     (save-excursion
       (set-buffer standard-output)
       (help-mode))))
-
 
-;;; dialog-box versions
+;;; dialog-box versions [XEmacs]
 
 (defun ask-user-about-lock-dbox (fn opponent)
   (let ((echo-keystrokes 0)
@@ -146,7 +153,7 @@
 		((and (misc-user-event-p event) (eq (event-object event) 'steal))
 		 (throw 'aual-done t))
 		((and (misc-user-event-p event) (eq (event-object event) 'yield))
-		 (signal 'file-locked (list fn opponent)))
+		 (signal 'file-locked (list "File is locked" fn opponent)))
 		((button-release-event-p event) ;; don't beep twice
 		 nil)
 		(t
--- a/lisp/rmail/rmail-kill.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/rmail/rmail-kill.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,3 +1,31 @@
+;;; rmail-kill.el --- Mail filtering for rmail
+
+;; Copyright status unknown
+
+;; Author: Unknown
+;; Keywords: mail
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF.
+
+;;; Commentary:
+;; This is the Original Notice on this file:
 ;; GNU Emacs and this file "rmail-kill.el", is distributed in the hope
 ;; that it will be useful, but WITHOUT ANY WARRANTY.  No author or
 ;; distributor accepts responsibility to anyone for the consequences
@@ -13,6 +41,7 @@
 ;; named COPYING.  Among other things, the copyright notice and this
 ;; notice must be preserved on all copies.
 
+;;; Code:
 (setq rmail-message-filter 'rmail-maybe-execute-message
       rmail-mode-hook '((lambda ()
 			  (define-key rmail-mode-map "e" 'rmail-extract-rejected-message)
@@ -123,3 +152,7 @@
 (defun read-string-with-default (prompt default)
   (let ((s (read-string prompt)))
     (if (string= s "") default s)))
+
+(provide 'rmail-kill)
+
+;;; rmail-kill.el ends here
--- a/lisp/rmail/rmail-xemacs.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/rmail/rmail-xemacs.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,7 +1,10 @@
-;; Mouse and font support for RMAIL running in Lucid GNU Emacs
-;; written by Wilson H. Tien (wtien@urbana.mcd.mot.com); modified by jwz.
+;;; rmail-xemacs.el --- Mouse and font support for RMAIL running on XEmacs
+
 ;; Copyright (C) 1992-1993 Free Software Foundation, Inc.
 
+;; Author: Wilson H. Tien <wtien@urbana.mcd.mot.com>
+;; Keywords: mail
+
 ;; This file is part of XEmacs.
 
 ;; XEmacs is free software; you can redistribute it and/or modify it
@@ -15,12 +18,21 @@
 ;; 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.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF.
+
+;;; Commentary:
 
-;;; Right button pops up a menu of commands in Rmail and Rmail summary buffers.
-;;; Middle button selects indicated mail message in Rmail summary buffer
+;; Mouse and font support for RMAIL running in Lucid GNU Emacs
+;; written by Wilson H. Tien (wtien@urbana.mcd.mot.com); modified by jwz.
+
+;; Right button pops up a menu of commands in Rmail and Rmail summary buffers.
+;; Middle button selects indicated mail message in Rmail summary buffer
+
+;;; Code:
 
 (defvar rmail-summary-mode-menu
   '("Rmail Summary Commands"
@@ -219,3 +231,5 @@
 
 
 (provide 'rmail-xemacs)
+
+;;; rmail-xemacs ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/tl/emu-e19.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,271 @@
+;;; emu-e19.el --- emu module for Emacs 19 and XEmacs 19
+
+;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id: emu-e19.el,v 1.1.1.1 1996/12/18 22:53:09 steve Exp $
+;; Keywords: emulation, compatibility, mule, Latin-1
+
+;; This file is part of tl (Tiny Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+;;; @ version and variant specific features
+;;;
+
+(cond (running-xemacs
+       (require 'emu-xemacs))
+      (running-emacs-19
+       (require 'emu-19)
+       ))
+
+
+;;; @ character set
+;;;
+
+(defconst charset-ascii 0 "Character set of ASCII")
+(defconst charset-latin-1 129 "Character set of ISO-8859-1")
+
+(defun charset-description (charset)
+  "Return description of CHARSET. [emu-e19.el]"
+  (if (< charset 128)
+      (documentation-property 'charset-ascii 'variable-documentation)
+    (documentation-property 'charset-latin-1 'variable-documentation)
+    ))
+
+(defun charset-registry (charset)
+  "Return registry name of CHARSET. [emu-e19.el]"
+  (if (< charset 128)
+      "ASCII"
+    "ISO8859-1"))
+
+(defun charset-columns (charset)
+  "Return number of columns a CHARSET occupies when displayed.
+\[emu-e19.el]"
+  1)
+
+(defun charset-direction (charset)
+  "Return the direction of a character of CHARSET by
+  0 (left-to-right) or 1 (right-to-left). [emu-e19.el]"
+  0)
+
+(defun find-charset-string (str)
+  "Return a list of charsets in the string.
+\[emu-e19.el; Mule emulating function]"
+  (if (string-match "[\200-\377]" str)
+      (list lc-ltn1)
+    ))
+
+(defalias 'find-non-ascii-charset-string 'find-charset-string)
+
+(defun find-charset-region (start end)
+  "Return a list of charsets in the region between START and END.
+\[emu-e19.el; Mule emulating function]"
+  (if (save-excursion
+	(save-restriction
+	  (narrow-to-region start end)
+	  (goto-char start)
+	  (re-search-forward "[\200-\377]" nil t)
+	  ))
+      (list lc-ltn1)
+    ))
+
+(defalias 'find-non-ascii-charset-region 'find-charset-region)
+
+;;; @@ for old MULE emulation
+;;;
+
+(defconst lc-ascii 0)
+(defconst lc-ltn1 129)
+
+
+;;; @ coding-system
+;;;
+
+(defconst *internal* nil)
+(defconst *ctext* nil)
+(defconst *noconv* nil)
+
+(defun decode-coding-string (string coding-system)
+  "Decode the STRING which is encoded in CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  string)
+
+(defun encode-coding-string (string coding-system)
+  "Encode the STRING as CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  string)
+
+(defun decode-coding-region (start end coding-system)
+  "Decode the text between START and END which is encoded in CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  0)
+
+(defun encode-coding-region (start end coding-system)
+  "Encode the text between START and END to CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  0)
+
+(defun detect-coding-region (start end)
+  "Detect coding-system of the text in the region between START and END.
+\[emu-e19.el; Emacs 20 emulating function]"
+  )
+
+(defun set-buffer-file-coding-system (coding-system &optional force)
+  "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  )
+
+(defmacro as-binary-process (&rest body)
+  (` (let (selective-display)	; Disable ^M to nl translation.
+       (,@ body)
+       )))
+
+(defmacro as-binary-input-file (&rest body)
+  (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
+       (,@ body)
+       )))
+
+
+;;; @@ for old MULE emulation
+;;;
+
+(defun code-convert-string (str ic oc)
+  "Convert code in STRING from SOURCE code to TARGET code,
+On successful converion, returns the result string,
+else returns nil. [emu-e19.el; old MULE emulating function]"
+  str)
+
+(defun code-convert-region (beg end ic oc)
+  "Convert code of the text between BEGIN and END from SOURCE
+to TARGET. On successful conversion returns t,
+else returns nil. [emu-e19.el; old MULE emulating function]"
+  t)
+
+
+;;; @ MIME charset
+;;;
+
+(defvar charsets-mime-charset-alist
+  (list (cons (list charset-ascii) 'us-ascii)))
+
+(defvar default-mime-charset 'iso-8859-1)
+
+(defun mime-charset-to-coding-system (charset)
+  (if (stringp charset)
+      (setq charset (intern (downcase charset)))
+    )
+  (and (memq charset (list 'us-ascii default-mime-charset))
+       charset)
+  )
+
+(defun detect-mime-charset-region (start end)
+  "Return MIME charset for region between START and END.
+\[emu-e19.el]"
+  (if (save-excursion
+	(save-restriction
+	  (narrow-to-region start end)
+	  (goto-char start)
+	  (re-search-forward "[\200-\377]" nil t)
+	  ))
+      default-mime-charset
+    'us-ascii))
+
+(defun encode-mime-charset-region (start end charset)
+  "Encode the text between START and END as MIME CHARSET.
+\[emu-e19.el]"
+  )
+
+(defun decode-mime-charset-region (start end charset)
+  "Decode the text between START and END as MIME CHARSET.
+\[emu-e19.el]"
+  )
+
+(defun encode-mime-charset-string (string charset)
+  "Encode the STRING as MIME CHARSET. [emu-e19.el]"
+  string)
+
+(defun decode-mime-charset-string (string charset)
+  "Decode the STRING as MIME CHARSET. [emu-e19.el]"
+  string)
+
+
+;;; @ character
+;;;
+
+(defun char-charset (chr)
+  "Return the character set of char CHR.
+\[emu-e19.el; XEmacs 20 emulating function]"
+  (if (< chr 128)
+      charset-ascii
+    charset-latin-1))
+
+(defun char-bytes (char)
+  "Return number of bytes a character in CHAR occupies in a buffer.
+\[emu-e19.el; MULE emulating function]"
+  1)
+
+(defalias 'char-length 'char-bytes)
+
+(defun char-columns (character)
+  "Return number of columns a CHARACTER occupies when displayed.
+\[emu-e19.el]"
+  1)
+
+;;; @@ for old MULE emulation
+;;;
+
+(defalias 'char-width 'char-columns)
+
+(defalias 'char-leading-char 'char-charset)
+
+
+;;; @ string
+;;;
+
+(defalias 'string-columns 'length)
+
+(defun string-to-char-list (str)
+  (mapcar (function identity) str)
+  )
+
+(defalias 'string-to-int-list 'string-to-char-list)
+
+(defalias 'sref 'aref)
+
+(defun truncate-string (str width &optional start-column)
+  "Truncate STR to fit in WIDTH columns.
+Optional non-nil arg START-COLUMN specifies the starting column.
+\[emu-e19.el; MULE 2.3 emulating function]"
+  (or start-column
+      (setq start-column 0))
+  (substring str start-column width)
+  )
+
+;;; @@ for old MULE emulation
+;;;
+
+(defalias 'string-width 'length)
+
+
+;;; @ end
+;;;
+
+(provide 'emu-e19)
+
+;;; emu-e19.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/bench.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,269 @@
+;;; bench.el --- a crude benchmark for emacsen
+;; Copyright (C) 1987,88,89,90,93,94,95,96 Free Software Foundation, Inc.
+
+;; Author: Shane Holder <holder@rsn.hp.com>
+;; Adapted-By: Steve Baur <steve@altair.xemacs.org>
+
+;; 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:
+
+;; To run
+;; Extract the shar file in /tmp, or modify bench-large-lisp-file to
+;; point to the gnus-bench.el file.
+;; At the shell prompt emacs -q --no-site-file <= don't load users .emacs or
+;;    site-file
+;; M-x byte-compile-file "/tmp/bench.el"
+;; M-x load-file "/tmp/bench.elc"
+;; In the scratch buffer (bench 1)
+
+;;; Code:
+
+;; Use elp to profile benchmarks
+(require 'elp)
+(eval-when-compile (require 'cl))	; Emacs doesn't have when and cdar
+
+(defconst bench-version 1.0)
+
+(defconst bench-large-lisp-file "/usr/local/lib/gnus-bench.el"
+  "Large lisp file to use in benchmarks.
+Grab `ftp://ftp.xemacs.org/pub/beta/contrib/gnus-bench.el.gz' for a good
+version.  Don't install this file with Emacs/XEmacs.")
+
+(defconst bench-sort-buffer "*Sort*"
+  "File to be used in the sort benchmark")
+
+(defconst bench-sort-number-words 10000
+  "Number of words to use in sort benchmark")
+
+(defconst bench-pre-bench-hook nil
+  "Hook for individual bench mark initialization.")
+
+(defconst bench-post-bench-hook nil
+  "Hook for individual bench mark statistic collection.")
+
+(defconst bench-mark-function-alist 
+  '(
+    (bench-mark-1 . "Tower of Hanoi")
+    (bench-mark-2 . "Font Lock")
+    (bench-mark-3 . "Large File scrolling")
+    (bench-mark-4 . "Frame Creation")
+    (bench-mark-5 . "Generate Words")
+    (bench-mark-6 . "Sort Buffer")
+    (bench-mark-7 . "Large File bytecompilation")
+    (bench-mark-8 . "Loop Computation")
+    (bench-mark-9 . "Make a Few Large Size List")
+    (bench-mark-10 . "Garbage Collection Large Size List")
+    (bench-mark-11 . "Make Several Small Size List")
+    (bench-mark-12 . "Garbage Collection Small Size List")
+))
+
+(defconst bench-enabled-profiling nil
+  "If non-nil and the underlying emacs supports it, do function profiling.")
+
+(defconst bench-mark-profile-buffer "*Profile*"
+  "Buffer used for collection of profiling data.")
+
+(setq gc-cons-threshold 40000000)
+
+(defconst bench-number-of-large-lists 10
+  "Number of lists to use in large list creation/garbage collections")
+
+(defconst bench-number-of-small-lists 1000000
+  "Number of lists to use in small list creation/garbage collections")
+
+(defconst bench-large-list-size 1000000
+  "Size of list to use in small list creation/garbage collection")
+
+(defconst bench-small-list-size 10
+  "Size of list to use in small list creation/garbage collection")
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-1 ()
+  "How long to complete the tower of hanoi."
+  (hanoi 4))
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-2 ()
+  "How long to fonitfy a large file."
+  (find-file bench-large-lisp-file)
+  (font-lock-fontify-buffer))
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-3 ()
+  "How long does it take to scroll down through a large file."
+  (let ((buffer-read-only t))
+    (goto-char (point-min))
+    (while (< (point) (point-max))
+      (next-line 1)
+      (sit-for 0))))
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-4 ()
+  "How quickly can emacs create a new frame."
+  (make-frame))
+
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-5 ()
+  "How long does it take to generate lots of random words."
+  (set-buffer (get-buffer-create bench-sort-buffer))
+  (let ((tmp-words bench-sort-number-words))
+    (while (not (= tmp-words 0))
+      (let ((word-len (random 10)))
+	(while (not (= word-len 0))
+	  (insert (+ ?a (random 25)))
+	  (setq word-len (- word-len 1))))
+      (insert "\n")
+      (setq tmp-words (- tmp-words 1)))))
+
+;-----------------------------------------------------------------------------
+
+(defun bench-mark-6 ()
+  "How long does it take to sort the random words from bench-mark-5."
+  (set-buffer (get-buffer-create bench-sort-buffer))
+  (sort-lines nil (point-min) (point-max))
+)
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-7 ()
+  "How long does it take to byte-compile a large lisp file"
+  (byte-compile-file bench-large-lisp-file)
+)
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-8 ()
+  "How long does it take to run through a loop."
+  (let ((count 250000))
+    (let ((i 0) (gcount 0))
+      (while (< i count)
+	(increment)
+	(setq i (1+ i)))
+      (message "gcount = %d" gcount))))
+
+(defun increment ()
+  "Increment a variable for bench-mark-8."
+  (setq gcount (1+ gcount)))
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-9 ()
+  (let ((tmp-foo bench-number-of-large-lists))
+    (while (> tmp-foo 0)
+      (make-list bench-large-list-size '1)
+      (setq tmp-foo (- tmp-foo 1)))
+      )
+)
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-10 ()
+  (garbage-collect)
+)
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-11 ()
+  (let ((tmp-foo bench-number-of-small-lists))
+    (while (> tmp-foo 0)
+      (make-list bench-small-list-size '1)
+      (setq tmp-foo (- tmp-foo 1))
+      ))
+)
+
+;-----------------------------------------------------------------------------
+(defun bench-mark-12 ()
+  (garbage-collect)
+)
+
+;=============================================================================
+(defun bench-init ()
+  "Initialize profiling for bench marking package."
+  (if (fboundp 'start-profiling)
+      (let ((buf (get-buffer-create bench-mark-profile-buffer)))
+	(erase-buffer buf)
+	(when (profiling-active-p)
+	  (stop-profiling)
+	  (clear-profiling-info)))
+    (message "Profiling not available in this Emacs.")
+    (sit-for 2)))
+
+(defun bench-profile-start (test-name)
+  "Turn on profiling for test `test-name'."
+  (when (and bench-enabled-profiling
+	     (fboundp 'start-profiling))
+    (when (profiling-active-p)
+      (stop-profiling))
+    (let ((buf (get-buffer-create bench-mark-profile-buffer)))
+      (save-excursion
+	(set-buffer buf)
+	(insert "Test `" test-name "'\n")
+	(start-profiling)))))
+
+(defun bench-profile-stop (test-name)
+  "Turn off profiling for test `test-name'."
+  (when (and bench-enabled-profiling
+	     (fboundp 'stop-profiling))
+    (stop-profiling)
+    (let ((buf (get-buffer-create bench-mark-profile-buffer)))
+      (save-excursion
+	(set-buffer buf)
+	(insert (with-output-to-string
+		 (pretty-print-profiling-info)) "\n")))
+    (clear-profiling-info)))
+
+(add-hook 'bench-pre-bench-hook 'bench-profile-start)
+(add-hook 'bench-post-bench-hook 'bench-profile-stop)
+
+(defun bench (arg)
+  "Run a series of benchmarks."
+  (interactive "p")
+  (elp-instrument-package "bench-mark") ;Only instrument functions
+                                        ;beginning with bench-mark
+  (bench-init)
+  (if (fboundp 'byte-optimize)		;Turn off byte-compile optimization in XEmacs
+      (setq byte-optimize nil))
+  (let ((benches bench-mark-function-alist))
+    (while benches
+      (let ((test-name (cdar benches)))
+	(run-hook-with-args 'bench-pre-bench-hook test-name)
+	(let ((count arg))
+	  (while (> count 0)
+	    (message "Running %s - %s." (symbol-name (caar benches)) test-name)
+	    (funcall (caar benches))
+	    (setq count (1- count))))
+	(setq benches (cdr benches))
+	(run-hook-with-args 'bench-post-bench-hook test-name))
+      ))
+  (elp-results)
+  (goto-char (point-min))
+  (next-line 2)
+; I can't figure out a good way to sort the lines numerically.
+; If someone comes up with a good way, let me know.
+  (sort-lines nil (point) (point-max))
+  (goto-char (point-min))
+  (let ((benches bench-mark-function-alist))
+    (while benches
+      (goto-char (point-min))
+      (let ((test-name (cdar benches))
+	    (test-func (caar benches)))
+	(search-forward (symbol-name test-func))
+	(end-of-line)
+	(insert "   <= " test-name))
+	(setq benches (cdr benches))
+      ))
+)
+
+;;; bench.el ends here
--- a/lisp/utils/flow-ctrl.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/utils/flow-ctrl.el	Mon Aug 13 09:03:46 2007 +0200
@@ -20,29 +20,29 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
-;;;; Terminals that use XON/XOFF flow control can cause problems with
-;;;; GNU Emacs users.  This file contains Emacs Lisp code that makes it
-;;;; easy for a user to deal with this problem, when using such a
-;;;; terminal. 
-;;;;      
-;;;; To invoke these adjustments, a user need only invoke the function
-;;;; enable-flow-control-on with a list of terminal types in his/her own
-;;;; .emacs file.  As arguments, give it the names of one or more terminal
-;;;; types in use by that user which require flow control adjustments.
-;;;; Here's an example: 
-;;;; 
-;;;;	(enable-flow-control-on "vt200" "vt300" "vt101" "vt131")
+;; Terminals that use XON/XOFF flow control can cause problems with
+;; GNU Emacs users.  This file contains Emacs Lisp code that makes it
+;; easy for a user to deal with this problem, when using such a
+;; terminal. 
+;;      
+;; To invoke these adjustments, a user need only invoke the function
+;; enable-flow-control-on with a list of terminal types in his/her own
+;; .emacs file.  As arguments, give it the names of one or more terminal
+;; types in use by that user which require flow control adjustments.
+;; Here's an example: 
+;; 
+;;	(enable-flow-control-on "vt200" "vt300" "vt101" "vt131")
 
-;;; Portability note: This uses (getenv "TERM"), and therefore probably
-;;; won't work outside of UNIX-like environments.
+;; Portability note: This uses (getenv "TERM"), and therefore probably
+;; won't work outside of UNIX-like environments.
 
 ;;; Code:
 
@@ -51,6 +51,8 @@
 (defvar flow-control-c-q-replacement ?\036
   "Character that replaces C-q, when flow control handling is enabled.")
 
+;(put 'keyboard-translate-table 'char-table-extra-slots 0)
+
 ;;;###autoload
 (defun enable-flow-control (&optional argument)
   "Toggle flow control handling.
@@ -65,6 +67,7 @@
       (progn
 	;; Turn flow control off, and stop exchanging chars.
 	(set-input-mode t nil (nth 2 (current-input-mode)))
+	;; XEmacs
 	(keyboard-translate flow-control-c-s-replacement nil)
 	(keyboard-translate ?\^s nil)
 	(keyboard-translate flow-control-c-q-replacement nil)
@@ -74,6 +77,7 @@
     (set-input-mode nil t (nth 2 (current-input-mode)))
     ;; Initialize translate table, saving previous mappings, if any.
     ;; Swap C-s and C-\
+    ;; XEmacs
     (keyboard-translate flow-control-c-s-replacement ?\^s)
     (keyboard-translate ?\^s flow-control-c-s-replacement)
     ;; Swap C-q and C-^
@@ -98,12 +102,18 @@
 The tty terminal type is determined from the TERM environment variable.
 Trailing hyphens and everything following is stripped, so a TERM
 value of \"vt100-nam\" is treated the same as \"vt100\"."
-  (and
-   (eq (device-type) 'tty)
-   (getenv "TERM")
-   (member (replace-in-string (getenv "TERM") "[-_].*$" "")
-           losing-terminal-types)
-   (enable-flow-control)))
+  (let ((term (getenv "TERM"))
+	hyphend)
+    ;; Look for TERM in LOSING-TERMINAL-TYPES.
+    ;; If we don't find it literally, try stripping off words
+    ;; from the end, one by one.
+    (while (and term (not (member term losing-terminal-types)))
+      ;; Strip off last hyphen and what follows, then try again.
+      (if (setq hyphend (string-match "[-_][^-_]+$" term))
+	  (setq term (substring term 0 hyphend))
+	(setq term nil)))
+    (if term
+	(enable-flow-control))))
 
 (provide 'flow-ctrl)
 
--- a/lisp/utils/forms.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/utils/forms.el	Mon Aug 13 09:03:46 2007 +0200
@@ -1,8 +1,8 @@
-;;; forms.el --- Forms mode: edit a file as a form to fill in.
+;;; forms.el --- Forms mode: edit a file as a form to fill in
 
-;;; Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
 
-;; Author: Johan Vromans <jv@nl.net>
+;; Author: Johan Vromans <jvromans@squirrel.nl>
 ;; Version: Revision: 2.10 
 ;; Keywords: extensions
 ;; hacked on by jwz for XEmacs
@@ -20,262 +20,278 @@
 ;; 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.
+;; 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.28.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
-;;; Visit a file using a form.
-;;;
-;;; === Naming conventions
-;;;
-;;; The names of all variables and functions start with 'forms-'.
-;;; Names which start with 'forms--' are intended for internal use, and
-;;; should *NOT* be used from the outside.
-;;;
-;;; All variables are buffer-local, to enable multiple forms visits 
-;;; simultaneously.
-;;; Variable `forms--mode-setup' is local to *ALL* buffers, for it 
-;;; controls if forms-mode has been enabled in a buffer.
-;;;
-;;; === How it works ===
-;;;
-;;; Forms mode means visiting a data file which is supposed to consist
-;;; of records each containing a number of fields.  The records are
-;;; separated by a newline, the fields are separated by a user-defined
-;;; field separater (default: TAB).
-;;; When shown, a record is transferred to an Emacs buffer and
-;;; presented using a user-defined form.  One record is shown at a
-;;; time.
-;;;
-;;; Forms mode is a composite mode.  It involves two files, and two
-;;; buffers.
-;;; The first file, called the control file, defines the name of the
-;;; data file and the forms format.  This file buffer will be used to
-;;; present the forms.
-;;; The second file holds the actual data.  The buffer of this file
-;;; will be buried, for it is never accessed directly.
-;;;
-;;; Forms mode is invoked using M-x forms-find-file control-file .
-;;; Alternativily `forms-find-file-other-window' can be used.
-;;;
-;;; You may also visit the control file, and switch to forms mode by hand
-;;; with M-x forms-mode .
-;;;
-;;; Automatic mode switching is supported if you specify 
-;;; "-*- forms -*-" in the first line of the control file.
-;;; 
-;;; The control file is visited, evaluated using `eval-current-buffer',
-;;; and should set at least the following variables:
-;;;
-;;;	forms-file				[string]
-;;;			The name of the data file.
-;;;
-;;;	forms-number-of-fields			[integer]
-;;;			The number of fields in each record.
-;;;
-;;;	forms-format-list			[list]
-;;;			Formatting instructions.
-;;;
-;;; `forms-format-list' should be a list, each element containing
-;;;
-;;;   - a string, e.g. "hello".  The string is inserted in the forms
-;;;	"as is".
-;;;   
-;;;   - an integer, denoting a field number.
-;;;	The contents of this field are inserted at this point.
-;;;     Fields are numbered starting with number one.
-;;;   
-;;;   - a function call, e.g. (insert "text").
-;;;	This function call is dynamically evaluated and should return a
-;;;     string.  It should *NOT* have side-effects on the forms being
-;;;     constructed.  The current fields are available to the function
-;;;     in the variable `forms-fields', they should *NOT* be modified.
-;;;   
-;;;   - a lisp symbol, that must evaluate to one of the above.
-;;;
-;;; Optional variables which may be set in the control file:
-;;;
-;;;	forms-field-sep				[string, default TAB]
-;;;			The field separator used to separate the
-;;;			fields in the data file.  It may be a string.
-;;;
-;;;	forms-read-only				[bool, default nil]
-;;;			Non-nil means that the data file is visited
-;;;			read-only (view mode) as opposed to edit mode.
-;;;			If no write access to the data file is
-;;;			possible, view mode is enforced. 
-;;;
-;;;	forms-multi-line			[string, default "^K"]
-;;;			If non-null the records of the data file may
-;;;			contain fields that can span multiple lines in
-;;;			the form.
-;;;			This variable denotes the separator character
-;;;			to be used for this purpose.  Upon display, all
-;;;			occurrencies of this character are translated
-;;;			to newlines.  Upon storage they are translated
-;;;			back to the separator character.
-;;;
-;;;	forms-forms-scroll			[bool, default nil]
-;;;			Non-nil means: rebind locally the commands that
-;;;			perform `scroll-up' or `scroll-down' to use
-;;;			`forms-next-field' resp. `forms-prev-field'.
-;;;
-;;;	forms-forms-jump			[bool, default nil]
-;;;			Non-nil means: rebind locally the commands that
-;;;			perform `beginning-of-buffer' or `end-of-buffer'
-;;;			to perform `forms-first-field' resp. `forms-last-field'.
-;;;
-;;;	forms-read-file-filter			[symbol, default nil]
-;;;			If not nil: this should be the name of a 
-;;;			function that is called after the forms data file
-;;;			has been read.  It can be used to transform
-;;;			the contents of the file into a format more suitable
-;;;			for forms-mode processing.
-;;;
-;;;	forms-write-file-filter			[symbol, default nil]
-;;;			If not nil: this should be the name of a 
-;;;			function that is called before the forms data file
-;;;			is written (saved) to disk.  It can be used to undo
-;;;			the effects of `forms-read-file-filter', if any.
-;;;
-;;;	forms-new-record-filter			[symbol, default nil]
-;;;			If not nil: this should be the name of a 
-;;;			function that is called when a new
-;;;			record is created.  It can be used to fill in
-;;;			the new record with default fields, for example.
-;;;
-;;;	forms-modified-record-filter		[symbol, default nil]
-;;;			If not nil: this should be the name of a 
-;;;			function that is called when a record has
-;;;			been modified.  It is called after the fields
-;;;			are parsed.  It can be used to register
-;;;			modification dates, for example.
-;;;
-;;;	forms-use-extents			[bool, see text for default]
-;;;	forms-use-text-properties		[bool, see text for default]
-;;;			These variables control if forms mode should use
-;;;			text properties or extents to protect the form text
-;;;			from being modified (using text-property `read-only').
-;;;			Also, the read-write fields are shown using a
-;;;			distinct face, if possible.
-;;;			One of these variables defaults to t if running 
-;;;			FSF or Lucid Emacs 19.
-;;;
-;;;	forms-ro-face 				[symbol, default 'default]
-;;;			This is the face that is used to show
-;;;			read-only text on the screen.If used, this
-;;;			variable should be set to a symbol that is a
-;;;			valid face.
-;;;			E.g.
-;;;			  (make-face 'my-face)
-;;;			  (setq forms-ro-face 'my-face)
-;;;
-;;;	forms-rw-face				[symbol, default 'region]
-;;;			This is the face that is used to show
-;;;			read-write text on the screen.
-;;;
-;;; After evaluating the control file, its buffer is cleared and used
-;;; for further processing.
-;;; The data file (as designated by `forms-file') is visited in a buffer
-;;; `forms--file-buffer' which will not normally be shown.
-;;; Great malfunctioning may be expected if this file/buffer is modified
-;;; outside of this package while it is being visited!
-;;;
-;;; Normal operation is to transfer one line (record) from the data file,
-;;; split it into fields (into `forms--the-record-list'), and display it
-;;; using the specs in `forms-format-list'.
-;;; A format routine `forms--format' is built upon startup to format 
-;;; the records according to `forms-format-list'.
-;;;
-;;; When a form is changed the record is updated as soon as this form
-;;; is left.  The contents of the form are parsed using information
-;;; obtained from `forms-format-list', and the fields which are
-;;; deduced from the form are modified.  Fields not shown on the forms
-;;; retain their origional values.  The newly formed record then
-;;; replaces the contents of the old record in `forms--file-buffer'.
-;;; A parse routine `forms--parser' is built upon startup to parse
-;;; the records.
-;;;
-;;; Two exit functions exist: `forms-exit' and `forms-exit-no-save'.
-;;; `forms-exit' saves the data to the file, if modified.
-;;; `forms-exit-no-save` does not.  However, if `forms-exit-no-save'
-;;; is executed and the file buffer has been modified, Emacs will ask
-;;; questions anyway.
-;;;
-;;; Other functions provided by forms mode are:
-;;;
-;;;	paging (forward, backward) by record
-;;;	jumping (first, last, random number)
-;;;	searching
-;;;	creating and deleting records
-;;;	reverting the form (NOT the file buffer)
-;;;	switching edit <-> view mode v.v.
-;;;	jumping from field to field
-;;;
-;;; As an documented side-effect: jumping to the last record in the
-;;; file (using forms-last-record) will adjust forms--total-records if
-;;; needed.
-;;;
-;;; The forms buffer can be in on eof two modes: edit mode or view
-;;; mode.  View mode is a read-only mode, you cannot modify the
-;;; contents of the buffer.
-;;;
-;;; Edit mode commands:
-;;; 
-;;; TAB		 forms-next-field
-;;; \C-c TAB	 forms-next-field
-;;; \C-c <	 forms-first-record
-;;; \C-c >	 forms-last-record
-;;; \C-c ?	 describe-mode
-;;; \C-c \C-k	 forms-delete-record
-;;; \C-c \C-q	 forms-toggle-read-only
-;;; \C-c \C-o	 forms-insert-record
-;;; \C-c \C-l	 forms-jump-record
-;;; \C-c \C-n	 forms-next-record
-;;; \C-c \C-p	 forms-prev-record
-;;; \C-c \C-s	 forms-search
-;;; \C-c \C-x	 forms-exit
-;;; 
-;;; Read-only mode commands:
-;;; 
-;;; SPC 	 forms-next-record
-;;; DEL	 forms-prev-record
-;;; ?	 describe-mode
-;;; \C-q forms-toggle-read-only
-;;; l	 forms-jump-record
-;;; n	 forms-next-record
-;;; p	 forms-prev-record
-;;; s	 forms-search
-;;; x	 forms-exit
-;;; 
-;;; Of course, it is also possible to use the \C-c prefix to obtain the
-;;; same command keys as in edit mode.
-;;; 
-;;; The following bindings are available, independent of the mode: 
-;;; 
-;;; [next]	  forms-next-record
-;;; [prior]	  forms-prev-record
-;;; [begin]	  forms-first-record
-;;; [end]	  forms-last-record
-;;; [S-TAB]	  forms-prev-field
-;;; [backtab] forms-prev-field
-;;;
-;;; For convenience, TAB is always bound to `forms-next-field', so you
-;;; don't need the C-c prefix for this command.
-;;;
-;;; As mentioned above (see `forms-forms-scroll' and `forms-forms-jump')
-;;; the bindings of standard functions `scroll-up', `scroll-down',
-;;; `beginning-of-buffer' and `end-of-buffer' can be locally replaced with
-;;; forms mode functions next/prev record and first/last
-;;; record.
-;;;
-;;; `local-write-file hook' is defined to save the actual data file
-;;; instead of the buffer data, `revert-file-hook' is defined to
-;;; revert a forms to original.
+;; Visit a file using a form.
+;;
+;; === Naming conventions
+;;
+;; The names of all variables and functions start with 'forms-'.
+;; Names which start with 'forms--' are intended for internal use, and
+;; should *NOT* be used from the outside.
+;;
+;; All variables are buffer-local, to enable multiple forms visits 
+;; simultaneously.
+;; Variable `forms--mode-setup' is local to *ALL* buffers, for it 
+;; controls if forms-mode has been enabled in a buffer.
+;;
+;; === How it works ===
+;;
+;; Forms mode means visiting a data file which is supposed to consist
+;; of records each containing a number of fields.  The records are
+;; separated by a newline, the fields are separated by a user-defined
+;; field separator (default: TAB).
+;; When shown, a record is transferred to an Emacs buffer and
+;; presented using a user-defined form.  One record is shown at a
+;; time.
+;;
+;; Forms mode is a composite mode.  It involves two files, and two
+;; buffers.
+;; The first file, called the control file, defines the name of the
+;; data file and the forms format.  This file buffer will be used to
+;; present the forms.
+;; The second file holds the actual data.  The buffer of this file
+;; will be buried, for it is never accessed directly.
+;;
+;; Forms mode is invoked using M-x forms-find-file control-file .
+;; Alternatively `forms-find-file-other-window' can be used.
+;;
+;; You may also visit the control file, and switch to forms mode by hand
+;; with M-x forms-mode .
+;;
+;; Automatic mode switching is supported if you specify 
+;; "-*- forms -*-" in the first line of the control file.
+;; 
+;; The control file is visited, evaluated using `eval-current-buffer',
+;; and should set at least the following variables:
+;;
+;;	forms-file				[string]
+;;			The name of the data file.
+;;
+;;	forms-number-of-fields			[integer]
+;;			The number of fields in each record.
+;;
+;;	forms-format-list			[list]
+;;			Formatting instructions.
+;;
+;; `forms-format-list' should be a list, each element containing
+;;
+;;   - a string, e.g. "hello".  The string is inserted in the forms
+;;	"as is".
+;;   
+;;   - an integer, denoting a field number.
+;;	The contents of this field are inserted at this point.
+;;     Fields are numbered starting with number one.
+;;   
+;;   - a function call, e.g. (insert "text").
+;;	This function call is dynamically evaluated and should return a
+;;     string.  It should *NOT* have side-effects on the forms being
+;;     constructed.  The current fields are available to the function
+;;     in the variable `forms-fields', they should *NOT* be modified.
+;;   
+;;   - a lisp symbol, that must evaluate to one of the above.
+;;
+;; Optional variables which may be set in the control file:
+;;
+;;	forms-field-sep				[string, default TAB]
+;;			The field separator used to separate the
+;;			fields in the data file.  It may be a string.
+;;
+;;	forms-read-only				[bool, default nil]
+;;			Non-nil means that the data file is visited
+;;			read-only (view mode) as opposed to edit mode.
+;;			If no write access to the data file is
+;;			possible, view mode is enforced. 
+;;
+;;	forms-check-number-of-fields            [bool, default t]
+;;			If non-nil, a warning will be issued whenever
+;;			a record is found that does not have the number
+;;			of fields specified by `forms-number-of-fields'.
+;;
+;;	forms-multi-line			[string, default "^K"]
+;;			If non-null the records of the data file may
+;;			contain fields that can span multiple lines in
+;;			the form.
+;;			This variable denotes the separator character
+;;			to be used for this purpose.  Upon display, all
+;;			occurrences of this character are translated
+;;			to newlines.  Upon storage they are translated
+;;			back to the separator character.
+;;
+;;	forms-forms-scroll			[bool, default nil]
+;;			Non-nil means: rebind locally the commands that
+;;			perform `scroll-up' or `scroll-down' to use
+;;			`forms-next-field' resp. `forms-prev-field'.
+;;
+;;	forms-forms-jump			[bool, default nil]
+;;			Non-nil means: rebind locally the commands that
+;;			perform `beginning-of-buffer' or `end-of-buffer'
+;;			to perform `forms-first-field' and `forms-last-field'.
+;;
+;;	forms-insert-after			[bool, default nil]
+;;			Non-nil means: inserts of new records go after
+;;			current record, also initial position is at last
+;;			record.
+;;
+;;	forms-read-file-filter			[symbol, default nil]
+;;			If not nil: this should be the name of a 
+;;			function that is called after the forms data file
+;;			has been read.  It can be used to transform
+;;			the contents of the file into a format more suitable
+;;			for forms-mode processing.
+;;
+;;	forms-write-file-filter			[symbol, default nil]
+;;			If not nil: this should be the name of a 
+;;			function that is called before the forms data file
+;;			is written (saved) to disk.  It can be used to undo
+;;			the effects of `forms-read-file-filter', if any.
+;;
+;;	forms-new-record-filter			[symbol, default nil]
+;;			If not nil: this should be the name of a 
+;;			function that is called when a new
+;;			record is created.  It can be used to fill in
+;;			the new record with default fields, for example.
+;;
+;;	forms-modified-record-filter		[symbol, default nil]
+;;			If not nil: this should be the name of a 
+;;			function that is called when a record has
+;;			been modified.  It is called after the fields
+;;			are parsed.  It can be used to register
+;;			modification dates, for example.
+;;
+;;	forms-use-extents			[bool, see text for default]
+;;	forms-use-text-properties		[bool, see text for default]
+;;			These variables control if forms mode should use
+;;			text properties or extents to protect the form text
+;;			from being modified (using text-property `read-only').
+;;			Also, the read-write fields are shown using a
+;;			distinct face, if possible.
+;;			As of emacs 19.29, the `intangible' text property
+;;			is used to prevent moving into read-only fields.
+;;			This variable defaults to t if running Emacs 19
+;;			with text properties.
+;;			The default face to show read-write fields is
+;;			copied from face `region'.
+;;
+;;	forms-ro-face 				[symbol, default 'default]
+;;			This is the face that is used to show
+;;			read-only text on the screen.If used, this
+;;			variable should be set to a symbol that is a
+;;			valid face.
+;;			E.g.
+;;			  (make-face 'my-face)
+;;			  (setq forms-ro-face 'my-face)
+;;
+;;	forms-rw-face				[symbol, default 'region]
+;;			This is the face that is used to show
+;;			read-write text on the screen.
+;;
+;; After evaluating the control file, its buffer is cleared and used
+;; for further processing.
+;; The data file (as designated by `forms-file') is visited in a buffer
+;; `forms--file-buffer' which will not normally be shown.
+;; Great malfunctioning may be expected if this file/buffer is modified
+;; outside of this package while it is being visited!
+;;
+;; Normal operation is to transfer one line (record) from the data file,
+;; split it into fields (into `forms--the-record-list'), and display it
+;; using the specs in `forms-format-list'.
+;; A format routine `forms--format' is built upon startup to format 
+;; the records according to `forms-format-list'.
+;;
+;; When a form is changed the record is updated as soon as this form
+;; is left.  The contents of the form are parsed using information
+;; obtained from `forms-format-list', and the fields which are
+;; deduced from the form are modified.  Fields not shown on the forms
+;; retain their original values.  The newly formed record then
+;; replaces the contents of the old record in `forms--file-buffer'.
+;; A parse routine `forms--parser' is built upon startup to parse
+;; the records.
+;;
+;; Two exit functions exist: `forms-exit' and `forms-exit-no-save'.
+;; `forms-exit' saves the data to the file, if modified.
+;; `forms-exit-no-save` does not.  However, if `forms-exit-no-save'
+;; is executed and the file buffer has been modified, Emacs will ask
+;; questions anyway.
+;;
+;; Other functions provided by forms mode are:
+;;
+;;	paging (forward, backward) by record
+;;	jumping (first, last, random number)
+;;	searching
+;;	creating and deleting records
+;;	reverting the form (NOT the file buffer)
+;;	switching edit <-> view mode v.v.
+;;	jumping from field to field
+;;
+;; As an documented side-effect: jumping to the last record in the
+;; file (using forms-last-record) will adjust forms--total-records if
+;; needed.
+;;
+;; The forms buffer can be in on eof two modes: edit mode or view
+;; mode.  View mode is a read-only mode, you cannot modify the
+;; contents of the buffer.
+;;
+;; Edit mode commands:
+;; 
+;; TAB		 forms-next-field
+;; \C-c TAB	 forms-next-field
+;; \C-c <	 forms-first-record
+;; \C-c >	 forms-last-record
+;; \C-c ?	 describe-mode
+;; \C-c \C-k	 forms-delete-record
+;; \C-c \C-q	 forms-toggle-read-only
+;; \C-c \C-o	 forms-insert-record
+;; \C-c \C-l	 forms-jump-record
+;; \C-c \C-n	 forms-next-record
+;; \C-c \C-p	 forms-prev-record
+;; \C-c \C-r	 forms-search-backward
+;; \C-c \C-s	 forms-search-forward
+;; \C-c \C-x	 forms-exit
+;; 
+;; Read-only mode commands:
+;; 
+;; SPC 	 forms-next-record
+;; DEL	 forms-prev-record
+;; ?	 describe-mode
+;; \C-q forms-toggle-read-only
+;; l	 forms-jump-record
+;; n	 forms-next-record
+;; p	 forms-prev-record
+;; r	 forms-search-backward
+;; s	 forms-search-forward
+;; x	 forms-exit
+;; 
+;; Of course, it is also possible to use the \C-c prefix to obtain the
+;; same command keys as in edit mode.
+;; 
+;; The following bindings are available, independent of the mode: 
+;; 
+;; [next]	  forms-next-record
+;; [prior]	  forms-prev-record
+;; [begin]	  forms-first-record
+;; [end]	  forms-last-record
+;; [S-TAB]	  forms-prev-field
+;; [backtab] forms-prev-field
+;;
+;; For convenience, TAB is always bound to `forms-next-field', so you
+;; don't need the C-c prefix for this command.
+;;
+;; As mentioned above (see `forms-forms-scroll' and `forms-forms-jump')
+;; the bindings of standard functions `scroll-up', `scroll-down',
+;; `beginning-of-buffer' and `end-of-buffer' can be locally replaced with
+;; forms mode functions next/prev record and first/last
+;; record.
+;;
+;; `local-write-file hook' is defined to save the actual data file
+;; instead of the buffer data, `revert-file-hook' is defined to
+;; revert a forms to original.
 
 ;;; Code:
 
@@ -284,10 +300,10 @@
 (provide 'forms)			;;; official
 (provide 'forms-mode)			;;; for compatibility
 
-(defconst forms-version (substring "!Revision: 2.10 !" 11 -2)
+(defconst forms-version (substring "$Revision: 1.1.1.2 $" 11 -2)
   "The version number of forms-mode (as string).  The complete RCS id is:
 
-  !Id: forms.el,v 2.10 1994/07/26 21:31:13 rms Exp !")
+  $Id: forms.el,v 1.1.1.2 1996/12/18 22:51:25 steve Exp $")
 
 (defvar forms-mode-hooks nil
   "Hook functions to be run upon entering Forms mode.")
@@ -305,6 +321,9 @@
 
 ;;; Optional variables with default values.
 
+(defvar forms-check-number-of-fields t
+  "*If non-nil, warn about records with wrong number of fields.")
+
 (defvar forms-field-sep "\t"
   "Field separator character (default TAB).")
 
@@ -348,10 +367,14 @@
 Defaults to t if this emacs is capable of handling text properties.")
 
 (defvar forms-use-text-properties (and (fboundp 'set-text-properties)
-				       (not forms-use-extents))
+				       (not forms-use-extents)) ; XEmacs
   "*Non-nil means: use emacs-19 text properties.
 Defaults to t if this emacs is capable of handling text properties.")
 
+(defvar forms-insert-after nil
+  "*Non-nil means: inserts of new records go after current record.
+Also, initial position is at last record.")
+
 (defvar forms-ro-face (if (string-match "XEmacs" emacs-version)
 			  'forms-label-face
 			'default)
@@ -392,7 +415,7 @@
    "List of strings of the current record, as parsed from the file.")
 
 (defvar forms--search-regexp nil
-  "Last regexp used by forms-search.")
+  "Last regexp used by forms-search functions.")
 
 (defvar forms--format nil
   "Formatting routine.")
@@ -415,27 +438,27 @@
 
 (defvar forms--rw-face nil
   "Face used to represent read-write data on the screen.")
-
 
 ;;;###autoload 
 (defun forms-mode (&optional primary)
   "Major mode to visit files in a field-structured manner using a form.
 
 Commands:                        Equivalent keys in read-only mode:
-
- TAB          forms-next-field           TAB
- C-c TAB      forms-next-field
- C-c <        forms-first-record         <
- C-c >        forms-last-record          >
- C-c ?        describe-mode              ?
- C-c C-k      forms-delete-record
- C-c C-q      forms-toggle-read-only     q
- C-c C-o      forms-insert-record
- C-c C-l      forms-jump-record          l
- C-c C-n      forms-next-record          n
- C-c C-p      forms-prev-record          p
- C-c C-s      forms-search               s
- C-c C-x      forms-exit                 x"
+ TAB            forms-next-field          TAB
+ \\C-c TAB       forms-next-field          
+ \\C-c <         forms-first-record         <
+ \\C-c >         forms-last-record          >
+ \\C-c ?         describe-mode              ?
+ \\C-c \\C-k      forms-delete-record
+ \\C-c \\C-q      forms-toggle-read-only     q
+ \\C-c \\C-o      forms-insert-record
+ \\C-c \\C-l      forms-jump-record          l
+ \\C-c \\C-n      forms-next-record          n
+ \\C-c \\C-p      forms-prev-record          p
+ \\C-c \\C-r      forms-search-backward      r
+ \\C-c \\C-s      forms-search-forward       s
+ \\C-c \\C-x      forms-exit                 x
+"
   (interactive)
 
   ;; This is not a simple major mode, as usual.  Therefore, forms-mode
@@ -466,6 +489,7 @@
         (make-local-variable 'forms-multi-line)
 	(make-local-variable 'forms-forms-scroll)
 	(make-local-variable 'forms-forms-jump)
+	(make-local-variable 'forms-insert-after)
 ;;	(make-local-variable 'forms-use-text-properties)
 
 	;; Filter functions.
@@ -480,7 +504,7 @@
 	(setq forms-new-record-filter nil)
 	(setq forms-modified-record-filter nil)
 
-	(if forms--lemacs-p
+	(if forms--lemacs-p ; XEmacs
 	    (progn
 	      ;; forms-field-face defaults to bold.
 	      ;; forms-label-face defaults to no attributes
@@ -578,8 +602,7 @@
 	(make-local-variable 'forms--dynamic-text)
 
 	;; Prevent accidental overwrite of the control file and autosave.
-	(setq buffer-file-name nil)
-	(auto-save-mode nil)
+	(set-visited-file-name nil)
 
 	;; Prepare this buffer for further processing.
 	(setq buffer-read-only nil)
@@ -621,6 +644,10 @@
     ;;(message "forms: building keymap... done.")
     )
 
+  ;; set the major mode indicator
+  (setq major-mode 'forms-mode)
+  (setq mode-name "Forms")
+
   ;; find the data file
   (setq forms--file-buffer (find-file-noselect forms-file))
 
@@ -630,9 +657,10 @@
     (if read-file-filter
 	(save-excursion
 	  (set-buffer forms--file-buffer)
-	  (let ((inhibit-read-only t))
-	    (run-hooks 'read-file-filter))
-	  (set-buffer-modified-p nil)
+	  (let ((inhibit-read-only t)
+		(file-modified (buffer-modified-p)))
+	    (run-hooks 'read-file-filter)
+	    (if (not file-modified) (set-buffer-modified-p nil)))
 	  (if write-file-filter
 	      (progn
 		(make-variable-buffer-local 'local-write-file-hooks)
@@ -641,7 +669,8 @@
 	  (save-excursion
 	    (set-buffer forms--file-buffer)
 	    (make-variable-buffer-local 'local-write-file-hooks)
-	    (setq local-write-file-hooks write-file-filter)))))
+	    ;; (setq local-write-file-hooks (list write-file-filter))))))
+	    (add-hook 'local-write-file-hooks 'write-file-filter)))))
 
   ;; count the number of records, and set see if it may be modified
   (let (ro)
@@ -660,9 +689,6 @@
 	(setq forms-read-only t)))
 
   ;;(message "forms: proceeding setup...")
-  ;; set the major mode indicator
-  (setq major-mode 'forms-mode)
-  (setq mode-name "Forms")
 
   ;; Since we aren't really implementing a minor mode, we hack the modeline
   ;; directly to get the text " View " into forms-read-only form buffers.  For
@@ -684,8 +710,8 @@
 	(insert 
 	 "GNU Emacs Forms Mode version " forms-version "\n\n"
 	 (if (file-exists-p forms-file)
-	     (concat "No records available in file \"" forms-file "\".\n\n")
-	   (format "Creating new file \"%s\"\nwith %d field%s per record.\n\n"
+	     (concat "No records available in file `" forms-file "'\n\n")
+	   (format "Creating new file `%s'\nwith %d field%s per record\n\n"
 		   forms-file forms-number-of-fields
 		   (if (= 1 forms-number-of-fields) "" "s")))
 	 "Use " (substitute-command-keys "\\[forms-insert-record]")
@@ -700,6 +726,10 @@
     (forms-jump-record forms--current-record)
     )
 
+  (if forms-insert-after
+      (forms-last-record)
+    (forms-first-record))
+
   ;; user customising
   ;;(message "forms: proceeding setup (user hooks)...")
   (run-hooks 'forms-mode-hooks)
@@ -717,7 +747,7 @@
   ;; of the fields on the display. This array is used by 
   ;; `forms--parser-using-text-properties' to extract the fields data
   ;; from the form on the screen.
-  ;; Upon completion, `forms-format-list' is garanteed correct, so
+  ;; Upon completion, `forms-format-list' is guaranteed correct, so
   ;; `forms--make-format' and `forms--make-parser' do not need to perform
   ;; any checks.
 
@@ -789,8 +819,8 @@
 	  ;; Validate.
 	  (or (fboundp (car-safe el))
 	      (error (concat "Forms format error: "
-			     "not a function "
-			     (prin1-to-string (car-safe el)))))
+			     "not a function %S")
+		     (car-safe el)))
 
 	  ;; Shift.
 	  (if prev-item
@@ -801,8 +831,8 @@
 	 ;; else
 	 (t
 	  (error (concat "Forms format error: "
-			 "invalid element "
-			 (prin1-to-string el)))))
+			 "invalid element %S")
+		 el)))
 
 	;; Advance to next element of the list.
 	(setq the-list rem)))
@@ -910,12 +940,12 @@
 		(,@ (if (numberp (car forms-format-list))
 			nil
 		      '((add-text-properties (point-min) (1+ (point-min))
-					     '(front-sticky (read-only))))))
+					     '(front-sticky (read-only intangible))))))
 		;; Prevent insertion after the last text.
 		(remove-text-properties (1- (point)) (point)
 					'(rear-nonsticky)))
 	      (setq forms--iif-start nil)))
-       (if forms-use-extents
+       (if forms-use-extents ; XEmacs version
 	   (` (lambda (arg)
 		(,@ (apply 'append
 			   (mapcar 'forms--make-format-elt-using-extents
@@ -1038,8 +1068,10 @@
 	   (point))
 	 (list 'face forms--ro-face	; read-only appearance
 	       'read-only (,@ (list (1+ forms--marker)))
+	       'intangible t
 	       'insert-in-front-hooks '(forms--iif-hook)
-	       'rear-nonsticky '(face read-only insert-in-front-hooks))))))
+	       'rear-nonsticky '(face read-only insert-in-front-hooks
+				      intangible))))))
     
    ((numberp el)
     (` ((let ((here (point)))
@@ -1065,12 +1097,15 @@
 	   (point))
 	 (list 'face forms--ro-face
 	       'read-only (,@ (list (1+ forms--marker)))
+	       'intangible t
 	       'insert-in-front-hooks '(forms--iif-hook)
-	       'rear-nonsticky '(read-only face insert-in-front-hooks))))))
+	       'rear-nonsticky '(read-only face insert-in-front-hooks
+					   intangible))))))
 
    ;; end of cond
    ))
 
+;; XEmacs
 (defun forms--make-format-elt-using-extents (el)
   "Helper routine to generate format function."
 
@@ -1238,9 +1273,9 @@
 	(if (setq there 
 		  (next-single-property-change here 'read-only))
 	    (aset forms--recordv (aref forms--elements i)
-		  (buffer-substring here there))
+		  (buffer-substring-no-properties here there))
 	  (aset forms--recordv (aref forms--elements i)
-		(buffer-substring here (point-max)))))
+		(buffer-substring-no-properties here (point-max)))))
       (setq i (1+ i)))))
 
 (defun forms--make-parser-elt (el)
@@ -1262,7 +1297,7 @@
   ;;     (setq here (point))
   ;;     (if (not (search-forward "\nmore text: " nil t nil))
   ;; 	    (error "Parse error: cannot find \"\\nmore text: \""))
-  ;;     (aset forms--recordv 5 (buffer-substring here (- (point) 12)))
+  ;;     (aset forms--recordv 5 (buffer-substring-no-properties here (- (point) 12)))
   ;;
   ;;	 ;;  (tocol 40)
   ;;	(let ((forms--dyntext (car-safe forms--dynamic-text)))
@@ -1272,7 +1307,7 @@
   ;;	  (setq forms--dynamic-text (cdr-safe forms--dynamic-text)))
   ;;     ... 
   ;;     ;; final flush (due to terminator sentinel, see below)
-  ;;	(aset forms--recordv 7 (buffer-substring (point) (point-max)))
+  ;;	(aset forms--recordv 7 (buffer-substring-no-properties (point) (point-max)))
 
   (cond
    ((stringp el)
@@ -1298,7 +1333,7 @@
    ((null el)
     (if forms--field
 	(` ((aset forms--recordv (, (1- forms--field))
-		  (buffer-substring (point) (point-max)))))))
+		  (buffer-substring-no-properties (point) (point-max)))))))
    ((listp el)
     (prog1
 	(if forms--field
@@ -1307,7 +1342,7 @@
 		  (if (not (search-forward forms--dyntext nil t nil))
 		      (error "Parse error: cannot find \"%s\"" forms--dyntext))
 		  (aset forms--recordv (, (1- forms--field))
-			(buffer-substring here
+			(buffer-substring-no-properties here
 					  (- (point) (length forms--dyntext)))))))
 	  (` ((let ((forms--dyntext (aref forms--dyntexts (, forms--dyntext))))
 		(if (not (looking-at (regexp-quote forms--dyntext)))
@@ -1383,11 +1418,12 @@
   (define-key forms-mode-map "\C-l" 'forms-jump-record)
   (define-key forms-mode-map "\C-n" 'forms-next-record)
   (define-key forms-mode-map "\C-p" 'forms-prev-record)
-  (define-key forms-mode-map "\C-s" 'forms-search)
+  (define-key forms-mode-map "\C-r" 'forms-search-backward)
+  (define-key forms-mode-map "\C-s" 'forms-search-forward)
   (define-key forms-mode-map "\C-x" 'forms-exit)
   (define-key forms-mode-map "<" 'forms-first-record)
   (define-key forms-mode-map ">" 'forms-last-record)
-  (define-key forms-mode-map "?" 'describe-mode)
+  (define-key forms-mode-map "?" 'describe-mode) ; XEmacs
   (define-key forms-mode-map "\C-?" 'forms-prev-record)
 
   ;; `forms-mode-ro-map' replaces the local map when in read-only mode.
@@ -1399,24 +1435,120 @@
   (define-key forms-mode-ro-map "l" 'forms-jump-record)
   (define-key forms-mode-ro-map "n" 'forms-next-record)
   (define-key forms-mode-ro-map "p" 'forms-prev-record)
-  (define-key forms-mode-ro-map "s" 'forms-search)
+  (define-key forms-mode-ro-map "r" 'forms-search-backward)
+  (define-key forms-mode-ro-map "s" 'forms-search-forward)
   (define-key forms-mode-ro-map "x" 'forms-exit)
   (define-key forms-mode-ro-map "<" 'forms-first-record)
   (define-key forms-mode-ro-map ">" 'forms-last-record)
   (define-key forms-mode-ro-map "?" 'describe-mode)
   (define-key forms-mode-ro-map " " 'forms-next-record)
   (forms--mode-commands1 forms-mode-ro-map)
+  (forms--mode-menu-ro forms-mode-ro-map)
 
   ;; This is the normal, local map.
   (setq forms-mode-edit-map (make-keymap))
   (define-key forms-mode-edit-map "\t"   'forms-next-field)
   (define-key forms-mode-edit-map "\C-c" forms-mode-map)
   (forms--mode-commands1 forms-mode-edit-map)
+  (forms--mode-menu-edit forms-mode-edit-map)
   )
 
-(defun forms--mode-commands1 (map)
+(defun forms--mode-menu-ro (map)
+;;; Menu initialisation
+;  (define-key map [menu-bar] (make-sparse-keymap))
+  (define-key map [menu-bar forms]
+    (cons "Forms" (make-sparse-keymap "Forms")))
+  (define-key map [menu-bar forms menu-forms-exit]
+    '("Exit Forms Mode" . forms-exit))
+  (define-key map [menu-bar forms menu-forms-sep1]
+    '("----"))
+  (define-key map [menu-bar forms menu-forms-save]
+    '("Save Data" . forms-save-buffer))
+  (define-key map [menu-bar forms menu-forms-print]
+    '("Print Data" . forms-print))
+  (define-key map [menu-bar forms menu-forms-describe]
+    '("Describe Mode" . describe-mode))
+  (define-key map [menu-bar forms menu-forms-toggle-ro]
+    '("Toggle View/Edit" . forms-toggle-read-only))
+  (define-key map [menu-bar forms menu-forms-jump-record]
+    '("Jump" . forms-jump-record))
+  (define-key map [menu-bar forms menu-forms-search-backward]
+    '("Search Backward" . forms-search-backward))
+  (define-key map [menu-bar forms menu-forms-search-forward]
+    '("Search Forward" . forms-search-forward))
+  (define-key map [menu-bar forms menu-forms-delete-record]
+    '("Delete" . forms-delete-record))
+  (define-key map [menu-bar forms menu-forms-insert-record]
+    '("Insert" . forms-insert-record))
+  (define-key map [menu-bar forms menu-forms-sep2]
+    '("----"))
+  (define-key map [menu-bar forms menu-forms-last-record]
+    '("Last Record" . forms-last-record))
+  (define-key map [menu-bar forms menu-forms-first-record]
+    '("First Record" . forms-first-record))
+  (define-key map [menu-bar forms menu-forms-prev-record]
+    '("Previous Record" . forms-prev-record))
+  (define-key map [menu-bar forms menu-forms-next-record]
+    '("Next Record" . forms-next-record))
+  (define-key map [menu-bar forms menu-forms-sep3]
+    '("----"))
+  (define-key map [menu-bar forms menu-forms-prev-field]
+    '("Previous Field" . forms-prev-field))
+  (define-key map [menu-bar forms menu-forms-next-field]
+    '("Next Field" . forms-next-field))
+  (put 'forms-insert-record 'menu-enable '(not forms-read-only))
+  (put 'forms-delete-record 'menu-enable '(not forms-read-only))
+)
+(defun forms--mode-menu-edit (map)
+;;; Menu initialisation
+;  (define-key map [menu-bar] (make-sparse-keymap))
+  (define-key map [menu-bar forms]
+    (cons "Forms" (make-sparse-keymap "Forms")))
+  (define-key map [menu-bar forms menu-forms-edit--exit]
+    '("Exit" . forms-exit))
+  (define-key map [menu-bar forms menu-forms-edit-sep1]
+    '("----"))
+  (define-key map [menu-bar forms menu-forms-edit-save]
+    '("Save Data" . forms-save-buffer))
+  (define-key map [menu-bar forms menu-forms-edit-print]
+    '("Print Data" . forms-print))
+  (define-key map [menu-bar forms menu-forms-edit-describe]
+    '("Describe Mode" . describe-mode))
+  (define-key map [menu-bar forms menu-forms-edit-toggle-ro]
+    '("Toggle View/Edit" . forms-toggle-read-only))
+  (define-key map [menu-bar forms menu-forms-edit-jump-record]
+    '("Jump" . forms-jump-record))
+  (define-key map [menu-bar forms menu-forms-edit-search-backward]
+    '("Search Backward" . forms-search-backward))
+  (define-key map [menu-bar forms menu-forms-edit-search-forward]
+    '("Search Forward" . forms-search-forward))
+  (define-key map [menu-bar forms menu-forms-edit-delete-record]
+    '("Delete" . forms-delete-record))
+  (define-key map [menu-bar forms menu-forms-edit-insert-record]
+    '("Insert" . forms-insert-record))
+  (define-key map [menu-bar forms menu-forms-edit-sep2]
+    '("----"))
+  (define-key map [menu-bar forms menu-forms-edit-last-record]
+    '("Last Record" . forms-last-record))
+  (define-key map [menu-bar forms menu-forms-edit-first-record]
+    '("First Record" . forms-first-record))
+  (define-key map [menu-bar forms menu-forms-edit-prev-record]
+    '("Previous Record" . forms-prev-record))
+  (define-key map [menu-bar forms menu-forms-edit-next-record]
+    '("Next Record" . forms-next-record))
+  (define-key map [menu-bar forms menu-forms-edit-sep3]
+    '("----"))
+  (define-key map [menu-bar forms menu-forms-edit-prev-field]
+    '("Previous Field" . forms-prev-field))
+  (define-key map [menu-bar forms menu-forms-edit-next-field]
+    '("Next Field" . forms-next-field))
+  (put 'forms-insert-record 'menu-enable '(not forms-read-only))
+  (put 'forms-delete-record 'menu-enable '(not forms-read-only))
+)
+
+(defun forms--mode-commands1 (map) 
   "Helper routine to define keys."
-  (if forms--lemacs-p
+  (if forms--lemacs-p ; XEmacs
       (progn
 	(define-key map [tab] 'forms-next-field)
 	(define-key map [(shift tab)] 'forms-prev-field))
@@ -1440,11 +1572,11 @@
       (progn
 	(substitute-key-definition 'scroll-up 'forms-next-record
 				   (current-local-map)
-				   ;;(current-global-map)
+				   ;;(current-global-map) ; FSF
 				   )
 	(substitute-key-definition 'scroll-down 'forms-prev-record
 				   (current-local-map)
-				   ;;(current-global-map)
+				   ;;(current-global-map) ; FSF
 				   )))
   ;;
   ;; beginning-of-buffer -> forms-first-record
@@ -1453,11 +1585,11 @@
       (progn
 	(substitute-key-definition 'beginning-of-buffer 'forms-first-record
 				   (current-local-map)
-				   ;;(current-global-map)
+				   ;;(current-global-map) ; FSF
 				   )
 	(substitute-key-definition 'end-of-buffer 'forms-last-record
 				   (current-local-map)
-				   ;;(current-global-map)
+				   ;;(current-global-map) ;FSF
 				   )))
   ;;
   ;; Save buffer
@@ -1471,7 +1603,7 @@
 
 (defun forms--help ()
   "Initial help for Forms mode."
-  (message (substitute-command-keys (concat
+  (message "%s" (substitute-command-keys (concat
   "\\[forms-next-record]:next"
   "   \\[forms-prev-record]:prev"
   "   \\[forms-first-record]:first"
@@ -1519,7 +1651,7 @@
   (let ((here (point)))
     (prog2
      (end-of-line)
-     (buffer-substring here (point))
+     (buffer-substring-no-properties here (point))
      (goto-char here))))
 
 (defun forms--show-record (the-record)
@@ -1550,9 +1682,11 @@
   ;; Verify the number of fields, extend forms--the-record-list if needed.
   (if (= (length forms--the-record-list) forms-number-of-fields)
       nil
-    (beep)
-    (message "Warning: this record has %d fields instead of %d"
-	     (length forms--the-record-list) forms-number-of-fields)
+    (if (null forms-check-number-of-fields)
+	nil
+      (beep)
+      (message "Warning: this record has %d fields instead of %d"
+	       (length forms--the-record-list) forms-number-of-fields))
     (if (< (length forms--the-record-list) forms-number-of-fields)
 	(setq forms--the-record-list 
 	      (append forms--the-record-list
@@ -1570,7 +1704,7 @@
   (set-buffer-modified-p nil)
   (setq buffer-read-only forms-read-only)
   (setq mode-line-process
-	(format " %d/%d" forms--current-record forms--total-records)))
+	(concat " " forms--current-record "/" forms--total-records)))
 
 (defun forms--parse-form ()
   "Parse contents of form into list of strings."
@@ -1761,7 +1895,7 @@
 (defun forms-toggle-read-only (arg)
   "Toggles read-only mode of a forms mode buffer.
 With an argument, enables read-only mode if the argument is positive.
-Otherwise enables edit mode if the visited file is writeable."
+Otherwise enables edit mode if the visited file is writable."
 
   (interactive "P")
 
@@ -1778,7 +1912,7 @@
 	      buffer-read-only)
 	    (progn
 	      (setq forms-read-only t)
-	      (message "No write access to \"%s\"" forms-file)
+	      (message "No write access to `%s'" forms-file)
 	      (beep))
 	  (setq forms-read-only nil))
 	(if (equal ro forms-read-only)
@@ -1804,15 +1938,21 @@
   "Create a new record before the current one.
 With ARG: store the record after the current one.
 If `forms-new-record-filter' contains the name of a function, 
-it is called to fill (some of) the fields with default values."
+it is called to fill (some of) the fields with default values.
+If `forms-insert-after is non-nil, the default behavior is to insert
+after the current record."
 
   (interactive "P")
 
   (if forms-read-only
       (error ""))
 
-  (let ((ln (if arg (1+ forms--current-record) forms--current-record))
-        the-list the-record)
+  (let (ln the-list the-record)
+
+    (if (or (and arg forms-insert-after)
+	    (and (not arg) (not forms-insert-after)))
+	(setq ln forms--current-record)
+      (setq ln (1+ forms--current-record)))
 
     (forms--checkmod)
     (if forms-new-record-filter
@@ -1865,10 +2005,10 @@
 	(forms-jump-record forms--current-record)))
   (message ""))
 
-(defun forms-search (regexp)
-  "Search REGEXP in file buffer."
+(defun forms-search-forward (regexp)
+  "Search forward for record containing REGEXP."
   (interactive 
-   (list (read-string (concat "Search for" 
+   (list (read-string (concat "Search forward for" 
 				  (if forms--search-regexp
 				   (concat " ("
 					   forms--search-regexp
@@ -1887,7 +2027,39 @@
 	  (if (null (re-search-forward regexp nil t))
 	      (progn
 		(goto-char here)
-		(message (concat "\"" regexp "\" not found."))
+		(message "\"%s\" not found" regexp)
+		nil)
+	    (setq the-record (forms--get-record))
+	    (setq the-line (1+ (count-lines (point-min) (point))))))
+	(progn
+	  (setq forms--current-record the-line)
+	  (forms--show-record the-record)
+	  (re-search-forward regexp nil t))))
+  (setq forms--search-regexp regexp))
+
+(defun forms-search-backward (regexp)
+  "Search backward for record containing REGEXP."
+  (interactive 
+   (list (read-string (concat "Search backward for" 
+				  (if forms--search-regexp
+				   (concat " ("
+					   forms--search-regexp
+					   ")"))
+				  ": "))))
+  (if (equal "" regexp)
+      (setq regexp forms--search-regexp))
+  (forms--checkmod)
+
+  (let (the-line the-record here
+		 (fld-sep forms-field-sep))
+    (if (save-excursion
+	  (set-buffer forms--file-buffer)
+	  (setq here (point))
+	  (beginning-of-line)
+	  (if (null (re-search-backward regexp nil t))
+	      (progn
+		(goto-char here)
+		(message "\"%s\" not found" regexp)
 		nil)
 	    (setq the-record (forms--get-record))
 	    (setq the-line (1+ (count-lines (point-min) (point))))))
@@ -1929,7 +2101,8 @@
   (let ((i 0)
 	(here (point))
 	there
-	(cnt 0))
+	(cnt 0)
+	(inhibit-point-motion-hooks t))
 
     (if (zerop arg)
 	(setq cnt 1)
@@ -1955,7 +2128,8 @@
   (let ((i (length forms--markers))
 	(here (point))
 	there
-	(cnt 0))
+	(cnt 0)
+	(inhibit-point-motion-hooks t))
 
     (if (zerop arg)
 	(setq cnt 1)
@@ -1973,13 +2147,39 @@
 		    (throw 'done t))))))
 	nil
       (goto-char (aref forms--markers (1- (length forms--markers)))))))
+
+(defun forms-print ()
+  "Send the records to the printer with 'print-buffer', one record per page."
+  (interactive)
+  (let ((inhibit-read-only t)
+	(save-record forms--current-record)
+	(nb-record 1)
+	(record nil))
+    (while (<= nb-record forms--total-records)
+      (forms-jump-record nb-record)
+      (setq record (buffer-string))
+      (save-excursion
+	(set-buffer (get-buffer-create "*forms-print*"))
+	(goto-char (buffer-end 1))
+	(insert record)
+	(setq buffer-read-only nil)
+	(if (< nb-record forms--total-records)
+	    (insert "\n\n")))
+      (setq nb-record (1+ nb-record)))
+    (save-excursion
+      (set-buffer "*forms-print*")
+      (print-buffer)
+      (set-buffer-modified-p nil)
+      (kill-buffer (current-buffer)))
+    (forms-jump-record save-record)))
+
 ;;;
 ;;; Special service
 ;;;
 (defun forms-enumerate (the-fields)
   "Take a quoted list of symbols, and set their values to sequential numbers.
 The first symbol gets number 1, the second 2 and so on.
-It returns the higest number.
+It returns the highest number.
 
 Usage: (setq forms-number-of-fields
              (forms-enumerate
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/id-select.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,1218 @@
+;;!emacs
+;;
+;; LCD-ENTRY:    id-select.el|InfoDock Associates|elisp@infodock.com|Syntactical region selecting|12/02/96|1.4.3|
+;;
+;; FILE:         id-select.el
+;; SUMMARY:      Select larger and larger syntax-driven regions in a buffer.
+;; USAGE:        XEmacs and Emacs Lisp Library
+;; KEYWORDS:     matching, mouse
+;;
+;; AUTHOR:       Bob Weiner
+;;
+;; ORG:          InfoDock Associates.  We sell corporate support and development
+;;               contracts for InfoDock, Emacs and XEmacs.
+;;               E-mail: <info@infodock.com>  Web: http://www.infodock.com
+;;               Tel: +1 408-243-3300
+;;
+;; ORIG-DATE:    19-Oct-96 at 02:25:27
+;; LAST-MOD:      2-Dec-96 at 19:45:28 by Bob Weiner
+;;
+;; Copyright (C) 1996  InfoDock Associates
+;;
+;; This file is part of InfoDock.
+;; It is available for use and distribution under the terms of the GNU Public
+;; License.
+;;
+;; DESCRIPTION:  
+;;
+;;   This is a radically cool, drop in mouse and keyboard-based library for
+;;   selecting successively bigger syntactical regions within a buffer.
+;;   Simply load this library and you are ready to try it out by
+;;   double-clicking on various kinds of characters in different buffer major
+;;   modes.  You'll quickly get the hang of it.  (It also provides a command
+;;   to jump between beginning and end tags within HTML and SGML buffers.) 
+;;   
+;;   A great deal of smarts are built-in so that it does the right thing
+;;   almost all of the time; many other attempts at similar behavior such as
+;;   thing.el fail to deal with many file format complexities.
+;;   
+;;   Double clicks of the Selection Key (left mouse key) at the same point
+;;   will select bigger and bigger regions with each successive use.  The
+;;   first double click selects a region based upon the character at the
+;;   point of the click.  For example, with the point over an opening or
+;;   closing grouping character, such as { or }, the whole grouping is
+;;   selected, e.g. a C function.  When on an _ or - within a programming
+;;   language variable name, the whole name is selected.  The type of
+;;   selection is displayed in the minibuffer as feedback.  When using a
+;;   language based mainly on indenting, like Bourne shell, a double click on
+;;   the first alpha character of a line, such as an if statement, selects
+;;   the whole statement.
+;;
+;;   ---------------
+;;
+;;   This whole package is driven by a single function, available in mouse
+;;   and keyboard forms, that first marks a region based on the syntax
+;;   category of the character following point.  Successive invocations mark
+;;   larger and larger regions until the whole buffer is marked.  See the
+;;   documentation for the function, id-select-syntactical-region, for the
+;;   kinds of syntax categories handled.
+;;
+;;   Loading this package automatically installs its functionalty on
+;;   double-clicks (or higher) of the left mouse key.  (See the documentation
+;;   for the variable, mouse-track-click-hook, for how this is done.)  A
+;;   single click of the left button will remove the region and reset point.
+;;
+;;   The function, id-select-thing, may be bound to a key, {C-c s}, seems to
+;;   be a reasonable choice, to provide the same syntax-driven region
+;;   selection functionality.  Use {C-g} to unmark the region when done.
+;;   Use, id-select-thing-with-mouse, if you want to bind this to a mouse key
+;;   and thereby use single clicks instead of double clicks.
+;;
+;;   Three other commands are also provided:
+;;    id-select-and-copy-thing - mark and copy the syntactical unit to the
+;;      kill ring 
+;;    id-select-and-kill-thing - kill the syntactical unit at point
+;;    id-select-goto-matching-tag - In HTML and SGML modes (actually any
+;;      listed in the variable, `id-select-markup-modes'), moves point to the
+;;      start of the tag paired with the closest tag that point is within or
+;;      which it precedes, so you can quickly jump back and forth between
+;;      open and close tags.
+;;
+;;   ---------------
+;;   SETUP:
+;;
+;;   To autoload this package under XEmacs or InfoDock via mouse usage, add
+;;   the following line to one of your initialization files.  (Don't do this
+;;   for GNU Emacs.)
+;;
+;;      (add-hook 'mouse-track-click-hook 'id-select-double-click-hook)
+;;
+;;   For any version of Emacs you should add the following autoload entries
+;;   at your site:
+;;
+;;      (autoload 'id-select-and-kill-thing
+;;         "id-select" "Kill syntactical region selection" t)
+;;      (autoload 'id-select-and-copy-thing
+;;         "id-select" "Select and copy syntactical region" t)
+;;      (autoload 'id-select-double-click-hook
+;;         "id-select" "Double mouse click syntactical region selection" nil)
+;;      (autoload 'id-select-thing
+;;         "id-select" "Keyboard-driven syntactical region selection" t)
+;;      (autoload 'id-select-thing-with-mouse
+;;         "id-select" "Single mouse click syntactical region selection" t)
+;;
+;;   If you want to be able to select C++ and Java methods and classes by
+;;   double-clicking on the first character of a definition or on its opening
+;;   or closing brace, you may need the following setting (all
+;;   because Sun programmers can't put their opening braces in the first
+;;   column):
+;;
+;;      (add-hook 'java-mode-hook
+;;         (function
+;;           (lambda ()
+;;	      (setq defun-prompt-regexp
+;;		    "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*"))))
+;;
+;;      (add-hook 'c++-mode-hook
+;;	   (function
+;;	    (lambda ()
+;;	      (setq defun-prompt-regexp
+;;		   "^[ \t]*\\(template[ \t\n\r]*<[^>;.{}]+>[ \t\n\r]*\\)?\\(\\(\\(auto\\|const\\|explicit\\|extern[ \t\n\r]+\"[^\"]+\"\\|extern\\|friend\\|inline\\|mutable\\|overload\\|register\\|static\\|typedef\\|virtual\\)[ \t\n\r]+\\)*\\(\\([[<a-zA-Z][]_a-zA-Z0-9]*\\(::[]_a-zA-Z0-9]+\\)?[ \t\n\r]*<[_<>a-zA-Z0-9 ,]+>[ \t\n\r]*[*&]*\\|[[<a-zA-Z][]_<>a-zA-Z0-9]*\\(::[[<a-zA-Z][]_<>a-zA-Z0-9]+\\)?[ \t\n\r]*[*&]*\\)[*& \t\n\r]+\\)\\)?\\(\\(::\\|[[<a-zA-Z][]_a-zA-Z0-9]*[ \t\n\r]*<[^>;{}]+>[ \t\n\r]*[*&]*::\\|[[<a-zA-Z][]_~<>a-zA-Z0-9]*[ \t\n\r]*[*&]*::\\)[ \t\n\r]*\\)?\\(operator[ \t\n\r]*[^ \t\n\r:;.,?~{}]+\\([ \t\n\r]*\\[\\]\\)?\\|[_~<a-zA-Z][^][ \t:;.,~{}()]*\\|[*&]?\\([_~<a-zA-Z][_a-zA-Z0-9]*[ \t\n\r]*<[^>;{}]+[ \t\n\r>]*>\\|[_~<a-zA-Z][_~<>a-zA-Z0-9]*\\)\\)[ \t\n\r]*\\(([^{;]*)\\(\\([ \t\n\r]+const\\|[ \t\n\r]+mutable\\)?\\([ \t\n\r]*[=:][^;{]+\\)?\\)?\\)\\s-*"))))
+;;
+;;   If you want tags, comments, sentences and text blocks to be selectable
+;;   in HTML mode, you need to add the following to your personal
+;;   initializations  (You would do something similar for SGML mode.):
+;;
+;;      ;; Make tag begin and end delimiters act like grouping characters,
+;;      ;; for easy syntactical selection of tags.
+;;      (add-hook 'html-mode-hook
+;;    	  (function
+;;	   (lambda ()
+;;	     (modify-syntax-entry ?<  "(>" html-mode-syntax-table)
+;;	     (modify-syntax-entry ?>  ")<" html-mode-syntax-table)
+;;	     (modify-syntax-entry ?\" "\"" html-mode-syntax-table)
+;;	     (modify-syntax-entry ?=  "."  html-mode-syntax-table)
+;;	     (make-local-variable 'comment-start)
+;;	     (make-local-variable 'comment-end)
+;;	     (setq comment-start "<!--" comment-end "-->")
+;;	     (make-local-variable 'sentence-end)
+;;	     (setq sentence-end "\\([^ \t\n\r>]<\\|>\\(<[^>]*>\\)*\\|[.?!][]\"')}]*\\($\\| $\\|\t\\|  \\)\\)[ \t\n]*")
+;;
+;;           (define-key html-mode-map "\C-c." 'id-select-goto-matching-tag)
+;;           )))
+;;
+;; DESCRIP-END.
+
+;;; ************************************************************************
+;;; Public variables
+;;; ************************************************************************
+
+(defvar id-select-brace-modes
+  '(c++-mode c-mode java-mode objc-mode perl-mode tcl-mode)
+  "*List of language major modes which define things with brace delimiters.")
+
+(defvar id-select-markup-modes
+  '(html-mode sgml-mode)
+  "*List of markup language modes that use SGML-style <tag> </tag> pairs.")
+
+(defvar id-select-text-modes
+  '(fundamental-mode kotl-mode indented-text-mode Info-mode outline-mode text-mode)
+  "*List of textual modes where paragraphs may be outdented or indented.")
+
+(defvar id-select-indent-modes
+  (append '(asm-mode csh-mode eiffel-mode ksh-mode python-mode pascal-mode
+	    sather-mode)
+	  id-select-text-modes)
+  "*List of language major modes which use mostly indentation to define syntactic structure.")
+
+(defvar id-select-indent-non-end-regexp-alist
+  '((csh-mode    "\\(\\|then\\|elsif\\|else\\)[ \t]*$")
+    (eiffel-mode "\\(\\|then\\|else if\\|else\\)[ \t]*$")
+    (ksh-mode    "\\(\\|then\\|elif\\|else\\)[ \t]*$")
+    (pascal-mode "\\(\\|then\\|else\\)[ \t]*$")
+    (python-mode "[ \t]*$")
+    (sather-mode "\\(\\|then\\|else if\\|else\\)[ \t]*$")
+    ;;
+    (fundamental-mode "[^ \t\n]")
+    (kotl-mode "[^ \t\n]")
+    (indented-text-mode "[^ \t\n]")
+    (Info-mode "[^ \t\n]")
+    (outline-mode "[^\\*]")
+    (text-mode  "[^ \t\n]")
+    )
+  "List of (major-mode . non-terminator-line-regexp) elements used to avoid early dropoff when marking indented code.")
+
+(defvar id-select-indent-end-regexp-alist
+  '((csh-mode "end\\|while")
+    (eiffel-mode "end")
+    (ksh-mode "\\(fi\\|esac\\|until\\|done\\)[ \t\n]")
+    (pascal-mode "end")
+    (sather-mode "end")
+    ;;
+    (fundamental-mode "[ \t]*$")
+    (indented-text-mode "[ \t]*$")
+    (Info-mode "[ \t]*$")
+    (text-mode  "[ \t]*$")
+    )
+  "List of (major-mode . terminator-line-regexp) elements used to include a final line when marking indented code.")
+
+(defvar id-select-char-p t
+  "*If t, return single character boundaries when all else fails.")
+
+(defvar id-select-display-type t
+  "*If t, display the thing selected with each mouse click.")
+
+(defvar id-select-whitespace t
+  "*If t, groups of whitespace are considered as things.")
+
+(if (string-match "XEmacs" emacs-version)
+    (add-hook 'mouse-track-click-hook 'id-select-double-click-hook)
+  (if (string-match "^19\\." emacs-version)
+      (progn (transient-mark-mode 1)
+	     (global-set-key [mouse-1] 'mouse-set-point)
+	     (global-set-key [double-mouse-1] 'id-select-thing-with-mouse)
+	     (global-set-key [triple-mouse-1] 'id-select-thing-with-mouse))))
+
+;;; ************************************************************************
+;;; Public functions
+;;; ************************************************************************
+
+;;
+;; Commands
+;;
+
+;;;###autoload
+(defun id-select-thing ()
+  "Mark the region selected by the syntax of the thing at point.
+If invoked repeatedly, selects bigger and bigger things.
+If `id-select-display-type' is non-nil, the type of selection is displayed in
+the minibuffer."
+  (interactive
+   (cond ((and (fboundp 'region-active-p) (region-active-p))
+	  nil)
+	 ((and (boundp 'transient-mark-mode) transient-mark-mode mark-active)
+	  nil)
+	 (t
+	  ;; Reset selection based on the syntax of character at point.
+	  (id-select-reset)
+	  nil)))
+  (let ((region (id-select-boundaries (point))))
+    (if region
+	(progn (goto-char (car region))
+	       (set-mark (cdr region))
+	       (if (fboundp 'activate-region) (activate-region))
+	       (if (and (boundp 'transient-mark-mode)
+			transient-mark-mode)
+		   (setq mark-active t))
+	       (and (interactive-p) id-select-display-type
+		    (message "%s" id-select-previous))
+	       (run-hooks 'id-select-thing-hook)
+	       t))))
+
+;;;###autoload
+(defun id-select-thing-with-mouse (event)
+  "Select a region based on the syntax of the character from a mouse click.
+If the click occurs at the same point as the last click, select
+the next larger syntactic structure.  If `id-select-display-type' is non-nil,
+the type of selection is displayed in the minibuffer."
+  (interactive "@e")
+  (cond ((and (eq id-select-prior-point (point))
+	      (eq id-select-prior-buffer (current-buffer)))
+	 ;; Prior click was at the same point as before, so enlarge
+	 ;; selection to the next bigger item.
+	 (if (and (id-select-bigger-thing) id-select-display-type)
+ 	     (progn
+	       ;; Conditionally, save selected region for pasting.
+ 	       (cond
+		;; XEmacs
+		((fboundp 'x-store-cutbuffer)
+		 (x-store-cutbuffer (buffer-substring (point) (mark))))
+		;; Emacs 19
+		((and (boundp 'interprogram-cut-function)
+		      interprogram-cut-function)
+		 (x-set-selection 'PRIMARY (buffer-substring (point) (mark)))))
+	       (message "%s" id-select-previous)))
+	 t)
+	(t (setq this-command 'mouse-start-selection)
+	   (id-select-reset)
+	   (id-select-thing-with-mouse event))))
+
+;;;###autoload
+(defun id-select-goto-matching-tag ()
+  "If in a major mode listed in `id-select-markup-modes,' moves point to the start of the tag paired with the closest tag that point is within or precedes.
+Returns t if point is moved, else nil.
+Signals an error if no tag is found following point or if the closing tag
+does not have a `>' terminator character."
+  (interactive)
+  (if (not (memq major-mode id-select-markup-modes))
+      nil
+    (let ((result)
+	  ;; Assume case of tag names is irrelevant.
+	  (case-fold-search t)
+	  (opoint (point))
+	  (tag)
+	  end-point
+	  start-regexp
+	  end-regexp)
+
+      ;; Leave point at the start of the tag that point is within or that
+      ;; follows point.
+      (cond
+       ;; Point is at the start of a tag.
+       ((looking-at "<[^<> \t\n\r]"))
+       ;; Point was within a tag.
+       ((and (re-search-backward "[<>]" nil t)
+	     (looking-at "<[^<> \t\n\r]")))
+       ;; Move to following tag.
+       ((and (re-search-forward "<" nil t)
+	     (progn (backward-char 1)
+		    (looking-at "<[^<> \t\n\r]"))))
+       ;; No tag follows point.
+       (t (error "(id-select-goto-matching-tag): No tag found after point.")))
+
+      (if (catch 'done
+	    (cond
+	     ;; Beginning of a tag pair
+	     ((looking-at "<[^/][^<> \t\n\r]*")
+	      (setq tag (buffer-substring (match-beginning 0) (match-end 0))
+		    start-regexp (regexp-quote tag)
+		    end-regexp   (concat "</" (substring start-regexp 1)))
+	      ;; Skip over nested tags.
+	      (let ((count 0)
+		    (regexp (concat start-regexp "\\|" end-regexp))
+		    match-point)
+		(while (and (>= count 0)
+			    (re-search-forward regexp nil t))
+		  (setq match-point (match-beginning 0))
+		  (if (/= (char-after (1+ (match-beginning 0))) ?/)
+		      ;; Start tag
+		      (setq count (1+ count))
+		    ;; End tag
+		    (setq end-point (point))
+		    (if (or (not (re-search-forward "[<>]" nil t))
+			    (= (preceding-char) ?<))
+			;; No terminator character `>' for end tag
+			(progn (setq result end-point)
+			       (throw 'done nil)))
+		    (setq count (1- count))
+		    (if (= count 0)
+			(progn
+			  (goto-char match-point)
+			  (setq result t)
+			  (throw 'done result)))))))
+	     ;;
+	     ;; End of a tag pair
+	     ((or (looking-at "</[^> \t\n\r]+")
+		  (and (skip-chars-backward "<")
+		       (looking-at "</[^> \t\n\r]+")))
+	      (goto-char (match-end 0))
+	      (setq tag (buffer-substring (match-beginning 0) (match-end 0))
+		    end-regexp (regexp-quote tag)
+		    start-regexp   (concat "<" (substring end-regexp 2)))
+	      (setq end-point (point))
+	      (if (or (not (re-search-forward "[<>]" nil t))
+		      (= (preceding-char) ?<))
+		  ;; No terminator character `>' for end tag
+		  (progn (setq result end-point)
+			 (throw 'done nil)))
+	      ;; Skip over nested tags.
+	      (let ((count 0)
+		    (regexp (concat start-regexp "\\|" end-regexp)))
+		(while (and (>= count 0)
+			    (re-search-backward regexp nil t))
+		  (if (= (char-after (1+ (point))) ?/)
+		      ;; End tag
+		      (setq count (1+ count))
+		    ;; Start tag
+		    (setq count (1- count))
+		    (if (= count 0)
+			(progn
+			  (setq result t)
+			  (throw 'done t)))))))))
+	  nil
+	;; Didn't find matching tag.
+	(goto-char opoint))
+
+      (cond ((integerp result)
+	     (goto-char result)
+	     (error "(id-select-goto-matching-tag): Add a terminator character for this end <tag>"))
+	    ((null tag)
+	     (error "(id-select-goto-matching-tag): No <tag> following point"))
+	    ((null result)
+	     (if (interactive-p)
+		 (progn
+		   (beep)
+		   (message "(id-select-goto-matching-tag): No matching tag for %s>"
+			    tag)
+		   result)))
+	    (t result)))))
+
+;;;###autoload
+(defun id-select-and-copy-thing ()
+  "Copy the region surrounding the syntactical unit at point."
+  (interactive)
+  (let ((bounds (id-select-boundaries (point))))
+    (if bounds (copy-region-as-kill (car bounds) (cdr bounds)))))
+
+;;;###autoload
+(defun id-select-and-kill-thing ()
+  "Kill the region surrounding the syntactical unit at point."
+  (interactive "*")
+  (let ((bounds (id-select-boundaries (point))))
+    (if bounds (kill-region (car bounds) (cdr bounds)))))
+
+
+;;
+;; Functions
+;;
+
+(defun id-select-boundaries (pos)
+  "Return the (start . end) of a syntactically defined region based upon the last region selected or on position POS.
+The character at POS is selected if no other thing is matched."
+  (interactive)
+  (setq zmacs-region-stays t)
+  (setcar id-select-old-region (car id-select-region))
+  (setcdr id-select-old-region (cdr id-select-region))
+  (let ((prior-type id-select-previous))
+    (cond
+     ((eq id-select-previous 'char)
+      (id-select-syntactical-region pos))
+     ((and (car id-select-old-region)
+	   (memq id-select-previous
+		 '(sexp sexp-start sexp-end sexp-up))
+	   (id-select-sexp-up pos)
+	   (id-select-region-bigger-p id-select-old-region id-select-region))
+      id-select-region)
+     ;;
+     ;; In the general case, we can't know ahead of time what the next
+     ;; biggest type of thing to select is, so we test them all and choose
+     ;; the best fit.  This means that dynamically, the order of type
+     ;; selection will change based on the buffer context.
+     (t (let ((min-region (1+ (- (point-max) (point-min))))
+	      (result)
+	      region region-size)
+	  (mapcar
+	   (function
+	    (lambda (sym-func)
+	      (setq region
+		    (if (car (cdr sym-func))
+			(funcall (car (cdr sym-func)) pos)))
+	      (if (and region (car region)
+		       (id-select-region-bigger-p
+			id-select-old-region region)
+		       (setq region-size
+			     (- (cdr region) (car region)))
+		       (< region-size min-region))
+		  (setq min-region region-size
+			result 
+			(list;; The actual selection type is
+			 ;; sometimes different than the one we
+			 ;; originally tried, so recompute it here.
+			 (car (assq id-select-previous
+				    id-select-bigger-alist))
+			 (car region) (cdr region))))))
+	   id-select-bigger-alist)
+	  (if result
+	      ;; Returns id-select-region
+	      (progn (setq id-select-previous (car result))
+		     (id-select-set-region (nth 1 result) (nth 2 result)))
+	    ;;
+	    ;; Restore prior selection type since we failed to find a
+	    ;; new one.
+	    (setq id-select-previous prior-type)
+	    (beep)
+	    (message
+	     "(id-select-boundaries): `%s' is the largest selectable region"
+	     id-select-previous)
+	    nil))))))
+
+;;;###autoload
+(defun id-select-double-click-hook (event click-count)
+  "Select a region based on the syntax of the character wherever the mouse is double-clicked.
+If the double-click occurs at the same point as the last double-click, select
+the next larger syntactic structure.  If `id-select-display-type' is non-nil,
+the type of selection is displayed in the minibuffer."
+  (cond ((/= click-count 2)
+	 ;; Return nil so any other hooks are performed.
+	 nil)
+	(t (id-select-thing-with-mouse event))))
+
+(defun id-select-syntactical-region (pos)
+  "Return the (start . end) of a syntactically defined region based upon the buffer position POS.
+Uses `id-select-syntax-alist' and the current buffer's syntax table to
+determine syntax groups.
+
+Typically:
+ Open or close grouping character syntax marks an s-expression.
+ Double quotes mark strings.
+ The end of a line marks the line, including its trailing newline.
+ Word syntax marks the current word.
+ Symbol syntax (such as _) marks a symbol.
+ Whitespace marks a span of whitespace.
+ Comment start or end syntax marks the comment.
+ Punctuation syntax marks the words on both sides of the punctuation.
+ The fallback default is to mark the character at POS.
+
+If an error occurs during syntax scanning, it returns nil."
+  (interactive "d")
+  (setq id-select-previous 'char)
+  (if (save-excursion (goto-char pos) (eolp))
+      (id-select-line pos)
+    (let* ((syntax (char-syntax (if (eobp) (preceding-char) (char-after pos))))
+           (pair (assq syntax id-select-syntax-alist)))
+      (cond ((and pair
+		  (or id-select-whitespace
+		      (not (eq (car (cdr pair)) 'thing-whitespace))))
+             (funcall (car (cdr pair)) pos))
+            (id-select-char-p
+             (setq id-select-previous 'char)
+             (id-select-set-region pos (1+ pos)))
+            (t
+             nil)))))
+
+;;; ************************************************************************
+;;; Private functions
+;;; ************************************************************************
+
+(defun id-select-at-blank-line-or-comment ()
+  "Return non-nil if on a blank line or a comment start or end line.
+Assumes point is befor any non-whitespace character on the line."
+  (let ((comment-end-p (and (stringp comment-end)
+			    (not (string-equal comment-end "")))))
+    (if (looking-at
+	 (concat "\\s-*$\\|\\s-*\\(//\\|/\\*\\|.*\\*/"
+		 (if comment-start
+		     (concat
+		      "\\|" (regexp-quote comment-start)))
+		 (if comment-end-p
+		     (concat
+		      "\\|.*" (regexp-quote comment-end)))
+		 "\\)"))
+	(or (not (and comment-start comment-end-p))
+	    ;; Ignore start and end of comments that
+	    ;; follow non-commented text.
+	    (not (looking-at
+		  (format ".*\\S-.*%s.*%s"
+			  (regexp-quote comment-start)
+			  (regexp-quote comment-end))))))))
+
+(defun id-select-region-bigger-p (old-region new-region)
+  "Return t if OLD-REGION is smaller than NEW-REGION and NEW-REGION partially overlaps OLD-REGION, or if OLD-REGION is uninitialized."
+  (if (null (car old-region))
+      t
+    (and (> (abs (- (cdr new-region) (car new-region)))
+       (abs (- (cdr old-region) (car old-region))))
+	 ;; Ensure the two regions intersect.
+	 (or (and (<= (min (cdr new-region) (car new-region))
+		      (min (cdr old-region) (car old-region)))
+		  (>  (max (cdr new-region) (car new-region))
+		      (min (cdr old-region) (car old-region))))
+	     (and (>  (min (cdr new-region) (car new-region))
+		      (min (cdr old-region) (car old-region)))
+		  (<= (min (cdr new-region) (car new-region))
+		      (max (cdr old-region) (car old-region))))))))
+
+(defun id-select-bigger-thing ()
+  "Select a bigger object where point is."
+  (prog1
+      (id-select-thing)
+    (setq this-command 'select-thing)))
+
+(defun id-select-reset ()
+  ;; Reset syntactic selection.
+  (setq id-select-prior-point (point)
+	id-select-prior-buffer (current-buffer)
+	id-select-previous 'char)
+  (id-select-set-region nil nil))
+
+(defun id-select-set-region (beginning end)
+  "Set the cons cell held by the variable `id-select-region' to (BEGINNING . END).
+Return the updated cons cell."
+  (setcar id-select-region beginning)
+  (setcdr id-select-region end)
+  (if (and (null beginning) (null end))
+      (progn (setcar id-select-old-region nil)
+	     (setcdr id-select-old-region nil)))
+  (if (and (not (eq id-select-previous 'buffer))
+	   (integerp beginning) (integerp end)
+	   (= beginning (point-min)) (= end (point-max)))
+      ;; If we selected the whole buffer, make sure that 'thing' type is 'buffer'.
+      nil
+    id-select-region))
+
+(defun id-select-string-p (&optional start-delim end-delim)
+  "Returns (start . end) of string whose first line point is within or immediately before.
+Positions include delimiters.  String is delimited by double quotes unless
+optional START-DELIM and END-DELIM (strings) are given.
+Returns nil if not within a string."
+  (let ((opoint (point))
+	(count 0)
+	bol start delim-regexp start-regexp end-regexp)
+    (or start-delim (setq start-delim "\""))
+    (or end-delim (setq end-delim "\""))
+    ;; Special case for the empty string.
+    (if (looking-at (concat (regexp-quote start-delim)
+			    (regexp-quote end-delim)))
+	(id-select-set-region (point) (match-end 0))
+      (setq start-regexp (concat "\\(^\\|[^\\]\\)\\("
+				 (regexp-quote start-delim) "\\)")
+	    end-regexp   (concat "[^\\]\\(" (regexp-quote end-delim) "\\)")
+	    delim-regexp (concat start-regexp "\\|" end-regexp))
+      (save-excursion
+	(beginning-of-line)
+	(setq bol (point))
+	(while (re-search-forward delim-regexp opoint t)
+	  (setq count (1+ count))
+	  ;; This is so we don't miss the closing delimiter of an empty
+	  ;; string.
+	  (if (and (= (point) (1+ bol))
+		   (looking-at (regexp-quote end-delim)))
+	      (setq count (1+ count))
+	    (if (bobp) nil (backward-char 1))))
+	(goto-char opoint)
+	;; If found an even # of starting and ending delimiters before
+	;; opoint, then opoint is at the start of a string, where we want it.
+	(if (zerop (mod count 2))
+	    (if (bobp) nil (backward-char 1))
+	  (re-search-backward start-regexp nil t))
+	;; Point is now before the start of the string.
+	(if (re-search-forward start-regexp nil t)
+	    (progn
+	      (setq start (match-beginning 2))
+	      (if (re-search-forward end-regexp nil t)
+		  (id-select-set-region start (point)))))))))
+
+;;;
+;;; Code selections
+;;;
+
+(defun id-select-brace-def-or-declaration (pos)
+  "If POS is at the first character, opening brace or closing brace of a brace delimited language definition, return (start . end) region, else nil.
+The major mode for each supported brace language must be included in the
+list, id-select-brace-modes."
+  (interactive)
+  (if (not (and (featurep 'cc-mode) (memq major-mode id-select-brace-modes)))
+      nil
+    (save-excursion
+      (goto-char pos)
+      (let ((at-def-brace
+	     (or (looking-at "^{") (looking-at "^}")
+		 ;; Handle stupid old C-style and new Java
+		 ;; style of putting braces at the end of
+		 ;; lines.
+		 (and (= (following-char) ?{)
+		      (stringp defun-prompt-regexp)
+		      (save-excursion
+			(beginning-of-line)
+			(looking-at defun-prompt-regexp)))
+		 (and (= (following-char) ?})
+		      (stringp defun-prompt-regexp)
+		      (condition-case ()
+			  (progn
+			    ;; Leave point at opening brace.
+			    (goto-char
+			     (scan-sexps (1+ (point)) -1))
+			    ;; Test if these are defun braces.
+			    (save-excursion
+			      (beginning-of-line)
+			      (looking-at defun-prompt-regexp)))
+			(error nil)))))
+	    eod)
+	(if (or at-def-brace
+		;; At the start of a definition:
+		;; Must be at the first non-whitespace character in the line.
+		(and (= (point) (save-excursion (back-to-indentation) (point)))
+		     ;; Must be on an alpha or symbol-constituent character.
+		     ;; Also allow ~ for C++ destructors. 
+		     (looking-at "[a-zA-z~]\\|\\s_")
+		     ;; Previous line, if any,  must be blank or a comment
+		     ;; start or end or `defun-prompt-regexp' must be defined
+		     ;; for this mode.
+		     (or (stringp defun-prompt-regexp)
+			 (save-excursion
+			   (if (/= (forward-line -1) 0)
+			       t
+			     (id-select-at-blank-line-or-comment))))))
+	    (progn
+	      (setq id-select-previous 'brace-def-or-declaration)
+	      ;; Handle declarations and definitions embedded within classes.
+	      (if (and (= (following-char) ?{)
+		       (/= (point) (save-excursion (back-to-indentation) (point))))
+		  (setq at-def-brace nil))
+	      ;;
+	      (if at-def-brace nil (beginning-of-line))
+	      (if (and (not at-def-brace)
+		       (stringp defun-prompt-regexp)
+		       (looking-at defun-prompt-regexp))
+		  ;; Mark the declaration or definition
+		  (id-select-set-region
+		   (point)
+		   (progn (goto-char (match-end 0))
+			  (if (= (following-char) ?{)
+			      (forward-list 1)
+			    (search-forward ";" nil t))
+			  (skip-chars-forward " \t")
+			  (skip-chars-forward "\n")
+			  (if (looking-at "^\\s-*$")
+			      (forward-line 1))
+			  (point)))
+		;; Mark function definitions only
+		(setq eod (save-excursion
+			    (condition-case ()
+				(progn
+				  (end-of-defun)
+				  (if (looking-at "^\\s-*$")
+				      (forward-line 1))
+				  (point))
+			      (error (point-max)))))
+		(if (= (following-char) ?})
+		    ;; Leave point at opening brace.
+		    (goto-char (scan-sexps (1+ (point)) -1)))
+		(if (= (following-char) ?{)
+		    (progn
+		      (while (and (zerop (forward-line -1))
+				  (not (id-select-at-blank-line-or-comment))))
+		      (if (id-select-at-blank-line-or-comment)
+			  (forward-line 1))))
+		;; Mark the whole definition
+		(setq id-select-previous 'brace-def-or-declaration)
+		(id-select-set-region (point) eod))))))))
+
+(defun id-select-indent-def (pos)
+  "If POS is at the first alpha character on a line, return (start . end) region,
+
+The major mode for each supported indented language must be included in the
+list, id-select-indent-modes."
+  (interactive)
+  (if (not (memq major-mode id-select-indent-modes))
+      nil
+    (save-excursion
+      (goto-char pos)
+      (if (and 
+	   ;; Use this function only if point is on the first non-blank
+	   ;; character of a block, whatever a block is for the current
+	   ;; mode.
+	   (cond ((eq major-mode 'kotl-mode)
+		  (and (looking-at "[1-9*]") (not (kview:valid-position-p))))
+		 ((or (eq major-mode 'outline-mode) selective-display)
+		  (save-excursion (beginning-of-line)
+				  (looking-at outline-regexp)))
+		 ;; After indent in any other mode, must be on an alpha 
+		 ;; or symbol-constituent character.
+		 (t (looking-at "[a-zA-z]\\|\\s_")))
+	   ;; Must be at the first non-whitespace character in the line.
+	   (= (point) (save-excursion (back-to-indentation) (point))))
+	  (let* ((start-col (current-column))
+		 (opoint (if (eq major-mode 'kotl-mode)
+			     (progn (kotl-mode:to-valid-position) (point))
+			   (beginning-of-line) (point))))
+	    (while
+		(and (zerop (forward-line 1))
+		     (bolp)
+		     (or (progn (back-to-indentation)
+				(> (current-column) start-col))
+			 ;; If in a text mode, allow outdenting, otherwise
+			 ;; only include special lines here indented to the
+			 ;; same point as the original line.
+			 (and (or (memq major-mode id-select-text-modes)
+				  (= (current-column) start-col))
+			      (looking-at
+			       (or (car (cdr
+					 (assq
+					  major-mode
+					  id-select-indent-non-end-regexp-alist)))
+				   "\\'"))))))
+	    (if (and (looking-at
+		      (or (car (cdr (assq major-mode
+					  id-select-indent-end-regexp-alist)))
+			  "\\'"))
+		     (or (memq major-mode id-select-text-modes)
+			 (= (current-column) start-col)))
+		(forward-line 1))
+	    (beginning-of-line)
+	    ;; Mark the whole definition
+	    (setq id-select-previous 'indent-def)
+	    (id-select-set-region opoint (point)))))))
+
+(defun id-select-symbol (pos)
+  "Return (start . end) of a symbol at POS."
+  (or (id-select-markup-pair pos)
+      ;; Test for indented def here since might be on an '*' representing
+      ;; an outline entry, in which case we mark entries as indented blocks.
+      (id-select-indent-def pos)
+      (save-excursion
+	(if (memq (char-syntax (if (eobp) (preceding-char) (char-after pos)))
+		  '(?w ?_))
+	    (progn (setq id-select-previous 'symbol)
+		   (condition-case ()
+		       (let ((end (scan-sexps pos 1)))
+			 (id-select-set-region
+			  (min pos (scan-sexps end -1)) end))
+		     (error nil)))))))
+
+(defun id-select-sexp-start (pos)
+  "Return (start . end) of sexp starting at POS."
+  (or (id-select-markup-pair pos)
+      (id-select-brace-def-or-declaration pos)
+      (save-excursion
+	(setq id-select-previous 'sexp-start)
+	(condition-case ()
+	    (id-select-set-region pos (scan-sexps pos 1))
+	  (error nil)))))
+
+(defun id-select-sexp-end (pos)
+  "Return (start . end) of sexp ending at POS."
+  (or (id-select-brace-def-or-declaration pos)
+      (save-excursion
+	(setq id-select-previous 'sexp-end)
+	(condition-case ()
+	    (id-select-set-region (scan-sexps (1+ pos) -1) (1+ pos))
+	  (error nil)))))
+
+(defun id-select-sexp (pos)
+  "Return (start . end) of the sexp that POS is within."
+  (setq id-select-previous 'sexp)
+  (save-excursion 
+    (goto-char pos)
+    (condition-case ()
+	(id-select-set-region (progn (backward-up-list 1) (point))
+			      (progn (forward-list 1) (point)))
+      (error nil))))
+
+(defun id-select-sexp-up (pos)
+  "Return (start . end) of the sexp enclosing the selected area or nil."
+  (setq id-select-previous 'sexp-up)
+  ;; Keep going up and backward in sexps.  This means that id-select-sexp-up
+  ;; can only be called after id-select-sexp or after itself.
+  (setq pos (or (car id-select-region) pos))
+  (save-excursion 
+    (goto-char pos)
+    (condition-case ()
+	(id-select-set-region (progn (backward-up-list 1) (point))
+			      (progn (forward-list 1) (point)))
+      (error nil))))
+
+(defun id-select-preprocessor-def (pos)
+  "Return (start . end) of a preprocessor #definition starting at POS, if any.
+The major mode for each language that uses # preprocessor notation must be
+included in the list, id-select-brace-modes."
+  ;; Only applies in brace modes (strictly, this should apply in a subset
+  ;; of brace modes, but doing it this way permits for configurability.  In
+  ;; other modes, one doesn't have to use the function on a # symbol.
+  (if (not (memq major-mode id-select-brace-modes))
+      nil
+    (setq id-select-previous 'preprocessor-def)
+    (save-excursion
+      (goto-char pos)
+      (if (and (= (following-char) ?#)
+	       ;; Must be at the first non-whitespace character in the line.
+	       (= (point) (save-excursion (back-to-indentation) (point))))
+	  (progn
+	    ;; Skip past continuation lines that end with a backslash.
+	    (while (and (looking-at ".*\\\\\\s-*$")
+			(zerop (forward-line 1))))
+	    (forward-line 1)
+	    ;; Include one trailing blank line, if any.
+	    (if (looking-at "^[ \t\n\r]*$") (forward-line 1))
+	    (id-select-set-region pos (point)))))))
+
+;; Allow punctuation marks not followed by white-space to include
+;; the previous and subsequent sexpression.  Useful in contexts such as
+;; 'foo.bar'.
+(defun id-select-punctuation (pos)
+  "Return (start . end) region including sexpressions before and after POS, when at a punctuation character."
+  (or (id-select-comment pos)
+      (id-select-preprocessor-def pos)
+      (id-select-brace-def-or-declaration pos) ;; Might be on a C++ ;; destructor ~.
+      (save-excursion
+	(setq id-select-previous 'punctuation)
+	(goto-char (min (1+ pos) (point-max)))
+	(if (= (char-syntax (if (eobp) (preceding-char) (char-after (point))))
+	       ?\ )
+	    (id-select-set-region pos (1+ pos))
+	  (goto-char pos)
+	  (id-select-set-region
+	   (save-excursion (backward-sexp) (point))
+	   (progn (forward-sexp) (point)))))))
+
+(defun id-select-comment (pos)
+  "Return rest of line from POS to newline."
+  (setq id-select-previous 'comment)
+  (save-excursion
+    (goto-char pos)
+    (let ((start-regexp  (if (stringp comment-start)
+			     (regexp-quote comment-start)))
+	  (end-regexp    (if (stringp comment-end)
+			     (regexp-quote comment-end)))
+	  bolp)
+      (cond
+       ;; Beginning of a comment
+       ((and (stringp comment-start)
+	     (or (looking-at start-regexp)
+		 (and (skip-chars-backward comment-start)
+		      (looking-at start-regexp))))
+	(skip-chars-backward " \t")
+	(setq bolp (bolp)
+	      pos (point))
+	(if (equal comment-end "")
+	    (progn (end-of-line)
+		   (id-select-set-region pos (point)))
+	  (if (stringp comment-end)
+	      ;; Skip over nested comments.
+	      (let ((count 0)
+		    (regexp (concat start-regexp "\\|" end-regexp)))
+		(catch 'done
+		  (while (re-search-forward regexp nil t)
+		    (if (string-equal
+			 (buffer-substring (match-beginning 0) (match-end 0))
+			 comment-start)
+			(setq count (1+ count))
+		      ;; End comment
+		      (setq count (1- count))
+		      (if (= count 0)
+			  (progn
+			    (if (looking-at "[ \t]*[\n\r]")
+				;; Don't include final newline unless the
+				;; comment is first thing on its line.
+				(goto-char (if bolp (match-end 0)
+					     (1- (match-end 0)))))
+			    (throw 'done (id-select-set-region
+					  pos (point))))))))))))
+       ;; End of a comment
+       ((and (stringp comment-end)
+	     (not (string-equal comment-end ""))
+	     (or (looking-at end-regexp)
+		 (and (skip-chars-backward comment-end)
+		      (looking-at end-regexp))))
+	(goto-char (match-end 0))
+	(if (looking-at "[ \t]*[\n\r]")
+	    (goto-char (match-end 0)))
+	(setq pos (point))
+	(skip-chars-forward " \t")
+	;; Skip over nested comments.
+	(let ((count 0)
+	      (regexp (concat start-regexp "\\|" end-regexp)))
+	  (catch 'done
+	    (while (re-search-backward regexp nil t)
+	      (if (string-equal
+		   (buffer-substring (match-beginning 0) (match-end 0))
+		   comment-end)
+		  (setq count (1+ count))
+		;; Begin comment
+		(setq count (1- count))
+		(if (= count 0)
+		    (progn
+		      (skip-chars-backward " \t")
+		      ;; Don't include final newline unless the comment is
+		      ;; first thing on its line.
+		      (if (bolp) nil (setq pos (1- pos)))
+		      (throw 'done (id-select-set-region
+				    (point) pos)))))))))))))
+
+;;;
+;;; Textual selections
+;;;
+
+(defun id-select-word (pos)
+  "Return (start . end) of word at POS."
+  (or (id-select-brace-def-or-declaration pos)
+      (id-select-indent-def pos)
+      (progn (setq id-select-previous 'word)
+	     (save-excursion
+	       (goto-char pos)
+	       (forward-word 1)
+	       (let ((end (point)))
+		 (forward-word -1)
+		 (id-select-set-region (point) end))))))
+
+(defun id-select-string (pos)
+  "Returns (start . end) of string at POS or nil.  Pos include delimiters.
+Delimiters may be single, double or open and close quotes."
+  (setq id-select-previous 'string)
+  (save-excursion
+    (goto-char pos)
+    (if (and (memq major-mode id-select-markup-modes)
+	     (/= (following-char) ?\")
+	     (save-excursion
+	       (and (re-search-backward "[<>]" nil t)
+		    (= (following-char) ?>))))
+	(progn (setq id-select-previous 'text)
+	       (search-backward ">" nil t)
+	       (id-select-set-region
+		(1+ (point))
+		(progn (if (search-forward "<" nil 'end)
+			   (1- (point))
+			 (point)))))
+      (or (id-select-string-p) (id-select-string-p "'" "'")
+	  (id-select-string-p "`" "'")))))
+
+(defun id-select-sentence (pos)
+  "Return (start . end) of the sentence at POS."
+  (setq id-select-previous 'sentence)
+  (save-excursion 
+    (goto-char pos)
+    (condition-case ()
+	(id-select-set-region (progn (backward-sentence) (point))
+			      (progn (forward-sentence) (point)))
+      (error nil))))
+
+(defun id-select-whitespace (pos)
+  "Return (start . end) of all but one char of whitespace POS, unless 
+there is only one character of whitespace or this is leading whitespace on
+the line.  Then return all of it."
+  (setq id-select-previous 'whitespace)
+  (save-excursion
+    (goto-char pos)
+    (if (= (following-char) ?\^L)
+	(id-select-page pos)
+      (let ((end (progn (skip-chars-forward " \t") (point)))
+	    (start (progn (skip-chars-backward " \t") (point))))
+	(if (looking-at "[ \t]")
+	    (if (or (bolp) (= (1+ start) end))
+		(id-select-set-region start end)
+	      (id-select-set-region (1+ start) end)))))))
+
+(defun id-select-markup-pair (pos)
+  "Return (start . end) of region between the opening and closing of an HTML or SGML tag pair, one of which is at POS.
+The major mode for each language that uses such tags must be included in the
+list, id-select-markup-modes."
+  (if (not (memq major-mode id-select-markup-modes))
+      nil
+    (setq id-select-previous 'markup-pair)
+    (let ((pos-with-space)
+	  ;; Assume case of tag names is irrelevant.
+	  (case-fold-search t)
+	  (result)
+	  start-regexp
+	  end-regexp
+	  bolp
+	  opoint)
+      (save-excursion
+	(catch 'done
+	  (goto-char pos)
+	  (cond
+	   ;; Beginning of a tag pair
+	   ((looking-at "<[^/][^<> \t\n\r]*")
+	    (setq start-regexp (regexp-quote (buffer-substring
+					      (match-beginning 0) (match-end 0)))
+		  end-regexp   (concat "</" (substring start-regexp 1)))
+	    (setq pos (point))
+	    (skip-chars-backward " \t")
+	    (setq bolp (bolp)
+		  pos-with-space (point))
+	    ;; Skip over nested tags.
+	    (let ((count 0)
+		  (regexp (concat start-regexp "\\|" end-regexp)))
+	      (while (and (>= count 0)
+			  (re-search-forward regexp nil t))
+		(if (/= (char-after (1+ (match-beginning 0))) ?/)
+		    ;; Start tag
+		    (setq count (1+ count))
+		  ;; Move past end tag terminator
+		  (setq opoint (point))
+		  (if (or (not (re-search-forward "[<>]" nil t))
+			  (= (preceding-char) ?<))
+		      (progn (setq result opoint)
+			     (throw 'done nil)))
+		  (setq count (1- count))
+		  (if (= count 0)
+		      (progn
+			(if (looking-at "[ \t]*[\n\r]")
+			    ;; Don't include final newline unless the
+			    ;; start tag was the first thing on its line.
+			    (if bolp
+				(progn (goto-char (match-end 0))
+				       ;; Include leading space since the
+				       ;; start and end tags begin and end
+				       ;; lines.
+				       (setq pos pos-with-space))
+			      (goto-char (1- (match-end 0)))))
+			(setq result (id-select-set-region pos (point)))
+			(throw 'done nil)))))))
+	   ;;
+	   ;; End of a tag pair
+	   ((or (looking-at "</[^> \t\n\r]+")
+		(and (skip-chars-backward "<")
+		     (looking-at "</[^> \t\n\r]+")))
+	    (goto-char (match-end 0))
+	    (setq end-regexp (regexp-quote (buffer-substring
+					    (match-beginning 0) (match-end 0)))
+		  start-regexp   (concat "<" (substring end-regexp 2)))
+	    (setq opoint (point))
+	    (if (or (not (re-search-forward "[<>]" nil t))
+		    (= (preceding-char) ?<))
+		(progn (setq result opoint)
+		       (throw 'done nil)))
+	    (setq pos (point))
+	    (if (looking-at "[ \t]*[\n\r]")
+		(setq pos-with-space (match-end 0)))
+	    ;; Skip over nested tags.
+	    (let ((count 0)
+		  (regexp (concat start-regexp "\\|" end-regexp)))
+	      (while (and (>= count 0)
+			  (re-search-backward regexp nil t))
+		(if (= (char-after (1+ (point))) ?/)
+		    ;; End tag
+		    (setq count (1+ count))
+		  ;; Start tag
+		  (setq count (1- count))
+		  (if (= count 0)
+		      (progn
+			(if pos-with-space
+			    ;; Newline found after original end tag.
+			    (progn 
+			      (skip-chars-backward " \t")
+			      (if (bolp)
+				  ;; Don't include final newline unless the
+				  ;; start tag is the first thing on its line.
+				  (setq pos pos-with-space)
+				(setq pos (1- pos-with-space))
+				;; Don't include non-leading space.
+				(skip-chars-forward " \t"))))
+			(setq result (id-select-set-region (point) pos))
+			(throw 'done nil))))))))))
+      (if (integerp result)
+	  (progn (goto-char result)
+		 (error "(id-select-markup-pair): Add a terminator character for this end tag"))
+	result))))
+
+;;;
+;;; Document selections
+;;;
+
+(defun id-select-line (pos)
+  "Return (start . end) of the whole line POS is in, with newline unless at end of buffer."
+  (setq id-select-previous 'line)
+  (save-excursion
+    (goto-char pos)
+    (let* ((start (progn (beginning-of-line 1) (point)))
+	   (end (progn (forward-line 1) (point))))
+      (id-select-set-region start end))))
+
+(defun id-select-paragraph (pos)
+  "Return (start . end) of the paragraph at POS."
+  (setq id-select-previous 'paragraph)
+  (save-excursion 
+    (goto-char pos)
+    (id-select-set-region (progn (backward-paragraph) (point))
+			  (progn (forward-paragraph) (point)))))
+
+(defun id-select-page (pos)
+  "Return (start . end) of the page preceding POS."
+  (setq id-select-previous 'page)
+  (save-excursion 
+    (goto-char pos)
+    (id-select-set-region (progn (backward-page) (point))
+			  (progn (forward-page) (point)))))
+
+(defun id-select-buffer (pos)
+  "Return (start . end) of the buffer at POS."
+  (setq id-select-previous 'buffer)
+  (id-select-set-region (point-min) (point-max)))
+
+;;; ************************************************************************
+;;; Private variables
+;;; ************************************************************************
+
+(defvar id-select-bigger-alist
+  '((char nil)
+    (whitespace id-select-whitespace)
+    (word id-select-word)
+    (symbol id-select-symbol)
+    (punctuation nil)
+    (string id-select-string)
+    (text nil)
+    (comment id-select-comment)
+    (markup-pair nil)
+    (preprocessor-def nil)
+    (sexp id-select-sexp)
+    (sexp-start nil)
+    (sexp-end nil)
+    (sexp-up id-select-sexp-up)
+    (line id-select-line)
+    (sentence id-select-sentence)
+    (brace-def-or-declaration id-select-brace-def-or-declaration)
+    (indent-def id-select-indent-def)
+    (paragraph id-select-paragraph)
+    (page id-select-page)
+    (buffer id-select-buffer)
+    )
+  "List of (REGION-TYPE-SYMBOL REGION-SELECTION-FUNCTION) pairs.
+Used to go from one thing to a bigger thing.  See id-select-bigger-thing.
+Nil value for REGION-SELECTION-FUNCTION means that region type is skipped
+over when trying to grow the region and is only used when a selection is made
+with point on a character that triggers that type of selection.  Ordering of
+entries is largely irrelevant to any code that uses this list.")
+
+
+(defvar id-select-prior-buffer nil)
+(defvar id-select-prior-point nil)
+
+(defvar id-select-previous 'char
+  "Most recent type of selection.  Must be set by all id-select functions.")
+
+(defvar id-select-region (cons 'nil 'nil)
+  "Cons cell that contains a region (<beginning> . <end>).
+The function `id-select-set-region' updates and returns it.")
+
+(defvar id-select-old-region (cons 'nil 'nil)
+  "Cons cell that contains a region (<beginning> . <end>).")
+
+(defvar id-select-syntax-alist
+  '((?w  id-select-word)
+    (?_  id-select-symbol)
+    (?\" id-select-string)
+    (?\( id-select-sexp-start)
+    (?\$ id-select-sexp-start)
+    (?'  id-select-sexp-start)
+    (?\) id-select-sexp-end)
+    (?   id-select-whitespace)
+    (?<  id-select-comment)
+    (?.  id-select-punctuation))
+  "*List of pairs of the form (SYNTAX-CHAR FUNCTION) used by the function `id-select-syntactical-region'.
+Each FUNCTION takes a single position argument and returns a region
+(start . end) delineating the boundaries of the thing at that position.
+Ordering of entries is largely irrelevant to any code that uses this list.")
+
+
+(provide 'id-select)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/pretty-print.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,564 @@
+;;   -*- Syntax: Emacs-Lisp; Mode: emacs-lisp -*-
+;; 
+;; Emacs Lisp pretty printer and macro expander
+;; 
+;; Copyright (C) 1992,1993 Guido Bosch <Guido.Bosch@loria.fr>
+
+;; This file is written in GNU Emacs Lisp, but is not part of GNU Emacs.
+
+;; The software contained in this file is free software; you can
+;; redistribute it and/or modify it under the terms of the GNU General
+;; Public License as published by the Free Software Foundation; either
+;; version 2, or (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; 
+;; Please send bugs and comments to the author.
+;;
+;; <DISCLAIMER>
+;; This program is still under development.  Neither the author nor
+;; CRIN-INRIA accepts responsibility to anyone for the consequences of
+;; using it or for whether it serves any particular purpose or works
+;; at all.
+;; 
+;; The package has been developed under Lucid Emacs 19, but also runs
+;; on Emacs 18, if it is compiled with the version 19 byte compiler
+;; (function `compiled-function-p' lacking).
+;;
+
+;; Installation and Usage
+;; ----------------------
+;;
+;; This package provides an Emacs Lisp sexpression pretty printer and
+;; macroexpander.  To install it, put the following line in your .emacs,
+;; default.el or site-init.el/site-run.el (for Lucid Emacs): 
+;; (require 'pp)
+;; 
+;; The package can also be made autoloadable, with the following entry 
+;; points: 
+;; (autoload 'pp-function "pp" nil t)
+;; (autoload 'pp-variable "pp" nil t)
+;; (autoload 'pp-plist     "pp" nil t)
+;; (autoload 'macroexpand-sexp "pp" nil t)
+;; (autoload 'macroexpand-all-sexp "pp" nil t)
+;; (autoload 'prettyexpand-sexp "pp" nil t)
+;; (autoload 'prettyexpand-all-sexp "pp" nil t)
+;;
+;;(define-key emacs-lisp-mode-map '(control meta m) 'macroexpand-sexp)
+;;(define-key emacs-lisp-mode-map '(control meta M) 'macroexpand-all-sexp)
+;;(define-key emacs-lisp-mode-map '(control symbol m) 'prettyexpand-sexp)
+;;(define-key emacs-lisp-mode-map '(control symbol M) 'prettyexpand-all-sexp)
+;;
+;;(define-key lisp-interaction-mode-map '(control meta m) 'macroexpand-sexp)
+;;(define-key lisp-interaction-mode-map '(control meta M) 'macroexpand-all-sexp)
+;;(define-key lisp-interaction-mode-map '(control symbol m) 'prettyexpand-sexp)
+;;(define-key lisp-interaction-mode-map '(control symbol M) 'prettyexpand-all-sexp)
+;;
+
+;; Pretty printing of the different cells of a symbol is done with the
+;; commands:
+;;
+;; 		M-x pp-function
+;; 		M-x pp-variable
+;;		M-x pp-plist
+;;
+;; They print a symbol's function definition, variable value and
+;; property list, respectively.  These commands pop up a separate
+;; window in which the pretty printed lisp object is displayed.
+;; Completion for function and variable symbols is provided. If a
+;; function is byte compiled, `pp-function' proposes to call the Emacs
+;; Lisp disassembler (this feature only works for Emacs 19, as it
+;; needs the `compiled-function-p' predicate).
+;;
+;; To use the macro expander, put the cursor at the beginning of the
+;; form to be expanded, then type
+;;
+;; 	        C-M-m 		(macroexpand-sexp)
+;; or		C-M-Sh-M  	(macroexpand-all-sexp)
+;; 
+;; Both commands will pop up a temporary window containing the
+;; macroexpanded code. The only difference is that the second command
+;; expands recursively all containing macro calls, while the first one
+;; does it only for the uppermost sexpression.  
+;; 	With a prefix argument, the macro expansion isn't displayed in a
+;; separate buffer but replaces the original code in the current
+;; buffer. Be aware: Comments will be lost.
+;; 	You can get back the original sexpression using the `undo'
+;; 	command on `C-x u'.
+;;
+;; There is also a prettyfied version of the macroexpander:
+;;
+;;		C-Sym-m		(prettyexpand-sexp)
+;; or		C-Sym-M		(prettyexpand-all-sexp)
+;; 
+;; The only difference with the corresponding macroexpand commands is 
+;; that calls to macros specified in the variable
+;; `pp-shadow-expansion-list' are not expanded, in order to make the
+;; code look nicer. This is only useful for Lucid Emacs or code that
+;; uses Dave Gillespies cl package, as it inhibits expansion of the
+;; following macros: block, eval-when, defun*, defmacro*, function*,
+;; setf.
+
+; Change History
+; 
+; $Log: pretty-print.el,v $
+; Revision 1.1.1.1  1996/12/18 22:51:29  steve
+; XEmacs 20.0 -- Beta 31
+;
+; Revision 1.4  1993/03/25  14:09:52  bosch
+; Commands `prettyexpand-sexp' and `prettyexpand-all-sexp' and
+; corresponding key bindings added.  Commands pp-{function, variable}
+; rewritten. `pp-plist' added. Function `pp-internal-loop' (for Dave
+; Gillespies CL loop macro) added.
+;
+; Revision 1.3  1993/03/03  12:24:13  bosch
+; Macroexpander rewritten. Function `pp-macroexpand-all' added (snarfed
+; from Dave Gillespies cl-extra.el). Pretty printing for top level
+; defining forms added (`pp-internal-def'). Key bindings for
+; `emacs-lisp-mode-map' and `lisp-interaction-mode-map' added.  Built-in
+; variable `print-gensym' set for printinng uninterned symbols. Started
+; adding support for cl-dg (defun*, defmacro*, ...).  Minor bug fixes.
+;
+; Revision 1.2  1993/02/25  17:35:02  bosch
+; Comments about Emacs 18 compatibility added.
+;
+; Revision 1.1  1993/02/25  16:55:01  bosch
+; Initial revision
+;
+;
+
+
+;; TO DO LIST
+;; ----------
+;; Provide full Emacs 18 compatibility.
+
+;; Popper support
+(defvar pp-buffer-name "*Pretty Print*")
+(defvar pp-macroexpand-buffer-name "*Macro Expansion*")
+(if (featurep 'popper)
+    (or (eq popper-pop-buffers 't)
+	(setq popper-pop-buffers 
+	      (cons pp-buffer-name 
+		    (cons pp-macroexpand-buffer-name 
+			  popper-pop-buffers)))))
+
+;; User level functions
+;;;###autoload
+(defun pp-function (symbol)
+  "Pretty print the function definition of SYMBOL in a seperate buffer"
+  (interactive 
+   (list (pp-read-symbol 'fboundp "Pretty print function definition of: ")))
+  (if (compiled-function-p (symbol-function symbol))
+      (if (y-or-n-p 
+	   (format "Function %s is byte compiled. Disassemble? " symbol))
+	  (disassemble (symbol-function symbol))
+	(pp-symbol-cell symbol 'symbol-function))
+    (pp-symbol-cell symbol 'symbol-function)))
+
+;;;###autoload
+(defun pp-variable (symbol)
+  "Pretty print the variable value of SYMBOL in a seperate buffer"
+  (interactive
+   (list (pp-read-symbol 'boundp "Pretty print variable value of: ")))
+  (pp-symbol-cell symbol 'symbol-value))
+
+;;;###autoload
+(defun pp-plist (symbol)
+  "Pretty print the property list of SYMBOL in a seperate buffer"
+  (interactive
+   (list (pp-read-symbol 'symbol-plist "Pretty print property list of: ")))
+  (pp-symbol-cell symbol 'symbol-plist))
+
+(defun pp-read-symbol (predicate prompt)
+  "Read a symbol for which  PREDICATE is true, promptiong with PROMPT."
+  (let (symbol)
+    (while (or (not symbol) (not (funcall predicate symbol)))
+      (setq symbol 
+	    (intern-soft 
+	     (completing-read
+	      prompt
+	      obarray
+	      predicate
+	      t
+	      (and symbol (symbol-name symbol))))))
+    symbol))
+
+(defun pp-symbol-cell (symbol accessor)  
+  "Pretty print the contents of the cell of SYMBOL that can be reached
+with the function ACCESSOR."
+  (with-output-to-temp-buffer pp-buffer-name
+    (set-buffer pp-buffer-name)
+    (emacs-lisp-mode)
+    (erase-buffer)
+    (pp-internal 
+     (funcall accessor symbol) 
+     (format "%s's %s is:\n" symbol accessor))
+    (terpri)))
+
+
+  
+;; Macro expansion (user level)
+
+;;;###autoload
+(defun macroexpand-sexp (&optional replace)
+  "Macro expand the sexpression following point. Pretty print expansion in a
+temporary buffer. With prefix argument, replace the original
+sexpression by its expansion in the current buffer."
+  (interactive "P")
+  (pp-macroexpand-internal 'macroexpand replace t))
+
+;;;###autoload
+(defun macroexpand-all-sexp (&optional replace)
+  "Macro expand recursively the sexpression following point. Pretty print
+expansion in a temporary buffer. With prefix argument, replace the
+original sexpression by its expansion in the current buffer."
+  (interactive "P")
+  (pp-macroexpand-internal 'pp-macroexpand-all replace t))
+
+;;;###autoload
+(defun prettyexpand-sexp (&optional replace)
+  "Macro expand the sexpression following point. Pretty print expansion
+in a temporary buffer. With prefix argument, replace the original
+sexpression by its expansion in the current buffer.  
+	However, calls to macros specified in the variable
+`pp-shadow-expansion-list' are not expanded, in order to make the code
+look nicer."
+
+  (interactive "P")
+  (pp-macroexpand-internal 'macroexpand replace))
+
+;;;###autoload
+(defun prettyexpand-all-sexp (&optional replace)
+  "Macro expand recursively the sexpression following point. Pretty print
+expansion in a temporary buffer. With prefix argument, replace the
+original sexpression by its expansion in the current buffer.
+	However, calls to macros specified in the variable
+`pp-shadow-expansion-list' are not expanded, in order to make the code
+look nicer."
+  (interactive "P")
+  (pp-macroexpand-internal 'pp-macroexpand-all replace))
+
+(define-key emacs-lisp-mode-map '(control meta m) 'macroexpand-sexp)
+(define-key emacs-lisp-mode-map '(control meta M) 'macroexpand-all-sexp)
+(define-key emacs-lisp-mode-map '(control symbol m) 'prettyexpand-sexp)
+(define-key emacs-lisp-mode-map '(control symbol M) 'prettyexpand-all-sexp)
+
+(define-key lisp-interaction-mode-map '(control meta m) 'macroexpand-sexp)
+(define-key lisp-interaction-mode-map '(control meta M) 'macroexpand-all-sexp)
+(define-key lisp-interaction-mode-map '(control symbol m) 'prettyexpand-sexp)
+(define-key lisp-interaction-mode-map '(control symbol M) 'prettyexpand-all-sexp)
+
+
+;; Macro expansion (internals)
+
+(defvar pp-shadow-expansion-list
+  (mapcar 'list '(block eval-when defun* defmacro* function* setf))
+  "The value of this variable is given as the optional environment
+argument of the macroexpand functions. Forms specified in this list are
+not expanded.")
+
+(defun pp-macroexpand-internal 
+  (macroexpand-function replace &optional dont-shadow)
+  "Macro expand the sexp that starts at point, using
+MACROEXPAND-FUNCTION.  If REPLACE is non-nil, replace the original
+text by its expansion, otherwise pretty print the expansion in a
+temporary buffer. With optional argument DONT-SHADOW non-nil, do not
+use the `pp-shadow-expansion-list' to inhibit expansion of some
+forms."
+
+  (interactive)
+  (let ((expansion
+	 (funcall 
+	  macroexpand-function
+	  (let ((stab (syntax-table)))
+	    (unwind-protect
+		(save-excursion
+		  (set-syntax-table emacs-lisp-mode-syntax-table)
+		  ;; (forward-sexp 1)
+		  (read (current-buffer)))
+	      (set-syntax-table stab)))
+	  (if dont-shadow 
+	      nil
+	    pp-shadow-expansion-list))))
+    (save-excursion
+      (if replace 
+	  (let ((start (point))
+		(end (progn (forward-sexp 1) (point))))
+	    (delete-region start end)
+	    (pp-internal expansion))
+	(with-output-to-temp-buffer pp-macroexpand-buffer-name
+	  (set-buffer pp-macroexpand-buffer-name)
+	  (erase-buffer)
+	  (emacs-lisp-mode)
+	  (pp-internal expansion))))))
+
+;; Internal pretty print functions
+
+(defun pp-internal (form &optional title)
+  "Pretty print FORM in in the current buffer.
+Optional string TITEL is inserted before the pretty  print."
+  (let (start)
+    (if title (princ title))
+    (setq start (point))
+    ;; print-escape-newlines must be t, otherwise we cannot use
+    ;; (current-column) to detect good line breaks
+    (let ((print-escape-newlines t)
+	  (print-gensym t)
+	  )
+      (prin1 form (current-buffer))
+      (goto-char start)
+      (pp-internal-sexp))))
+
+(defun pp-internal-sexp ()
+  "Pretty print the following sexp. 
+Point must be on or before the first character."
+
+  (skip-chars-forward " \n\t")
+  (let* ((char (following-char))
+	 (ch-class (char-syntax char))
+	 (start (point)))
+
+    (cond
+     ;; open paren
+     ((eq char ?\()
+      (down-list 1)
+      (if (memq  (char-syntax (following-char)) '(?_ ?w))
+	  (let ((symbol (read (current-buffer))))
+	    (cond ((fboundp symbol)
+		   (goto-char start)
+		   (pp-internal-function symbol))
+		  ((memq symbol '(lambda macro))
+		   (pp-internal-lambda))
+		  (t
+		   (goto-char start)
+		   (pp-internal-list))))
+	(up-list -1)
+	(pp-internal-list)))
+     
+     ;;symbols & strings
+     ((memq  ch-class '(?_		; symbol
+			?w		; word
+			?\"		; string
+			?\\		; escape
+			?\'		; quote (for uninterned symbols)
+			)) (forward-sexp 1))
+	
+     ;; vector
+     ((eq char ?\[) (pp-internal-list))
+     
+     ;; error otherwise
+     (t (error "pp-internal-sexp: character class not treated yet: `%c'" 
+	       ch-class)))))
+
+(defun pp-internal-function (func)
+  "Pretty print a functuion call.
+Point must be on the open paren. the function symbol may be passed as an 
+optional argument."
+  (let ((start (point))
+	(too-large (>= (save-excursion
+			 (forward-sexp 1)
+			 (current-column))
+		       fill-column))
+	(indent-info (get func lisp-indent-function)))
+    (down-list 1)
+    ;; skip over function name
+    (forward-sexp 1)
+    (cond
+     ((memq func '(let let*)) (pp-internal-let))
+
+     ((eq func 'cond) (pp-internal-cond))
+
+     ((memq func '(if while with-output-to-temp-buffer catch block))
+      (pp-internal-sexp)
+      (pp-internal-body 't))
+
+     ((eq func 'quote) (pp-internal-quote))
+
+     ((memq func '(progn 
+		    prog1 prog2
+		    save-window-excursion 
+		    save-excursion 
+		    save-restriction))
+      (pp-internal-body 't))
+
+     ((memq func '(defun defmacro defsubst defun* defmacro*))
+      (pp-internal-def))
+     
+     ((eq func 'loop) (pp-internal-loop))
+
+     ('t (pp-internal-body too-large)))))
+
+(defun pp-internal-def ()
+  (forward-sexp 1)			; skip name
+  (if (looking-at " nil")		; replace nil by () 
+      (replace-match " ()")
+    (forward-sexp 1))
+  (if (looking-at " \"")
+      ;; comment string. Replace all escaped linefeeds by real ones
+      (let ((limit (save-excursion (forward-sexp 1) (point-marker))))
+	(newline-and-indent)
+	(while (re-search-forward "\\\\n" limit t)
+	  (replace-match "\n" nil nil))
+	(goto-char limit)))
+  (pp-internal-body 't))
+
+(defun pp-internal-list ()
+  "Pretty print a list  or a vector.
+Point must be on the open paren."
+  (let ((too-large (>= (save-excursion
+			(forward-sexp 1)
+			(current-column))
+		      fill-column)))
+    (down-list 1)
+    (pp-internal-sexp)
+    (pp-internal-body too-large)))
+
+(defun pp-internal-body (&optional force-indent)
+  "Prety print a body of sexp. Stop after reaching a `)'.  If argument
+FORCE-INDENT is non-nil, break line after each sexpression of the
+body."
+  (skip-chars-forward " \n\t")
+  (let (ch-class)
+    ;; while not closing paren
+    (while (/= (setq ch-class (char-syntax (following-char))) ?\)) 
+      (if  force-indent (newline-and-indent))
+      (pp-internal-sexp))
+    (up-list 1)))
+
+(defun pp-internal-loop ()
+  "Prety print a loop body. Stop after reaching a `)'. 
+Line breaks are done before the following keywords: "
+  (forward-sexp 1)
+  (skip-chars-forward " \n\t")
+  (let (ch-class)
+    ;; while not closing paren
+    (while (/= (setq ch-class (char-syntax (following-char))) ?\))
+      (if (not (looking-at "for\\|repeat\\|with\\|while\\|until\\|always\\|never\\|thereis\\|collect\\|append\\|nconc\\|sum\\|count\\|maximize\\|minimize\\|if\\|when\\|else\\|unless\\|do\\W\\|initially\\|finally\\|return\\|named"))
+	  (pp-internal-sexp)
+	(newline-and-indent)
+	(forward-sexp 1))
+      (skip-chars-forward " \n\t"))
+    (up-list 1)))
+
+(defun pp-internal-body-list ()
+  (let ((too-large (>= (save-excursion
+			(forward-sexp 1)
+			(current-column))
+		      fill-column))
+	ch-class)
+    (down-list 1)
+    (pp-internal-sexp)
+    (while (/= (setq ch-class (char-syntax (following-char))) ?\)) 
+      (if  too-large (newline-and-indent))
+      (pp-internal-sexp))
+    (up-list 1)))
+    
+(defun pp-internal-lambda ()
+  (forward-sexp 1) ; arguments
+  (pp-internal-body 't))
+
+(defun pp-internal-let ()
+  "Pretty print a let-like  form.
+Cursor is behind funtion symbol."
+  (down-list 1)
+  (while (not (= (following-char) ?\)))
+    (if (= (following-char) ?\()
+	(pp-internal-body-list)
+      (forward-sexp 1))
+    (if (not (= (following-char) ?\)))
+        (newline-and-indent)))
+  (up-list 1)
+  (pp-internal-body 't))
+
+(defun pp-internal-cond ()
+  "Pretty print a cond-like  form.
+Cursor is behind funtion symbol."
+  (skip-chars-forward " \n\t")
+  (while (not (= (following-char) ?\)))
+    (pp-internal-body-list)
+    (if (not (= (following-char) ?\)))
+	(newline-and-indent)))
+  (up-list 1))
+
+      
+(defun pp-internal-quote ()
+  "Pretty print a quoted list.
+Cursor is behind the symbol quote."
+  (skip-chars-forward " \n\t")
+  (let ((end (point)))
+    (backward-sexp 1)
+    (delete-region (point) end)
+    (up-list -1)
+    (setq end (point))
+    (forward-sexp 1)
+    (delete-char -1)
+    (goto-char end)
+    (delete-char 1)
+    (insert "'")
+    (if (= (char-syntax (following-char)) ?\()
+	;; don't print it as sexp, because it could be (let ... ) or
+	;; (cond ... ) or whatever. 
+	(pp-internal-list)
+      (pp-internal-sexp))))
+
+
+;; Stolen form Dave Gillespies cl-extra.el
+(defun pp-macroexpand-all (form &optional env)
+  "Expand all macro calls through a Lisp FORM.
+This also does some trivial optimizations to make the form prettier."
+  (setq form (macroexpand form env))
+  (cond 
+   ((not (consp form)) form)
+   ((memq (car form) '(let let*))
+    (if (null (nth 1 form))
+	(pp-macroexpand-all (cons 'progn (cdr (cdr form))) env)
+      (cons (car form) 
+	    (cons (pp-macroexpand-lets (nth 1 form) env)
+		  (pp-macroexpand-body (cdr (cdr form)) env)))))
+   ((eq (car form) 'cond)
+    (cons (car form)
+	  (mapcar (function (lambda (x) (pp-macroexpand-body x env)))
+		  (cdr form))))
+   ((eq (car form) 'condition-case)
+    (cons (car form)
+	  (cons (nth 1 form)
+		(cons (pp-macroexpand-all (nth 2 form) env)
+		      (pp-macroexpand-lets 
+		       (cdr (cdr (cdr form))) env)))))
+   ((memq (car form) '(quote function))
+    (if (eq (car-safe (nth 1 form)) 'lambda)
+	(list (car form) 
+	      (cons 'lambda
+		    (cons (car (cdr (car (cdr form))))
+			  (pp-macroexpand-body 
+			   (cdr (cdr (car (cdr form)))) env))))
+      form))
+   ((memq (car form) '(defun defmacro))
+    (cons (car form)
+	  (cons (nth 1 form)
+		(pp-macroexpand-body (cdr (cdr form)) env))))
+   ((and (eq (car form) 'progn) (not (cdr (cdr form))))
+    (pp-macroexpand-all (nth 1 form) env))
+   (t 
+    (cons (car form) (pp-macroexpand-body (cdr form) env)))))
+
+(defun pp-macroexpand-body (body &optional env)
+  (mapcar (function (lambda (x) (pp-macroexpand-all x env))) body))
+
+(defun pp-macroexpand-lets (list &optional env)
+  (mapcar (function
+	   (lambda (x)
+	     (if (consp x) (cons (car x) (pp-macroexpand-body (cdr x) env))
+	       x))) list))
+
+(run-hooks 'pp-load-hook)
+(provide 'pp)
+
+;; end pp.el
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/smtpmail.el	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,527 @@
+;; Simple SMTP protocol (RFC 821) for sending mail
+
+;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+
+;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
+;; Maintainer: Brian D. Carlstrom <bdc@ai.mit.edu>
+;; Keywords: mail
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: FSF 19.34.
+
+;;; Commentary:
+
+;; Send Mail to smtp host from smtpmail temp buffer.
+
+;; Please add these lines in your .emacs(_emacs).
+;;
+;;(setq send-mail-function 'smtpmail-send-it)
+;;(setq smtpmail-default-smtp-server "YOUR SMTP HOST")
+;;(setq smtpmail-smtp-service "smtp")
+;;(setq smtpmail-local-domain "YOUR DOMAIN NAME")
+;;(setq smtpmail-debug-info t)
+;;(load-library "smtpmail")
+;;(setq smtpmail-code-conv-from nil)
+;;(setq user-full-name "YOUR NAME HERE")
+
+;;; Code:
+
+(require 'sendmail)
+
+;;;
+(defvar smtpmail-default-smtp-server nil
+  "*Specify default SMTP server.")
+
+(defvar smtpmail-smtp-server 
+  (or (getenv "SMTPSERVER") smtpmail-default-smtp-server)
+  "*The name of the host running SMTP server.")
+
+(defvar smtpmail-smtp-service 25
+  "*SMTP service port number. smtp or 25 .")
+
+(defvar smtpmail-local-domain nil
+  "*Local domain name without a host name.
+If the function (system-name) returns the full internet address,
+don't define this value.")
+
+(defvar smtpmail-debug-info nil
+  "*smtpmail debug info printout. messages and process buffer.")
+
+(defvar smtpmail-code-conv-from nil ;; *junet*
+  "*smtpmail code convert from this code to *internal*..for tiny-mime..")
+
+;;;
+;;;
+;;;
+
+(defun smtpmail-send-it ()
+  (require 'mail-utils)
+  (let ((errbuf (if mail-interactive
+		    (generate-new-buffer " smtpmail errors")
+		  0))
+	(tembuf (generate-new-buffer " smtpmail temp"))
+	(case-fold-search nil)
+	resend-to-addresses
+	delimline
+	(mailbuf (current-buffer)))
+    (unwind-protect
+	(save-excursion
+	  (set-buffer tembuf)
+	  (erase-buffer)
+	  (insert-buffer-substring mailbuf)
+	  (goto-char (point-max))
+	  ;; require one newline at the end.
+	  (or (= (preceding-char) ?\n)
+	      (insert ?\n))
+	  ;; Change header-delimiter to be what sendmail expects.
+	  (goto-char (point-min))
+	  (re-search-forward
+	    (concat "^" (regexp-quote mail-header-separator) "\n"))
+	  (replace-match "\n")
+	  (backward-char 1)
+	  (setq delimline (point-marker))
+;;	  (sendmail-synch-aliases)
+	  (if (and mail-aliases (fboundp expand-mail-aliases)) ; XEmacs
+	      (expand-mail-aliases (point-min) delimline))
+	  (goto-char (point-min))
+	  ;; ignore any blank lines in the header
+	  (while (and (re-search-forward "\n\n\n*" delimline t)
+		      (< (point) delimline))
+	    (replace-match "\n"))
+	  (let ((case-fold-search t))
+	    (goto-char (point-min))
+	    (goto-char (point-min))
+	    (while (re-search-forward "^Resent-to:" delimline t)
+	      (setq resend-to-addresses
+		    (save-restriction
+		      (narrow-to-region (point)
+					(save-excursion
+					  (end-of-line)
+					  (point)))
+		      (append (mail-parse-comma-list)
+			      resend-to-addresses))))
+;;; Apparently this causes a duplicate Sender.
+;;;	    ;; If the From is different than current user, insert Sender.
+;;;	    (goto-char (point-min))
+;;;	    (and (re-search-forward "^From:"  delimline t)
+;;;		 (progn
+;;;		   (require 'mail-utils)
+;;;		   (not (string-equal
+;;;			 (mail-strip-quoted-names
+;;;			  (save-restriction
+;;;			    (narrow-to-region (point-min) delimline)
+;;;			    (mail-fetch-field "From")))
+;;;			 (user-login-name))))
+;;;		 (progn
+;;;		   (forward-line 1)
+;;;		   (insert "Sender: " (user-login-name) "\n")))
+	    ;; Don't send out a blank subject line
+	    (goto-char (point-min))
+	    (if (re-search-forward "^Subject:[ \t]*\n" delimline t)
+		(replace-match ""))
+	    ;; Put the "From:" field in unless for some odd reason
+	    ;; they put one in themselves.
+	    (goto-char (point-min))
+	    (if (not (re-search-forward "^From:" delimline t))
+		(let* ((login user-mail-address)
+		       (fullname (user-full-name)))
+		  (cond ((eq mail-from-style 'angles)
+			 (insert "From: " fullname)
+			 (let ((fullname-start (+ (point-min) 6))
+			       (fullname-end (point-marker)))
+			   (goto-char fullname-start)
+			   ;; Look for a character that cannot appear unquoted
+			   ;; according to RFC 822.
+			   (if (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]"
+						  fullname-end 1)
+			       (progn
+				 ;; Quote fullname, escaping specials.
+				 (goto-char fullname-start)
+				 (insert "\"")
+				 (while (re-search-forward "[\"\\]"
+							   fullname-end 1)
+				   (replace-match "\\\\\\&" t))
+				 (insert "\""))))
+			 (insert " <" login ">\n"))
+			((eq mail-from-style 'parens)
+			 (insert "From: " login " (")
+			 (let ((fullname-start (point)))
+			   (insert fullname)
+			   (let ((fullname-end (point-marker)))
+			     (goto-char fullname-start)
+			     ;; RFC 822 says \ and nonmatching parentheses
+			     ;; must be escaped in comments.
+			     ;; Escape every instance of ()\ ...
+			     (while (re-search-forward "[()\\]" fullname-end 1)
+			       (replace-match "\\\\\\&" t))
+			     ;; ... then undo escaping of matching parentheses,
+			     ;; including matching nested parentheses.
+			     (goto-char fullname-start)
+			     (while (re-search-forward 
+				     "\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)"
+				     fullname-end 1)
+			       (replace-match "\\1(\\3)" t)
+			       (goto-char fullname-start))))
+			 (insert ")\n"))
+			((null mail-from-style)
+			 (insert "From: " login "\n")))))
+	    ;; Insert an extra newline if we need it to work around
+	    ;; Sun's bug that swallows newlines.
+	    (goto-char (1+ delimline))
+	    (if (eval mail-mailer-swallows-blank-line)
+		(newline))
+	    ;; Find and handle any FCC fields.
+	    (goto-char (point-min))
+	    (if (re-search-forward "^FCC:" delimline t)
+		(mail-do-fcc delimline))
+	    (if mail-interactive
+		(save-excursion
+		  (set-buffer errbuf)
+		  (erase-buffer))))
+	  ;;
+	  ;;
+	  ;;
+	  (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*"))
+	  (setq smtpmail-recipient-address-list
+		(or resend-to-addresses
+		    (smtpmail-deduce-address-list tembuf (point-min) delimline)))
+	  (kill-buffer smtpmail-address-buffer)
+
+	  (smtpmail-do-bcc delimline)
+
+	  (if (not (null smtpmail-recipient-address-list))
+	      (if (not (smtpmail-via-smtp smtpmail-recipient-address-list tembuf))
+		  (error "Sending failed; SMTP protocol error"))
+	    (error "Sending failed; no recipients"))
+	  )
+      (kill-buffer tembuf)
+      (if (bufferp errbuf)
+	  (kill-buffer errbuf)))))
+
+
+;(defun smtpmail-via-smtp (host,port,sender,destination,smtpmail-text-buffer)
+
+(defun smtpmail-fqdn ()
+  (if smtpmail-local-domain
+      (concat (system-name) "." smtpmail-local-domain)
+    (system-name)))
+
+(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)
+  (let ((process nil)
+	(host smtpmail-smtp-server)
+	(port smtpmail-smtp-service)
+	response-code
+	greeting
+	process-buffer)
+    (unwind-protect
+	(catch 'done
+	  ;; get or create the trace buffer
+	  (setq process-buffer
+		(get-buffer-create (format "*trace of SMTP session to %s*" host)))
+
+	  ;; clear the trace buffer of old output
+	  (save-excursion
+	    (set-buffer process-buffer)
+	    (erase-buffer))
+
+	  ;; open the connection to the server
+	  (setq process (open-network-stream "SMTP" process-buffer host port))
+	  (and (null process) (throw 'done nil))
+
+	  ;; set the send-filter
+	  (set-process-filter process 'smtpmail-process-filter)
+
+	  (save-excursion
+	    (set-buffer process-buffer)
+	    (make-local-variable 'smtpmail-read-point)
+	    (setq smtpmail-read-point (point-min))
+
+	    
+	    (if (or (null (car (setq greeting (smtpmail-read-response process))))
+		    (not (integerp (car greeting)))
+		    (>= (car greeting) 400))
+		(throw 'done nil)
+	      )
+
+	    ;; HELO
+	    (smtpmail-send-command process (format "HELO %s" (smtpmail-fqdn)))
+
+	    (if (or (null (car (setq response-code (smtpmail-read-response process))))
+		    (not (integerp (car response-code)))
+		    (>= (car response-code) 400))
+		(throw 'done nil)
+	      )
+
+	    ;; MAIL FROM: <sender>
+;	    (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn)))
+	    (smtpmail-send-command process (format "MAIL FROM: <%s>" user-mail-address))
+
+	    (if (or (null (car (setq response-code (smtpmail-read-response process))))
+		    (not (integerp (car response-code)))
+		    (>= (car response-code) 400))
+		(throw 'done nil)
+	      )
+	    
+	    ;; RCPT TO: <recipient>
+	    (let ((n 0))
+	      (while (not (null (nth n recipient)))
+		(smtpmail-send-command process (format "RCPT TO: <%s>" (nth n recipient)))
+		(setq n (1+ n))
+
+		(if (or (null (car (setq response-code (smtpmail-read-response process))))
+			(not (integerp (car response-code)))
+			(>= (car response-code) 400))
+		    (throw 'done nil)
+		  )
+		))
+	    
+	    ;; DATA
+	    (smtpmail-send-command process "DATA")
+
+	    (if (or (null (car (setq response-code (smtpmail-read-response process))))
+		    (not (integerp (car response-code)))
+		    (>= (car response-code) 400))
+		(throw 'done nil)
+	      )
+
+	    ;; Mail contents
+	    (smtpmail-send-data process smtpmail-text-buffer)
+
+	    ;;DATA end "."
+	    (smtpmail-send-command process ".")
+
+	    (if (or (null (car (setq response-code (smtpmail-read-response process))))
+		    (not (integerp (car response-code)))
+		    (>= (car response-code) 400))
+		(throw 'done nil)
+	      )
+
+	    ;;QUIT
+;	    (smtpmail-send-command process "QUIT")
+;	    (and (null (car (smtpmail-read-response process)))
+;		 (throw 'done nil))
+	    t ))
+      (if process
+	  (save-excursion
+	    (set-buffer (process-buffer process))
+	    (smtpmail-send-command process "QUIT")
+	    (smtpmail-read-response process)
+
+;	    (if (or (null (car (setq response-code (smtpmail-read-response process))))
+;		    (not (integerp (car response-code)))
+;		    (>= (car response-code) 400))
+;		(throw 'done nil)
+;	      )
+	    (delete-process process))))))
+
+
+(defun smtpmail-process-filter (process output)
+  (save-excursion
+    (set-buffer (process-buffer process))
+    (goto-char (point-max))
+    (insert output)))
+
+(defun smtpmail-read-response (process)
+  (let ((case-fold-search nil)
+	(response-string nil)
+	(response-continue t)
+	(return-value '(nil ""))
+	match-end)
+
+;    (setq response-string nil)
+;    (setq response-continue t)
+;    (setq return-value '(nil ""))
+
+    (while response-continue
+      (goto-char smtpmail-read-point)
+      (while (not (search-forward "\r\n" nil t))
+	(accept-process-output process)
+	(goto-char smtpmail-read-point))
+
+      (setq match-end (point))
+      (if (null response-string)
+	  (setq response-string
+		(buffer-substring smtpmail-read-point (- match-end 2))))
+	
+      (goto-char smtpmail-read-point)
+      (if (looking-at "[0-9]+ ")
+	  (progn (setq response-continue nil)
+;		 (setq return-value response-string)
+
+		 (if smtpmail-debug-info
+		     (message response-string))
+
+		 (setq smtpmail-read-point match-end)
+		 (setq return-value
+		       (cons (string-to-int 
+			      (buffer-substring (match-beginning 0) (match-end 0))) 
+			     response-string)))
+	
+	(if (looking-at "[0-9]+-")
+	    (progn (setq smtpmail-read-point match-end)
+		   (setq response-continue t))
+	  (progn
+	    (setq smtpmail-read-point match-end)
+	    (setq response-continue nil)
+	    (setq return-value 
+		  (cons nil response-string))
+	    )
+	  )))
+    (setq smtpmail-read-point match-end)
+    return-value))
+
+
+(defun smtpmail-send-command (process command)
+  (goto-char (point-max))
+  (if (= (aref command 0) ?P)
+      (insert "PASS <omitted>\r\n")
+    (insert command "\r\n"))
+  (setq smtpmail-read-point (point))
+  (process-send-string process command)
+  (process-send-string process "\r\n"))
+
+(defun smtpmail-send-data-1 (process data)
+  (goto-char (point-max))
+
+  (if (not (null smtpmail-code-conv-from))
+      (setq data (code-convert-string data smtpmail-code-conv-from *internal*)))
+	
+  (if smtpmail-debug-info
+      (insert data "\r\n"))
+
+  (setq smtpmail-read-point (point))
+  ;; Escape "." at start of a line
+  (if (eq (string-to-char data) ?.)
+      (process-send-string process "."))
+  (process-send-string process data)
+  (process-send-string process "\r\n")
+  )
+
+(defun smtpmail-send-data (process buffer)
+  (let
+      ((data-continue t)
+       (sending-data nil)
+       this-line
+       this-line-end)
+
+    (save-excursion
+      (set-buffer buffer)
+      (goto-char (point-min)))
+
+    (while data-continue
+      (save-excursion
+	(set-buffer buffer)
+	(beginning-of-line)
+	(setq this-line (point))
+	(end-of-line)
+	(setq this-line-end (point))
+	(setq sending-data nil)
+	(setq sending-data (buffer-substring this-line this-line-end))
+	(if (/= (forward-line 1) 0)
+	    (setq data-continue nil)))
+
+      (smtpmail-send-data-1 process sending-data)
+      )
+    )
+  )
+    
+
+(defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end)
+  "Get address list suitable for smtp RCPT TO: <address>."
+  (require 'mail-utils)  ;; pick up mail-strip-quoted-names
+  (let
+      ((case-fold-search t)
+       (simple-address-list "")
+       this-line
+       this-line-end
+       addr-regexp)
+    
+    (unwind-protect
+	(save-excursion
+	  ;;
+	  (set-buffer smtpmail-address-buffer) (erase-buffer)
+	  (insert-buffer-substring smtpmail-text-buffer header-start header-end)
+	  (goto-char (point-min))
+	  ;; RESENT-* fields should stop processing of regular fields.
+	  (save-excursion
+	    (if (re-search-forward "^RESENT-TO:" header-end t)
+		(setq addr-regexp "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)")
+	      (setq addr-regexp  "^\\(TO:\\|CC:\\|BCC:\\)")))
+
+	  (while (re-search-forward addr-regexp header-end t)
+	    (replace-match "")
+	    (setq this-line (match-beginning 0))
+	    (forward-line 1)
+	    ;; get any continuation lines
+	    (while (and (looking-at "^[ \t]+") (< (point) header-end))
+	      (forward-line 1))
+	    (setq this-line-end (point-marker))
+	    (setq simple-address-list
+		  (concat simple-address-list " "
+			  (mail-strip-quoted-names (buffer-substring this-line this-line-end))))
+	    )
+	  (erase-buffer)
+	  (insert-string " ")
+	  (insert-string simple-address-list)
+	  (insert-string "\n")
+	  (subst-char-in-region (point-min) (point-max) 10 ?  t);; newline --> blank
+	  (subst-char-in-region (point-min) (point-max) ?, ?  t);; comma   --> blank
+	  (subst-char-in-region (point-min) (point-max)  9 ?  t);; tab     --> blank
+
+	  (goto-char (point-min))
+	  ;; tidyness in case hook is not robust when it looks at this
+	  (while (re-search-forward "[ \t]+" header-end t) (replace-match " "))
+
+	  (goto-char (point-min))
+	  (let (recipient-address-list)
+	    (while (re-search-forward " \\([^ ]+\\) " (point-max) t)
+	      (backward-char 1)
+	      (setq recipient-address-list (cons (buffer-substring (match-beginning 1) (match-end 1))
+						 recipient-address-list))
+	      )
+	    (setq smtpmail-recipient-address-list recipient-address-list))
+
+	  )
+      )
+    )
+  )
+
+
+(defun smtpmail-do-bcc (header-end)
+  "Delete BCC: and their continuation lines from the header area.
+There may be multiple BCC: lines, and each may have arbitrarily
+many continuation lines."
+  (let ((case-fold-search t))
+	(save-excursion (goto-char (point-min))
+	  ;; iterate over all BCC: lines
+	  (while (re-search-forward "^BCC:" header-end t)
+	        (delete-region (match-beginning 0) (progn (forward-line 1) (point)))
+		;; get rid of any continuation lines
+		(while (and (looking-at "^[ \t].*\n") (< (point) header-end))
+		  (replace-match ""))
+		)
+	  ) ;; save-excursion
+	) ;; let
+  )
+
+
+
+(provide 'smtpmail)
+
+;; smtpmail.el ends here
--- a/lisp/version.el	Mon Aug 13 09:03:07 2007 +0200
+++ b/lisp/version.el	Mon Aug 13 09:03:46 2007 +0200
@@ -18,14 +18,14 @@
 ;; Free Software Foundation Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-;;; Synched up with: FSF 19.30.
+;;; Synched up with: FSF 19.34.
 
 ;;; Code:
 
 (defconst emacs-version "20.0"
   "Version numbers of this version of Emacs.")
 
-(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta30)")))
+(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta31)")))
 
 (defconst emacs-major-version
   (progn (or (string-match "^[0-9]+" emacs-version)
--- a/man/ChangeLog	Mon Aug 13 09:03:07 2007 +0200
+++ b/man/ChangeLog	Mon Aug 13 09:03:46 2007 +0200
@@ -1,3 +1,7 @@
+Tue Dec 10 18:35:21 1996  Rod Whitby  <rwhitby@asc.sps.mot.com>
+
+	* vhdl-mode.texi: New file.
+
 Thu Jan 24 12:41:33 1991  Richard Stallman  (rms at mole.ai.mit.edu)
 
 	* texinfo.tex: Delete spurious character at beginning.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/vhdl-mode.texi	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,1285 @@
+\input texinfo   @c -*- texinfo -*-
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment %**start of header (This is for running Texinfo on a region)
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@setfilename  vhdl-mode.info
+@settitle     VHDL-MODE Version 2 Documentation
+@footnotestyle end
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment @setchapternewpage odd !! we don't want blank pages !!
+@comment %**end of header (This is for running Texinfo on a region)
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment 
+@comment texinfo manual for @file{vhdl-mode.el} version 2
+@comment manual version: 2.1
+@comment adapted from the cc-mode texinfo manual by Barry A. Warsaw
+@comment <bwarsaw@cnri.reston.va.us>
+@comment 
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment The following line inserts the copyright notice 
+@comment into the Info file.
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@ifinfo
+Copyright @copyright{} 1995 Rodney J. Whitby
+@end ifinfo
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment !!!The titlepage section does not appear in the Info file.!!!
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@titlepage
+@sp 10
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment The title is printed in a large font.
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@center @titlefont{VHDL-MODE Version 2}
+@sp 2
+@center A GNU Emacs mode for editing VHDL code.
+@center (manual revision: 2.1)
+@sp 2
+@center Rod Whitby
+@center @code{rwhitby@asc.corp.mot.com}
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment  The following two commands start the copyright page
+@comment  for the printed manual.  This will not appear in the Info file.
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1995 Rodney J. Whitby
+@end titlepage
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment The Top node contains the master menu for the Info file.
+@comment This appears only in the Info file, not the printed manual.
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@node    Top,       Introduction, (dir),    (dir)
+@comment node-name, next,          previous, up
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@menu
+* Introduction::                
+* Getting Connected::           
+* New Indentation Engine::
+* Customizing Indentation::
+* Syntactic Symbols::
+* Indentation Commands::
+* Frequently Asked Questions::
+* Getting the latest vhdl-mode release::
+* Sample .emacs File::
+* Requirements::                
+* Limitations and Known Bugs::  
+* Mailing Lists and Submitting Bug Reports::  
+* Concept Index::               
+* Command Index::               Command Index
+* Key Index::                   Key Index
+* Variable Index::              Variable Index
+@end menu
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@node     Introduction, Getting Connected, Top,      Top
+@comment  node-name,    next,            previous, up
+@chapter  Introduction
+@cindex   Introduction
+
+Welcome to @code{vhdl-mode}, version 2.  This is a GNU Emacs mode for
+editing files containing VHDL code.  
+
+This manual will describe the following:
+
+@itemize @bullet
+@item
+How to get started using @code{vhdl-mode}.
+
+@item
+How the new indentation engine works.
+
+@item
+How to customize the new indentation engine.
+
+@end itemize
+
+@findex vhdl-version
+The major version number was incremented to 2 with the addition of the
+new indentation engine. To find the minor revision number of this
+release, use @kbd{M-x vhdl-version RET}.
+
+A special word of thanks goes to Barry Warsaw, who wrote the
+@code{cc-mode} indentation engine that formed the basis of the
+@code{vhdl-mode} indentation engine.  This manual is also based upon the
+manual for @code{cc-mode}.
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@node     Getting Connected, New Indentation Engine, Introduction,      Top
+@comment  node-name,       next,                   previous,          up
+@chapter  Getting Connected
+@cindex   Getting Connected
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@file{vhdl-mode.el} works well with the 3 main branches of Emacs 19:
+XEmacs, Win-Emacs (which has the same heritage as XEmacs) and the Emacs
+19 maintained by the FSF.  FSF's Emacs 19 users will want to use Emacs
+version 19.21 or better, Win-Emacs users will want 1.35 or better, and
+XEmacs users will want 19.6 or better.  Earlier versions of these
+Emacsen have deficiencies and/or bugs which will adversely affect the
+performance and usability of @code{vhdl-mode}.
+
+@cindex .emacs file
+The first thing you will want to do is put @file{vhdl-mode.el} somewhere
+on your @code{load-path} so Emacs can find it.  Do a @kbd{C-h v
+load-path RET} to see all the directories Emacs looks at when loading a
+file.  If none of these directories are appropriate, create a new
+directory and add it to your @code{load-path}:
+
+@noindent
+@emph{[in the shell]}
+@example
+@group
+
+% cd
+% mkdir mylisp
+% mv vhdl-mode.el mylisp
+% cd mylisp
+
+@end group
+@end example
+
+@noindent
+@emph{[in your .emacs file add]}
+@example
+
+(setq load-path (cons "~/mylisp" load-path))
+
+@end example
+
+@cindex byte compile
+Next you want to @dfn{byte compile} @file{vhdl-mode.el}.  The mode 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!}
+
+Here's what to do to byte-compile the file [in emacs]:
+@example
+
+M-x byte-compile-file RET ~/mylisp/vhdl-mode.el RET
+
+@end example
+
+Now add the following autoloads to your @file{.emacs} file so that
+@code{vhdl-mode} gets loaded at the right time:
+@example
+
+(autoload 'vhdl-mode "vhdl-mode" "VHDL Editing Mode" t)
+
+@end example
+
+Alternatively, if you want to make sure @code{vhdl-mode} is loaded when
+Emacs starts up, you could use this line instead of the autoload above:
+@example
+
+(require 'vhdl-mode)
+
+@end example
+
+Next, you will want to set up Emacs so that it edits VHDL files in
+@code{vhdl-mode}. All users should add the following to their
+@file{.emacs} file.  Note that this assumes you'll be editing @code{.vhd}
+and files as VHDL. YMMV:
+@example
+@group
+
+(setq auto-mode-alist
+  (append
+    '(("\\.vhd$" . vhdl-mode)
+     ) auto-mode-alist))
+
+@end group
+@end example
+
+That's all you need -- I know, I know, it sounds like a lot @code{:-)},
+but after you've done all this, you should only need to quit and restart
+Emacs.  The next time you visit a VHDL file you should be using
+@code{vhdl-mode}.  You can check this easily by hitting @kbd{M-x
+vhdl-version RET} in the @code{vhdl-mode} buffer.  You should see this
+message in the echo area:
+@example
+
+Using @code{vhdl-mode} version 2.@var{XXX}
+
+@end example
+
+@noindent
+where @var{XXX} will be some minor revision number.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@node     New Indentation Engine, Indentation Commands, Getting Connected, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  New Indentation Engine
+@cindex   New Indentation Engine
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@code{vhdl-mode} has a new indentation engine, providing a simplified, yet
+flexible and general mechanism for customizing indentation. It breaks
+indentation calculation into two steps. First for the line of code being
+indented, @code{vhdl-mode} analyzes what kind of language construct it's
+looking at, then it applies user defined offsets to the current line
+based on this analysis.
+
+This section will briefly cover how indentation is calculated in
+@code{vhdl-mode}. It is important to understand the indentation model
+being used so that you will know how to customize @code{vhdl-mode} for
+your personal coding style.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@menu
+* Syntactic Analysis::       Step 1 -- Syntactic Analysis
+* Indentation Calculation::  Step 2 -- Indentation Calculation
+@end menu
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Syntactic Analysis, Indentation Calculation, , New Indentation Engine
+@comment  node-name,              next,                    previous,up
+@section  Syntactic Analysis
+@cindex   Syntactic Analysis
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+@cindex relative buffer position
+@cindex syntactic symbol
+@cindex syntactic component
+@cindex syntactic component list
+@cindex relative buffer position
+The first thing @code{vhdl-mode} does when indenting a line of code, is
+to analyze the line, determining the @dfn{syntactic component list} of
+the construct on that line.  A @dfn{syntactic component} consists of a
+pair of information (in lisp parlance, a @emph{cons cell}), where the
+first part is a @dfn{syntactic symbol}, and the second part is a
+@dfn{relative buffer position}.  Syntactic symbols describe elements of
+VHDL code, e.g. @code{statement}, @code{comment}, @code{block-open},
+@code{block-close}, etc.  @xref{Syntactic Symbols}, for a complete list
+of currently recognized syntactic symbols and their semantics.  Also,
+the variable @code{vhdl-offsets-alist} contains the list of currently
+supported syntactic symbols.
+
+Conceptually, a line of VHDL code is always indented relative to the
+indentation of some line higher up in the buffer.  This is represented
+by the relative buffer position in the syntactic component.
+
+It might help to see an example. Suppose we had the following code as
+the only thing in a @code{vhdl-mode} buffer @footnote{The line numbers
+in this and future examples don't actually appear in the buffer.}:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:   q <= not d;
+  4:   wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+@kindex C-c C-s
+@findex vhdl-show-syntactic-information
+@findex show-syntactic-information (vhdl-)
+We can use the command @kbd{C-c C-s}
+(@code{vhdl-show-syntactic-information}) to simply report what the
+syntactic analysis is for the current line.  Running this command on
+line 4 of example 1, we'd see in the echo area:
+@example
+
+((statement . 28))
+
+@end example
+
+This tells us that the line is a statement and it is indented relative
+to buffer position 28, which happens to be the @samp{q} on line 3.  If
+you were to move point to line 3 and hit @kbd{C-c C-s}, you would see:
+@example
+
+((statement-block-intro . 20))
+
+@end example
+
+This indicates that line 3 is the first statement in a block, and is
+indented relative to buffer position 20, which is the @samp{b} in the
+@code{begin} keyword on line 2.
+
+@cindex comment only line
+Syntactic component lists can contain more than one component, and
+individual syntactic compenents need not have relative buffer positions.
+The most common example of this is a line that contains a @dfn{comment
+only line}.
+@example
+@group
+
+%%% TBD %%%
+
+@end group
+@end example
+
+@noindent
+Hitting @kbd{C-c C-s} on line 3 of the example gives us:
+@example
+
+((comment-intro) (block-intro . 46))
+
+@end example
+
+@noindent
+so you can see that the syntactic component list contains two syntactic
+components.  Also notice that the first component,
+@samp{(comment-intro)} has no relative buffer position.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Indentation Calculation, , Syntactic Analysis, New Indentation Engine
+@comment  node-name,              next,                    previous,up
+@section  Indentation Calculation
+@cindex   Indentation Calculation
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+Indentation for the current line is calculated using the syntactic
+component list derived in step 1 above (see @ref{Syntactic
+Analysis}).  Each component contributes to the final total indentation
+of the line in two ways.
+
+First, the syntactic symbols are looked up in the @code{vhdl-offsets-alist}
+variable, which is an association list of syntactic symbols and the
+offsets to apply for those symbols.  These offsets are added to the
+running total.
+
+Second, if the component has a relative buffer position, @code{vhdl-mode}
+adds the column number of that position to the running total.  By adding
+up the offsets and columns for every syntactic component on the list,
+the final total indentation for the current line is computed.
+
+Let's use our code example above to see how this works.  Here is our
+example again.
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:   q <= not d;
+  4:   wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+@kindex TAB
+Let's say point is on line 3 and we hit the @key{TAB} key to re-indent
+the line.  Remember that the syntactic component list for that
+line is:
+@example
+
+((statement-block-intro . 20))
+
+@end example
+
+@noindent
+@code{vhdl-mode} looks up @code{statement-block-intro} in the
+@code{vhdl-offsets-alist} variable.  Let's say it finds the value @samp{2};
+it adds this to the running total (initialized to zero), yielding a
+running total indentation of 2 spaces.
+
+Next @code{vhdl-mode} goes to buffer position 20 and asks for the
+current column.  Since the @code{begin} keyword at buffer position 20 is
+in column zero, it adds @samp{0} to the running total.  Since there is
+only one syntactic component on the list for this line, indentation
+calculation is complete, and the total indentation for the line is 2
+spaces.
+Simple, huh?
+
+Actually, the mode usually just does The Right Thing without you having
+to think about it in this much detail.  But when customizing
+indentation, it's helpful to understand the general indentation model
+being used.
+
+@vindex vhdl-echo-syntactic-information-p
+@vindex echo-syntactic-information-p (vhdl-)
+@cindex TAB
+To help you configure @code{vhdl-mode}, you can set the variable
+@code{vhdl-echo-syntactic-information-p} to non-@code{nil} so that the
+syntactic component list and calculated offset will always be echoed in
+the minibuffer when you hit @kbd{TAB}.
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Indentation Commands, Customizing Indentation, New Indentation Engine, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  Indentation Commands
+@cindex   Indentation Commands
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@strong{<TBD>}
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Customizing Indentation, Syntactic Symbols, Indentation Commands, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  Customizing Indentation
+@cindex   Customizing Indentation
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@cindex vhdl-set-offset
+@cindex set-offset (vhdl-)
+The @code{vhdl-offsets-alist} variable is where you customize all your
+indentations.  You simply need to decide what additional offset you want
+to add for every syntactic symbol.  You can use the command @kbd{C-c
+C-o} (@code{vhdl-set-offset}) as the way to set offsets, both
+interactively and from your mode hook.  Also, you can set up
+@emph{styles} of indentation.  Most likely, you'll find one of the
+pre-defined styles will suit your needs, but if not, this section will
+describe how to set up basic editing configurations.  @xref{Styles} for
+an explanation of how to set up named styles.
+
+@cindex vhdl-basic-offset
+@cindex basic-offset (vhdl-)
+As mentioned previously, the variable @code{vhdl-offsets-alist} is an
+association list between syntactic symbols and the offsets to be applied
+for those symbols.  In fact, these offset values can be an integer, a
+function or variable name, or one of the following symbols: @code{+},
+@code{-}, @code{++}, @code{--}, @code{*}, or @code{/}.  The symbol
+values have the following meanings:
+
+@itemize @bullet
+
+@item
+@code{+}  --  1 x @code{vhdl-basic-offset}
+@item
+@code{-}  --  -1 x @code{vhdl-basic-offset}
+@item
+@code{++} --  2 x @code{vhdl-basic-offset}
+@item
+@code{--} --  -2 x @code{vhdl-basic-offset}
+@item
+@code{*}  --  0.5 x @code{vhdl-basic-offset}
+@item
+@code{/}  --  -0.5 x @code{vhdl-basic-offset}
+
+@end itemize
+
+@noindent
+So, for example, because most of the default offsets are defined in
+terms of @code{+}, @code{-}, and @code{0}, if you like the general
+indentation style, but you use 2 spaces instead of 4 spaces per level,
+you can probably achieve your style just by changing
+@code{vhdl-basic-offset} like so (in your @file{.emacs} file):
+@example
+
+(setq vhdl-basic-offset 2)
+
+@end example
+
+To change indentation styles more radically, you will want to change the
+value associated with the syntactic symbols in the
+@code{vhdl-offsets-alist} variable.  First, I'll show you how to do that
+interactively, then I'll describe how to make changes to your
+@file{.emacs} file so that your changes are more permanent.
+
+@menu
+* Interactive Customization::
+* Permanent Customization::
+* Styles::
+* Advanced Customizations::
+@end menu
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Interactive Customization, Permanent Customization, , Customizing Indentation
+@comment  node-name,              next,                    previous,up
+
+@section  Interactive Customization
+@cindex   Interactive Customization
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+As an example of how to customize indentation, let's change the
+style of the example above from:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:   q <= not d;
+  4:   wait on d;
+  5: end inverter;
+
+@end group
+@end example
+@noindent
+to:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:     q <= not d;
+  4:     wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+In other words, we want to change the indentation of the statments
+inside the inverter process.  Notice that the construct we want to
+change starts on line 3.  To change the indentation of a line, we need
+to see which syntactic component affect the offset calculations for that
+line.  Hitting @kbd{C-c C-s} on line 3 yields:
+@example
+
+((statement-block-intro . 20))
+
+@end example
+
+@findex vhdl-set-offset
+@findex set-offset (vhdl-)
+@kindex C-c C-o
+@noindent
+So we know that to change the offset of the first signal assignment, we need to
+change the indentation for the @code{statement-block-intro} syntactic
+symbol.  To do this interactively, just hit @kbd{C-c C-o}
+(@code{vhdl-set-offset}).  This prompts you for the syntactic symbol to
+change, providing a reasonable default.  In this case, the default is
+@code{statement-block-intro}, which is just the syntactic symbol we want to
+change!
+
+After you hit return, @code{vhdl-mode} will then prompt you for the new
+offset value, with the old value as the default.  The default in this
+case is @samp{+}, so hit backspace to delete the @samp{+}, then hit
+@samp{++} and @kbd{RET}.  This will associate an offset of twice the
+basic indent with the syntactic symbol @code{statement-block-intro} in
+the @code{vhdl-offsets-alist} variable.
+
+@findex vhdl-indent-defun
+@findex indent-defun (vhdl-)
+@kindex C-c C-q
+To check your changes quickly, just hit @kbd{C-c C-q}
+(@code{vhdl-indent-defun}) to reindent the entire function.  The example
+should now look like:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:     q <= not d;
+  4:     wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+Notice how just changing the offset on line 3 is all we needed to do.
+Since the other affected lines are indented relative to line 3, they are
+automatically indented the way you'd expect.  For more complicated
+examples, this may not always work.  The general approach to take is to
+always start adjusting offsets for lines higher up in the file, then
+re-indent and see if any following lines need further adjustments.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Permanent Customization, Styles, Interactive Customization, Customizing Indentation
+@comment  node-name,              next,                    previous,up
+
+@section  Permanent Indentation
+@cindex   Permanent Indentation
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-mode-hook
+@cindex hooks
+To make this change permanent, you need to add some lisp code to your
+@file{.emacs} file.  @code{vhdl-mode} provides a @code{vhdl-mode-hook}
+that you can use to customize your language editing styles.  This hook
+gets run as the last thing when you enter @code{vhdl-mode}.
+
+Here's a simplified example of what you can add to your @file{.emacs}
+file to make the changes described in the previous section
+(@ref{Interactive Customization}) more permanent.  See the Emacs
+manuals for more information on customizing Emacs via hooks.
+@xref{Sample .emacs File} for a more complete sample @file{.emacs} file.
+@footnote{The use of @code{add-hook} in this example only works for
+Emacs 19.  Workarounds are available if you are using Emacs 18, but this
+just points out another reason for you to upgrade to Emacs 19!
+@code{:-)}}
+@example
+@group
+
+(defun my-vhdl-mode-hook ()
+  ;; my customizations for all of vhdl-mode
+  (vhdl-set-offset 'statement-block-intro '++)
+  ;; other customizations can go here
+  )
+(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
+
+@end group
+@end example
+
+For complex customizations, you will probably want to set up a
+@emph{style} that groups all your customizations under a single
+name. @xref{Styles} for details.
+
+The offset value can also be a function, and this is how power users
+gain enormous flexibility in customizing indentation. @xref{Advanced
+Customizations} for details.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Styles, Advanced Customizations, Permanent Customization, Customizing Indentation
+@comment  node-name,              next,                    previous,up
+
+@section  Styles
+@cindex   Styles
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+Most people only need to edit code formatted in just a few well-defined
+and consistent styles.  For example, their organization might impose a
+``blessed'' style that all its programmers must conform to.  Similarly,
+people who work on GNU software will have to use the GNU coding style on
+C code.  Some shops are more lenient, allowing some variety of coding
+styles, and as programmers come and go, there could be a number of
+styles in use.  For this reason, @code{vhdl-mode} makes it convenient for
+you to set up logical groupings of customizations called @dfn{styles},
+associate a single name for any particular style, and pretty easily
+start editing new or existing code using these styles.  This chapter
+describes how to set up styles and how to edit your C code using styles.
+
+@menu
+* Built-in Styles::
+* Adding Styles::
+* File Styles::
+@end menu
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Built-in Styles, Adding Styles, , Styles
+@comment  node-name,              next,                    previous,up
+
+@subsection  Built-in Styles
+@cindex   Built-in Styles
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+If you're lucky, one of @code{vhdl-mode}'s built-in styles might be just
+what you're looking for.  Some of the most common VHDL styles are
+already built-in.  These include:
+
+@itemize @bullet
+@item
+@cindex IEEE style
+@code{GNU} -- the coding style in the IEEE Language Reference Manual.
+
+@end itemize
+
+@findex vhdl-set-style
+@findex set-style (vhdl-)
+If you'd like to experiment with these built-in styles you can simply
+type the following in a @code{vhdl-mode} buffer:
+@example
+@group
+
+@kbd{M-x vhdl-set-style RET}.
+
+@end group
+@end example
+@noindent
+You will be prompted for one of the above styles (with completion).
+Enter one of the styles and hit @kbd{RET}.  Note however that setting a
+style in this way does @emph{not} automatically re-indent your file.
+For commands that you can use to view the effect of your changes, see
+@ref{Indentation Commands}.
+
+Once you find a built-in style you like, you can make the change
+permanent by adding a call to your @file{.emacs} file.  Let's say for
+example that you want to use the @code{IEEE} style in all your
+files.  You would add this:
+@example
+@group
+
+(defun my-vhdl-mode-hook ()
+  ;; use IEEE style for all VHDL code
+  (vhdl-set-style "IEEE")
+  ;; other customizations can go here
+  )
+(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
+
+@end group
+@end example
+
+@noindent
+@xref{Permanent Customization}.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Adding Styles, File Styles, Built-in Styles, Styles
+@comment  node-name,              next,                    previous,up
+
+@subsection  Adding Styles
+@cindex   Adding Styles
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-style-alist
+@vindex style-alist (vhdl-)
+@findex vhdl-add-style
+@findex add-style (vhdl-)
+If none of the built-in styles is appropriate, you'll probably want to
+add a new style definition.  Styles are kept in the @code{vhdl-style-alist}
+variable, but you probably won't want to modify this variable directly.
+@code{vhdl-mode} provides a function, called @code{vhdl-add-style}, that you
+can use to easily add new styles or update existing styles.  This
+function takes two arguments, a @var{stylename} string, and an
+association list @var{description} of style customizations.  If
+@var{stylename} is not already in @code{vhdl-style-alist}, the new style is
+added, otherwise the style already associated with @var{stylename} is
+changed to the new @var{description}.  This function also takes an
+optional third argument, which if non-@code{nil}, automatically
+institutes the new style in the current buffer.
+
+The sample @file{.emacs} file provides a concrete example of how a new
+style can be added and automatically set.  @xref{Sample .emacs File}.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     File Styles, ,  Adding Styles, Styles
+@comment  node-name,              next,                    previous,up
+
+@subsection  File Styles
+@cindex   File Styles
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@cindex local variables
+The Emacs manual describes how you can customize certain variables on a
+per-file basis by including a @dfn{Local Variable} block at the end of
+the file.  So far, you've only seen a functional interface to
+@code{vhdl-mode}, which is highly inconvenient for use in a Local Variable
+block.  @code{vhdl-mode} provides two variables that make it easier for
+you to customize your style on a per-file basis.
+
+@vindex vhdl-file-style
+@vindex file-style (vhdl-)
+@vindex vhdl-file-offsets
+@vindex file-offsets (vhdl-)
+
+The variable @code{vhdl-file-style} can be set to a style name string as
+described in @ref{Built-in Styles}.  When the file is visited,
+@code{vhdl-mode} will automatically set the file's style to this style
+using @code{vhdl-set-style}.
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+@findex vhdl-set-offset
+@findex set-offset (vhdl-)
+Another variable, @code{vhdl-file-offsets}, takes an association list
+similar to what is allowed in @code{vhdl-offsets-alist}.  When the file is
+visited, @code{vhdl-mode} will automatically institute these offets using
+@code{vhdl-set-offset}.  @xref{Customizing Indentation}.
+
+Note that file style settings (i.e. @code{vhdl-file-style}) are applied
+before file offset settings (i.e. @code{vhdl-file-offsets}).
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Advanced Customizations, , Styles, Customizing Indentation
+@comment  node-name,              next,                    previous,up
+
+@section  Advanced Customizations
+@cindex   Advanced Customizations
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-style-alist
+@vindex style-alist (vhdl-)
+@vindex vhdl-basic-offset
+@vindex basic-offset (vhdl-)
+For most users, @code{vhdl-mode} will support their coding styles with
+very little need for customizations.  Usually, one of the standard
+styles defined in @code{vhdl-style-alist} will do the trick.  Sometimes,
+one of the syntactic symbol offsets will need to be tweeked slightly, or
+perhaps @code{vhdl-basic-offset} will need to be changed.  However, some
+styles require a more advanced ability for customization, and one of the
+real strengths of @code{vhdl-mode} is that the syntactic analysis model
+provides a very flexible framework for customizing indentation. This
+allows you to perform special indentation calculations for situations
+not handled by the mode directly.
+
+@menu
+* Custom Indentation Functions::
+* Other Special Indentations::
+@end menu
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Custom Indentation Functions, Other Special Indentations, , Advanced Customizations
+@comment  node-name,              next,                    previous,up
+
+@subsection  Custom Indentation Functions
+@cindex   Custom Indentation Functions
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@cindex custom indentation functions
+One of the most common ways to customize @code{vhdl-mode} is by writing
+@dfn{custom indentation functions} and associating them with specific
+syntactic symbols (see @ref{Syntactic Symbols}).  @code{vhdl-mode} itself
+uses custom indentation functions to provide more sophisticated
+indentation, for example when lining up selected signal assignments:
+@example
+@group
+
+%%% TBD %%%
+
+@end group
+@end example
+
+In this example, the @code{statement-cont} syntactic symbol has an
+offset of @code{+}, and @code{vhdl-basic-offset} is 2, so lines 4
+through 6 are simply indented two spaces to the right of line 3.  But
+perhaps we'd like @code{vhdl-mode} to be a little more intelligent so
+that it offsets the waveform descriptions relative to the signal
+assignment operator in line 3.  To do this, we have to write a custom
+indentation function which finds the column of signal assignment
+operator on the first line of the statement.  Here is the lisp code
+(from the @file{vhdl-mode.el} source file) that implements this:
+@example
+@group
+
+(defun vhdl-lineup-statement-cont (langelem)
+  ;; line up statement-cont after the assignment operator
+  (save-excursion
+    (let* ((relpos (cdr langelem))
+	   (assignp (save-excursion
+		     (goto-char (vhdl-point 'boi))
+		     (and (re-search-forward "\\(<\\|:\\)="
+					     (vhdl-point 'eol) t)
+			  (- (point) (vhdl-point 'boi)))))
+	   (curcol (progn
+		     (goto-char relpos)
+		     (current-column)))
+	   foundp)
+      (while (and (not foundp)
+		  (< (point) (vhdl-point 'eol)))
+	(re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move)
+	(if (vhdl-in-literal (cdr langelem))
+	    (forward-char)
+	  (if (= (preceding-char) ?\()
+	      ;; skip over any parenthesized expressions
+	      (goto-char (min (vhdl-point 'eol)
+			      (scan-lists (point) 1 1)))
+	    ;; found an assignment operator (not at eol)
+	    (setq foundp (not (looking-at "\\s-*$"))))))
+      (if (not foundp)
+	  ;; there's no assignment operator on the line
+	  vhdl-basic-offset
+	;; calculate indentation column after assign and ws, unless
+	;; our line contains an assignment operator
+	(if (not assignp)
+	    (progn
+	      (forward-char)
+	      (skip-chars-forward " \t")
+	      (setq assignp 0)))
+	(- (current-column) assignp curcol))
+      )))
+
+@end group
+@end example
+@noindent
+Custom indent functions take a single argument, which is a syntactic
+component cons cell (see @ref{Syntactic Analysis}).  The
+function returns an integer offset value that will be added to the
+running total indentation for the lne.  Note that what actually gets
+returned is the difference between the column that the signal assignment
+operator is on, and the column of the buffer relative position passed in
+the function's argument.  Remember that @code{vhdl-mode} automatically
+adds in the column of the component's relative buffer position and we
+don't want that value added into the final total twice.
+
+@cindex statement-cont syntactic symbol
+@findex vhdl-lineup-statement-cont
+@findex lineup-statement-cont (vhdl-)
+Now, to associate the function @code{vhdl-lineup-statement-cont} with the
+@code{statement-cont} syntactic symbol, we can add something like the
+following to our @code{vhdl-mode-hook}:
+@example
+
+(vhdl-set-offset 'statement-cont 'vhdl-lineup-statement-cont)
+
+@end example
+
+@kindex C-c C-q
+Now the function looks like this after re-indenting (using @kbd{C-c
+C-q}):
+@example
+@group
+
+%%% TBD %%%
+
+@end group
+@end example
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+Custom indentation functions can be as simple or as complex as you like,
+and any syntactic symbol that appears in @code{vhdl-offsets-alist} can have
+a custom indentation function associated with it.  Note however that
+using many custom indentation functions may have a performance impact on
+@code{vhdl-mode}.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node     Other Special Indentations, , Custom Indentation Functions, Advanced Customizations
+@comment  node-name,              next,                    previous,up
+
+@subsection  Other Special Indentations
+@cindex   Other Special Indentations
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-special-indent-hook
+@vindex special-indent-hook (vhdl-)
+One other variable is available for you to customize @code{vhdl-mode}:
+@code{vhdl-special-indent-hook}.  This is a standard hook variable that
+is called after every line is indented by @code{vhdl-mode}.  You can use
+it to do any special indentation or line adjustments your style
+dictates, such as adding extra indentation to the port map clause in a
+component instantiation, etc.  Note however, that you should not change
+@code{point} or @code{mark} inside your @code{vhdl-special-indent-hook}
+functions.
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Syntactic Symbols, Frequently Asked Questions, Customizing Indentation, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  Syntactic Symbols
+@cindex   Syntactic Symbols
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@vindex vhdl-offsets-alist
+The complete list of recognized syntactic symbols is described in the
+@code{vhdl-offsets-alist} variable.  This chapter will provide some
+examples to help clarify these symbols.
+
+@cindex -open syntactic symbols
+@cindex -close syntactic symbols
+Most syntactic symbol names follow a general naming convention.  When a
+line begins with a @code{begin} or @code{end} keyword, the syntactic
+symbol will contain the suffix @code{-open} or @code{-close}
+respectively.
+
+@cindex -intro syntactic symbols
+@cindex -cont syntactic symbols
+@cindex -block-intro syntactic symbols
+Usually, a distinction is made between the first line that introduces a
+construct and lines that continue a construct, and the syntactic symbols
+that represent these lines will contain the suffix @code{-intro} or
+@code{-cont} respectively.  As a sub-classification of this scheme, a
+line which is the first of a particular block construct will contain the
+suffix @code{-block-intro}.
+
+@strong{<TBD> include the name and a brief example of every syntactic
+symbol currently recognized}
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Frequently Asked Questions, Getting the latest vhdl-mode release, Syntactic Symbols, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  Frequently Asked Questions
+@cindex   Frequently Asked Questions
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@kindex C-x h
+@kindex ESC C-\
+@kindex C-c C-q
+@kindex ESC C-q
+@kindex ESC C-u
+@kindex RET
+@kindex LFD
+@findex newline-and-indent
+@quotation
+
+@strong{Q.} @emph{How do I re-indent the whole file?}
+
+@strong{A.} Visit the file and hit @kbd{C-x h} to mark the whole
+buffer. Then hit @kbd{@key{ESC} C-\} to re-indent the entire region
+which you've just marked.
+@sp 2
+
+@strong{Q.} @emph{How do I re-indent the entire function?}
+
+@strong{A.} Hit @kbd{@key{ESC} C-h} to mark the entire function. Then
+hit @kbd{@key{ESC} C-\} to re-indent the entire region which you've just
+marked.
+@sp 2
+
+@strong{Q.} @emph{How do I re-indent the current block?}
+
+@strong{A.} First move to the brace which opens the block with
+@kbd{@key{ESC} C-u}, then re-indent that expression with
+@kbd{@key{ESC} C-q}.
+@sp 2
+
+@strong{Q.} @emph{How do I re-indent the current statement?}
+
+@strong{A.} First move to the beginning of the statement with
+@kbd{@key{ESC} a}, then re-indent that expression with @kbd{@key{ESC}
+C-q}.
+@sp 2
+
+@strong{Q.} @emph{Why doesn't the @key{RET} key indent the line to
+where the new text should go after inserting the newline?}
+
+@strong{A.} Emacs' convention is that @key{RET} just adds a newline,
+and that @key{LFD} adds a newline and indents it.  You can make
+@key{RET} do this too by adding this to your
+@code{vhdl-mode-hook} (see the sample @file{.emacs} file
+@ref{Sample .emacs File}):
+@example
+
+(define-key vhdl-mode-map "\C-m" 'newline-and-indent)
+
+@end example
+
+This is a very common question. @code{:-)} If you want this to be the
+default behavior, don't lobby me, lobby RMS!
+@sp 2
+
+@strong{Q.} @emph{I put @code{(vhdl-set-offset 'statement-cont 0)}
+in my @file{.emacs} file but I get an error saying that
+@code{vhdl-set-offset}'s function definition is void.}
+
+@strong{A.} This means that @code{vhdl-mode} wasn't loaded into your
+Emacs session by the time the @code{vhdl-set-offset} call was reached,
+mostly likely because @code{vhdl-mode} is being autoloaded.  Instead
+of putting the @code{vhdl-set-offset} line in your top-level
+@file{.emacs} file, put it in your @code{vhdl-mode-hook}, or
+simply add the following to the top of your @file{.emacs} file:
+@example
+
+(require 'vhdl-mode)
+
+@end example
+
+See the sample @file{.emacs} file @ref{Sample .emacs File} for
+details.
+
+@end quotation
+
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Getting the latest vhdl-mode release, Sample .emacs File, Frequently Asked Questions, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  Getting the latest @code{vhdl-mode} release
+@cindex   Getting the latest @code{vhdl-mode} release
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+The best way to be sure you always have the latest @code{vhdl-mode}
+release is to join the @code{vhdl-mode-announce} mailing list.  If you
+are a brave soul, and wish to participate in beta testing of new
+releases of @code{vhdl-mode}, you may also join the
+@code{vhdl-mode-victims} mailing list.  Send email to the author to join
+either of these lists.
+
+The canonical anonymous FTP URL for @code{vhdl-mode} is
+@code{ftp://ftp.eda.com.au/pub/emacs/vhdl-mode.tar.gz}.  Special thanks
+to Ken Wood <ken@@eda.com.au> for providing an FTP repository for
+@code{vhdl-mode}.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Sample .emacs File, Requirements, Getting the latest vhdl-mode release, Top
+@comment  node-name,              next,                    previous,up
+
+@chapter  Sample @file{.emacs} file
+@cindex   Sample @file{.emacs} file
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@example
+;; Here's a sample .emacs file that might help you along the way.  Just
+;; copy this region and paste it into your .emacs file.  You may want to
+;; change some of the actual values.
+
+(defconst my-vhdl-style
+  '((vhdl-tab-always-indent        . t)
+    (vhdl-comment-only-line-offset . 4)
+    (vhdl-offsets-alist            . ((arglist-close    . vhdl-lineup-arglist)
+                                      (statement-cont   . 0)
+                                      (case-alternative . 4)
+                                      (block-open       . 0)))
+    (vhdl-echo-syntactic-information-p . t)
+    )
+  "My VHDL Programming Style")
+
+;; Customizations for vhdl-mode
+(defun my-vhdl-mode-hook ()
+  ;; add my personal style and set it for the current buffer
+  (vhdl-add-style "PERSONAL" my-vhdl-style t)
+  ;; offset customizations not in my-vhdl-style
+  (vhdl-set-offset 'statement-case-intro '++)
+  ;; other customizations
+  (setq tab-width 8
+        ;; this will make sure spaces are used instead of tabs
+        indent-tabs-mode nil)
+  ;; keybindings for VHDL are put in vhdl-mode-map
+  (define-key vhdl-mode-map "\C-m" 'newline-and-indent)
+  )
+
+;; the following only works in Emacs 19
+;; Emacs 18ers can use (setq vhdl-mode-hook 'my-vhdl-mode-hook)
+(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
+@end example
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Requirements, Limitations and Known Bugs, Sample .emacs File, Top
+@comment  node-name,              next,                    previous,up
+@chapter  Requirements
+@cindex   Requirements
+@comment * Requirements
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@cindex reporter.el
+@file{vhdl-mode.el} requires @file{reporter.el} for submission of bug
+reports.  @file{reporter.el} is distributed with the latest FSF and
+XEmacs 19's.  Here is the Emacs Lisp Archive anonymous ftp'ing
+record for those of you who are using older Emacsen.
+
+@comment * Here's the Emacs Lisp Archive information for @file{reporter.el}:
+@example
+
+         GNU Emacs Lisp Code Directory Apropos -- "reporter"
+"~/" refers to archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive/
+
+reporter (2.12)       06-Jul-1994
+     Barry A. Warsaw, <bwarsaw@@cen.com>
+     ~/misc/reporter.el.Z
+     Customizable bug reporting of lisp programs.
+
+@end example
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node  Limitations and Known Bugs, Mailing Lists and Submitting Bug Reports, Requirements, Top
+@comment  node-name,              next,                    previous,up
+@chapter  Limitations and Known Bugs
+@cindex   Limitations and Known Bugs
+@comment * Limitations and Known Bugs
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@itemize @bullet
+@item
+Re-indenting large regions or expressions can be slow.
+
+@item
+Use with Emacs 18 can be slow and annoying. You should seriously
+consider upgrading to Emacs 19.
+
+@end itemize
+
+@node  Mailing Lists and Submitting Bug Reports, Concept Index, Limitations and Known Bugs, Top
+@comment  node-name,              next,                    previous,up
+@chapter  Mailing Lists and Submitting Bug Reports
+@cindex   Mailing Lists and Submitting Bug Reports
+@comment * Mailing Lists and Submitting Bug Reports
+
+@kindex C-c C-b
+@findex vhdl-submit-bug-report
+@findex submit-bug-report (vhdl-)
+@cindex beta testers mailing list
+@cindex announcement mailing list
+To report bugs, use the @kbd{C-c C-b} (@code{vhdl-submit-bug-report})
+command.  This provides vital information I need to reproduce your
+problem.  Make sure you include a concise, but complete code example.
+Please try to boil your example down to just the essential code needed
+to reproduce the problem, and include an exact recipe of steps needed to
+expose the bug.  Be especially sure to include any code that appears
+@emph{before} your bug example.
+
+For other help or suggestions, send a message to
+@code{rwhitby@@asc.corp.mot.com}.
+
+Send an add message to @code{rwhitby@@asc.corp.mot.com} to get on the
+@code{vhdl-mode-victims} beta testers list where beta releases of
+@code{vhdl-mode} are posted.  Note that you shouldn't expect beta
+releases to be as stable as public releases.
+
+There is also an announce only list where the latest public releases of
+@code{vhdl-mode} are posted.  Send an add message to
+@code{rwhitby@@asc.corp.mot.com} to be added to this list.
+
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node    Concept Index, Command Index,  Mailing Lists and Submitting Bug Reports, Top
+@comment node-name,    next,  previous,      up
+@unnumbered Concept Index
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@printindex cp
+
+
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node    Command Index, Key Index,  Concept Index, Top
+@comment node-name,    next,  previous,      up
+@unnumbered Command Index
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@ifinfo
+
+@end ifinfo
+Since all @code{vhdl-mode} commands are prepended with the string
+@samp{vhdl-}, each appears under its @code{vhdl-<thing>} name and its
+@code{<thing> (vhdl-)} name.
+@iftex
+@sp 2
+@end iftex
+@printindex fn
+
+
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node    Key Index, Variable Index,  Command Index, Top
+@comment node-name,    next,  previous,      up
+@unnumbered Key Index
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@printindex ky
+
+
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node    Variable Index,    ,  Key Index, Top
+@comment node-name,    next,  previous,      up
+@unnumbered Variable Index
+@c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+@ifinfo
+
+@end ifinfo
+Since all @code{vhdl-mode} variables are prepended with the string
+@samp{vhdl-}, each appears under its @code{vhdl-<thing>} name and its
+@code{<thing> (vhdl-)} name.
+@iftex
+@sp 2
+@end iftex
+@printindex vr
+@summarycontents
+@contents
+@bye
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ChangeLog	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,34 @@
+Tue Dec 10 11:17:32 1996  Shane Holder  <holder@mordor.rsn.hp.com>
+
+	* s/hpux9shxr4.h: hpux9shr.h -> hpux9-shr.h
+
+	* s/hpux10.h: hpux9shr.h -> hpux9-shr.h
+
+Sat Dec  7 18:29:34 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* puresize.h (BASE_PURESIZE): Bumped up PURESIZE by 10k.
+
+Sat Dec  7 16:26:34 1996  Martin Buchholz  <mrb@Eng.Sun.COM>
+
+	* config.h.in: configure for POSIX getcwd if available.
+
+Sat Dec  7 15:48:39 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* s/sunos4-1-shr.h: Renamed from sunos4-1shr.h.
+
+	* s/sunos4-1-3-shr.h: Renamed from sunos4-1-3shr.h.
+
+	* s/sunos4-1-2-shr.h: Renamed from sunos4-1-2-shr.h.
+
+	* s/sunos4-0-shr.h: Renamed from sunos4-0shr.h.
+
+	* s/hpux9-shr.h: Renamed from hpux9shr.h.
+
+	* s/hpux8-shr.h: Renamed from hpux8shr.h.
+
+	* s/hpux10-shr.h: Renamed from hpux10shr.h.
+
+Wed Dec  4 23:38:03 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* redisplay.c: Allow column numbers in modeline to start from 1.
+
--- a/src/config.h.in	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/config.h.in	Mon Aug 13 09:03:46 2007 +0200
@@ -171,6 +171,7 @@
 #undef HAVE_GETPAGESIZE
 #undef HAVE_GETTIMEOFDAY
 #undef HAVE_GETWD
+#undef HAVE_GETCWD
 #undef HAVE_LOGB
 #undef HAVE_LRAND48
 #undef HAVE_MATHERR
--- a/src/event-stream.c	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/event-stream.c	Mon Aug 13 09:03:46 2007 +0200
@@ -78,6 +78,9 @@
 /* Hook run when XEmacs is about to be idle. */
 Lisp_Object Qpre_idle_hook, Vpre_idle_hook;
 
+/* Control gratuitous keyboard focus throwing. */
+int focus_follows_mouse;
+
 #ifdef ILL_CONCEIVED_HOOK
 /* Hook run after a command if there's no more input soon.  */
 Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook;
@@ -1638,6 +1641,7 @@
 	 in emacs_handle_focus_change_final() is based on the _FOR_HOOKS
 	 value, we need to do so too. */
       if (!NILP (sel_frame) &&
+	  !focus_follows_mouse &&
 	  !EQ (DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS (d), sel_frame) &&
 	  !NILP (DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d)) &&
 	  !EQ (DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d), sel_frame))
@@ -4165,6 +4169,13 @@
 */ );
   Vpre_idle_hook = Qnil;
 
+  DEFVAR_BOOL ("focus-follows-mouse", &focus_follows_mouse /*
+Variable to control XEmacs behavior with respect to focus changing.
+If this variable is set to t, then XEmacs will not gratuitously change
+the keyboard focus.
+*/ );
+  focus_follows_mouse = 0;
+
 #ifdef ILL_CONCEIVED_HOOK
   /* Ill-conceived because it's not run in all sorts of cases
      where XEmacs is blocking.  That's what `pre-idle-hook'
--- a/src/puresize.h	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/puresize.h	Mon Aug 13 09:03:46 2007 +0200
@@ -32,9 +32,9 @@
    things configured in. */
 
 #if (LONGBITS == 64)
-# define BASE_PURESIZE 912000
+# define BASE_PURESIZE 922000
 #else
-# define BASE_PURESIZE 552000
+# define BASE_PURESIZE 562000
 #endif
 
 /* If any particular systems need to change the base puresize, they
--- a/src/redisplay.c	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/redisplay.c	Mon Aug 13 09:03:46 2007 +0200
@@ -477,6 +477,7 @@
 Lisp_Object Vuse_left_overflow, Vuse_right_overflow;
 Lisp_Object Vtext_cursor_visible_p;
 
+int column_number_start_at_one;
 
 /***************************************************************************/
 /*									   */
@@ -5703,7 +5704,7 @@
       /* print the current column */
     case 'c':
       {
-	int col = current_column (b);
+	int col = current_column (b) + (column_number_start_at_one != 0);
 	int temp = col;
 	int size = 2;
 	char *buf;
@@ -8298,6 +8299,11 @@
 See `set-window-redisplay-end-trigger'.
 */ );
   Vredisplay_end_trigger_functions = Qnil;
+
+  DEFVAR_BOOL ("column-number-start-at-one", &column_number_start_at_one /*
+Non-nil means column display number starts at 1.
+*/ );
+  column_number_start_at_one = 1;
 }
 
 void
@@ -8397,4 +8403,5 @@
 				      text_cursor_visible_p),
 			 text_cursor_visible_p_changed,
 			 0, 0);
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/hpux10-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,29 @@
+/* Synched up with: FSF 19.31. */
+
+/* For building XEmacs under HPUX 10.0 with dynamic libraries. */
+
+#define ORDINARY_LINK
+
+/* XEmacs change */
+/* Only support for hp9000s300 currently */
+#if !defined(__hp9000s300)
+#define HPUX_USE_SHLIBS
+#endif /* !hp9000s300 */
+
+/* XEmacs: */
+/* Don't tell the linker to link statically */
+#ifdef NOT_C_CODE
+#define START_FILES
+#define LINKER $(CC)
+#endif /* THIS IS YMAKEFILE */
+
+/* get call to brk() when rerunning XEmacs */
+#define RUN_TIME_REMAP
+
+#include "hpux10.h"
+
+/* We must turn off -g since it forces -static.  */
+#ifdef __GNUC__
+#undef C_DEBUG_SWITCH
+#define C_DEBUG_SWITCH
+#endif
--- a/src/s/hpux10.h	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/s/hpux10.h	Mon Aug 13 09:03:46 2007 +0200
@@ -2,7 +2,7 @@
 
 /* System description file for hpux version 10.  */
 
-#include "hpux9shr.h"
+#include "hpux9-shr.h"
 
 /* We have to go this route, rather than hpux9's approach of renaming the
    functions via macros.  The system's stdlib.h has fully prototyped
--- a/src/s/hpux10shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/* Synched up with: FSF 19.31. */
-
-/* For building XEmacs under HPUX 10.0 with dynamic libraries. */
-
-#define ORDINARY_LINK
-
-/* XEmacs change */
-/* Only support for hp9000s300 currently */
-#if !defined(__hp9000s300)
-#define HPUX_USE_SHLIBS
-#endif /* !hp9000s300 */
-
-/* XEmacs: */
-/* Don't tell the linker to link statically */
-#ifdef NOT_C_CODE
-#define START_FILES
-#define LINKER $(CC)
-#endif /* THIS IS YMAKEFILE */
-
-/* get call to brk() when rerunning XEmacs */
-#define RUN_TIME_REMAP
-
-#include "hpux10.h"
-
-/* We must turn off -g since it forces -static.  */
-#ifdef __GNUC__
-#undef C_DEBUG_SWITCH
-#define C_DEBUG_SWITCH
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/hpux8-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,19 @@
+/* Synched up with: Not in FSF. */
+
+/* For building XEmacs under HPUX 8.0 with dynamic libraries. */
+
+/* Don't tell the linker to link statically */
+#ifdef NOT_C_CODE
+/* now done in hpux8.h */
+/* #define LD_SWITCH_SYSTEM -L/usr/lib/X11R4 -L/usr/lib/Motif1.1 */
+#ifdef __GNUC__
+#define LIB_STANDARD
+#endif
+#endif /* THIS IS YMAKEFILE */
+
+/* get call to brk() when rerunning XEmacs */
+#define RUN_TIME_REMAP
+
+#define HPUX_USE_SHLIBS
+
+#include "hpux8.h"
--- a/src/s/hpux8shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/* Synched up with: Not in FSF. */
-
-/* For building XEmacs under HPUX 8.0 with dynamic libraries. */
-
-/* Don't tell the linker to link statically */
-#ifdef NOT_C_CODE
-/* now done in hpux8.h */
-/* #define LD_SWITCH_SYSTEM -L/usr/lib/X11R4 -L/usr/lib/Motif1.1 */
-#ifdef __GNUC__
-#define LIB_STANDARD
-#endif
-#endif /* THIS IS YMAKEFILE */
-
-/* get call to brk() when rerunning XEmacs */
-#define RUN_TIME_REMAP
-
-#define HPUX_USE_SHLIBS
-
-#include "hpux8.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/hpux9-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,37 @@
+/* Synched up with: FSF 19.31. */
+
+/* For building XEmacs under HPUX 9.0 with dynamic libraries. */
+
+#define ORDINARY_LINK
+
+/* XEmacs change */
+/* Only support for hp9000s700 currently */
+#if !defined(__hp9000s300)
+/* #ifndef USE_GCC */
+#define HPUX_USE_SHLIBS
+/* #endif */
+#endif /* !hp9000s300 */
+
+/* XEmacs: */
+/* Don't tell the linker to link statically */
+#ifdef NOT_C_CODE
+#define START_FILES
+#define LINKER $(CC)
+/* now done in hpux8.h */
+/* #define LD_SWITCH_SYSTEM -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 */
+#endif /* THIS IS YMAKEFILE */
+
+/* get call to brk() when rerunning XEmacs */
+/* #ifndef USE_GCC */
+#define RUN_TIME_REMAP
+/* #endif */
+
+#include "hpux9.h"
+
+#if 0 /* No longer needed, since in current GCC -g no longer does that.  */
+/* We must turn off -g since it forces -static.  */
+#ifdef __GNUC__
+#undef C_DEBUG_SWITCH
+#define C_DEBUG_SWITCH
+#endif
+#endif
--- a/src/s/hpux9shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/* Synched up with: FSF 19.31. */
-
-/* For building XEmacs under HPUX 9.0 with dynamic libraries. */
-
-#define ORDINARY_LINK
-
-/* XEmacs change */
-/* Only support for hp9000s700 currently */
-#if !defined(__hp9000s300)
-/* #ifndef USE_GCC */
-#define HPUX_USE_SHLIBS
-/* #endif */
-#endif /* !hp9000s300 */
-
-/* XEmacs: */
-/* Don't tell the linker to link statically */
-#ifdef NOT_C_CODE
-#define START_FILES
-#define LINKER $(CC)
-/* now done in hpux8.h */
-/* #define LD_SWITCH_SYSTEM -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 */
-#endif /* THIS IS YMAKEFILE */
-
-/* get call to brk() when rerunning XEmacs */
-/* #ifndef USE_GCC */
-#define RUN_TIME_REMAP
-/* #endif */
-
-#include "hpux9.h"
-
-#if 0 /* No longer needed, since in current GCC -g no longer does that.  */
-/* We must turn off -g since it forces -static.  */
-#ifdef __GNUC__
-#undef C_DEBUG_SWITCH
-#define C_DEBUG_SWITCH
-#endif
-#endif
--- a/src/s/hpux9shxr4.h	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/s/hpux9shxr4.h	Mon Aug 13 09:03:46 2007 +0200
@@ -1,6 +1,6 @@
 /* Synched up with: FSF 19.31. */
 
-#include "hpux9shr.h"
+#include "hpux9-shr.h"
 
 #undef  C_SWITCH_X_SYSTEM
 #define C_SWITCH_X_SYSTEM -I/usr/include/Motif1.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/sunos4-0-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,63 @@
+/* Synched up with: FSF 19.31. (Split off from sunos4shr.h.) */
+
+/* This file permits building Emacs with a shared libc on Sunos 4.
+   To make this work, you must completely replace your C shared library
+   using one of the SunOS 4.1.x jumbo replacement patches from Sun.
+   Here are the patch numbers for Sunos 4.1.3:
+   100890-10   SunOS 4.1.3: domestic libc jumbo patch
+   100891-10   SunOS 4.1.3: international libc jumbo patch  */
+
+
+#include "sunos4-0.h"
+
+/* Say that the text segment of a.out includes the header;
+   the header actually occupies the first few bytes of the text segment
+   and is counted in hdr.a_text.  */
+
+/*  Misleading!  Actually gets loaded after crt0.o */
+#undef START_FILES
+#define START_FILES pre-crt0.o
+
+/*
+ *  Kludge!  can't get at symbol "start" in std crt0.o
+ *  Who the #$%&* decided to remove the __ characters!
+ *  Someone needs to fix this in sysdep.c  with an #ifdef BROKEN_START in
+ * sysdep.c.  We do not use this address so any value should do really.  Still
+ *  may need it in the future?
+ */
+#define BROKEN_START
+#ifndef TEXT_START
+#define TEXT_START 0x2020
+#endif
+
+#undef UNEXEC
+#define UNEXEC	unexsunos4.o
+#ifndef RUN_TIME_REMAP
+#define RUN_TIME_REMAP
+#endif
+#define ORDINARY_LINK
+#define SUNOS4_SHARED_LIBRARIES
+
+#undef LD_SWITCH_SYSTEM
+
+#undef	SYSTEM_MALLOC
+#ifndef GNU_MALLOC
+#define	GNU_MALLOC
+#endif
+#ifndef REL_ALLOC
+#define	REL_ALLOC
+#endif
+
+#undef USE_DL_STUBS
+
+#ifndef HAVE_X11R6
+/* With X11R5 it was reported that linking -lXmu dynamically
+   did not work.  With X11R6, it does work; and since normally
+   only the dynamic libraries are available, we should use them.  */
+#ifdef __GNUC__
+#define LIBXMU -Xlinker -Bstatic -lXmu -Xlinker -Bdynamic
+#else
+#define LIBXMU -Bstatic -lXmu -Bdynamic
+#endif
+
+#endif  /* not HAVE_X11R6 */
--- a/src/s/sunos4-0shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/* Synched up with: FSF 19.31. (Split off from sunos4shr.h.) */
-
-/* This file permits building Emacs with a shared libc on Sunos 4.
-   To make this work, you must completely replace your C shared library
-   using one of the SunOS 4.1.x jumbo replacement patches from Sun.
-   Here are the patch numbers for Sunos 4.1.3:
-   100890-10   SunOS 4.1.3: domestic libc jumbo patch
-   100891-10   SunOS 4.1.3: international libc jumbo patch  */
-
-
-#include "sunos4-0.h"
-
-/* Say that the text segment of a.out includes the header;
-   the header actually occupies the first few bytes of the text segment
-   and is counted in hdr.a_text.  */
-
-/*  Misleading!  Actually gets loaded after crt0.o */
-#undef START_FILES
-#define START_FILES pre-crt0.o
-
-/*
- *  Kludge!  can't get at symbol "start" in std crt0.o
- *  Who the #$%&* decided to remove the __ characters!
- *  Someone needs to fix this in sysdep.c  with an #ifdef BROKEN_START in
- * sysdep.c.  We do not use this address so any value should do really.  Still
- *  may need it in the future?
- */
-#define BROKEN_START
-#ifndef TEXT_START
-#define TEXT_START 0x2020
-#endif
-
-#undef UNEXEC
-#define UNEXEC	unexsunos4.o
-#ifndef RUN_TIME_REMAP
-#define RUN_TIME_REMAP
-#endif
-#define ORDINARY_LINK
-#define SUNOS4_SHARED_LIBRARIES
-
-#undef LD_SWITCH_SYSTEM
-
-#undef	SYSTEM_MALLOC
-#ifndef GNU_MALLOC
-#define	GNU_MALLOC
-#endif
-#ifndef REL_ALLOC
-#define	REL_ALLOC
-#endif
-
-#undef USE_DL_STUBS
-
-#ifndef HAVE_X11R6
-/* With X11R5 it was reported that linking -lXmu dynamically
-   did not work.  With X11R6, it does work; and since normally
-   only the dynamic libraries are available, we should use them.  */
-#ifdef __GNUC__
-#define LIBXMU -Xlinker -Bstatic -lXmu -Xlinker -Bdynamic
-#else
-#define LIBXMU -Bstatic -lXmu -Bdynamic
-#endif
-
-#endif  /* not HAVE_X11R6 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/sunos4-1-2-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,14 @@
+/* Synched up with: Not in FSF. */
+
+/* For building XEmacs under SunOS 4.1.* with dynamic libraries. */
+
+#ifdef NOT_C_CODE
+# ifdef USE_GCC
+  /* of course gcc has to take different args than the rest of the universe */
+#  define LD_SWITCH_SYSTEM -dynamic
+# else
+#  define LD_SWITCH_SYSTEM -Bdynamic
+# endif
+#endif
+
+#include "sunos4-1-2.h"
--- a/src/s/sunos4-1-2shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-/* Synched up with: Not in FSF. */
-
-/* For building XEmacs under SunOS 4.1.* with dynamic libraries. */
-
-#ifdef NOT_C_CODE
-# ifdef USE_GCC
-  /* of course gcc has to take different args than the rest of the universe */
-#  define LD_SWITCH_SYSTEM -dynamic
-# else
-#  define LD_SWITCH_SYSTEM -Bdynamic
-# endif
-#endif
-
-#include "sunos4-1-2.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/sunos4-1-3-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,14 @@
+/* Synched up with: Not in FSF. */
+
+/* For building XEmacs under SunOS 4.1.* with dynamic libraries. */
+
+#ifdef NOT_C_CODE
+# ifdef USE_GCC
+  /* of course gcc has to take different args than the rest of the universe */
+#  define LD_SWITCH_SYSTEM -dynamic
+# else
+#  define LD_SWITCH_SYSTEM -Bdynamic
+# endif
+#endif
+
+#include "sunos4-1-3.h"
--- a/src/s/sunos4-1-3shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-/* Synched up with: Not in FSF. */
-
-/* For building XEmacs under SunOS 4.1.* with dynamic libraries. */
-
-#ifdef NOT_C_CODE
-# ifdef USE_GCC
-  /* of course gcc has to take different args than the rest of the universe */
-#  define LD_SWITCH_SYSTEM -dynamic
-# else
-#  define LD_SWITCH_SYSTEM -Bdynamic
-# endif
-#endif
-
-#include "sunos4-1-3.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/sunos4-1-shr.h	Mon Aug 13 09:03:46 2007 +0200
@@ -0,0 +1,14 @@
+/* Synched up with: Not in FSF. */
+
+/* For building XEmacs under SunOS 4.1.* with dynamic libraries. */
+
+#ifdef NOT_C_CODE
+# ifdef USE_GCC
+  /* of course gcc has to take different args than the rest of the universe */
+#  define LD_SWITCH_SYSTEM -dynamic
+# else
+#  define LD_SWITCH_SYSTEM -Bdynamic
+# endif
+#endif
+
+#include "sunos4-1.h"
--- a/src/s/sunos4-1shr.h	Mon Aug 13 09:03:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-/* Synched up with: Not in FSF. */
-
-/* For building XEmacs under SunOS 4.1.* with dynamic libraries. */
-
-#ifdef NOT_C_CODE
-# ifdef USE_GCC
-  /* of course gcc has to take different args than the rest of the universe */
-#  define LD_SWITCH_SYSTEM -dynamic
-# else
-#  define LD_SWITCH_SYSTEM -Bdynamic
-# endif
-#endif
-
-#include "sunos4-1.h"