changeset 82:6a378aca36af r20-0b91

Import from CVS: tag r20-0b91
author cvs
date Mon, 13 Aug 2007 09:07:36 +0200
parents ebca3d831cea
children ba3ba6e17456
files CHANGES-beta ChangeLog configure configure.in etc/sample.emacs etc/sgml/HTML32.dtd etc/toolbar/ediff-A-up.xbm etc/toolbar/ediff-A-up.xpm etc/toolbar/ediff-A-xx.xpm etc/toolbar/ediff-B-up.xbm etc/toolbar/ediff-B-up.xpm etc/toolbar/ediff-B-xx.xpm etc/toolbar/ediff-help.xbm etc/toolbar/ediff-help.xpm etc/toolbar/ediff-next.xbm etc/toolbar/ediff-next.xpm etc/toolbar/ediff-prev.xbm etc/toolbar/ediff-prev.xpm etc/toolbar/ediff-quit.xbm etc/toolbar/ediff-quit.xpm etc/toolbar/ediff-refine.xbm etc/toolbar/ediff-refine.xpm etc/toolbar/ediff-save-xx.xbm etc/toolbar/ediff-save-xx.xpm etc/toolbar/ediff-save.xbm etc/toolbar/ediff-save.xpm etc/toolbar/ediff-toggle-split-up.xbm etc/toolbar/ediff-toggle-split-up.xpm etc/toolbar/ediff-update.xbm etc/toolbar/ediff-update.xpm etc/w3/stylesheet info/dir lib-src/make-docfile.c lib-src/tm-au lisp/ChangeLog lisp/comint/telnet.el lisp/dired/dired.el lisp/ediff/Makefile lisp/ediff/README lisp/ediff/ediff-diff.el lisp/ediff/ediff-help.el lisp/ediff/ediff-hook.el lisp/ediff/ediff-init.el lisp/ediff/ediff-merg.el lisp/ediff/ediff-mult.el lisp/ediff/ediff-ptch.el lisp/ediff/ediff-tbar.el lisp/ediff/ediff-util.el lisp/ediff/ediff-vers.el lisp/ediff/ediff-wind.el lisp/ediff/ediff.el lisp/modes/imenu.el lisp/modes/m4-mode.el lisp/modes/rsz-minibuf.el lisp/modes/view.el lisp/mule/mule-files.el lisp/mule/mule-init.el lisp/mule/mule-misc.el lisp/packages/compile.el lisp/packages/func-menu.el lisp/packages/hyper-apropos.el lisp/packages/info.el lisp/packages/man.el lisp/packages/mode-motion+.el lisp/packages/ps-print.el lisp/prim/auto-autoloads.el lisp/prim/files.el lisp/prim/window.el lisp/psgml/ChangeLog lisp/psgml/psgml.el lisp/tl/emu-x20.el lisp/tl/tl-str.el lisp/tm/tm-edit.el lisp/utils/bench.el lisp/utils/finder.el lisp/utils/timezone.el lisp/version.el lisp/viper/Makefile lisp/viper/README lisp/viper/viper-ex.el lisp/viper/viper-init.el lisp/viper/viper-keym.el lisp/viper/viper-macs.el lisp/viper/viper-mous.el lisp/viper/viper-util.el lisp/viper/viper.el lisp/w3/ChangeLog lisp/w3/Makefile lisp/w3/base64.el lisp/w3/css.el lisp/w3/default.css lisp/w3/dsssl.el lisp/w3/font.el lisp/w3/images.el lisp/w3/md5.el lisp/w3/mm.el lisp/w3/mule-sysdp.el lisp/w3/socks.el lisp/w3/ssl.el lisp/w3/todo lisp/w3/url-auth.el lisp/w3/url-cookie.el lisp/w3/url-file.el lisp/w3/url-gopher.el lisp/w3/url-gw.el lisp/w3/url-http.el lisp/w3/url-irc.el lisp/w3/url-mail.el lisp/w3/url-misc.el lisp/w3/url-news.el lisp/w3/url-nfs.el lisp/w3/url-parse.el lisp/w3/url-pgp.el lisp/w3/url-vars.el lisp/w3/url-wais.el lisp/w3/url.el lisp/w3/urlauth.el lisp/w3/w3-about.el lisp/w3/w3-annotat.el lisp/w3/w3-auto.el lisp/w3/w3-display.el lisp/w3/w3-e19.el lisp/w3/w3-emulate.el lisp/w3/w3-forms.el lisp/w3/w3-hot.el lisp/w3/w3-imap.el lisp/w3/w3-keyword.el lisp/w3/w3-latex.el lisp/w3/w3-menu.el lisp/w3/w3-mouse.el lisp/w3/w3-parse.el lisp/w3/w3-prefs.el lisp/w3/w3-print.el lisp/w3/w3-speak.el lisp/w3/w3-style.el lisp/w3/w3-sysdp.el lisp/w3/w3-toolbar.el lisp/w3/w3-vars.el lisp/w3/w3-widget.el lisp/w3/w3-xemac.el lisp/w3/w3.el lisp/w3/widget-edit.el lisp/w3/widget.el lisp/x11/x-font-menu.el lisp/x11/x-menubar.el lwlib/lwlib-Xaw.c man/ediff.texi man/viper.texi man/w3.texi man/xemacs-faq.texi src/ChangeLog src/EmacsFrame.c src/Makefile.in.in src/buffer.c src/buffer.h src/config.h.in src/emacsfns.h src/energize.c src/event-Xt.c src/event-stream.c src/fileio.c src/getloadavg.c src/glyphs-x.c src/glyphs.c src/hpplay.c src/lread.c src/lstream.c src/m/aviion.h src/menubar-x.c src/nas.c src/process.c src/puresize.h src/redisplay-output.c src/redisplay-tty.c src/redisplay.c src/regex.c src/s/dgux5-4r4.h src/s/nextstep.h src/scrollbar-x.c src/scrollbar-x.h src/scrollbar.c src/specifier.c src/symbols.c src/sysdep.c src/vmsfns.c src/vmsproc.c
diffstat 186 files changed, 12479 insertions(+), 6305 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 09:06:45 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 09:07:36 2007 +0200
@@ -1,4 +1,13 @@
 							-*- indented-text -*-
+to 20.0 beta91
+-- func-menu.el-2.45
+-- ediff-2.64
+-- viper-2.92
+-- w3-3.0.50
+-- html 3.2 final dtd added.
+-- Miscellaneous bug fixes
+-- ps-print.el-3.05 Courtesy of Jacques Duthen Prestataire
+
 to 20.0 beta90
 -- ediff-2.64
 -- viper-2.92
--- a/ChangeLog	Mon Aug 13 09:06:45 2007 +0200
+++ b/ChangeLog	Mon Aug 13 09:07:36 2007 +0200
@@ -1,4 +1,40 @@
+Wed Jan 22 21:07:17 1997  Steven L Baur  <steve@altair.xemacs.org>
+	* XEmacs 20.0-b91 (prerelease 2) is released.
+
+	* configure.in (--with-scrollbars): Add Athena3d as a toolkit
+	type.
+
+	* lwlib/lwlib-Xaw.c (xaw_update_one_widget): Let Athena 3d have 0
+	borderwidth.
+	(xaw_scrollbar_scroll): Use SCROLLBAR_LINE_UP and
+	SCROLLBAR_LINE_DOWN since that's current the only to get to the
+	bottom of the buffer. :-(
+
+Tue Jan 21 20:01:19 1997  Steven L. Baur  <steve@altair.xemacs.org>
+
+	* configure.in (beta): Add LWLIB_USES_ATHENA for odd
+	configurations that use both Motif and Athena.
+
+	* etc/sgml/HTML32.dtd: html-3.2 final dtd added.
+
+Wed Jan 15 12:55:19 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* info/dir (Gnus): Updated spelling and info.
+
+Mon Jan 13 13:37:27 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* configure.in: Remove assignment of NON_GNU_CPP for irix-6.0.
+
+Mon Jan 13 00:36:01 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* lib-src/make-docfile.c (scan_lisp_file): eliminate doc-string
+	warnings for ccl-read-*
+
 Sat Jan 11 12:05:31 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* etc/sample.emacs: Remove code snippet that wipes out the cycle
+	buffer modeline feature.
+
 	* XEmacs 20.0 beta90 (prerelease 1) is released.
 	* XEmacs 19.15 beta90 (prerelease 1) is released.
 	
--- a/configure	Mon Aug 13 09:06:45 2007 +0200
+++ b/configure	Mon Aug 13 09:07:36 2007 +0200
@@ -202,8 +202,9 @@
 --with-menubars=TYPE	Use TYPE menubars (lucid, motif, or no).  The Lucid
 			widgets emulate Motif (mostly) but are faster.
 			*WARNING*  The Motif menubar is currently broken.
---with-scrollbars=TYPE	Use TYPE scrollbars (lucid, motif, athena, or no).
---with-dialogs=TYPE	Use TYPE dialog boxes (motif, athena, or no).
+--with-scrollbars=TYPE	Use TYPE scrollbars (lucid, motif, athena, 
+			athena3d, or no).
+--with-dialogs=TYPE	Use TYPE dialog boxes (motif, athena, athena3d, or no).
 			(Lucid menubars and scrollbars are the default.
 			 Motif dialog boxes will be used if Motif can be
 			 found.)
@@ -698,6 +699,7 @@
 	  case "${val}" in
 	    l | lu | luc | luci | lucid )		val=lucid  ;;
 	    m | mo | mot | moti | motif )		val=motif  ;;
+	    athena3d | athena-3d )			val=athena3d ;;
 	    a | at | ath | athe | athen | athena )	val=athena ;;
 	    n | no | non | none )			val=no ;;
 	    * )
@@ -1033,6 +1035,7 @@
   cydra*-cydrome-sysv* ) machine=cydra5 opsys=usg5-3 ;;
 
   ## Data General AViiON Machines
+  i586-dg-dgux*R4* | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) machine=aviion opsys=dgux5-4r3 ;;
   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) machine=aviion opsys=dgux5-4r2 ;;
   m88k-dg-dgux* 			  ) machine=aviion opsys=dgux	   ;;
@@ -1272,7 +1275,7 @@
   ## Iris 4D
   mips-sgi-irix3.*      ) machine=iris4d opsys=irix3-3 ;;
   mips-sgi-irix4.*      ) machine=iris4d opsys=irix4-0 ;;
-  mips-sgi-irix6*       ) machine=iris4d opsys=irix6-0  NON_GNU_CPP=/lib/cpp ;;
+  mips-sgi-irix6*       ) machine=iris4d opsys=irix6-0 ;;
   mips-sgi-irix5.[3-9]* ) machine=iris4d opsys=irix5-3 ;;
   mips-sgi-irix5.2*     ) machine=iris4d opsys=irix5-2 ;;
   mips-sgi-irix5.1*     ) machine=iris4d opsys=irix5-1 ;;
@@ -4084,6 +4087,12 @@
 test "${with_menubars}"   = "motif" -o \
      "${with_scrollbars}" = "motif" -o \
      "${with_dialogs}"    = "motif"  && with_motif="yes"
+test "${with_menubars}"   = "athena" -o \
+     "${with_scrollbars}" = "athena" -o \
+     "${with_dialogs}"    = "athena"  && with_athena="yes"
+test "${with_menubars}"   = "athena3d" -o \
+     "${with_scrollbars}" = "athena3d" -o \
+     "${with_dialogs}"    = "athena3d"  && with_athena="yes"
 test "${with_menubars}"   = ""       && with_menubars="lucid"
 test "${with_menubars}"   = "athena" && with_menubars="lucid"
 test "${with_scrollbars}" = ""       && with_scrollbars="lucid"
@@ -4187,6 +4196,32 @@
 "
 }
 
+if test "${with_scrollbars}" = "athena3d"; then
+	
+{
+test -n "$verbose" && \
+echo "	defining LWLIB_SCROLLBARS_ATHENA"
+echo "#define" LWLIB_SCROLLBARS_ATHENA "1" >> confdefs.h
+DEFS="$DEFS -DLWLIB_SCROLLBARS_ATHENA=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}LWLIB_SCROLLBARS_ATHENA\${ac_dB}LWLIB_SCROLLBARS_ATHENA\${ac_dC}1\${ac_dD}
+\${ac_uA}LWLIB_SCROLLBARS_ATHENA\${ac_uB}LWLIB_SCROLLBARS_ATHENA\${ac_uC}1\${ac_uD}
+\${ac_eA}LWLIB_SCROLLBARS_ATHENA\${ac_eB}LWLIB_SCROLLBARS_ATHENA\${ac_eC}1\${ac_eD}
+"
+}
+
+	
+{
+test -n "$verbose" && \
+echo "	defining LWLIB_SCROLLBARS_ATHENA3D"
+echo "#define" LWLIB_SCROLLBARS_ATHENA3D "1" >> confdefs.h
+DEFS="$DEFS -DLWLIB_SCROLLBARS_ATHENA3D=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}LWLIB_SCROLLBARS_ATHENA3D\${ac_dB}LWLIB_SCROLLBARS_ATHENA3D\${ac_dC}1\${ac_dD}
+\${ac_uA}LWLIB_SCROLLBARS_ATHENA3D\${ac_uB}LWLIB_SCROLLBARS_ATHENA3D\${ac_uC}1\${ac_uD}
+\${ac_eA}LWLIB_SCROLLBARS_ATHENA3D\${ac_eB}LWLIB_SCROLLBARS_ATHENA3D\${ac_eC}1\${ac_eD}
+"
+}
+
+fi
 test "${with_dialogs}"    = "motif"  && 
 {
 test -n "$verbose" && \
@@ -4211,6 +4246,32 @@
 "
 }
 
+if test "${with_dialogs}"    = "athena3d"; then
+	
+{
+test -n "$verbose" && \
+echo "	defining LWLIB_DIALOGS_ATHENA"
+echo "#define" LWLIB_DIALOGS_ATHENA "1" >> confdefs.h
+DEFS="$DEFS -DLWLIB_DIALOGS_ATHENA=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}LWLIB_DIALOGS_ATHENA\${ac_dB}LWLIB_DIALOGS_ATHENA\${ac_dC}1\${ac_dD}
+\${ac_uA}LWLIB_DIALOGS_ATHENA\${ac_uB}LWLIB_DIALOGS_ATHENA\${ac_uC}1\${ac_uD}
+\${ac_eA}LWLIB_DIALOGS_ATHENA\${ac_eB}LWLIB_DIALOGS_ATHENA\${ac_eC}1\${ac_eD}
+"
+}
+
+	
+{
+test -n "$verbose" && \
+echo "	defining LWLIB_DIALOGS_ATHENA3D"
+echo "#define" LWLIB_DIALOGS_ATHENA3D "1" >> confdefs.h
+DEFS="$DEFS -DLWLIB_DIALOGS_ATHENA3D=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}LWLIB_DIALOGS_ATHENA3D\${ac_dB}LWLIB_DIALOGS_ATHENA3D\${ac_dC}1\${ac_dD}
+\${ac_uA}LWLIB_DIALOGS_ATHENA3D\${ac_uB}LWLIB_DIALOGS_ATHENA3D\${ac_uC}1\${ac_uD}
+\${ac_eA}LWLIB_DIALOGS_ATHENA3D\${ac_eB}LWLIB_DIALOGS_ATHENA3D\${ac_eC}1\${ac_eD}
+"
+}
+
+fi
 
 ############################################################################
 #									   #
@@ -6296,6 +6357,18 @@
 "
 }
 
+test "${with_athena}" = yes && 
+{
+test -n "$verbose" && \
+echo "	defining LWLIB_USES_ATHENA"
+echo "#define" LWLIB_USES_ATHENA "1" >> confdefs.h
+DEFS="$DEFS -DLWLIB_USES_ATHENA=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}LWLIB_USES_ATHENA\${ac_dB}LWLIB_USES_ATHENA\${ac_dC}1\${ac_dD}
+\${ac_uA}LWLIB_USES_ATHENA\${ac_uB}LWLIB_USES_ATHENA\${ac_uC}1\${ac_uD}
+\${ac_eA}LWLIB_USES_ATHENA\${ac_eB}LWLIB_USES_ATHENA\${ac_eC}1\${ac_eD}
+"
+}
+
 test "${with_toolbars}" = yes && 
 {
 test -n "$verbose" && \
@@ -6830,8 +6903,10 @@
 test "$with_scrollbars" = lucid  && echo "  Using the Lucid scrollbar."
 test "$with_scrollbars" = motif  && echo "  Using the Motif scrollbar."
 test "$with_scrollbars" = athena && echo "  Using the Athena scrollbar."
+test "$with_scrollbars" = athena3d && echo "  Using the Athena-3d scrollbar."
 test "$with_dialogs"    = motif  && echo "  Using the Motif dialog boxes."
 test "$with_dialogs"    = athena && echo "  Using the Athena dialog boxes."
+test "$with_dialogs"    = athena3d && echo "  Using the Athena-3d dialog boxes."
 
 test "${use_union_type}"     = yes && echo "  Using the union type for Lisp_Objects."
 test "${debug}"              = yes && echo "  Compiling in extra code for debugging."
--- a/configure.in	Mon Aug 13 09:06:45 2007 +0200
+++ b/configure.in	Mon Aug 13 09:07:36 2007 +0200
@@ -218,8 +218,9 @@
 --with-menubars=TYPE	Use TYPE menubars (lucid, motif, or no).  The Lucid
 			widgets emulate Motif (mostly) but are faster.
 			*WARNING*  The Motif menubar is currently broken.
---with-scrollbars=TYPE	Use TYPE scrollbars (lucid, motif, athena, or no).
---with-dialogs=TYPE	Use TYPE dialog boxes (motif, athena, or no).
+--with-scrollbars=TYPE	Use TYPE scrollbars (lucid, motif, athena, 
+			athena3d, or no).
+--with-dialogs=TYPE	Use TYPE dialog boxes (motif, athena, athena3d, or no).
 			(Lucid menubars and scrollbars are the default.
 			 Motif dialog boxes will be used if Motif can be
 			 found.)
@@ -714,6 +715,7 @@
 	  case "${val}" in
 	    l | lu | luc | luci | lucid )		val=lucid  ;;
 	    m | mo | mot | moti | motif )		val=motif  ;;
+	    athena3d | athena-3d )			val=athena3d ;;
 	    a | at | ath | athe | athen | athena )	val=athena ;;
 	    n | no | non | none )			val=no ;;
 	    * )
@@ -1039,6 +1041,7 @@
   cydra*-cydrome-sysv* ) machine=cydra5 opsys=usg5-3 ;;
 
   ## Data General AViiON Machines
+  i586-dg-dgux*R4* | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) machine=aviion opsys=dgux5-4r3 ;;
   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) machine=aviion opsys=dgux5-4r2 ;;
   m88k-dg-dgux* 			  ) machine=aviion opsys=dgux	   ;;
@@ -1278,7 +1281,7 @@
   ## Iris 4D
   mips-sgi-irix3.*      ) machine=iris4d opsys=irix3-3 ;;
   mips-sgi-irix4.*      ) machine=iris4d opsys=irix4-0 ;;
-  mips-sgi-irix6*       ) machine=iris4d opsys=irix6-0  NON_GNU_CPP=/lib/cpp ;;
+  mips-sgi-irix6*       ) machine=iris4d opsys=irix6-0 ;;
   mips-sgi-irix5.[3-9]* ) machine=iris4d opsys=irix5-3 ;;
   mips-sgi-irix5.2*     ) machine=iris4d opsys=irix5-2 ;;
   mips-sgi-irix5.1*     ) machine=iris4d opsys=irix5-1 ;;
@@ -2537,6 +2540,12 @@
 test "${with_menubars}"   = "motif" -o \
      "${with_scrollbars}" = "motif" -o \
      "${with_dialogs}"    = "motif"  && with_motif="yes"
+test "${with_menubars}"   = "athena" -o \
+     "${with_scrollbars}" = "athena" -o \
+     "${with_dialogs}"    = "athena"  && with_athena="yes"
+test "${with_menubars}"   = "athena3d" -o \
+     "${with_scrollbars}" = "athena3d" -o \
+     "${with_dialogs}"    = "athena3d"  && with_athena="yes"
 test "${with_menubars}"   = ""       && with_menubars="lucid"
 test "${with_menubars}"   = "athena" && with_menubars="lucid"
 test "${with_scrollbars}" = ""       && with_scrollbars="lucid"
@@ -2552,8 +2561,16 @@
 test "${with_scrollbars}" = "lucid"  && AC_DEFINE(LWLIB_SCROLLBARS_LUCID)
 test "${with_scrollbars}" = "motif"  && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF)
 test "${with_scrollbars}" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA)
+if test "${with_scrollbars}" = "athena3d"; then
+	AC_DEFINE(LWLIB_SCROLLBARS_ATHENA)
+	AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D)
+fi
 test "${with_dialogs}"    = "motif"  && AC_DEFINE(LWLIB_DIALOGS_MOTIF)
 test "${with_dialogs}"    = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA)
+if test "${with_dialogs}"    = "athena3d"; then
+	AC_DEFINE(LWLIB_DIALOGS_ATHENA)
+	AC_DEFINE(LWLIB_DIALOGS_ATHENA3D)
+fi
 
 ############################################################################
 #									   #
@@ -2992,6 +3009,7 @@
 IF_YES_AC_DEFINE(rel_alloc,       REL_ALLOC)
 IF_YES_AC_DEFINE(LISP_FLOAT_TYPE, LISP_FLOAT_TYPE)
 IF_YES_AC_DEFINE(with_motif,      LWLIB_USES_MOTIF)
+IF_YES_AC_DEFINE(with_athena,	 LWLIB_USES_ATHENA)
 IF_YES_AC_DEFINE(with_toolbars,  HAVE_TOOLBARS)
 IF_YES_AC_DEFINE(with_tty,       HAVE_TTY)
 IF_YES_AC_DEFINE(with_tooltalk,  TOOLTALK)
@@ -3122,8 +3140,10 @@
 test "$with_scrollbars" = lucid  && echo "  Using the Lucid scrollbar."
 test "$with_scrollbars" = motif  && echo "  Using the Motif scrollbar."
 test "$with_scrollbars" = athena && echo "  Using the Athena scrollbar."
+test "$with_scrollbars" = athena3d && echo "  Using the Athena-3d scrollbar."
 test "$with_dialogs"    = motif  && echo "  Using the Motif dialog boxes."
 test "$with_dialogs"    = athena && echo "  Using the Athena dialog boxes."
+test "$with_dialogs"    = athena3d && echo "  Using the Athena-3d dialog boxes."
 
 test "${use_union_type}"     = yes && echo "  Using the union type for Lisp_Objects."
 test "${debug}"              = yes && echo "  Compiling in extra code for debugging."
--- a/etc/sample.emacs	Mon Aug 13 09:06:45 2007 +0200
+++ b/etc/sample.emacs	Mon Aug 13 09:07:36 2007 +0200
@@ -38,34 +38,34 @@
 ;; and such.
 
 ;; Make F1 invoke help
-(global-set-key 'f1 'help-command)
+(global-set-key [f1] 'help-command)
 ;; Make F2 be `undo'
-(global-set-key 'f2 'undo)
+(global-set-key [f2] 'undo)
 ;; Make F3 be `find-file'
 ;; Note: it does not currently work to say
 ;;   (global-set-key 'f3 "\C-x\C-f")
 ;; The reason is that macros can't do interactive things properly.
 ;; This is an extremely longstanding bug in Emacs.  Eventually,
 ;; it will be fixed. (Hopefully ..)
-(global-set-key 'f3 'find-file)
+(global-set-key [f3] 'find-file)
 
 ;; Make F4 be "mark", F5 be "copy", F6 be "paste"
 ;; Note that you can set a key sequence either to a command or to another
 ;; key sequence.
-(global-set-key 'f4 'set-mark-command)
-(global-set-key 'f5 "\M-w")
-(global-set-key 'f6 "\C-y")
+(global-set-key [f4] 'set-mark-command)
+(global-set-key [f5] "\M-w")
+(global-set-key [f6]"\C-y")
 
 ;; Shift-F4 is "pop mark off of stack"
 (global-set-key '(shift f4) (lambda () (interactive) (set-mark-command t)))
 
 ;; Make F7 be `save-buffer'
-(global-set-key 'f7 'save-buffer)
+(global-set-key [f7] 'save-buffer)
 
 ;; Make F8 be "start macro", F9 be "end macro", F10 be "execute macro"
-(global-set-key 'f8 'start-kbd-macro)
-(global-set-key 'f9 'end-kbd-macro)
-(global-set-key 'f10 'call-last-kbd-macro)
+(global-set-key [f8] 'start-kbd-macro)
+(global-set-key [f9] 'end-kbd-macro)
+(global-set-key [f10] 'call-last-kbd-macro)
 
 ;; Here's an alternative binding if you don't use keyboard macros:
 ;; Make F8 be `save-buffer' followed by `delete-window'.
@@ -98,21 +98,6 @@
        ;; When running ispell, consider all 1-3 character words as correct.
        (setq ispell-extra-args '("-W" "3"))
 
-       ;; Change the way the buffer name is displayed in the
-       ;; modeline.  The variable for this is called
-       ;; 'modeline-buffer-identification but was called
-       ;; 'mode-line-buffer-identification in older XEmacsen.
-       (if (boundp 'modeline-buffer-identification)
-	   ;; Note that if you want to put more than one form in the
-	   ;; `THEN' clause of an IF-THEN-ELSE construct, you have to
-	   ;; surround the forms with `progn'.  You don't have to
-	   ;; do this for the `ELSE' clauses.
-	   (progn
-	     (setq-default modeline-buffer-identification '("XEmacs: %17b"))
-	     (setq         modeline-buffer-identification '("XEmacs: %17b")))
-	 (setq-default mode-line-buffer-identification '("XEmacs: %17b"))
-	 (setq         mode-line-buffer-identification '("XEmacs: %17b")))
-
        (cond ((or (not (fboundp 'device-type))
 		  (equal (device-type) 'x))
 	      ;; Code which applies only when running emacs under X goes here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/sgml/HTML32.dtd	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,598 @@
+<!--
+        W3C Document Type Definition for the HyperText Markup Language
+        version 3.2 as ratified by a vote of W3C member companies.
+        For more information on W3C look at  URL http://www.w3.org/
+
+        Date: Tuesday January 14th 1996
+
+        Author: Dave Raggett <dsr@w3.org>
+
+        HTML 3.2 aims to capture recommended practice as of early '96
+        and as such to be used as a replacement for HTML 2.0 (RFC 1866).
+        Widely deployed rendering attributes are included where they
+        have been shown to be interoperable. SCRIPT and STYLE are
+        included to smooth the introduction of client-side scripts
+        and style sheets. Browsers must avoid showing the contents
+        of these element Otherwise support for them is not required.
+        ID, CLASS and STYLE attributes are not included in this version
+        of HTML.
+-->
+
+<!ENTITY % HTML.Version
+        "-//W3C//DTD HTML 3.2 Final//EN"
+
+        -- Typical usage:
+
+            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+            <html>
+            ...
+            </html>
+        --
+        >
+
+<!--================== Deprecated Features Switch =========================-->
+
+<!ENTITY % HTML.Deprecated "INCLUDE">
+
+<!--================== Imported Names =====================================-->
+
+<!ENTITY % Content-Type "CDATA"
+        -- meaning a MIME content type, as per RFC1521
+        -->
+
+<!ENTITY % HTTP-Method "GET | POST"
+        -- as per HTTP specification
+        -->
+
+<!ENTITY % URL "CDATA"
+        -- The term URL means a CDATA attribute
+           whose value is a Uniform Resource Locator,
+           See RFC1808 (June 95) and RFC1738 (Dec 94).
+        -->
+
+<!-- Parameter Entities -->
+
+<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK" -- repeatable head elements -->
+
+<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
+
+<!ENTITY % list "UL | OL |  DIR | MENU">
+
+<![ %HTML.Deprecated [
+    <!ENTITY % preformatted "PRE | XMP | LISTING">
+]]>
+
+<!ENTITY % preformatted "PRE">
+
+<!--================ Character mnemonic entities ==========================-->
+
+<!ENTITY % ISOlat1 PUBLIC
+       "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML">
+%ISOlat1;
+
+<!--================ Entities for special symbols =========================-->
+<!-- &trade and &cbsp are not widely deployed and so not included here -->
+
+<!ENTITY amp    CDATA "&#38;"   -- ampersand          -->
+<!ENTITY gt     CDATA "&#62;"   -- greater than       -->
+<!ENTITY lt     CDATA "&#60;"   -- less than          -->
+
+<!--=================== Text Markup =======================================-->
+
+<!ENTITY % font "TT | I | B  | U | STRIKE | BIG | SMALL | SUB | SUP">
+
+<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE">
+
+<!ENTITY % special "A | IMG | APPLET | FONT | BASEFONT | BR | SCRIPT | MAP">
+
+<!ENTITY % form "INPUT | SELECT | TEXTAREA">
+
+<!ENTITY % text "#PCDATA | %font | %phrase | %special | %form">
+
+<!ELEMENT (%font|%phrase) - - (%text)*>
+
+<!-- there are also 16 widely known color names although
+  the resulting colors are implementation dependent:
+
+   aqua, black, blue, fuchsia, gray, green, lime, maroon,
+   navy, olive, purple, red, silver, teal, white, and yellow
+
+ These colors were originally picked as being the standard
+ 16 colors supported with the Windows VGA palette.
+ -->
+
+<!ELEMENT FONT - - (%text)*     -- local change to font -->
+<!ATTLIST FONT
+    size    CDATA   #IMPLIED    -- [+]nn e.g. size="+1", size=4 --
+    color   CDATA   #IMPLIED    -- #RRGGBB in hex, e.g. red: color="#FF0000" --
+    >
+
+<!ELEMENT BASEFONT - O EMPTY    -- base font size (1 to 7)-->
+<!ATTLIST BASEFONT
+    size    CDATA   #IMPLIED    -- e.g. size=3 --
+    >
+
+<!ELEMENT BR    - O EMPTY    -- forced line break -->
+<!ATTLIST BR
+        clear (left|all|right|none) none -- control of text flow --
+        >
+
+<!--================== HTML content models ================================-->
+<!--
+    HTML has three basic content models:
+
+        %text       character level elements and text strings
+        %flow       block-like elements e.g. paragraphs and lists
+        %bodytext   as %flow plus headers H1-H6 and ADDRESS
+-->
+
+<!ENTITY % block
+     "P | %list | %preformatted | DL | DIV | CENTER |
+      BLOCKQUOTE | FORM | ISINDEX | HR | TABLE">
+
+<!-- %flow is used for DD and LI -->
+
+<!ENTITY % flow "(%text | %block)*">
+
+<!--=================== Document Body =====================================-->
+
+<!ENTITY % body.content "(%heading | %text | %block | ADDRESS)*">
+
+<!ENTITY % color "CDATA" -- a color specification: #HHHHHH @@ details? -->
+
+<!ENTITY % body-color-attrs "
+        bgcolor %color #IMPLIED
+        text %color #IMPLIED
+        link %color #IMPLIED
+        vlink %color #IMPLIED
+        alink %color #IMPLIED
+        ">
+
+<!ELEMENT BODY O O  %body.content>
+<!ATTLIST BODY
+        background %URL #IMPLIED  -- texture tile for document background --
+        %body-color-attrs;  -- bgcolor, text, link, vlink, alink --
+        >
+
+<!ENTITY % address.content "((%text;) | P)*">
+
+<!ELEMENT ADDRESS - - %address.content>
+
+<!ELEMENT DIV - - %body.content>
+<!ATTLIST DIV
+        align   (left|center|right) #IMPLIED -- alignment of following text --
+        >
+
+<!-- CENTER is a shorthand for DIV with ALIGN=CENTER -->
+<!ELEMENT center - - %body.content>
+
+<!--================== The Anchor Element =================================-->
+
+<!ELEMENT A - - (%text)* -(A)>
+<!ATTLIST A
+        name    CDATA   #IMPLIED    -- named link end --
+        href    %URL    #IMPLIED    -- URL for linked resource --
+        rel     CDATA   #IMPLIED    -- forward link types --
+        rev     CDATA   #IMPLIED    -- reverse link types --
+        title   CDATA   #IMPLIED    -- advisory title string --
+        >
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ENTITY % SHAPE "(rect|circle|poly)">
+<!ENTITY % COORDS "CDATA" -- comma separated list of numbers -->
+
+<!ELEMENT MAP - - (AREA)*>
+<!ATTLIST MAP
+    name    CDATA   #IMPLIED
+    >
+
+<!ELEMENT AREA - O EMPTY>
+<!ATTLIST AREA
+    shape   %SHAPE  rect
+    coords  %COORDS #IMPLIED  -- defines coordinates for shape --
+    href    %URL    #IMPLIED  -- this region acts as hypertext link --
+    nohref (nohref) #IMPLIED  -- this region has no action --
+    alt     CDATA   #REQUIRED -- needed for non-graphical user agents --
+    >
+
+<!--================== The LINK Element ==================================-->
+
+<!ENTITY % Types "CDATA"
+        -- See Internet Draft: draft-ietf-html-relrev-00.txt
+           LINK has been part of HTML since the early days
+           although few browsers as yet take advantage of it.
+
+           Relationship values can be used in principle:
+
+                a) for document specific toolbars/menus when used
+                   with the LINK element in the document head:
+                b) to link to a separate style sheet
+                c) to make a link to a script
+                d) by stylesheets to control how collections of
+                   html nodes are rendered into printed documents
+                e) to make a link to a printable version of this document
+                   e.g. a postscript or pdf version
+-->
+
+<!ELEMENT LINK - O EMPTY>
+<!ATTLIST LINK
+        href    %URL    #IMPLIED    -- URL for linked resource --
+        rel     %Types  #IMPLIED    -- forward link types --
+        rev     %Types  #IMPLIED    -- reverse link types --
+        title   CDATA   #IMPLIED    -- advisory title string --
+        >
+
+<!--=================== Images ============================================-->
+
+<!ENTITY % Length "CDATA"   -- nn for pixels or nn% for percentage length -->
+<!ENTITY % Pixels "CDATA"   -- integer representing length in pixels -->
+
+<!-- Suggested widths are used for negotiating image size
+     with the module responsible for painting the image.
+     align=left or right cause image to float to margin
+     and for subsequent text to wrap around image -->
+
+<!ENTITY % IAlign "(top|middle|bottom|left|right)">
+
+<!ELEMENT IMG    - O EMPTY --  Embedded image -->
+<!ATTLIST IMG
+        src     %URL     #REQUIRED  -- URL of image to embed --
+        alt     CDATA    #IMPLIED   -- for display in place of image --
+        align   %IAlign  #IMPLIED   -- vertical or horizontal alignment --
+        height  %Pixels  #IMPLIED   -- suggested height in pixels --
+        width   %Pixels  #IMPLIED   -- suggested width in pixels --
+        border  %Pixels  #IMPLIED   -- suggested link border width --
+        hspace  %Pixels  #IMPLIED   -- suggested horizontal gutter --
+        vspace  %Pixels  #IMPLIED   -- suggested vertical gutter --
+        usemap  %URL     #IMPLIED   -- use client-side image map --
+        ismap   (ismap)  #IMPLIED   -- use server image map --
+        >
+
+<!-- USEMAP points to a MAP element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--=================== Java APPLET tag ===================================-->
+<!--
+  This tag is supported by all Java enabled browsers. Applet resources
+  (including their classes) are normally loaded relative to the document
+  URL (or <BASE> element if it is defined). The CODEBASE attribute is used
+  to change this default behavior. If the CODEBASE attribute is defined then
+  it specifies a different location to find applet resources. The value
+  can be an absolute URL or a relative URL. The absolute URL is used as is
+  without modification and is not effected by the documents <BASE> element.
+  When the codebase attribute is relative, then it is relative to the
+  document URL (or <BASE> tag if defined).
+-->
+<!ELEMENT APPLET - - (PARAM | %text)*>
+<!ATTLIST APPLET
+        codebase %URL     #IMPLIED   -- code base --
+        code     CDATA    #REQUIRED  -- class file --
+        alt      CDATA    #IMPLIED   -- for display in place of applet --
+        name     CDATA    #IMPLIED   -- applet name --
+        width    %Pixels  #REQUIRED  -- suggested width in pixels --
+        height   %Pixels  #REQUIRED  -- suggested height in pixels --
+        align    %IAlign  #IMPLIED   -- vertical or horizontal alignment --
+        hspace   %Pixels  #IMPLIED   -- suggested horizontal gutter --
+        vspace   %Pixels  #IMPLIED   -- suggested vertical gutter --
+        >
+
+<!ELEMENT PARAM - O EMPTY>
+<!ATTLIST PARAM
+        name    NMTOKEN   #REQUIRED  -- The name of the parameter --
+        value   CDATA     #IMPLIED   -- The value of the parameter --
+        >
+
+<!--
+Here is an example:
+
+    <applet codebase="applets/NervousText"
+        code=NervousText.class
+        width=300
+        height=50>
+    <param name=text value="Java is Cool!">
+    <img src=sorry.gif alt="This looks better with Java support">
+    </applet>
+-->
+
+<!--=================== Horizontal Rule ===================================-->
+
+<!ELEMENT HR    - O EMPTY>
+<!ATTLIST HR
+        align (left|right|center) #IMPLIED
+        noshade (noshade) #IMPLIED
+        size  %Pixels #IMPLIED
+        width %Length #IMPLIED
+        >
+<!--=================== Paragraphs=========================================-->
+
+<!ELEMENT P     - O (%text)*>
+<!ATTLIST P
+        align  (left|center|right) #IMPLIED
+        >
+
+<!--=================== Headings ==========================================-->
+
+<!--
+  There are six levels of headers from H1 (the most important)
+  to H6 (the least important).
+-->
+
+<!ELEMENT ( %heading )  - -  (%text;)*>
+<!ATTLIST ( %heading )
+        align  (left|center|right) #IMPLIED
+        >
+
+<!--=================== Preformatted Text =================================-->
+
+<!-- excludes images and changes in font size -->
+
+<!ENTITY % pre.exclusion "IMG|BIG|SMALL|SUB|SUP|FONT">
+
+<!ELEMENT PRE - - (%text)* -(%pre.exclusion)>
+<!ATTLIST PRE
+        width NUMBER #implied -- is this widely supported? --
+        >
+
+<![ %HTML.Deprecated [
+
+<!ENTITY % literal "CDATA"
+        -- historical, non-conforming parsing mode where
+           the only markup signal is the end tag
+           in full
+        -->
+
+<!ELEMENT (XMP|LISTING) - -  %literal>
+<!ELEMENT PLAINTEXT - O %literal>
+
+]]>
+
+<!--=================== Block-like Quotes =================================-->
+
+<!ELEMENT BLOCKQUOTE - - %body.content>
+
+<!--=================== Lists =============================================-->
+
+<!--
+    HTML 3.2 allows you to control the sequence number for ordered lists.
+    You can set the sequence number with the START and VALUE attributes.
+    The TYPE attribute may be used to specify the rendering of ordered
+    and unordered lists.
+-->
+
+<!-- definition lists - DT for term, DD for its definition -->
+
+<!ELEMENT DL    - -  (DT|DD)+>
+<!ATTLIST DL
+        compact (compact) #IMPLIED -- more compact style --
+        >
+
+<!ELEMENT DT - O  (%text)*>
+<!ELEMENT DD - O  %flow;>
+
+<!-- Ordered lists OL, and unordered lists UL -->
+<!ELEMENT (OL|UL) - -  (LI)+>
+
+<!--
+       Numbering style
+    1   arablic numbers     1, 2, 3, ...
+    a   lower alpha         a, b, c, ...
+    A   upper alpha         A, B, C, ...
+    i   lower roman         i, ii, iii, ...
+    I   upper roman         I, II, III, ...
+
+    The style is applied to the sequence number which by default
+    is reset to 1 for the first list item in an ordered list.
+
+    This can't be expressed directly in SGML due to case folding.
+-->
+
+<!ENTITY % OLStyle "CDATA" -- constrained to: [1|a|A|i|I] -->
+
+<!ATTLIST OL -- ordered lists --
+        type      %OLStyle   #IMPLIED   -- numbering style --
+        start     NUMBER     #IMPLIED   -- starting sequence number --
+        compact  (compact)   #IMPLIED   -- reduced interitem spacing --
+        >
+
+<!-- bullet styles -->
+
+<!ENTITY % ULStyle "disc|square|circle">
+
+<!ATTLIST UL -- unordered lists --
+        type    (%ULStyle)   #IMPLIED   -- bullet style --
+        compact (compact)    #IMPLIED   -- reduced interitem spacing --
+        >
+
+<!ELEMENT (DIR|MENU) - -  (LI)+ -(%block)>
+<!ATTLIST DIR
+        compact (compact) #IMPLIED
+        >
+<!ATTLIST MENU
+        compact (compact) #IMPLIED
+        >
+
+<!-- <DIR>              Directory list                  -->
+<!-- <DIR COMPACT>      Compact list style              -->
+<!-- <MENU>             Menu list                       -->
+<!-- <MENU COMPACT>     Compact list style              -->
+
+<!-- The type attribute can be used to change the bullet style
+     in unordered lists and the numbering style in ordered lists -->
+
+<!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle|%OLStyle)" -->
+
+<!ELEMENT LI - O %flow -- list item -->
+<!ATTLIST LI
+        type    %LIStyle     #IMPLIED   -- list item style --
+        value    NUMBER      #IMPLIED   -- reset sequence number --
+        >
+
+<!--================ Forms ===============================================-->
+
+<!ELEMENT FORM - - %body.content -(FORM)>
+<!ATTLIST FORM
+        action %URL #IMPLIED  -- server-side form handler --
+        method (%HTTP-Method) GET -- see HTTP specification --
+        enctype %Content-Type; "application/x-www-form-urlencoded"
+        >
+
+<!ENTITY % InputType
+        "(TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT
+            | RESET | FILE | HIDDEN | IMAGE)">
+
+<!ELEMENT INPUT - O EMPTY>
+<!ATTLIST INPUT
+        type %InputType TEXT     -- what kind of widget is needed --
+        name  CDATA #IMPLIED     -- required for all but submit and reset --
+        value CDATA #IMPLIED     -- required for radio and checkboxes --
+        checked (checked) #IMPLIED -- for radio buttons and check boxes --
+        size CDATA  #IMPLIED     -- specific to each type of field --
+        maxlength NUMBER #IMPLIED
+        src   %URL  #IMPLIED     -- for fields with background images --
+        align  (top|middle|bottom|left|right) top -- image alignment --
+        >
+
+<!ELEMENT SELECT - - (OPTION+)>
+<!ATTLIST SELECT
+        name CDATA #REQUIRED
+        size NUMBER #IMPLIED
+        multiple (multiple) #IMPLIED
+        >
+
+<!ELEMENT OPTION - O (#PCDATA)*>
+<!ATTLIST OPTION
+        selected (selected) #IMPLIED
+        value  CDATA  #IMPLIED -- defaults to element content --
+        >
+
+<!-- Multi-line text input field. -->
+
+<!ELEMENT TEXTAREA - - (#PCDATA)*>
+<!ATTLIST TEXTAREA
+        name CDATA #REQUIRED
+        rows NUMBER #REQUIRED
+        cols NUMBER #REQUIRED
+        >
+
+<!--======================= Tables ========================================-->
+
+<!-- Widely deployed subset of the full table standard, see RFC 1942
+     e.g. at http://www.ics.uci.edu/pub/ietf/html/rfc1942.txt -->
+
+<!-- horizontal placement of table relative to window -->
+<!ENTITY % Where "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents -->
+<!ENTITY % cell.halign
+        "align  (left|center|right) #IMPLIED"
+        >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cell.valign
+        "valign  (top|middle|bottom)  #IMPLIED"
+        >
+
+<!ELEMENT table - - (caption?, tr+)>
+<!ELEMENT tr - O (th|td)*>
+<!ELEMENT (th|td) - O %body.content>
+
+<!ATTLIST table                       -- table element --
+        align     %Where;   #IMPLIED  -- table position relative to window --
+        width     %Length   #IMPLIED  -- table width relative to window --
+        border    %Pixels   #IMPLIED  -- controls frame width around table --
+        cellspacing %Pixels #IMPLIED  -- spacing between cells --
+        cellpadding %Pixels #IMPLIED  -- spacing within cells --
+        >
+
+<!ELEMENT CAPTION - - (%text;)* -- table or figure caption -->
+<!ATTLIST CAPTION
+        align (top|bottom) #IMPLIED
+        >
+
+<!ATTLIST tr                       -- table row --
+        %cell.halign;              -- horizontal alignment in cells --
+        %cell.valign;              -- vertical alignment in cells --
+        >
+
+<!ATTLIST (th|td)                  -- header or data cell --
+        nowrap (nowrap)  #IMPLIED  -- suppress word wrap --
+        rowspan NUMBER   1         -- number of rows spanned by cell --
+        colspan NUMBER   1         -- number of cols spanned by cell --
+        %cell.halign;              -- horizontal alignment in cell --
+        %cell.valign;              -- vertical alignment in cell --
+        width   %Pixels  #IMPLIED  -- suggested width for cell --
+        height  %Pixels  #IMPLIED  -- suggested height for cell --
+        >
+
+<!--================ Document Head ========================================-->
+
+<!-- %head.misc defined earlier on as "SCRIPT|STYLE|META|LINK" -->
+
+<!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
+
+<!ELEMENT HEAD O O  (%head.content) +(%head.misc)>
+
+<!ELEMENT TITLE - -  (#PCDATA)* -(%head.misc)
+          -- The TITLE element is not considered part of the flow of text.
+             It should be displayed, for example as the page header or
+             window title.
+          -->
+
+<!ELEMENT ISINDEX - O EMPTY>
+<!ATTLIST ISINDEX
+        prompt CDATA #IMPLIED -- prompt message -->
+
+<!--
+    The BASE element gives an absolute URL for dereferencing relative
+    URLs, e.g.
+
+         <BASE href="http://foo.com/index.html">
+         ...
+         <IMG SRC="images/bar.gif">
+
+    The image is deferenced to
+
+         http://foo.com/images/bar.gif
+
+   In the absence of a BASE element the document URL should be used.
+   Note that this is not necessarily the same as the URL used to
+   request the document, as the base URL may be overridden by an HTTP
+   header accompanying the document.
+-->
+
+<!ELEMENT BASE - O EMPTY>
+<!ATTLIST BASE
+        href %URL  #REQUIRED
+        >
+
+<!ELEMENT META - O EMPTY -- Generic Metainformation -->
+<!ATTLIST META
+        http-equiv  NAME    #IMPLIED  -- HTTP response header name  --
+        name        NAME    #IMPLIED  -- metainformation name       --
+        content     CDATA   #REQUIRED -- associated information     --
+        >
+
+<!-- SCRIPT/STYLE are place holders for transition to next version of HTML -->
+
+<!ELEMENT STYLE  - - (#PCDATA)*  -(%head.misc) -- style info -->
+<!ELEMENT SCRIPT - - (#PCDATA)*  -(%head.misc) -- script statements -->
+
+<!--================ Document Structure ===================================-->
+
+<!ENTITY % version.attr "VERSION CDATA #FIXED '%HTML.Version;'">
+
+<![ %HTML.Deprecated [
+    <!ENTITY % html.content "HEAD, BODY, PLAINTEXT?">
+]]>
+
+<!ENTITY % html.content "HEAD, BODY">
+
+<!ELEMENT HTML O O  (%html.content)>
+<!ATTLIST HTML
+        %version.attr;
+        >
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-A-up.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-A-up_width 15
+#define ediff-A-up_height 15
+static char ediff-A-up_bits[] = {
+ 0x00,0x80,0x00,0x80,0x00,0x80,0xc0,0x81,0xe0,0x83,0x60,0x83,0x70,0x87,0x30,
+ 0x86,0x38,0x8e,0xf8,0x8f,0x18,0x8c,0x18,0x8c,0x00,0x80,0x00,0x80,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-A-up.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,24 @@
+/* XPM */
+static char *ediff_A[] = {
+/* width height num_colors chars_per_pixel */
+"    15   15       2            1",
+/* colors */
+". c blue",
+"# c Gray75 s backgroundToolBarColor",
+/* pixels */
+"###############",
+"###############",
+"###############",
+"######...######",
+"#####.....#####",
+"#####..#..#####",
+"####...#...####",
+"####..###..####",
+"###...###...###",
+"###.........###",
+"###..#####..###",
+"###..#####..###",
+"###############",
+"###############",
+"###############",
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-A-xx.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,24 @@
+/* XPM */
+static char *ediff_A[] = {
+/* width height num_colors chars_per_pixel */
+"    15   15       2            1",
+/* colors */
+". c gray60",
+"# c Gray75 s backgroundToolBarColor",
+/* pixels */
+"###############",
+"###############",
+"###############",
+"######...######",
+"#####.....#####",
+"#####..#..#####",
+"####...#...####",
+"####..###..####",
+"###...###...###",
+"###.........###",
+"###..#####..###",
+"###..#####..###",
+"###############",
+"###############",
+"###############",
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-B-up.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-B-up_width 15
+#define ediff-B-up_height 15
+static char ediff-B-up_bits[] = {
+ 0x00,0x80,0x00,0x80,0xf8,0x81,0xf8,0x83,0x38,0x87,0x38,0x86,0xf8,0x83,0xf8,
+ 0x87,0x38,0x8e,0x38,0x8c,0x38,0x8e,0xf8,0x87,0xf8,0x83,0x00,0x80,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-B-up.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char *ediff-B-up[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        2            1",
+/* colors */
+". c blue",
+"# c Gray75 s backgroundToolBarColor",
+/* pixels */
+"###############",
+"###############",
+"###......######",
+"###.......#####",
+"###...##...####",
+"###...###..####",
+"###.......#####",
+"###........####",
+"###...###...###",
+"###...####..###",
+"###...###...###",
+"###........####",
+"###.......#####",
+"###############",
+"###############",
+"###############"
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-B-xx.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char *ediff-B-up[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        2            1",
+/* colors */
+". c gray60",
+"# c Gray75 s backgroundToolBarColor",
+/* pixels */
+"###############",
+"###############",
+"###......######",
+"###.......#####",
+"###...##...####",
+"###...###..####",
+"###.......#####",
+"###........####",
+"###...###...###",
+"###...####..###",
+"###...###...###",
+"###........####",
+"###.......#####",
+"###############",
+"###############",
+"###############"
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-help.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-help_width 15
+#define ediff-help_height 15
+static char ediff-help_bits[] = {
+ 0x00,0x80,0xf0,0x83,0x0c,0x86,0xe4,0x8c,0x74,0x8d,0xb4,0x8c,0x58,0x86,0x20,
+ 0x83,0xa0,0x83,0xa0,0x81,0xc0,0x80,0x20,0x83,0x20,0x83,0xc0,0x81,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-help.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,26 @@
+/* XPM */
+static char *help[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        3            1",
+/* colors */
+". c #000000",
+"b c Gray75 s backgroundToolBarColor",
+"c c #ffff00",
+/* pixels */
+"bbbbbbbbbbbbbbb",
+"bbbb......bbbbb",
+"bbb.ccccc..bbbb",
+"bb.cc...cc..bbb",
+"bb.c..bb.c..bbb",
+"bb.c..b.cc..bbb",
+"bbb..b.cc..bbbb",
+"bbbbb.cc..bbbbb",
+"bbbbb.c..bbbbbb",
+"bbbbb.c..bbbbbb",
+"bbbbbb..bbbbbbb",
+"bbbbb.cc..bbbbb",
+"bbbbb.cc..bbbbb",
+"bbbbbb...bbbbbb",
+"bbbbbbbbbbbbbbb"
+"bbbbbbbbbbbbbbb"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-next.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-next_width 15
+#define ediff-next_height 15
+static char ediff-next_bits[] = {
+ 0x00,0x80,0x80,0x80,0x80,0x83,0x80,0x82,0xfe,0x8c,0x02,0x8a,0xfa,0xb7,0xfa,
+ 0xbf,0xfa,0x9f,0xfe,0x8f,0xfe,0x87,0x80,0x83,0x80,0x81,0x80,0x80,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-next.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char * file[] = {
+/* width height num_colors chars_per_pixel */
+"15 15 5 1",
+" 	c Gray75 s backgroundToolBarColor",
+".	c black",
+"X	c white",
+"o	c black",
+"O	c black",
+"               ",
+"       .       ",
+"       ..      ",
+"       .X.     ",
+" .......XX.    ",
+" .XXXXXXXoX.   ",
+" .XooooooooX.  ",
+" .Xoooooooooo. ",
+" .XooooooooO.  ",
+" .oOOOOOOoO.   ",
+" .......OO.    ",
+"       .O.     ",
+"       ..      ",
+"       .       ",
+"               ",
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-prev.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-prev_width 15
+#define ediff-prev_height 15
+static char ediff-prev_bits[] = {
+ 0x00,0x80,0x00,0x81,0x80,0x81,0x40,0x81,0x20,0xbf,0x50,0xa0,0xe8,0xaf,0xfc,
+ 0xaf,0xf8,0xaf,0xf0,0xbf,0xe0,0xbf,0xc0,0x81,0x80,0x81,0x00,0x81,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-prev.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,23 @@
+/* XPM */
+static char * left-arrow_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"15 15 3 1",
+" 	c Gray75 s backgroundToolBarColor",
+".	c black",
+"X	c white",
+"               ",
+"        .      ",
+"       ..      ",
+"      .X.      ",
+"     .XX...... ",
+"    .X.XXXXXX. ",
+"   .X.......X. ",
+"  ..........X. ",
+"   .........X. ",
+"    .......... ",
+"     ......... ",
+"      ...      ",
+"       ..      ",
+"        .      ",
+"               ",
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-quit.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-quit_width 15
+#define ediff-quit_height 15
+static char ediff-quit_bits[] = {
+ 0x00,0x80,0x06,0xb0,0x1e,0x98,0x3c,0x8c,0x70,0x82,0xe0,0x83,0xc0,0x81,0xe0,
+ 0x83,0x70,0x86,0x38,0x8c,0x1c,0x88,0x1c,0x90,0x08,0x80,0x00,0x80,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-quit.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,26 @@
+/* XPM */
+static char *delete[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        4            1",
+/* colors */
+". c #808080",
+"# c #800000",
+"a c #ffffff",
+"b c #c0c0c0",
+/* pixels */
+"bbbbbbbbbbbbbbb",
+"b##abbbbbbbb##a",
+"b####abbbbb##ab",
+"bb####abbb##abb",
+"bbbb###ab#abbbb",
+"bbbbb#####abbbb",
+"bbbbbb###abbbbb",
+"bbbbb#####abbbb",
+"bbbb###ab##abbb",
+"bbb###abbb##abb",
+"bb###abbbbb#abb",
+"bb###abbbbbb#ab",
+"bbb#abbbbbbbbbb",
+"bbb#abbbbbbbbbb",
+"bbbbbbbbbbbbbbb",
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-refine.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-refine_width 15
+#define ediff-refine_height 15
+static char ediff-refine_bits[] = {
+ 0x00,0x80,0x80,0x80,0x84,0x90,0x8c,0x98,0x98,0x8c,0xf0,0x87,0xe0,0x83,0xe0,
+ 0x83,0xe0,0x83,0xf0,0x87,0x98,0x8c,0x8c,0x98,0x84,0x90,0x80,0x80,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-refine.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,24 @@
+/* XPM */
+static char *help[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        2           1",
+/* colors */
+"# c #000000",
+"a c Gray75 s backgroundToolBarColor",
+/* pixels */
+"aaaaaaaaaaaaaaa",
+"aaaaaaa#aaaaaaa",
+"aa#aaaa#aaaa#aa",
+"aa##aaa#aaa##aa",
+"aaa##aa#aa##aaa",
+"aaaa#######aaaa",
+"aaaaa#####aaaaa",
+"aaaaa#####aaaaa",
+"aaaaa#####aaaaa",
+"aaaa#######aaaa",
+"aaa##aa#aa##aaa",
+"aa##aaa#aaa##aa",
+"aa#aaaa#aaaa#aa",
+"aaaaaaa#aaaaaaa",
+"aaaaaaaaaaaaaaa",
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-save-xx.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define disk-xx_width 15
+#define disk-xx_height 15
+static char disk-xx_bits[] = {
+ 0x00,0x00,0x0a,0x28,0x00,0x00,0x0a,0x28,0x00,0x00,0x0a,0x28,0x00,0x00,0xfa,
+ 0x2f,0x00,0x00,0x02,0x20,0x00,0x00,0x0a,0x29,0x00,0x00,0xf8,0x3f,0x00,0x00
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-save-xx.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char * disk[] = {
+"15 15 5 1",
+"X	c Gray75 s backgroundToolBarColor",
+"o	c Gray60",
+"O	c Gray60",
+"+	c Gray90",
+"@	c Gray40",
+"XXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXX",
+"XoooooooooooooX",
+"XoOo+++++++oOoX",
+"XoOo+++++++oOoX",
+"XoOo+++++++oOoX",
+"XoOo+++++++oOoX",
+"XoOoooooooooOoX",
+"XoOOOOOOOOOOOoX",
+"XoOoooooooooOoX",
+"XoOo@@@@o++oOoX",
+"XoOo@@@@o++oOoX",
+"XoOo@@@@o++oOoX",
+"XXooooooooooooX",
+"XXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXX"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-save.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define disk-up_width 15
+#define disk-up_height 15
+static char disk-up_bits[] = {
+ 0x00,0x00,0xfe,0x3f,0x0a,0x28,0x0a,0x28,0x0a,0x38,0x0a,0x28,0x0a,0x28,0xfa,
+ 0x2f,0x02,0x20,0xfa,0x2f,0x0a,0x29,0x0a,0x29,0x0c,0x29,0xf8,0x3f,0x00,0x00
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-save.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char * disk[] = {
+"15 15 5 1",
+"X	c Gray75 s backgroundToolBarColor",
+"o	c black",
+"O	c Gray60",
+"+	c Gray90",
+"@	c Gray40",
+"XXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXX",
+"XoooooooooooooX",
+"XoOo+++++++oOoX",
+"XoOo+++++++oOoX",
+"XoOo+++++++oOoX",
+"XoOo+++++++oOoX",
+"XoOoooooooooOoX",
+"XoOOOOOOOOOOOoX",
+"XoOoooooooooOoX",
+"XoOo@@@@o++oOoX",
+"XoOo@@@@o++oOoX",
+"XoOo@@@@o++oOoX",
+"XXooooooooooooX",
+"XXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXX"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-toggle-split-up.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-toggle-split-up_width 15
+#define ediff-toggle-split-up_height 15
+static char ediff-toggle-split-up_bits[] = {
+ 0x00,0x80,0xfe,0x87,0xfe,0x87,0x00,0x80,0x00,0xb0,0x7e,0xb0,0x1e,0xb0,0x1e,
+ 0xb0,0x3e,0xb2,0x72,0xb3,0xe2,0xb3,0xc0,0xb3,0xc0,0xb3,0xf0,0xb7,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-toggle-split-up.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char *ediff-toggle-split-up[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        3            1",
+/* colors */
+"# c #000000",
+"a c firebrick",
+"f c Gray75 s backgroundToolBarColor",
+/* pixels */
+"fffffffffffffff",
+"faaaaaaaaaaffff",
+"faaaaaaaaaaffff",
+"fffffffffffffff",
+"ffffffffffffaaf",
+"f######fffffaaf",
+"f####fffffffaaf",
+"f####fffffffaaf",
+"f#####fff#ffaaf",
+"f#ff###ff#ffaaf",
+"f#fff#####ffaaf",
+"ffffff####ffaaf",
+"ffffff####ffaaf",
+"ffff######ffaaf",
+"fffffffffffffff",
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-update.xbm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,6 @@
+#define ediff-update_width 15
+#define ediff-update_height 15
+static char ediff-update_bits[] = {
+ 0x00,0x80,0x78,0x80,0xcc,0x99,0x04,0x9b,0x04,0x9c,0x04,0x9e,0x0c,0x9f,0x00,
+ 0x80,0x7c,0x98,0x3c,0x90,0x1c,0x90,0x6c,0x90,0xcc,0x99,0x00,0x8f,0x00,0x80
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/toolbar/ediff-update.xpm	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char *update[] = {
+/* width height num_colors chars_per_pixel */
+"    15    15        3            1",
+/* colors */
+". c #000000",
+"a c #000080",
+"c c Gray75 s backgroundToolBarColor",
+/* pixels */
+"ccccccccccccccc",
+"ccc.aaacccccccc",
+"cc.acccaacccacc",
+"ccaccccccacaacc",
+"ccacccccccaaacc",
+"ccaccccccaaaacc",
+"cc.accccaaaaacc",
+"ccccccccccccccc",
+"ccaaaaacccca.cc",
+"ccaaaaccccccacc",
+"ccaaacccccccacc",
+"ccaacaccccccacc",
+"ccacccaaccca.cc",
+"ccccccccaaa.ccc",
+"ccccccccccccccc",
+};
\ No newline at end of file
--- a/etc/w3/stylesheet	Mon Aug 13 09:06:45 2007 +0200
+++ b/etc/w3/stylesheet	Mon Aug 13 09:07:36 2007 +0200
@@ -1,11 +1,27 @@
-/*       File: default.css
+/******************************************************************************
+**       File: default.css
 **    Purpose: Default Stylesheet for Emacs-W3
 **       Info: Copyright (c) 1995 William M. Perry <wmperry@spry.com>
 **    Created: William M. Perry <wmperry@spry.com>, Aug-31-1995
 ** Maintainer: William M. Perry <wmperry@spry.com>
 **
 **  This contains the top level fallback default styles for Emacs-w3
-*/
+**
+******************************************************************************
+**
+** To specify device-dependent styles, you must mark a section with
+** :devicetype:
+** If you are not using 'devicetype', then anything up to the next
+** :xxx: media descriptor is ignored.
+**
+** There are a few special Emacs-W3 sections
+**
+**  emacs - only include this chunk if you are using Emacs 19
+** speech - only include this chunk if you are using Emacspeak for audio
+** xemacs - only include this chunk if you are using XEmacs
+** normal - always include this chunk (useful for switching out of another 
+**          device-type block
+******************************************************************************/
 
 /*
 ** Headers
@@ -14,7 +30,7 @@
 h1,h2,h3,
 h4,h5,h6  {
 	    display: block;
-            font-family : utopia charter times itc-zapf-chancery inja;
+            font-family : serif;
             font-weight : bold;
           }
 
@@ -23,57 +39,74 @@
 ** we only use them under XEmacs.  Hopefully, this will change soon.
 */
 
-:xemacs:
-      h1  { font-size : 24pt }
-      h2  { font-size : 18pt }
-      h3  { font-size : 16pt }
-      h4  { font-size : 14pt }
-      h5  { font-size : 12pt }
-      h6  { font-size : 10pt }
+@media xemacs {
+      h1  { font-size : +12pt }
+      h2  { font-size : +6pt  }
+      h3  { font-size : +4pt  }
+      h5  { font-size : -2pt  }
+      h6  { font-size : -4pt  }
+/*
+** Emacs-19 also doesn't handle how Emacs-W3 changes this type of font
+** very well, so lets only do it under XEmacs for now.  Emacs-19 can only
+** do monospaced fonts anyway, so its redundant.
+*/
+   pre,xmp,
+  plaintext { font-family: monospace }
+key,code,tt { font-family: monospace }
+} // @media xemacs
 
 /*
 ** Best we can do under Emacs-19 is use the default font and try to make
 ** the headers stand out somehow.
 */
 
-:emacs:
+@media emacs {
 h1,h2,h3,
-h4,h5,h6  { font-style: small-caps; text-decoration: underline }
+h4,h5,h6  { 
+            font-style: small-caps;
+            text-decoration: underline;
+	    color: blue;
+          }
 
-:normal:
+strong,em { color: red         }
+      dfn { font-style: italic }
+ s,strike { color: green       }
+
+} // @media emacs
+
        p  { display: block }
+ pre,xmp  { display: block; white-space: pre; }
+blockquote{ display: block; margin-left: 5; margin-right: 5; }
 
 /*
 ** List formatting instructions
 */
 
- dl,ul,ol {
- 	    display: block;
-	    margin-left: 5em
-	  }
+       ul { display: block;     }
+       ol { display: block;     }
+       dl { display: block;     }
+      dir { display: block;     }
+     menu { display: block;     }
+       dt { font-weight: bold; display: list-item }
+       dd { display: list-item; margin-left: 5; }
+       li { display: list-item; margin-left: 5; }
+    ul li { list-style: circle; }
+    ol li { list-style: decimal; }
 
-       li { display: list-item }
-       dt { font-weight: bold; display: block }
-       dd { insert-before: 3em; display: list-item }
-
-/*
-** All items that require fixed-width fonts
-*/
-
-   pre,xmp,
-  plaintext { font-family: monospace; display: block }
-key,code,tt { font-family: monospace }
+/* These are to make nested list items look better */
+ul ul,ol ul,ol ol,ul ol { display: line; }
 
 /*
 ** All logical emphasis tags, the way god intended
 */
 
-  strong,em { font-weight: bold }
-        dfn { font-style: italic }
+        div { display: line;                }
+  strong,em { font-weight: bold             }
+        dfn { font-style: italic            }
    s,strike { text-decoration: line-through }
-        sub { text-position: sub }
-        sup { text-position: sup }
-     secret { text-transform: rot13 }
+        sub { text-position: sub            }
+        sup { text-position: sup            }
+     secret { text-transform: rot13         }
 
 /*
 ** Physical emphasis - spawn of evil
@@ -82,13 +115,12 @@
 	  i { font-style: italic }
           u { text-decoration: underline }
       blink { text-decoration: blink }
-
+     center { display: line; text-align: center; }
 /*
 ** Various and sundry
 */
-         br { display: list-item }
-         hr { display: list-item }
-    hr[SRC] { replace: {SRC} }
+         br { display: line }
+         hr { display: line; text-align: center; }
 
 
 /*
@@ -96,34 +128,39 @@
 */
 
 a         { cursor: hand2  }
-a.link    { color: #FF0000 }
-a.visited { color: #B22222 }
-a.active  { color: #FF0000 }
+a:link    { color: #FF0000 }
+a:visited { color: #B22222 }
+a:active  { color: #FF0000 }
+
+/*
+** Table formatting
+*/
+table     { display: block;    }
+   th     { display: block; font-weight: bold; text-align: center; }
+   td     { display: block; text-align: left; }
+caption   { display: block; text-align: center; }
 
 /*
 ** Various other character-level formatting issues
 */
 
- address { align : right }
-abstract { font-style : bold & italic ; align : indent }
-   quote { font-style : italic ; align : indent }
+ address { text-align: right; display: line; }
+abstract { font-style: bold & italic ; text-align : indent }
+   quote { font-style: italic ; text-align : indent }
 
 /*
 ** Now for monochrome defaults
-** Anything up to the next :xxx: media descriptor is only used if
-** you are on that type of media.
 */
-:mono:
-   a.link { color: black; text-decoration: underline }
-a.visited { color: black; text-decoration: underline }
- a.active { color: white }
-
+@media mono {
+   a:link { color: black; text-decoration: underline }
+a:visited { color: black; text-decoration: underline }
+ a:active { color: white }
+} // @media mono
 /*
 ** All the TTY specific formatting
 */
 
-:tty:
-
+@media tty {
 /*
 ** First, handle some stuff for generic TTYs to emulate our old
 ** behaviour with w3-delimit-links and a subset of w3-delimit-emphasis
@@ -135,20 +172,19 @@
            insert-after: *
          }
 
-a.visited{
-           insert.before: "{{";
-           insert.after: "}}"
+a:visited{
+           insert-before: "{{";
+           insert-after: "}}"
          }
 
-a.link   {
-           insert.before: "[[";
-           insert.after: "]]"
+a:link   {
+           insert-before: "[[";
+           insert-after: "]]"
          }
+} // @media tty
 
-/* End Generic TTY */
 
-:ansi-tty:
-
+@media ansi-tty {
 /*
 ** Now comes the cool TTY stuff.  You will need to be using XEmacs 19.14
 ** or later (or Emacs 19.30 under DOS) in order to get any benefit from
@@ -172,6 +208,38 @@
 
 h1,h2,h3,
 h4,h5,h6  { color : cyan     }
-a.visited { color : magenta  }
-   a.link { color : red      }
- a.active { color : yellow   }
+a:visited { color : magenta  }
+   a:link { color : red      }
+ a:active { color : yellow   }
+} // @media ansi-tty
+
+@media speech {
+h1,h2,h3,
+h4,h5,h6 { voice-family: paul; stress: 2; richness: 9; }
+      h1 { pitch: 1; pitch-range: 9; }
+      h2 { pitch: 2; pitch-range: 8; }
+      h3 { pitch: 3; pitch-range: 7; }
+      h4 { pitch: 4; pitch-range: 6; }
+      h5 { pitch: 5; pitch-range: 5; }
+      h6 { pitch: 6; pitch-range: 4; }
+
+li,dt,dd { pitch: 6; richness: 6; }
+      dt { stress: 8; }
+
+pre,xmp,plaintext,key,code,tt { pitch: 1; 
+				pitch-range: 1;
+				stress: 1;
+				richness: 8;
+			      }
+      em { pitch: 6; pitch-range: 6; stress: 6; richness: 5; }
+  strong { pitch: 6; pitch-range: 6; stress: 9; richness: 9; }
+     dfn { pitch: 7; pitch-range: 6; stress: 6; }
+s,strike { richness: 0; }
+       i { pitch: 6; pitch-range: 6; stress: 6; richness: 5 }
+       b { pitch: 6; pitch-range: 6; stress: 9; richness: 9; }
+       u { richness: 0; }
+   a:link { voice-family: harry; }
+a:visited { voice-family: betty;}
+ a:active { voice-family: betty; pitch-range: 8; pitch: 8 }
+
+} // @media speech
--- a/info/dir	Mon Aug 13 09:06:45 2007 +0200
+++ b/info/dir	Mon Aug 13 09:07:36 2007 +0200
@@ -54,7 +54,7 @@
 * External-Widget::
 		Use XEmacs as a text widget inside of another program.
 * Forms::	A package for editing databases by filling in forms.
-* GNUS::	An NNTP-based newsreader for XEmacs.
+* Gnus::	A netnews and mail reader for XEmacs.
 * Hyperbole::	A programmable information management and hypertext system.
 * ILISP::	Multi-dialect inferior LISP interface.
 * Ispell::	Interactive spelling corrector.
--- a/lib-src/make-docfile.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/lib-src/make-docfile.c	Mon Aug 13 09:07:36 2007 +0200
@@ -827,8 +827,17 @@
 	      /* Skip until the first newline; remember the two previous chars. */
 	      while (c != '\n' && c >= 0)
 		{
+		  /* ### Kludge -- Ignore any ESC x x ISO2022 sequences */
+		  if (c == 27)
+		    {
+		      getc (infile);
+		      getc (infile);
+		      goto nextchar;
+		    }
+		  
 		  c2 = c1;
 		  c1 = c;
+		nextchar:
 		  c = getc (infile);
 		}
 	  
@@ -960,7 +969,7 @@
 	    }
 	}
 
-#ifdef DEBUG
+#if 0 /* causes crash */
       else if (! strcmp (buffer, "if") ||
 	       ! strcmp (buffer, "byte-code"))
 	;
--- a/lib-src/tm-au	Mon Aug 13 09:06:45 2007 +0200
+++ b/lib-src/tm-au	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-# $Id: tm-au,v 1.3 1997/01/11 20:13:51 steve Exp $
+# $Id: tm-au,v 1.4 1997/01/23 05:29:22 steve Exp $
 #
 
 PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
@@ -22,14 +22,15 @@
 	echo "$2; $3 ->"
 	tmdecode $3 $1 $filename
 	if [ "$AUDIOSERVER" = "" ]; then
-		if [ `uname` = "IRIX" ]; then
-			sfplay $filename
-		else
-			cat $filename > /dev/audio
-		fi
+          case "`uname`" in
+            IRIX )  sfplay $filename           ;;
+            OSF1 )  decsound -play $filename   ;;
+            *    )  cat $filename > /dev/audio ;;
+          esac
 	else
-		autool -v 40 $filename
+          autool -v 40 $filename
 	fi
+        
 	trap 'rm -f $filename' 0 1 2 3 13 15
 	;;
 "extract")
--- a/lisp/ChangeLog	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 09:07:36 2007 +0200
@@ -1,3 +1,91 @@
+Thu Jan  9 13:32:01 1997  Jacques Duthen Prestataire  <duthen@cegelec-red.fr>
+
+	* ps-print.el: Merge patch from [simon] Oct 8, 1996 Simon Marshall
+	<simon@gnu.ai.mit.edu>
+	(ps-print-version): Fix value.
+	(cl lisp-float-type): Require them.
+	(ps-number-of-columns ps-*-font-size): Try to select defaults
+	better suited when `ps-landscape-mode' is non-nil. 
+	(ps-*-faces): Change default for Font Lock mode faces when
+	`ps-print-color-p' is nil. 
+	(ps-right-header): Replace `time-stamp-yy/mm/dd'
+	by `time-stamp-mon-dd-yyyy'. 
+	(ps-end-file ps-begin-page): Fix bug in page count for Ghostview. 
+	(ps-generate-postscript-with-faces): Replace `ps-sorter' by
+	`car-less-than-car'.  
+	(ps-plot ps-generate): Replace `%d' by `%3d'.  
+
+Wed Jan 22 15:32:39 1997  Greg Klanderman  <greg@alphatech.com>
+
+	* modes/rsz-minibuf.el (resize-minibuffer-setup): Resize the
+	minibuffer earlier than the first received event.
+
+Wed Jan 22 15:29:08 1997  Barry A. Warsaw  <bwarsaw@CNRI.Reston.VA.US>
+
+	* modes/imenu.el (imenu-add-to-menubar): Don't attempt anything if
+	menu-bar lookup fails.
+
+Wed Jan 22 01:03:42 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* lisp/x11/x-font-menu.el: Make font menus work better in a
+	Japanese environment.
+
+Tue Jan 21 19:56:26 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* lisp/mule/mule-init.el (init-mule): Get Japanese man pages working.
+
+Fri Jan 17 17:22:54 1997  Hrvoje Niksic  <hniksic@bjesomar.srce.hr>
+ 
+	* man.el (Manual-mode): Don't mess with scrollbars if they aren't
+	present.
+
+Tue Jan 21 19:52:45 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* utils/timezone.el (timezone-parse-date): Fix Y2K bug.
+
+Tue Jan 21 19:32:44 1997  Barry A. Warsaw  <bwarsaw@anthem.cnri.reston.va.us>
+
+	* prim/files.el (hack-local-variables-prop-line): XEmacs should
+	not query to set local variables in the -*- line if there aren't
+	any to set!
+
+Thu Jan 16 18:24:20 1997  Steven L Baur  <steve@miranova.com>
+
+	* psgml/psgml.el: Use newer interface form for nsgmls.
+
+Thu Jan 16 04:06:24 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* comint/telnet.el (rsh): (Mostly) correct dealing with detection
+	of password prompt at login.
+
+Thu Jan 16 03:28:25 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* modes/view.el (View-scroll-lines-forward): Correct format typo.
+
+Mon Jan 13 22:50:23 1997  David Moore  <dmoore@UCSD.EDU>
+
+	* packages/compile.el: Clean up regexps.
+
+Sun Jan 12 20:50:08 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* modes/m4-mode.el: Changed m4-program to point to /usr/bin/m4.
+
+Sun Jan 12 18:49:30 1997   $B<i2,(B $BCNI'(B/MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* mule/mule-misc.el: `-columns' -> `-width' and define `-columns'
+	alias
+	Import definition of `truncate-string-to-width' from Emacs/mule-delta.
+
+Sun Jan 12 13:57:11 1997  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* prim/window.el (shrink-window-if-larger-than-buffer): Don't let
+	readjusted window change the buffer order stack.
+
+Sat Jan 11 20:12:47 1997  Vinnie Shelton  <shelton@icd.teradyne.com>
+
+	* utils/finder.el (finder-insert-at-column): Correct off-by-one
+	error affecting long file names.
+
 Fri Jan 10 22:27:58 1997  Shane Holder  <holder@rsn.hp.com>
 
 	* utils/bench.el:  New version.
@@ -532,7 +620,7 @@
 
 	* utils/smtpmail.el: New file from Emacs 19.34.
 
-Fri Dec  6 09:28:04 1996  MORIOKA Tomohiko <morioka@jaist.ac.jp>
+Fri Dec  6 09:28:04 1996  $B<i2,(B $BCNI'(B/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.
--- a/lisp/comint/telnet.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/comint/telnet.el	Mon Aug 13 09:07:36 2007 +0200
@@ -68,7 +68,7 @@
 (defvar telnet-count 0
   "Number of output strings read from the telnet process
 while looking for the initial password.")
-(make-variable-buffer-local 'telnet-count)
+;; (make-variable-buffer-local 'telnet-count)
 
 (defvar telnet-program "telnet"
   "Program to run to open a telnet connection.")
@@ -254,7 +254,6 @@
 					   (if port (concat " " port) "")
 					   "\n"))
       (setq comint-input-sender 'telnet-simple-send)
-      (setq telnet-count telnet-initial-count)
       ;; run last so that hooks can change things.
       (telnet-mode))))
 
@@ -273,6 +272,7 @@
         mode-name "Telnet"
         comint-prompt-regexp telnet-prompt-pattern)
   (use-local-map telnet-mode-map)
+  (set (make-local-variable 'telnet-count) telnet-initial-count)
   (run-hooks 'telnet-mode-hook))
 
 ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
@@ -303,8 +303,10 @@
     ;; antisocial than echoing a password, and more likely than connecting
     ;; to a non-Unix rsh host these days...
     ;;
-    ;; (set-process-filter (get-process name) 'telnet-initial-filter)
-    (set-process-filter (get-process name) 'telnet-filter)
+    ;; I disagree with the above.  -sb
+    ;;
+    (set-process-filter (get-process name) 'telnet-initial-filter)
+    ;; (set-process-filter (get-process name) 'telnet-filter)
     ;; run last so that hooks can change things.
     (telnet-mode)))
 
--- a/lisp/dired/dired.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/dired/dired.el	Mon Aug 13 09:07:36 2007 +0200
@@ -852,7 +852,9 @@
 	case-fold-search nil
 	buffer-read-only t
 	selective-display t		; for subdirectory hiding
-	modeline-buffer-identification '("Dired: %17b"))
+	modeline-buffer-identification
+	(list (cons modeline-buffer-id-left-extent "Dired: ")
+	      (cons modeline-buffer-id-right-extent "%17b")))
   (set (make-local-variable 'revert-buffer-function)
        (function dired-revert))
   (set (make-local-variable 'page-delimiter)
--- a/lisp/ediff/Makefile	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/Makefile	Mon Aug 13 09:07:36 2007 +0200
@@ -27,12 +27,10 @@
 # --------- ONLY AUTHORIZED PERSONNEL BEYOND THIS POINT!!! ------------
 EDIFF    = ediff-init.el ediff-help.el ediff-diff.el ediff-merg.el \
            ediff-wind.el ediff-util.el ediff-mult.el ediff-vers.el \
-           ediff-ptch.el ediff.el ediff-hook.el
-# ediff-tbar.el
+           ediff-ptch.el ediff.el ediff-hook.el ediff-tbar.el
 EDIFFelc = ediff-init.elc ediff-help.elc ediff-diff.elc ediff-merg.elc \
            ediff-wind.elc ediff-util.elc ediff-mult.elc ediff-vers.elc \
-           ediff-ptch.elc ediff.elc ediff-hook.elc
-# ediff-tbar.elc
+           ediff-ptch.elc ediff.elc ediff-hook.elc ediff-tbar.elc
 
 
 all: hello elc goodbye dvi info
--- a/lisp/ediff/README	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/README	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 **** EDIFF -- a comprehensive interface to diff for Emacs 19 and XEmacs 19
 
-**** This version of Ediff requires *at least* Emacs 19.30 or XEmacs 19.14
+**** This version of Ediff requires *at least* Emacs 19.34 or XEmacs 19.14
 
 This directory:
 
@@ -20,8 +20,9 @@
 ediff-mult.el   -- Ediff Emacs Lisp code
 ediff-vers.el	-- Ediff Emacs Lisp code
 ediff-ptch.el	-- Ediff Emacs Lisp code
-ediff-tbar.el	-- Ediff Emacs Lisp code -- this one only for XEmacs
+ediff-tbar.el	-- Ediff Emacs Lisp code -- for XEmacs only
 ediff-hook.el	-- Ediff Emacs Lisp code
+toolbar/	-- Ediff toolbar icons   -- for XEmacs only
 
 
 To install Ediff do:
@@ -57,42 +58,17 @@
    for Emacs 18). An even better thing would be to edit Makefile directly
    as indicated in the comments there.
 
-For manual installation, copy ediff*.elc into a directory on your load-path.
-
-For more details, read documentation at the beginning of the file ediff.el
-
-To install on-line documentation, you need to install the Info files
-by copying 
-
-ediff.info*
-
-into your Info directory (which is emacs-root-dir/info,
-if emacs-root-dir is the root directory of the installation).
-
-Then edit the file 
+4. Under XEmacs, copy the icons in the `toolbar' directory into
+   the-directory-where-xemacs-installed/etc/toolbar/
 
-emacs-root-dir/info/dir
-
-to include the root menu item for Ediff (check how other menu
-items look like in this file). 
-
-In Emacs, this item should look like this:
-
-*  Ediff: (ediff.info).  A Visual Interface to Unix Diff and Patch Utilities
-
-In XEmacs, it looks like:
-
-*  Ediff::        A Visual Interface to Unix Diff and Patch Utilities
-
-
-Normally, all Ediff menus and autoloads are already defined in Emacs, so u
+Normally, all Ediff menus and autoloads are already defined in Emacs, so you
 don't need to define anything in your .emacs to run Ediff.
 However, if it was announced that this distribution of Ediff contains
-new features, you may have to put 
+new features, you may need to put 
 
 (require 'ediff-hook)
 
 in your .emacs to take advantage of these new features. This doesn't load
-Ediff, but readies it for any taks u assign to it. When this version of
-Ediff gets installed in the standard Emacs distribution, you may remove
+Ediff, but readies Emacs for the things to come. When this version of
+Ediff gets installed in the standard Emacs distribution, you can remove
 the above require-statement (but leaving it in does no harm).
--- a/lisp/ediff/ediff-diff.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-diff.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-diff.el --- diff-related utilities
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -29,7 +29,7 @@
 (defvar ediff-default-variant)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     (or (featurep 'ediff-util)
--- a/lisp/ediff/ediff-help.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-help.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-help.el --- Code related to the contents of Ediff help buffers
 
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -29,7 +29,7 @@
 (defvar ediff-multiframe)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     ))
--- a/lisp/ediff/ediff-hook.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-hook.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
 
-;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -25,6 +25,8 @@
 
 ;;;   These must be placed in menu-bar.el in Emacs
 ;;
+;;      (define-key menu-bar-tools-menu [ediff-misc]
+;;	'("Ediff Miscellanea" . menu-bar-ediff-misc-menu))
 ;;      (define-key menu-bar-tools-menu [epatch]
 ;;	'("Apply Patch" . menu-bar-epatch-menu))
 ;;      (define-key menu-bar-tools-menu [ediff-merge]
@@ -36,6 +38,7 @@
 (defvar ediff-menu)
 (defvar ediff-merge-menu)
 (defvar epatch-menu)
+(defvar ediff-misc-menu)
 ;; end pacifier
 
 ;; allow menus to be set up without ediff-wind.el being loaded
@@ -43,32 +46,16 @@
 
 
 (defun ediff-xemacs-init-menus ()
-  (setq ediff-window-setup-function
-	(if (console-on-window-system-p)
-	    'ediff-setup-windows-multiframe
-	  'ediff-setup-windows-plain))
   (if (featurep 'menubar)
       (progn
-	(add-menu-button
-	 '("Tools")
-	 ["Use separate frame for Ediff control buffer"
-	  ediff-toggle-multiframe
-	  :style toggle
-	  :selected (eq ediff-window-setup-function 'ediff-setup-windows-multiframe)]
-	 "00-Browser...")
-	;;(add-menu-button
-	;; '("Tools")
-	;; ["Use a toolbar with Ediff control buffer"
-	;;  ediff-toggle-use-toolbar
-	;;  :style toggle
-	;;  :selected (ediff-use-toolbar-p)]
-	;; "00-Browser...")
 	(add-submenu
 	 '("Tools") ediff-menu "OO-Browser...")
 	(add-submenu
 	 '("Tools") ediff-merge-menu "OO-Browser...")
 	(add-submenu
 	 '("Tools") epatch-menu "OO-Browser...")
+	(add-submenu
+	 '("Tools") ediff-misc-menu "OO-Browser...")
 	(add-menu-button
 	 '("Tools")
 	 ["-------" nil nil] "OO-Browser...")
@@ -95,9 +82,6 @@
 	   "---"
 	   ["Regions Word-by-word..." ediff-regions-wordwise t]
 	   ["Regions Line-by-line..." ediff-regions-linewise t]
-	   "---"
-	   ["List Ediff Sessions..." ediff-show-registry t]
-	   ["Ediff Manual..." ediff-documentation t]
 	   ))
        (defvar ediff-merge-menu
 	 '("Merge"
@@ -117,17 +101,28 @@
 	   ["Directory Revisions..." ediff-merge-directory-revisions t]
 	   ["Directory Revisions with Ancestor..."
 	    ediff-merge-directory-revisions-with-ancestor t]
-	   "---"
-	   ["List Ediff Sessions..." ediff-show-registry t]
-	   ["Ediff Manual..." ediff-documentation t]
 	   ))
        (defvar epatch-menu
 	 '("Apply Patch"
 	   ["To a file..."  ediff-patch-file t]
 	   ["To a buffer..." ediff-patch-buffer t]
-	   "---"
+	   ))
+       (defvar ediff-misc-menu
+	 '("Ediff Miscellanea"
+	   ["Ediff Manual..." ediff-documentation t]
 	   ["List Ediff Sessions..." ediff-show-registry t]
-	   ["Ediff Manual..." ediff-documentation t]
+	   ["Use separate frame for Ediff control buffer..."
+	    ediff-toggle-multiframe
+	    :style toggle
+	    :selected (if (and (featurep 'ediff-util)
+			       (boundp 'ediff-window-setup-function))
+			  (eq ediff-window-setup-function
+			      'ediff-setup-windows-multiframe))]
+	   ["Use a toolbar with Ediff control buffer"
+	    ediff-toggle-use-toolbar
+	    :style toggle
+	    :selected (if (featurep 'ediff-tbar)
+			  (ediff-use-toolbar-p))]
 	   ))
 
        ;; put these menus before Object-Oriented-Browser in Tools menu
@@ -139,6 +134,10 @@
       ;; Emacs--only if menu-bar is loaded
       ((featurep 'menu-bar)
        ;; initialize menu bar keymaps
+       (defvar menu-bar-ediff-misc-menu
+	 (make-sparse-keymap "Ediff Miscellanea"))
+       (fset 'menu-bar-ediff-misc-menu
+	     (symbol-value 'menu-bar-ediff-misc-menu))
        (defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
        (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
        (defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge"))
@@ -148,14 +147,6 @@
        (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
 
        ;; define ediff-menu
-       (define-key menu-bar-ediff-menu [ediff-doc]
-	 '("Ediff Manual..." . ediff-documentation))
-       (define-key menu-bar-ediff-menu [emultiframe]
-	'("Toggle separate control buffer frame..."
-	  . ediff-toggle-multiframe))
-       (define-key menu-bar-ediff-menu [eregistry]
-	'("List Ediff Sessions..." . ediff-show-registry))
-       (define-key menu-bar-ediff-menu [separator-ediff-manual] '("--"))
        (define-key menu-bar-ediff-menu [window]
 	 '("This Window and Next Window" . compare-windows))
        (define-key menu-bar-ediff-menu [ediff-windows-linewise]
@@ -188,15 +179,6 @@
 	 '("Two Files..." . ediff-files))
 
        ;; define merge menu
-       (define-key menu-bar-ediff-merge-menu [ediff-doc2]
-	 '("Ediff Manual..." . ediff-documentation))
-       (define-key menu-bar-ediff-merge-menu [emultiframe2]
-	'("Toggle separate control buffer frame..."
-	  . ediff-toggle-multiframe))
-       (define-key menu-bar-ediff-merge-menu [eregistry2]
-	'("List Ediff Sessions..." . ediff-show-registry))
-       (define-key
-	 menu-bar-ediff-merge-menu [separator-ediff-merge-manual] '("--"))
        (define-key
 	 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions-with-ancestor]
 	 '("Directory Revisions with Ancestor..."
@@ -230,18 +212,20 @@
 	 '("Files..." . ediff-merge-files))
 
        ;; define epatch menu
-       (define-key menu-bar-epatch-menu [ediff-doc3]
-	 '("Ediff Manual..." . ediff-documentation))
-       (define-key menu-bar-epatch-menu [emultiframe3]
-	'("Toggle separate control buffer frame..."
-	  . ediff-toggle-multiframe))
-       (define-key menu-bar-epatch-menu [eregistry3]
-	'("List Ediff Sessions..." . ediff-show-registry))
-       (define-key menu-bar-epatch-menu [separator-epatch] '("--"))
        (define-key menu-bar-epatch-menu [ediff-patch-buffer]
 	 '("To a Buffer..." . ediff-patch-buffer))
        (define-key menu-bar-epatch-menu [ediff-patch-file]
-	 '("To a File..." . ediff-patch-file)))
+	 '("To a File..." . ediff-patch-file))
+
+       ;; define ediff miscellanea
+       (define-key menu-bar-ediff-misc-menu [emultiframe]
+	 '("Toggle use of separate control buffer frame..."
+	   . ediff-toggle-multiframe))
+       (define-key menu-bar-ediff-misc-menu [eregistry]
+	 '("List Ediff Sessions..." . ediff-show-registry))
+       (define-key menu-bar-ediff-misc-menu [ediff-doc]
+	 '("Ediff Manual..." . ediff-documentation))
+       )
       
       ) ; cond
 
@@ -345,13 +329,11 @@
     "ediff-util"
     "Toggle the use of separate frame for Ediff control buffer."
     t)
-  (condition-case nil
-      (if (string-match "XEmacs" emacs-version)
-	  (autoload 'ediff-toggle-use-toolbar
-	    "ediff-tbar"
-	    "Toggle the use of Ediff toolbar."
-	    t))
-    (error))
+  (autoload 'ediff-toggle-use-toolbar
+    "ediff-util"
+    "Toggle the use of Ediff toolbar."
+    t)
+  
   ) ; if purify-flag
 
 
--- a/lisp/ediff/ediff-init.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-init.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -32,6 +32,10 @@
 (defvar ediff-mouse-pixel-threshold)
 (defvar ediff-whitespace)
 (defvar ediff-multiframe)
+
+(and noninteractive
+     (eval-when-compile
+	 (load "ange-ftp" 'noerror)))
 ;; end pacifier
 
 ;; Is it XEmacs?
@@ -90,7 +94,7 @@
 (ediff-defvar-local ediff-buffer-C nil "")
 ;; Ancestor buffer
 (ediff-defvar-local ediff-ancestor-buffer nil "")
-;; The control buffer of ediff.
+;; The Ediff control buffer
 (ediff-defvar-local ediff-control-buffer nil "")
 
 ;;; Macros
@@ -625,8 +629,8 @@
   
   
 ;;;; warn if it is a wrong version of emacs
-;;(if (or (ediff-check-version '< 19 29 'emacs)
-;;	(ediff-check-version '< 19 12 'xemacs))
+;;(if (or (ediff-check-version '< 19 35 'emacs)
+;;	(ediff-check-version '< 19 15 'xemacs))
 ;;    (progn
 ;;      (with-output-to-temp-buffer ediff-msg-buffer
 ;;	(switch-to-buffer ediff-msg-buffer)
@@ -635,9 +639,9 @@
 ;;
 ;;This version of Ediff requires 
 ;;
-;;\t Emacs 19.29 and higher
+;;\t Emacs 19.35 and higher
 ;;\t OR
-;;\t XEmacs 19.12 and higher
+;;\t XEmacs 19.15 and higher
 ;;
 ;;It is unlikely to work under Emacs version %s
 ;;that you are using... " emacs-version))
--- a/lisp/ediff/ediff-merg.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-merg.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-merg.el --- merging utilities
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -33,7 +33,7 @@
 (defvar ediff-window-config-saved)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     (or (featurep 'ediff-util)
--- a/lisp/ediff/ediff-mult.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-mult.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff
 
-;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -667,7 +667,8 @@
 	   "     `=':\tmark identical files in each session\n\n"))
 
       (if (and (stringp regexp) (> (length regexp) 0))
-	  (insert (format "Filter-through regular expression: %s\n" regexp)))
+	  (insert
+	   (format "\n*** Filter-through regular expression: %s\n" regexp)))
       (if (and ediff-autostore-merges (ediff-merge-metajob)
 	       (stringp merge-autostore-dir))
 	  (insert (format
@@ -821,7 +822,8 @@
      DEL: previous line\n\n")
 
       (if (and (stringp regexp) (> (length regexp) 0))
-	  (insert (format "Filter-through regular expression: %s\n" regexp)))
+	  (insert
+	   (format "\n*** Filter-through regular expression: %s\n" regexp)))
       (insert "\n")
       (insert (format "\n%-27s%-26s"
 		      (ediff-truncate-string-left
--- a/lisp/ediff/ediff-ptch.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-ptch.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-ptch.el --- Ediff's  patch support
 
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -34,13 +34,11 @@
 (defvar ediff-shell)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     (or (featurep 'ediff)
 	(load "ediff.el" nil nil 'nosuffix))
-    (or (featurep 'ange-ftp)
-	(load "ange-ftp" 'noerror))
     ))
 ;; end pacifier
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/ediff/ediff-tbar.el	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,371 @@
+;;; ediff-tbar.el --- A toolbar for Ediff control buffer
+
+;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+
+;; Author: Marc Paquette <marcpa@cam.org>
+
+;; 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.
+
+;;; Code:
+	 
+(provide 'ediff-tbar)
+
+;; compiler pacifier
+(defvar toolbar-icon-directory)
+
+(eval-when-compile
+  (let ((load-path (cons (expand-file-name ".") load-path)))
+    (or (featurep 'ediff-init)
+	(load "ediff-init.el" nil nil 'nosuffix))
+    (or (featurep 'ediff-util)
+	(load "ediff-util.el" nil nil 'nosuffix))
+    ))
+;; end pacifier
+
+(require 'ediff-init)
+
+(defvar ediff-use-toolbar-p nil
+  "If t, Ediff will use a toolbar for the control frame.
+This has an effect only if your emacs supports Toolbars.
+Currently, XEmacs does, but not Emacs.
+Do not change the value of this variable interactively.
+This should be done only via the menu bar or by executing
+`ediff-toggle-use-toolbar'.")
+
+(defvar ediff-toolbar-height 21
+  "The height of the Ediff toolbar.
+The value must match the actual size of the toolbar icons.")
+
+(defvar ediff-toolbar-width 200.0
+  "The width of the Ediff toolbar.
+The value must match the actual width of the toolbar.
+Here's an example:
+    There are 10 buttons, each 15 pixels large, and the shadows occupy 2
+   pixels each side, and the last button is right-justified (so we reserve
+   about 30 pixels for fill space) = 200 pixels.")
+
+(defun ediff-has-toolbar-support-p ()
+  (and ediff-xemacs-p
+       (featurep 'toolbar)
+       (console-on-window-system-p)))
+       
+(defun ediff-use-toolbar-p ()
+  (and (ediff-has-toolbar-support-p)	;Can it do it ?
+       ediff-use-toolbar-p))		;Does the user want it ?
+
+;; Here the toolbar width is not the same width talked about in XEmacs
+;; lispref info documentation : it is the minimal width needed by
+;; ediff's toolbar to display all buttons, for an horizontal toolbar.
+;; Ideally, we would query the toolbar for the width of each button
+;; and add them, but I didn't find query functions in the doc on
+;; toolbars.  Therefore, I use a static number of pixels that should
+;; be adjusted if the toolbar gets more or loses some buttons. --marcpa
+(defun ediff-compute-toolbar-width ()
+  (if (not (ediff-use-toolbar-p))
+      0
+    (ceiling (/ ediff-toolbar-width (font-instance-width (face-font-instance 'default))))))
+
+(defvar ediff-toolbar-next-icon
+   (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	(if (featurep 'xpm) "ediff-next.xpm" "ediff-next.xbm")
+	toolbar-icon-directory)))
+  "Next difference icon in toolbar.")
+
+(defvar ediff-toolbar-previous-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	(if (featurep 'xpm) "ediff-prev.xpm" "ediff-prev.xbm")
+	toolbar-icon-directory)))
+  "Previous difference icon in toolbar.")
+
+(defvar ediff-toolbar-A-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	;; UP
+	(if (featurep 'xpm) "ediff-A-up.xpm" "ediff-A-up.xbm")
+	toolbar-icon-directory)
+       (expand-file-name
+	;; DOWN
+	(if (featurep 'xpm) "ediff-A-up.xpm" "ediff-A-up.xbm")
+	toolbar-icon-directory)
+       (expand-file-name
+	;; DISABLED
+	(if (featurep 'xpm) "ediff-A-xx.xpm" "ediff-A-up.xbm")
+	toolbar-icon-directory)
+       ))
+  "Select diff A icon in toolbar.")
+
+(defvar ediff-toolbar-B-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	;; UP
+	(if (featurep 'xpm) "ediff-B-up.xpm" "ediff-B-up.xbm")
+	toolbar-icon-directory)
+       (expand-file-name
+	;; DOWN
+	(if (featurep 'xpm) "ediff-B-up.xpm" "ediff-B-up.xbm")
+	toolbar-icon-directory)
+       (expand-file-name
+	;; DISABLED
+	(if (featurep 'xpm) "ediff-B-xx.xpm" "ediff-B-up.xbm")
+	toolbar-icon-directory)
+       ))
+  "Select diff B icon in toolbar.")
+
+(defvar ediff-toolbar-toggle-split-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	;; UP
+	(if (featurep 'xpm)
+	    "ediff-toggle-split-up.xpm" "ediff-toggle-split-up.xbm")
+	toolbar-icon-directory)
+       ))
+  "Toggle split mode between side-to-side and one-on-top-of-another.")
+
+(defvar ediff-toolbar-save-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	;; UP
+	(if (featurep 'xpm) "ediff-save.xpm" "ediff-save.xbm")
+	toolbar-icon-directory)
+       (expand-file-name
+	;; DOWN
+	(if (featurep 'xpm) "ediff-save.xpm" "ediff-save.xbm")
+	toolbar-icon-directory)
+       (expand-file-name
+	;; DISABLED
+	(if (featurep 'xpm) "ediff-save-xx.xpm" "ediff-save-xx.xbm")
+	toolbar-icon-directory)
+       ))
+  "Save merge buffer.")
+
+(defvar ediff-toolbar-quit-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	(if (featurep 'xpm) "ediff-quit.xpm" "ediff-quit.xbm")
+	toolbar-icon-directory)))
+  "Exit Ediff session.")
+
+(defvar ediff-toolbar-help-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	(if (featurep 'xpm) "ediff-help.xpm" "ediff-help.xbm")
+	toolbar-icon-directory)))
+  "Show Ediff help.")
+
+(defvar ediff-toolbar-refresh-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	(if (featurep 'xpm) "ediff-update.xpm" "ediff-update.xbm")
+	toolbar-icon-directory)))
+  "Refresh Ediff display (aka recenter).")
+
+(defvar ediff-toolbar-refine-icon
+  (if (featurep 'toolbar)
+      (toolbar-make-button-list
+       (expand-file-name
+	;; UP
+	(if (featurep 'xpm) "ediff-refine.xpm" "ediff-refine.xbm")
+	toolbar-icon-directory)
+       ))
+  "Refine current difference region by computing fine diffs.")
+
+(defun ediff-toolbar-previous-difference ()
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (ediff-previous-difference 1)))
+
+(defun ediff-toolbar-next-difference ()
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (ediff-next-difference 1)))
+
+(defun ediff-toolbar-select/copy-A ()
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (cond ((or (ediff-merge-job)
+	       (ediff-merge-with-ancestor-job))
+	   (ediff-copy-A-to-C nil))
+	  (t 
+	   (ediff-copy-A-to-B nil)))))
+
+(defun ediff-toolbar-select/copy-B ()
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (cond ((or (ediff-merge-job)
+	       (ediff-merge-with-ancestor-job))
+	   (ediff-copy-B-to-C nil))
+	  (t 
+	   (ediff-copy-B-to-A nil)))))
+
+(defun ediff-toolbar-toggle-split ()
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (ediff-toggle-split)))
+
+
+(defun ediff-toolbar-save ()
+  (interactive)
+  (ediff-barf-if-not-control-buffer)
+  (if (ediff-merge-job)
+      (ediff-maybe-save-and-delete-merge 'save-and-continue)
+    ;; 2-way or 3-way compare: save modified buffers
+    (mapcar (function
+	     (lambda (type)
+	       (let ((ebuf (ediff-get-buffer type)))
+		 (and (ediff-buffer-live-p ebuf)
+		      (ediff-eval-in-buffer ebuf
+			(and (buffer-modified-p)
+			     (save-buffer)))))))
+	    '(A B C))))
+
+
+(defun ediff-toolbar-quit ()
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (ediff-quit nil)))
+
+(defun ediff-toolbar-help ()
+  (interactive)
+  (ediff-toggle-help))
+
+(defun ediff-toolbar-refresh ()
+  "Recenter"
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (ediff-recenter)))
+
+(defun ediff-toolbar-refine ()
+  "Refine current difference region by computing fine diffs."
+  (interactive)
+  (let ((ediff-grab-mouse nil))
+    (ediff-make-or-kill-fine-diffs 'make-them)))
+
+(defun ediff-toolbar-refine-needed-p ()
+  (and (> ediff-current-difference 0)
+       (> ediff-auto-refine-limit
+	  (- (ediff-get-diff-posn 'A 'end ediff-current-difference)
+	     (ediff-get-diff-posn 'A 'beg ediff-current-difference)))))
+
+(defvar ediff-toolbar
+  (if (featurep 'toolbar)
+      '([ediff-toolbar-refine-icon
+	 ediff-toolbar-refine
+	 t
+	 ;;; The toolbar is not automatically refreshed (in 19.14)
+	 ;;; when :activep changes state. 
+	 ;;(ediff-toolbar-refine-needed-p)
+	 "Refine current difference region by computing fine diffs."]
+	[ediff-toolbar-previous-icon
+	 ediff-toolbar-previous-difference
+	 t
+	 "Go to the previous difference."]
+	[ediff-toolbar-next-icon
+	 ediff-toolbar-next-difference
+	 t
+	 "Advance to the next difference."]
+	[ediff-toolbar-A-icon
+	 ediff-toolbar-select/copy-A
+	 (not (ediff-3way-comparison-job))
+	 "Select/Copy difference A."]
+	[ediff-toolbar-B-icon
+	 ediff-toolbar-select/copy-B
+	 (not (ediff-3way-comparison-job))
+	 "Select/Copy difference B."]
+	[ediff-toolbar-save-icon
+	 ediff-toolbar-save
+	 t
+	 "Save buffers modified in this session."]
+	[ediff-toolbar-refresh-icon
+	 ediff-toolbar-refresh
+	 t
+	 "Refresh Ediff display (aka recenter)."]
+ 	[ediff-toolbar-toggle-split-icon
+	  ediff-toolbar-toggle-split
+	  t
+	 "Toggle split mode between side-to-side and one-on-top-of-another."]
+	[ediff-toolbar-help-icon
+	 ediff-toolbar-help
+	 t
+	 "Toggle short/long help."]
+	nil
+ 	[ediff-toolbar-quit-icon
+ 	 ediff-toolbar-quit
+ 	 t
+ 	 "Quit this ediff session."]
+	)))
+
+(defvar ediff-toolbar-3way
+  (if (featurep 'toolbar)
+      '([ediff-toolbar-refine-icon
+	 ediff-toolbar-refine
+	 t
+	 ;;; The toolbar is not automatically refreshed (in 19.14)
+	 ;;; when :activep changes state. 
+	 ;;(ediff-toolbar-refine-needed-p)
+	 "Refine current difference region by computing fine diffs."]
+	[ediff-toolbar-previous-icon
+	 ediff-toolbar-previous-difference
+	 t
+	 "Go to the previous difference."]
+	[ediff-toolbar-next-icon
+	 ediff-toolbar-next-difference
+	 t
+	 "Advance to the next difference."]
+	[ediff-toolbar-save-icon
+	 ediff-toolbar-save
+	 t
+	 "Save buffers modified in this session."]
+	[ediff-toolbar-refresh-icon
+	 ediff-toolbar-refresh
+	 t
+	 "Refresh Ediff display (aka recenter)."]
+ 	[ediff-toolbar-toggle-split-icon
+	  ediff-toolbar-toggle-split
+	  t
+	 "Toggle split mode between side-to-side and one-on-top-of-another."]
+	[ediff-toolbar-help-icon
+	 ediff-toolbar-help
+	 t
+	 "Toggle short/long help."]
+	nil
+ 	[ediff-toolbar-quit-icon
+ 	 ediff-toolbar-quit
+ 	 t
+ 	 "Quit this ediff session."]
+	)))
+
+
+
+;;; Local Variables:
+;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; End:
+
+;;; ediff-tbar.el ends here
--- a/lisp/ediff/ediff-util.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-util.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-util.el --- the core commands and utilities of ediff
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -29,10 +29,14 @@
 (defvar ediff-patch-diagnostics)
 (defvar ediff-patchbufer)
 (defvar ediff-toolbar)
+(defvar ediff-toolbar-3way)
+(defvar bottom-toolbar)
+(defvar bottom-toolbar-visible-p)
+(defvar bottom-toolbar-height)
 (defvar mark-active)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     (or (featurep 'ediff-help)
@@ -515,8 +519,10 @@
 		  ediff-split-window-function
 		  (ediff-multiframe-setup-p)
 		  ediff-wide-display-p))
+
+    ;; In multiframe, toolbar is set in ediff-setup-control-frame
     (if (not (ediff-multiframe-setup-p))
-	(ediff-make-bottom-toolbar))    ; checks if toolbar is requested
+	(ediff-make-bottom-toolbar)) ; this checks if toolbar is requested
     (goto-char (point-min))
     (skip-chars-forward ediff-whitespace)))
     
@@ -1181,33 +1187,21 @@
 	
 ;;;###autoload
 (defun ediff-toggle-multiframe ()
-  "Switch from the multiframe display to single-frame display and back.
-For a permanent change, set the variable `ediff-window-setup-function',
+  "Switch from multiframe display to single-frame display and back.
+To change the default, set the variable `ediff-window-setup-function',
 which see."
   (interactive)
-  (let (set-func window-setup-func)
+  (let (window-setup-func)
     (or (ediff-window-display-p)
 	(error "%sEmacs is not running as a window application"
 	       (if ediff-emacs-p "" "X")))
 
-  ;;(setq set-func (if (ediff-in-control-buffer-p) 'setq 'setq-default))
-
   (cond ((eq ediff-window-setup-function 'ediff-setup-windows-multiframe)
-	 ;; (eval
-	 ;;  (list
-	 ;;   set-func
-	 ;;   'ediff-window-setup-function ''ediff-setup-windows-plain))
-	 (setq window-setup-func 'ediff-setup-windows-plain)
-	 )
+	 (setq window-setup-func 'ediff-setup-windows-plain))
 	((eq ediff-window-setup-function 'ediff-setup-windows-plain)
 	 (if (ediff-in-control-buffer-p)
 	     (ediff-kill-bottom-toolbar))
-	 ;;(eval
-	 ;; (list
-	 ;;  set-func
-	 ;;  'ediff-window-setup-function 'ediff-setup-windows-multiframe))
-	 (setq window-setup-func 'ediff-setup-windows-multiframe)
-	 ))
+	 (setq window-setup-func 'ediff-setup-windows-multiframe)))
 
   ;; change default
   (setq-default ediff-window-setup-function window-setup-func)
@@ -1220,6 +1214,33 @@
   (if (ediff-in-control-buffer-p)
       (ediff-recenter 'no-rehighlight))))
 
+
+;;;###autoload
+(defun ediff-toggle-use-toolbar ()
+  "Enable or disable Ediff toolbar.
+Works only in versions of Emacs that support toolbars.
+To change the default, set the variable `ediff-use-toolbar-p', which see."
+  (interactive)
+  (if (featurep 'ediff-tbar)
+      (progn
+	(or (ediff-window-display-p)
+	    (error "%sEmacs is not running as a window application"
+		   (if ediff-emacs-p "" "X")))
+	(if (ediff-use-toolbar-p)
+	    (ediff-kill-bottom-toolbar))
+	;; do this only after killing the toolbar
+	(setq ediff-use-toolbar-p (not ediff-use-toolbar-p))
+	
+	(mapcar (function (lambda(buf)
+			    (ediff-eval-in-buffer buf
+			      ;; force redisplay
+			      (setq ediff-window-config-saved "")
+			      )))
+		ediff-session-registry)
+	(if (ediff-in-control-buffer-p)
+	    (ediff-recenter 'no-rehighlight)))))
+
+
 ;; if was using toolbar, kill it
 (defun ediff-kill-bottom-toolbar ()
   ;; Using ctl-buffer or ediff-control-window for LOCALE does not
@@ -1233,13 +1254,25 @@
 	(set-specifier bottom-toolbar (list (selected-frame) nil))
 	(set-specifier bottom-toolbar-visible-p (list (selected-frame) nil)))))
 
-;; if wants to use toolbar, make it
-(defun ediff-make-bottom-toolbar ()
-  (if (ediff-use-toolbar-p)
+;; If wants to use toolbar, make it.
+;; If not, zero the toolbar for XEmacs.
+;; Do nothing for Emacs.
+(defun ediff-make-bottom-toolbar (&optional frame)
+  (if (ediff-window-display-p)
       (progn
-	(set-specifier bottom-toolbar (list (selected-frame) ediff-toolbar))
-	(set-specifier bottom-toolbar-visible-p (list (selected-frame) t)) 
-	(set-specifier bottom-toolbar-height (list (selected-frame) 34)))))
+	(setq frame (or frame (selected-frame)))
+	(cond ((ediff-use-toolbar-p) ; this checks for XEmacs
+	       (set-specifier
+		bottom-toolbar
+		(list frame (if (ediff-3way-comparison-job)
+				ediff-toolbar-3way ediff-toolbar)))
+	       (set-specifier bottom-toolbar-visible-p (list frame t)) 
+	       (set-specifier bottom-toolbar-height
+			      (list frame ediff-toolbar-height)))
+	      (ediff-xemacs-p
+	       (set-specifier bottom-toolbar-height (list frame 0)))
+	      ))
+    ))
 	       
 ;; Merging
 
@@ -2202,13 +2235,15 @@
 temporarily reverses the meaning of this variable."
   (interactive "P")
   (ediff-barf-if-not-control-buffer)
-  (if (y-or-n-p (format "Quit this Ediff session%s? "
-			(if (ediff-buffer-live-p ediff-meta-buffer)
-			    " & show containing session group" "")))
-      (progn
-	(message "")
-	(ediff-really-quit reverse-default-keep-variants))
-    (message "")))
+  (let ((ctl-buf (current-buffer)))
+    (if (y-or-n-p (format "Quit this Ediff session%s? "
+			  (if (ediff-buffer-live-p ediff-meta-buffer)
+			      " & show containing session group" "")))
+	(progn
+	  (message "")
+	  (set-buffer ctl-buf)
+	  (ediff-really-quit reverse-default-keep-variants))
+      (message ""))))
 
 
 ;; Perform the quit operations.
@@ -2422,27 +2457,33 @@
 					(buffer-name ediff-buffer-C)))))
 	(ediff-kill-buffer-carefully ediff-buffer-C))))
 
-(defun ediff-maybe-save-and-delete-merge ()
+(defun ediff-maybe-save-and-delete-merge (&optional save-and-continue)
   "Default hook to run on quitting a merge job.
+This can also be used to save merge buffer in the middle of an Ediff session.
+
+If the optional SAVE-AND-CONTINUE argument is non-nil, save merge buffer and
+continue. Otherwise:
 If `ediff-autostore-merges' is nil, this does nothing.
 If it is t, it saves the merge buffer in the file `ediff-merge-store-file'
-or asks the user, if the latter is nil. It then then asks the user whether to
+or asks the user, if the latter is nil. It then asks the user whether to
 delete the merge buffer.
 If `ediff-autostore-merges' is neither nil nor t, the merge buffer is saved
 only if this merge job is part of a group, i.e., was invoked from within
 `ediff-merge-directories', `ediff-merge-directory-revisions', and such."
-  (let ((merge-store-file ediff-merge-store-file))
+  (let ((merge-store-file ediff-merge-store-file)
+	(ediff-autostore-merges ; fake ediff-autostore-merges, if necessary
+	 (if save-and-continue t ediff-autostore-merges)))
     (if ediff-autostore-merges
 	(cond ((stringp ediff-merge-store-file)
 	       ;; store, ask to delete
-	       (ediff-write-merge-buffer-then-kill
-		ediff-buffer-C merge-store-file 'show-file))
+	       (ediff-write-merge-buffer-and-maybe-kill
+		ediff-buffer-C merge-store-file 'show-file save-and-continue))
 	      ((eq ediff-autostore-merges t)
 	       ;; ask for file name
 	       (setq merge-store-file
-		     (read-file-name "Save the result of the merge in: "))
-	       (ediff-write-merge-buffer-then-kill
-		ediff-buffer-C merge-store-file))
+		     (read-file-name "Save the merge buffer in file: "))
+	       (ediff-write-merge-buffer-and-maybe-kill
+		ediff-buffer-C merge-store-file nil save-and-continue))
 	      ((and (ediff-buffer-live-p ediff-meta-buffer)
 		    (ediff-eval-in-buffer ediff-meta-buffer
 		      (ediff-merge-metajob)))
@@ -2451,12 +2492,16 @@
 	       ;; of the merge.
 	       ;; Ask where to save anyway--will decide what to do here later.
 	       (setq merge-store-file
-		     (read-file-name "The result of the merge goes into: "))
-	       (ediff-write-merge-buffer-then-kill
-		ediff-buffer-C merge-store-file))))
+		     (read-file-name "Save the merge buffer in file: "))
+	       (ediff-write-merge-buffer-and-maybe-kill
+		ediff-buffer-C merge-store-file nil save-and-continue))))
     ))
 
-(defun ediff-write-merge-buffer-then-kill (buf file &optional show-file)
+;; write merge buffer. If the optional argument save-and-continue is non-nil,
+;; then don't kill the merge buffer
+(defun ediff-write-merge-buffer-and-maybe-kill (buf file
+					       &optional
+					       show-file save-and-continue)
   (ediff-eval-in-buffer buf
     (if (or (not (file-exists-p file))
 	    (y-or-n-p (format "File %s exists, overwrite? " file)))
@@ -2466,7 +2511,9 @@
 	      (progn
 		(message "Merge buffer saved in: %s" file)
 		(sit-for 2)))
-	  (if (y-or-n-p "Merge buffer saved in file. Now kill the buffer? ")
+	  (if (and
+	       (not save-and-continue)
+	       (y-or-n-p "Merge buffer saved in file. Now kill the buffer? "))
 	      (ediff-kill-buffer-carefully buf))))))
 
 ;; The default way of suspending Ediff.
--- a/lisp/ediff/ediff-vers.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-vers.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-vers.el --- version control interface to Ediff
 
-;;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+;;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -32,11 +32,12 @@
 (defvar cvs-cookie-handle)
 (defvar ediff-temp-file-prefix)
 
-(eval-when-compile
-  (load "pcl-cvs" 'noerror)
-  (load "rcs" 'noerror)
-  (load "generic-sc" 'noerror)
-  (load "vc" 'noerror))
+(and noninteractive
+     (eval-when-compile
+       (load "pcl-cvs" 'noerror)
+       (load "rcs" 'noerror)
+       (load "generic-sc" 'noerror)
+       (load "vc" 'noerror)))
 ;; end pacifier
       
 ;; VC.el support
--- a/lisp/ediff/ediff-wind.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff-wind.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; ediff-wind.el --- window manipulation utilities
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 
@@ -38,13 +38,13 @@
 (defvar ediff-diff-status)
 
 (eval-when-compile
-  (let ((load-path (cons  "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
+    (or (featurep 'ediff-util)
+	(load "ediff-util.el" nil nil 'nosuffix))
     (or (featurep 'ediff-help)
 	(load "ediff-help.el" nil nil 'nosuffix))
-    (or (featurep 'ediff-util)
-	(load "ediff-util.el" nil nil 'nosuffix))
     (or (featurep 'ediff-tbar)
 	(load "ediff-tbar.el" 'noerror nil 'nosuffix))
     ))
@@ -878,16 +878,19 @@
 	  fheight lines
 	  fwidth (max (+ (ediff-help-message-line-length) 2)
 		      (ediff-compute-toolbar-width))
-	  adjusted-parameters (append (list
-				       ;; possibly change surrogate minibuffer
-				       (cons 'minibuffer
-					     (minibuffer-window
-					      designated-minibuffer-frame))
-				       (cons 'width fwidth)
-				       (cons 'height fheight))
-				      (funcall
-				       ediff-control-frame-position-function
-				       ctl-buffer fwidth fheight)))
+	  adjusted-parameters ;;(append
+	  (list
+	   ;; possibly change surrogate minibuffer
+	   (cons 'minibuffer
+		 (minibuffer-window
+		  designated-minibuffer-frame))
+	   (cons 'width fwidth)
+	   (cons 'height fheight))
+	  ;;(funcall
+	   ;;ediff-control-frame-position-function
+	   ;;ctl-buffer fwidth fheight)
+	  ;;)
+	  )
     (if ediff-use-long-help-message
 	(setq adjusted-parameters
 	      (cons '(auto-raise . nil) adjusted-parameters)))
@@ -896,8 +899,10 @@
     ;; are changed. 
     (if ediff-xemacs-p
 	(progn
+	  (set-specifier top-toolbar-height (list ctl-frame 2))
+	  (sit-for 0)
 	  (set-specifier top-toolbar-height (list ctl-frame 0))
-	  (set-specifier bottom-toolbar-height (list ctl-frame 0))
+	  ;;(set-specifier bottom-toolbar-height (list ctl-frame 0))
 	  (set-specifier left-toolbar-width (list ctl-frame 0))
 	  (set-specifier right-toolbar-width (list ctl-frame 0))
 	  ))
@@ -910,11 +915,13 @@
     (if (memq system-type '(emx windows-nt windows-95))
 	(modify-frame-parameters ctl-frame adjusted-parameters))
       
+    ;; make or zap toolbar (if not requested)
+    (ediff-make-bottom-toolbar ctl-frame)
+    
     (goto-char (point-min))
-    
+
     (modify-frame-parameters ctl-frame adjusted-parameters)
     (make-frame-visible ctl-frame)
-    (ediff-make-bottom-toolbar) ; no effect if the toolbar is not requested
     
     ;; This works around a bug in 19.25 and earlier. There, if frame gets
     ;; iconified, the current buffer changes to that of the frame that
@@ -930,6 +937,12 @@
 	   (raise-frame ctl-frame)))
     
     (set-window-dedicated-p (selected-window) t)
+
+    ;; Now move the frame. We must do it separately due to an obscure bug in
+    ;; XEmacs
+    (modify-frame-parameters
+     ctl-frame
+     (funcall ediff-control-frame-position-function ctl-buffer fwidth fheight))
       
     ;; synchronize so the cursor will move to control frame
     ;; per RMS suggestion
@@ -955,6 +968,7 @@
     (ediff-eval-in-buffer ctl-buffer
       (run-hooks 'ediff-after-setup-control-frame-hook))
     ))
+
     
 (defun ediff-destroy-control-frame (ctl-buffer)
   (ediff-eval-in-buffer ctl-buffer
@@ -1081,9 +1095,9 @@
     
     ;; control buffer format
     (setq mode-line-format
-	  (list (if (ediff-narrow-control-frame-p) "   " "-- ")
-		mode-line-buffer-identification
-		"        Quick Help"))
+	  (if (ediff-narrow-control-frame-p)
+	      (list "   " mode-line-buffer-identification)
+	    (list "-- " mode-line-buffer-identification "        Quick Help")))
     ;; control buffer id
     (setq mode-line-buffer-identification 
 	  (if (ediff-narrow-control-frame-p)
--- a/lisp/ediff/ediff.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/ediff/ediff.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,13 +1,13 @@
 ;;; ediff.el --- a comprehensive visual interface to diff & patch
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, version control.
 
 (defconst ediff-version "2.64" "The current version of Ediff")
-(defconst ediff-date "January 3, 1997" "Date of last update")  
+(defconst ediff-date "January 7, 1997" "Date of last update")  
 
 
 ;; This file is part of GNU Emacs.
@@ -109,9 +109,13 @@
 (provide 'ediff)
 
 ;; Compiler pacifier
+(and noninteractive
+     (eval-when-compile
+	 (load-library "dired")
+	 (load-library "info")
+	 (load "pcl-cvs" 'noerror)))
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
-    (load "dired")
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     (or (featurep 'ediff-mult)
@@ -120,7 +124,6 @@
 	(load "ediff-ptch.el" nil nil 'nosuffix))
     (or (featurep 'ediff-vers)
 	(load "ediff-vers.el" nil nil 'nosuffix))
-    (load "pcl-cvs" 'noerror)
     ))
 ;; end pacifier
 
@@ -285,8 +288,8 @@
   
     (ediff-eval-in-buffer (symbol-value buffer-name)
       (widen) ; Make sure the entire file is seen
-      (cond (file-magic  ;; file has handler, such as jka-compr-handler or
-	     ;; ange-ftp-hook-function--arrange for temp file
+      (cond (file-magic  ;   file has a handler, such as jka-compr-handler or
+	     		 ;;; ange-ftp-hook-function--arrange for temp file
 	     (ediff-verify-file-buffer 'magic)
 	     (setq file
 		   (ediff-make-temp-file
--- a/lisp/modes/imenu.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/modes/imenu.el	Mon Aug 13 09:07:36 2007 +0200
@@ -787,12 +787,13 @@
   (interactive "sImenu menu item name: ")
   (let ((newmap (make-sparse-keymap))
 	(menu-bar (lookup-key (current-local-map) [menu-bar])))
-    (define-key newmap [menu-bar]
-      (append (make-sparse-keymap) menu-bar))
-    (define-key newmap [menu-bar index]
-      (cons name (nconc (make-sparse-keymap "Imenu")
-			(make-sparse-keymap))))
-    (use-local-map (append newmap (current-local-map))))
+    (when menu-bar
+      (define-key newmap [menu-bar]
+	(append (make-sparse-keymap) menu-bar))
+      (define-key newmap [menu-bar index]
+	(cons name (nconc (make-sparse-keymap "Imenu")
+			  (make-sparse-keymap))))
+      (use-local-map (append newmap (current-local-map)))))
   (add-hook 'menu-bar-update-hook 'imenu-update-menubar))
 
 (defvar imenu-buffer-menubar nil)
--- a/lisp/modes/m4-mode.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/modes/m4-mode.el	Mon Aug 13 09:07:36 2007 +0200
@@ -28,7 +28,7 @@
 ;; It also sets the font-lock syntax stuff for colorization
 
 ;; By Drew Csillag (drew@staff.prodigy.com)
-;; $Id: m4-mode.el,v 1.1.1.1 1996/12/18 22:42:49 steve Exp $
+;; $Id: m4-mode.el,v 1.2 1997/01/23 05:29:30 steve Exp $
 
 ;; History:
 
@@ -69,7 +69,7 @@
 ;;; Code:
 
 ;;path to the m4 program
-(defvar m4-program "/usr/local/bin/m4")
+(defvar m4-program "/usr/bin/m4")
 
 ;;thank god for make-regexp.el!
 (defvar m4-font-lock-keywords
--- a/lisp/modes/rsz-minibuf.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/modes/rsz-minibuf.el	Mon Aug 13 09:07:36 2007 +0200
@@ -10,7 +10,7 @@
 ;;; Keywords: minibuffer, window, frames, display
 ;;; Status: Known to work in FSF GNU Emacs 19.23 and Lucid Emacs 19.9.
 
-;;; $Id: rsz-minibuf.el,v 1.1.1.1 1996/12/18 22:42:48 steve Exp $
+;;; $Id: rsz-minibuf.el,v 1.2 1997/01/23 05:29:30 steve Exp $
 
 ;;; This program is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -159,10 +159,16 @@
 	     (add-hook 'minibuffer-exit-hook 'resize-minibuffer-frame-restore
 		       nil t)
 	     (make-local-hook 'post-command-hook)
-	     (add-hook 'post-command-hook 'resize-minibuffer-frame nil t))))
+	     (add-hook 'post-command-hook 'resize-minibuffer-frame nil t)
+	     (unless (and (boundp 'icomplete-mode)
+			  icomplete-mode)
+	       (resize-minibuffer-frame)))))
      (t
       (make-local-hook 'post-command-hook)
-      (add-hook 'post-command-hook 'resize-minibuffer-window nil t))))))
+      (add-hook 'post-command-hook 'resize-minibuffer-window nil t)
+      (unless (and (boundp 'icomplete-mode)
+		   icomplete-mode)
+	(resize-minibuffer-window)))))))
 
 (defun resize-minibuffer-count-window-lines (&optional start end)
   "Return number of window lines occupied by text in region.
--- a/lisp/modes/view.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/modes/view.el	Mon Aug 13 09:07:36 2007 +0200
@@ -355,7 +355,7 @@
 	(scroll-up lines)))
     (cond ((pos-visible-in-window-p (point-max))
 	   (goto-char (point-max))
-	   (message "%"
+	   (message "%s"
 		    (substitute-command-keys
 		     "End.  Type \\[view-exit] to quit viewing."))))
     (move-to-window-line -1)
--- a/lisp/mule/mule-files.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/mule/mule-files.el	Mon Aug 13 09:07:36 2007 +0200
@@ -54,6 +54,7 @@
   ;;  '(; ("\\.el$" . euc-japan)
   '(("\\.el$" . iso-2022-8)
     ("\\.info$" . iso-2022-8)
+    ("ChangeLog$" . iso-2022-8)
     ("\\.\\(gz\\|Z\\)$" . binary)
     ("/spool/mail/.*$" . convert-mbox-coding-system))
   "Alist specifying the coding system used for particular files.
--- a/lisp/mule/mule-init.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/mule/mule-init.el	Mon Aug 13 09:07:36 2007 +0200
@@ -119,7 +119,10 @@
     ;; Translate remaining args on command line using pathname-coding-system
     (loop for arg in-ref command-line-args-left do
 	  (setf arg (decode-coding-string arg pathname-coding-system)))
-  
+
+    ;; rman seems to be incompatible with encoded text
+    (setq Manual-use-rosetta-man nil)
+    
     ;; Make sure ls -l output is readable by dired and encoded using
     ;; pathname-coding-system
     (add-hook
--- a/lisp/mule/mule-misc.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/mule/mule-misc.el	Mon Aug 13 09:07:36 2007 +0200
@@ -53,16 +53,7 @@
 (defun string-to-char-list (str)
   (mapcar 'identity str))
 
-;;; Slower, albeit more elegant, implementation??
-;; (defun string-columns (string)
-;;  "Return number of columns STRING occupies when displayed.
-;; Uses the charset-columns attribute of the characters in STRING,
-;; which may not accurately represent the actual display width in a
-;; window system."
-;;  (loop for c across string
-;;     sum (charset-columns (char-charset c))))
-
-(defun string-columns (string)
+(defun string-width (string)
   "Return number of columns STRING occupies when displayed.
 Uses the charset-columns attribute of the characters in STRING,
 which may not accurately represent the actual display width when
@@ -75,7 +66,8 @@
       (setq i (1+ i)))
     col))
 
-(defalias 'string-width 'string-columns)
+(defalias 'string-columns 'string-width)
+(make-obsolete 'string-columns 'string-width)
 
 (defun delete-text-in-column (from to)
   "Delete the text between column FROM and TO (exclusive) of the current line.
@@ -154,22 +146,76 @@
 	   (null (car buffer-undo-list)) )
       (setq buffer-undo-list (cdr buffer-undo-list)) ))
 
+
 ;;; Common API emulation functions for GNU Emacs-merged Mule.
 ;;; As suggested by MORIOKA Tomohiko
-(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."
-  (substring str (or start-column 0) width))
+
+;; Following definition were imported from Emacs/mule-delta.
+
+(defun truncate-string-to-width (str width &optional start-column padding)
+  "Truncate string STR to fit in WIDTH columns.
+Optional 1st arg START-COLUMN if non-nil specifies the starting column.
+Optional 2nd arg PADDING if non-nil, space characters are padded at
+the head and tail of the resulting string to fit in WIDTH if necessary.
+If PADDING is nil, the resulting string may be narrower than WIDTH."
+  (or start-column
+      (setq start-column 0))
+  (let ((len (length str))
+	(idx 0)
+	(column 0)
+	(head-padding "") (tail-padding "")
+	ch last-column last-idx from-idx)
+    (condition-case nil
+	(while (< column start-column)
+	  (setq ch (sref str idx)
+		column (+ column (char-width ch))
+		idx (+ idx (char-bytes ch))))
+      (args-out-of-range (setq idx len)))
+    (if (< column start-column)
+	(if padding (make-string width ?\ ) "")
+      (if (and padding (> column start-column))
+	  (setq head-padding (make-string (- column start-column) ?\ )))
+      (setq from-idx idx)
+      (condition-case nil
+	  (while (< column width)
+	    (setq last-column column
+		  last-idx idx
+		  ch (sref str idx)
+		  column (+ column (char-width ch))
+		  idx (+ idx (char-bytes ch))))
+	(args-out-of-range (setq idx len)))
+      (if (> column width)
+	  (setq column last-column idx last-idx))
+      (if (and padding (< column width))
+	  (setq tail-padding (make-string (- width column) ?\ )))
+      (setq str (substring str from-idx idx))
+      (if padding
+	  (concat head-padding str tail-padding)
+	str))))
+
+;;; For backward compatiblity ...
+;;;###autoload
+(defalias 'truncate-string 'truncate-string-to-width)
+(make-obsolete 'truncate-string 'truncate-string-to-width)
+
+;; end of imported definition
+
 
 (defalias 'sref 'aref)
 (defalias 'map-char-concat 'mapcar)
-(defun char-bytes (chr) 1)
-(defun char-length (chr) 1)
+(defun char-bytes (character)
+  "Return number of length a CHARACTER occupies in a string or buffer.
+It returns only 1 in XEmacs.  It is for compatibility with MULE 2.3."
+  1)
+(defalias 'char-length 'char-bytes)
 
-(defun char-columns (character)
+(defun char-width (character)
   "Return number of columns a CHARACTER occupies when displayed."
   (charset-columns (char-charset character)))
 
+(defalias 'char-columns 'char-width)
+(make-obsolete 'char-columns 'char-width)
+
 (defalias 'charset-description 'charset-doc-string)
 
 (defalias 'find-charset-string 'charsets-in-string)
@@ -177,44 +223,16 @@
 
 (defun find-non-ascii-charset-string (string)
   "Return a list of charsets in the STRING except ascii.
-For compatibility with Mule"
+It might be available for compatibility with Mule 2.3,
+because its `find-charset-string' ignores ASCII charset."
   (delq 'ascii (charsets-in-string string)))
 
 (defun find-non-ascii-charset-region (start end)
-  "Return a list of charsets except ascii
-in the region between START and END.
-For compatibility with Mule"
+  "Return a list of charsets except ascii in the region between START and END.
+It might be available for compatibility with Mule 2.3,
+because its `find-charset-string' ignores ASCII charset."
   (delq 'ascii (charsets-in-region start end)))
 
-;(defun truncate-string-to-column (str width &optional start-column)
-;  "Truncate STR to fit in WIDTH columns.
-;Optional non-nil arg START-COLUMN specifies the starting column."
-;  (or start-column
-;      (setq start-column 0))
-;  (let ((max-width (string-width str))
-;	(len (length str))
-;	(from 0)
-;	(column 0)
-;	to-prev to ch)
-;    (if (>= width max-width)
-;	(setq width max-width))
-;    (if (>= start-column width)
-;	""
-;      (while (< column start-column)
-;	(setq ch (aref str from)
-;	      column (+ column (char-width ch))
-;	      from (+ from (char-octets ch))))
-;      (if (< width max-width)
-;	  (progn
-;	    (setq to from)
-;	    (while (<= column width)
-;	      (setq ch (aref str to)
-;		    column (+ column (char-width ch))
-;		    to-prev to
-;		    to (+ to (char-octets ch))))
-;	    (setq to to-prev)))
-;      (substring str from to))))
-
 
 ;;; Language environments
 
--- a/lisp/packages/compile.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/compile.el	Mon Aug 13 09:07:36 2007 +0200
@@ -154,9 +154,9 @@
 
     ;; MIPS lint pass<n>; looks good for SunPro lint also
     ;;  TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomon.c due to truncation
-    ("[^ ]+ (\\([0-9]+\\)) in \\([^ ]+\\)" 2 1)
+    ("\n[^ \n]+ (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
     ;;  name defined but never used: LinInt in cmap_calc.c(199)
-    ("in \\([^(]+\\)(\\([0-9]+\\))$" 1 2)
+    ("in \\([^(\n]+\\)(\\([0-9]+\\))$" 1 2)
 
     ;; Ultrix 3.0 f77:
     ;;  fort: Severe: addstf.f, line 82: Missing operator or delimiter symbol
@@ -226,7 +226,7 @@
 
     ;; Sun ada (VADS, Solaris):
     ;;  /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: "," inserted
-    ("\n\\([^, ]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
+    ("\n\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
     )
   "Alist that specifies how to match errors in compiler output.
 Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...])
--- a/lisp/packages/func-menu.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/func-menu.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,8 +1,8 @@
 ;;; func-menu.el         --- Jump to a function within a buffer.
 ;;;
 ;;; David Hughes <ukchugd@ukpmr.cs.philips.nl>
-;;; Last modified: David Hughes 2nd May 1996
-;;; Version: 2.43
+;;; Last modified: David Hughes 13th January 1997
+;;; Version: 2.45
 ;;; Keywords: tools, c, lisp
 ;;;
 ;;; This program is free software; you can redistribute it and/or modify
@@ -43,8 +43,8 @@
 ;;; addition, the name of the function before point is optionally displayed in
 ;;; the modeline.
 ;;;
-;;; Support for non X Windows versions of Emacs:
-;;; ============================================
+;;; Support for non X Window versions of Emacs:
+;;; ===========================================
 ;;; This package can also be used for non X versions of Emacs. In this case,
 ;;; only modeline display and completing read input from the minibuffer are
 ;;; possible.
@@ -58,6 +58,15 @@
 ;;; Acknowledgements:
 ;;; =================
 ;;;
+;;; Fix to fume-function-name-regexp-c
+;;; Jonathan Edwards <edwards@intranet.com>
+;;;
+;;; Speedup for fume-cc-inside-comment
+;;; Peter Pezaris <pez@dwwc.com>
+;;;
+;;; Made menu placement more flexible
+;;; Bob Weiner <weiner@infodock.com>
+;;;
 ;;; Fortran90 regexp
 ;;; John Turner <turner@xdiv.lanl.gov>
 ;;;
@@ -65,6 +74,7 @@
 ;;; Andy Piper <andyp@parallax.co.uk>
 ;;;
 ;;; Java support
+;;; Bob Weiner <weiner@infodock.com>
 ;;; Heddy Boubaker <boubaker@dgac.fr>
 ;;;
 ;;; Patch for fume-rescan-buffer{-trigger}
@@ -140,6 +150,7 @@
 ;;; Thomas Plass <thomas.plass@mid-heidelberg.de>
 ;;;
 ;;; Extensions to fume-function-name-regexp-lisp
+;;; Vladimir Alexiev <vladimir@cs.ualberta.ca>
 ;;; Kari Heinola <kph@dpe.fi>
 ;;; Milo A. Chan <chan@jpmorgan.com>
 ;;; Jack Repenning <jackr@step7.informix.com>
@@ -162,7 +173,7 @@
 ;;; Philippe Queinnec <queinnec@cenatls.cena.dgac.fr>
 ;;;
 ;;; Assembly support
-;;; Bob Weiner <weiner@mot.com>
+;;; Bob Weiner <weiner@infodock.com>
 ;;;
 ;;; Removal of cl dependencies
 ;;; Russell Ritchie <russell@gssec.bt.co.uk>
@@ -202,14 +213,14 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;  Environment Initialisation  ;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defconst fume-version "2.43")
+(defconst fume-version "2.45")
 
 (defconst fume-developer "David Hughes <ukchugd@ukpmr.cs.philips.nl>")
 
 (defun fume-about ()
   (interactive)
   (sit-for 0)
-  (message "Func-Menu version %s, ¨ 1996 %s" fume-version fume-developer))
+  (message "Func-Menu version %s, © 1996 %s" fume-version fume-developer))
 
 (defconst fume-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
 
@@ -365,11 +376,11 @@
 (cond ((fboundp 'add-submenu)
        (defconst fume-add-submenu 'add-submenu)
        (defun fume-munge-menu-args (menu-name submenu before)
-         (list nil (cons menu-name submenu) before)))
+         (list fume-menu-path (cons menu-name submenu) before)))
       (t
        (defconst fume-add-submenu 'add-menu)
        (defun fume-munge-menu-args (menu-name submenu before)
-         (list nil menu-name submenu before))))
+         (list fume-menu-path menu-name submenu before))))
 
 (defun fume-add-submenu (menu-name submenu before)
   (apply fume-add-submenu (fume-munge-menu-args menu-name submenu before)))
@@ -397,10 +408,16 @@
 (defvar fume-buffer-name "*Function List*"
   "Name of buffer used to list functions when fume-list-functions called")
 
-(fume-defvar-local
- fume-menubar-menu-name "Functions"
+(defvar fume-menubar-menu-name "Functions"
  "*Set this to the string you want to appear in the menubar")
 
+;;; Bob Weiner <weiner@infodock.com>
+(defvar fume-menu-path nil
+  "Menubar menu under which the function menu should be installed.
+Nil means install it on the menubar itself.  Otherwise, it should be a list
+of strings, each string names a successively deeper menu under which the
+new menu should be located.")
+
 (defvar fume-menubar-menu-location "Buffers"
   "*Set this nil if you want the menu to appear last on the menubar.
 Otherwise set this to the menu you want \"Functions\" to appear in front of.")
@@ -520,21 +537,16 @@
 
 ;;; Lisp
 ;;;
-;;; Jack Repenning <jackr@step7.informix.com>
-;;; Cedric Beust <Cedric.Beust@sophia.inria.fr>
+;;; Vladimir Alexiev <vladimir@cs.ualberta.ca>
 (defvar fume-function-name-regexp-lisp
   (concat
-   "\\(^(defun+\\s-*[#:?A-Za-z0-9_+->]+\\s-*(\\)"
-   "\\|"
-   "\\(^(defsubst+\\s-*[#:?A-Za-z0-9_+->]+\\s-*(\\)"
-   "\\|"
-   "\\(^(defmacro+\\s-*[#:?A-Za-z0-9_+->]+\\s-*(\\)"
-   "\\|"
-   "\\(^(defadvice+\\s-*[#:?A-Za-z0-9_+->]+\\s-*(\\)"
-   "\\|"
-   "\\(^(de+\\s-*[#:?A-Za-z0-9_+->]+\\s-*(\\)"
-   "\\|"
-   "\\(^(dmd+\\s-*[#:?A-Za-z0-9_+->]+\\s-*(\\)"
+   "^[ \t]*"                            ; Allow whitespace   |(or (fboundp 'foo)
+                                        ;  for the construct |    (defun foo ()
+   "(\\(def[^vc][a-z]*\\)"              ; Allow (def* except (defvar, (defconst
+   "\\s-+"                              ; At least one whitespace
+   "'?[#:?A-Za-z0-9_+>-]+"              ; Allow (defalias 'foo 'bar)
+   "\\s-*"                              ; Whitespace
+   "\\(nil\\|(\\)"                      ; nil or (arg list
    )
   "Expression to get lisp function names")
 
@@ -543,11 +555,11 @@
 ;;; Danny Bar-Dov <danny@acet02.amil.co.il>
 (defvar fume-function-name-regexp-c
   (concat
-   "^[a-zA-Z0-9]+\\s-?"                ; type specs; there can be no
-   "\\([a-zA-Z0-9_*]+\\s-+\\)?"        ; more than 3 tokens, right?
+   "^[a-zA-Z0-9_]+\\s-?"                ; type specs; there can be no
+   "\\([a-zA-Z0-9_*]+\\s-+\\)?"         ; more than 3 tokens, right?
    "\\([a-zA-Z0-9_*]+\\s-+\\)?"
-   "\\([*&]+\\s-*\\)?"                 ; pointer
-   "\\([a-zA-Z0-9_*]+\\)[ \t\n]*("     ; name
+   "\\([*&]+\\s-*\\)?"                  ; pointer
+   "\\([a-zA-Z0-9_*]+\\)[ \t\n]*("      ; name
    )
   "Expression to get C function names")
 
@@ -787,6 +799,7 @@
 (defvar fume-function-name-regexp-make
   "^\\(\\(\\$\\s(\\)?\\(\\w\\|\\.\\)+\\(:sh\\)?\\(\\s)\\)?\\)\\s *\\(::?\\|\\+?=\\)"
   "Expression to get makefile target names")
+(add-hook 'makefile-mode-hook 'fume-add-menubar-entry)
 
 ;;; Directory Listings
 ;;;
@@ -819,6 +832,12 @@
   "^\\(task\\|function\\|module\\|primitive\\)[ \t]+\\([A-Za-z0-9_+-]*\\)[ \t]*(?"
   "Expression to get verilog module names")
 
+;;; Idl
+;;;
+;;; Lubos Pochman <lubos@rsinc.com>
+(defvar fume-function-name-regexp-idl
+  (cons "^\\s *\\([pP][rR][oO]\\|[fF][uU][nN][cC][tT][iI][oO][nN]\\)\\s +\\([A-Za-z][A-Za-z0-9_$]*\\)" 2)
+  "Expression to get Idl function Names")
 
 ;;; Assembly
 (defvar fume-function-name-regexp-asm
@@ -919,6 +938,9 @@
     ;; Verilog
     (verilog-mode . fume-function-name-regexp-verilog)
 
+    ;; Idl
+    (idl-mode . fume-function-name-regexp-idl)
+
     ;; Assembly
     (asm-mode . fume-function-name-regexp-asm)
     )
@@ -937,7 +959,11 @@
   ;; Search for the function
   (if (re-search-forward fume-function-name-regexp nil t)
       (let ((char (progn
-                    (backward-up-list 1)
+                    (if (string-match
+                         "[({[]"
+                         (char-to-string (char-after (1- (point)))))
+                        (backward-char)
+                      (forward-word -1))
                     (save-excursion
                       (goto-char (scan-sexps (point) 1))
                       (skip-chars-forward "[ \t\n]")
@@ -985,6 +1011,7 @@
         (cons (buffer-substring beg end) beg))))
 
 ;;; Specialised routine to get the next C function name in the buffer.
+;;; Modified 16/12/96: Jerome Bertorelle <bertorel@telspace.alcatel.fr>
 ;;;
 (defun fume-find-next-c-function-name (buffer)
   "Searches for the next C function in BUFFER."
@@ -999,7 +1026,7 @@
                       (following-char)))))
         ;; Skip this function name if it is a prototype declaration.
         (if (eq char ?\;)
-            (fume-find-next-function-name buffer)
+            (fume-find-next-c-function-name buffer)
           (let (beg
                 name)
             ;; Get the function name and position
@@ -1018,63 +1045,44 @@
                                 (format "%s %s"
                                         name
                                         (buffer-substring beg (point))))))))
-            ;; kludge to avoid 'void' in menu
-            (if (string-match "^void\\s-*" name)
-                (fume-find-next-function-name buffer)
+            ;; kludge to avoid 'void' etc in menu
+            (if (string-match "^void$\\|^if$\\|^switch$\\|^while$" name)
+                (fume-find-next-c-function-name buffer)
               (cons name beg)))))))
 
+;;; Peter Pezaris <pez@dwwc.com>
+;;;
 (defun fume-cc-inside-comment ()
-  (let ((here (point))
-        (bol-point (save-excursion (beginning-of-line) (point))))
-    (or
-     (save-excursion (and (re-search-backward "\/\/" bol-point t 1) t))
-     (save-excursion
-       (and
-        (re-search-backward "\\(/[*]\\)\\|\\([*]/\\)" (point-min) t 1)
-        (looking-at "/[*]")
-        (goto-char here)
-        (or (beginning-of-line 1) t)
-        (re-search-forward "[ \t]*/?[*][ \t]*" here t 1)
-        t)))))
+  (memq (buffer-syntactic-context) '(comment block-comment)))
 
 ;;; <jrm@odi.com>
 ;;; <ajp@eng.cam.ac.uk>
 ;;; <schittko@fokus.gmd.de>
+;;; <ukchugd@ukpmr.cs.philips.nl> - speedup, David Hughes 24th November 1996
 ;;;
 (defun fume-match-find-next-function-name (buffer)
-  "General next function name in BUFFER finder using match.
-The regexp is assumed to be a two item list the car of which is the regexp to
-use, and the cdr of which is the match position of the function name."
+  ;; General next function name in BUFFER finder using match.
+  ;; The regexp is assumed to be a two item list the car of which is the regexp
+  ;; to use, and the cdr of which is the match position of the function name
   (set-buffer buffer)
-  (let ((result nil)
-        (continue t)
-        (regexp (car fume-function-name-regexp)))
-    (while continue
-      ;; Search for the function
-      (if (re-search-forward regexp nil t)
-          (if (fume-cc-inside-comment)
-              () ; skip spurious finds in comments
-            (let ((first-token (save-excursion
-                                 (re-search-backward regexp nil t)
-                                 (prog1 (fume-what-looking-at)
-                                   (re-search-forward regexp nil t))))
-                  (last-char (progn
-                               (backward-up-list 1)
-                               (save-excursion
-                                 (goto-char (scan-sexps (point) 1))
-                                 (following-char)))))
-              ;; Skip function name if it's a prototype or typedef declaration
-              (if (or (eq last-char ?\;) (string= first-token "typedef"))
-                  nil
-                (setq result
-                      ;; Get function name and position including scope
-                      (cons (buffer-substring
-                             (match-beginning (cdr fume-function-name-regexp))
-                             (point))
-                            (match-beginning (cdr fume-function-name-regexp)))
-                      continue nil))))
-        (setq continue nil)))
-    result))
+  (let ((r (car fume-function-name-regexp))
+        (p (cdr fume-function-name-regexp)))
+    (catch 'found
+      (while (re-search-forward r nil t)
+        (catch 'skip
+          (if (fume-cc-inside-comment) (throw 'skip t))
+          (save-excursion
+            (re-search-backward r nil t)
+            (if (string= "typedef" (fume-what-looking-at)) (throw 'skip t))
+            (re-search-forward r nil t))
+          (backward-up-list 1)
+          (save-excursion
+            (goto-char (scan-sexps (point) 1))
+            (if (eq ?\; (following-char)) (throw 'skip t))) ; skip prototypes
+          (throw
+           'found
+           (cons (buffer-substring (setq p (match-beginning p)) (point)) p))))
+      nil)))
 
 ;;; Specialised routine to find the next Perl function
 ;;;
@@ -1083,6 +1091,7 @@
   (fume-find-next-sexp buffer))
 
 ;;; Specialised routine to find the next Java function
+;;; Bob Weiner <weiner@infodock.com>
 ;;; Heddy Boubaker <boubaker@dgac.fr>
 ;;;
 (defun fume-find-next-java-function-name (buffer)
@@ -1095,12 +1104,15 @@
         (forward-sexp)
         (if (and (looking-at "[^;(]*{")
                  (not (fume-cc-inside-comment)))
-            ;; This is a method definition and we're not
-            ;; in a comment.
+            ;; This is a method definition and we're not in a comment
             (let ((str (buffer-substring beg end)))
-              (or (string-match "if\\|switch\\|catch\\|for\\|while" str)
-                  ;; These constructs look like methods definitions
-                  ;; but are not.
+              ;; Bob Weiner <weiner@infodock.com> added exact match
+              ;; delimiters so function names that happen to contain
+              ;; any of these terms are not eliminated.  The old version
+              ;; would ignore "notify()" since it contained "if".
+              (or (string-match "\\`\\(if\\|switch\\|catch\\|for\\|while\\)\\'"
+                                str)
+                  ;; These constructs look like method definitions but are not
                   (cons str beg)))
           (fume-find-next-java-function-name buffer)))))
 
@@ -1370,8 +1382,20 @@
             (end (match-end 2)))
         (cons (buffer-substring beg end) beg))))
 
+;;; Specialised routine to get the next idl function in the buffer
+;;;
+;;; Lubos Pochman <lubos@rsinc.com>
+(defun fume-find-next-idl-function-name (buffer)
+  "Searches for the next idl function in BUFFER."
+  (set-buffer buffer)
+  (if (re-search-forward (car fume-function-name-regexp-idl) nil t)
+      (let ((beg (match-beginning (cdr fume-function-name-regexp-idl)))
+            (end (match-end (cdr fume-function-name-regexp-idl))))
+        (cons (buffer-substring beg end) beg))))
+
+
 ;;; Assembly
-;;; Bob Weiner <weiner@mot.com>
+;;; Bob Weiner <weiner@infodock.com>
 ;;;
 (defun fume-find-next-asm-function-name (buffer)
   "Searches for the next assembler function in BUFFER."
@@ -1417,6 +1441,7 @@
     (sgml-mode       . fume-find-next-sgml-element-name)
     (tcl-mode        . fume-match-find-next-function-name)
     (verilog-mode    . fume-find-next-verilog-function-name)
+    (idl-mode        . fume-find-next-idl-function-name)
     )
 
   "The connection between a mode and the defun that finds function names.
@@ -1426,12 +1451,10 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;  General utility functions  ;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;;; Routine to refresh the modeline
+;;; modeline refresh routine
 ;;;
-(if (fboundp 'redraw-modeline)          ; faster built-in method
-    (defalias 'fume-refresh-modeline 'redraw-modeline)
-  (defun fume-refresh-modeline ()       ; use old kludge method
-    (set-buffer-modified-p (buffer-modified-p))))
+(or (fboundp 'redraw-modeline)
+    (defun redraw-modeline () (set-buffer-modified-p (buffer-modified-p))))
 
 ;;; Smart mouse positioning
 ;;;
@@ -1464,18 +1487,18 @@
 
 ;;; Routines to add/remove/update function menu from menubar
 ;;;
-(defsubst fume-add-menubar-entry ()
+(defun fume-add-menubar-entry ()
   (interactive)
   (save-window-excursion (function-menu t)))
 
-(defsubst fume-remove-menubar-entry ()
+(defun fume-remove-menubar-entry ()
   (interactive)
   (cond ((and fume-running-xemacs current-menubar)
          (delete-menu-item (list fume-menubar-menu-name))
          ;; force update of the menubar
-         (fume-refresh-modeline))))
+         (redraw-modeline))))
 
-(defsubst fume-update-menubar-entry ()
+(defun fume-update-menubar-entry ()
   "Returns t if menubar was updated. Nil otherwise"
   (and fume-running-xemacs
        fume-not-tty
@@ -1483,7 +1506,7 @@
        (fume-add-menubar-entry)
        t))
 
-(defsubst fume-trim-string (string)
+(defun fume-trim-string (string)
   "Returns STRING with leading and trailing whitespace removed."
   (if (string-match "^[ \t]*" (setq string (format "%s" string)))
       (setq string (substring string (match-end 0))))
@@ -1493,52 +1516,55 @@
 
 (defvar fume-syntax-table nil)
 
-(defsubst fume-what-looking-at ()
-  (let (name
-        (orig-syntax-table (copy-syntax-table (syntax-table))))
-    (if fume-syntax-table
-        ()
-      (setq fume-syntax-table (copy-syntax-table))
-      (modify-syntax-entry ?: "w" fume-syntax-table))
-    (unwind-protect
-        (progn
-          (set-syntax-table fume-syntax-table)
-          (save-excursion
-            (while (looking-at "\\sw\\|\\s_") (forward-char 1))
-            (if (re-search-backward "\\sw\\|\\s_" nil t)
-                (let ((beg (progn (forward-char 1) (point))))
-                  (forward-sexp -1)
-                  (while (looking-at "\\s'") (forward-char 1))
-                  (setq name (buffer-substring beg (point)))))))
-      (set-syntax-table orig-syntax-table)
-      name)))
+(defun fume-what-looking-at (&optional check-primary-selection-p)
+  (or (and check-primary-selection-p
+           primary-selection-extent
+           (condition-case ()
+               (prog1 (buffer-substring (region-beginning) (region-end))
+                 (and zmacs-regions (zmacs-deactivate-region) (sit-for 0)))
+             (error nil)))
+      (let (name
+            (orig-syntax-table (copy-syntax-table (syntax-table))))
+        (if fume-syntax-table
+            ()
+          (setq fume-syntax-table (copy-syntax-table))
+          (modify-syntax-entry ?: "w" fume-syntax-table))
+        (unwind-protect
+            (progn
+              (set-syntax-table fume-syntax-table)
+              (save-excursion
+                (while (looking-at "\\sw\\|\\s_") (forward-char 1))
+                (if (re-search-backward "\\sw\\|\\s_" nil t)
+                    (let ((beg (progn (forward-char 1) (point))))
+                      (forward-sexp -1)
+                      (while (looking-at "\\s'") (forward-char 1))
+                      (setq name (buffer-substring beg (point)))))))
+          (set-syntax-table orig-syntax-table)
+          name))))
 
-;;; Find function name that point is in.
-;;; The trick is to start from the end...
+;;; Find function name that point is in
+;;; (trick is to start from the end)
 ;;;
-(defsubst fume-function-before-point ()
+(defun fume-function-before-point ()
   (if (or fume-modeline-funclist (fume-rescan-buffer) fume-modeline-funclist)
-      (let (result
-            (pt (point)))
+      (let ((p (point)))
         (save-excursion
           (catch 'found
             (mapcar (function
-                     (lambda (p)
-                       (goto-char (cdr p))
+                     (lambda (x)
+                       (goto-char (cdr x))
                        (beginning-of-line 1)
-                       (if (>= pt (point))
-                           (throw 'found (setq result (car p))))))
-                    fume-modeline-funclist))
-          result))))
+                       (if (>= p (point)) (throw 'found (car x)))))
+                    fume-modeline-funclist) nil)))))
 
 ;;; Routines to add a buffer local post command hook
 ;;;
-(defsubst fume-post-command-hook-p (hook)
+(defun fume-post-command-hook-p (hook)
   (memq hook (if fume-use-local-post-command-hook
                  local-post-command-hook
                post-command-hook)))
 
-(defsubst fume-add-post-command-hook (hook &optional append)
+(defun fume-add-post-command-hook (hook &optional append)
   (or (fume-post-command-hook-p hook)
       (cond (fume-use-local-post-command-hook
              (add-hook 'local-post-command-hook hook append))
@@ -1550,7 +1576,7 @@
              (make-local-variable 'post-command-hook)
              (add-hook 'post-command-hook hook append)))))
 
-(defsubst fume-remove-post-command-hook (hook)
+(defun fume-remove-post-command-hook (hook)
   (and (fume-post-command-hook-p hook)
        (cond (fume-use-local-post-command-hook
               (remove-hook 'local-post-command-hook hook))
@@ -1561,7 +1587,7 @@
 
 ;;; Routine to install the modeline feature
 ;;;
-(defsubst fume-maybe-install-modeline-feature ()
+(defun fume-maybe-install-modeline-feature ()
   (cond ((and fume-display-in-modeline-p (fume-set-defaults))
          (or fume-modeline-funclist
              (fume-post-command-hook-p 'fume-tickle-modeline)
@@ -1594,8 +1620,8 @@
   (cond ((not fume-display-in-modeline-p)
          (fume-remove-post-command-hook 'fume-tickle-modeline)
          (fume-add-post-command-hook 'fume-maybe-install-modeline-feature)))
-  ;; force an update of the mode line
-  (fume-refresh-modeline))
+  ;; force update of the modeline
+  (redraw-modeline))
 
 (fume-defvar-local fume-modeline-buffer-identification-0 nil
   "Storage for original modeline-buffer-identification")
@@ -1645,18 +1671,18 @@
 ;;; Sort function to sort items depending on their function-name
 ;;; An item looks like (NAME . POSITION).
 ;;;
-(defsubst fume-sort-by-name (item1 item2)
+(defun fume-sort-by-name (item1 item2)
   (or (string-lessp (car item1) (car item2))
       (string-equal (car item1) (car item2))))
 
 ;;; Sort function to sort items depending on their position
 ;;;
-(defsubst fume-sort-by-position (item1 item2)
+(defun fume-sort-by-position (item1 item2)
   (<= (cdr item1) (cdr item2)))
 
 ;;; Support function to calculate relative position in buffer
 ;;;
-(defsubst fume-relative-position ()
+(defun fume-relative-position ()
   (let ((pos (point))
         (total (buffer-size)))
     (if (> total 50000)
@@ -1668,7 +1694,7 @@
 ;;; Split LIST into sublists of max length N
 ;;; Example (fume-split '(1 2 3 4 5 6 7 8) 3)-> '((1 2 3) (4 5 6) (7 8))
 ;;;
-(defsubst fume-split (list n)
+(defun fume-split (list n)
   (let ((i 0)
         result
         sublist
@@ -1782,7 +1808,7 @@
             (let ((fume-scanning-message nil))
               (fume-rescan-buffer))))))
 
-(defsubst fume-install-rescan-buffer-trigger ()
+(defun fume-install-rescan-buffer-trigger ()
   (cond ((not (fume-post-command-hook-p 'fume-rescan-buffer-trigger))
          (fume-add-post-command-hook 'fume-rescan-buffer-trigger 'append)
          ;; Make narrow-to-region tickle func-menu
@@ -1864,6 +1890,9 @@
   ;; Reset dirty flag
   (setq fume-funclist-dirty-p nil))
 
+(defun fume-scan-buffer ()
+  (or fume-funclist (progn (fume-set-defaults) (fume-rescan-buffer))))
+
 ;;; Routine to position cursor
 ;;;
 (defun fume-goto-function (fn pos)
@@ -1921,12 +1950,14 @@
 
 ;;; Interface for Key bindings
 ;;;
-(defun function-menu (&optional use-menubar)
+(defun function-menu (&optional use-menubar return-only)
   "Pop up a menu of functions for selection with the mouse.
+Jumps to the selected function.  A mark is set at the old position,
+so you can easily go back with C-u \\[set-mark-command].
 
 With a prefix arg adds the menu to the current menubar.
-Jumps to the selected function.  A mark is set at the old position,
-so you can easily go back with C-u \\[set-mark-command]."
+Optional second argument, RETURN-ONLY if non-nil simply returns
+the basic menu of functions."
   (interactive "P")
 
   (setq use-menubar
@@ -1982,51 +2013,60 @@
              (or (> count 1)
                  (setq function-menu-items (cdr (car function-menu-items))))
 
-             (setq function-menu
-                   (` ((,@ function-menu-items)
-                       "----"
-                       ["Display full list of functions"
-                        fume-list-functions t]
-                       [(, (concat "Rescan buffer :  " (buffer-name)))
-                        (fume-rescan-buffer (, (null use-menubar))) t]
-                       "----"
-                       ["Toggle modeline display"
-                        fume-toggle-modeline-display t]
-                       ["Toggle buffer auto rescanning"
-                        fume-toggle-auto-rescanning t]
-                       ["About Func-Menu" fume-about t])))
+             (if return-only
+                 nil
+               (setq function-menu
+                     (` ((,@ function-menu-items)
+                         "----"
+                         ["Display full list of functions"
+                          fume-list-functions t]
+                         [(, (concat "Rescan buffer :  " (buffer-name)))
+                          (fume-rescan-buffer (, (null use-menubar))) t]
+                         "----"
+                         ["Toggle modeline display"
+                          fume-toggle-modeline-display t]
+                         ["Toggle buffer auto rescanning"
+                          fume-toggle-auto-rescanning t]
+                         ["About Func-Menu" fume-about t])))
 
-             (cond (use-menubar
-                    (fume-remove-menubar-entry)
-                    (set-buffer-menubar (copy-sequence current-menubar))
-                    (fume-add-submenu
-                     fume-menubar-menu-name
-                     (` ((,@ function-menu)
-                         "----"
-                         ["Remove Function Menu from menubar"
-                          fume-remove-menubar-entry t]))
-                     fume-menubar-menu-location))
+               (cond (use-menubar
+                      (fume-remove-menubar-entry)
+                      (set-buffer-menubar (copy-sequence current-menubar))
+                      (fume-add-submenu
+                       fume-menubar-menu-name
+                       (` ((,@ function-menu)
+                           "----"
+                           ["Remove Function Menu from menubar"
+                            fume-remove-menubar-entry t]))
+                       fume-menubar-menu-location))
 
-                   ((and fume-not-tty   ; trap tty segmentation faults...
-                         (not (popup-menu-up-p)))
-                    (or (fume-update-menubar-entry)
-                        (setq function-menu
-                              (cons
-                               ["Put Function Menu into menubar"
-                                (function-menu t) t]
-                               (cons "----" function-menu))))
+                     ((and fume-not-tty ; trap tty segmentation faults...
+                           (not (popup-menu-up-p)))
+                      (or (fume-update-menubar-entry)
+                          (setq function-menu
+                                (cons
+                                 ["Put Function Menu into menubar"
+                                  (function-menu t) t]
+                                 (cons "----" function-menu))))
 
-                    (if fume-auto-position-popup
-                        (fume-set-mouse-position))
+                      (if fume-auto-position-popup
+                          (fume-set-mouse-position))
 
-                    (popup-menu (cons "Functions" function-menu)))))))))
+                      (popup-menu
+                       (cons fume-menubar-menu-name function-menu)))))
+
+             ;; Return basic function menu for display by another function
+             function-menu-items)))))
 
 (defun fume-mouse-function-goto (event)
   "Goto function clicked on or prompt in minibuffer (with completion)."
   (interactive "@e")
-  (goto-char (event-point event))
-  (let ((fume-no-prompt-on-valid-default t))
-    (fume-prompt-function-goto)))
+  (let ((orig-pos (point)))
+    (goto-char (event-point event))
+    (let ((fume-no-prompt-on-valid-default t))
+      (fume-prompt-function-goto))
+    (or (= orig-pos (point))
+        (push-mark orig-pos (null fume-scanning-message)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;  Keyboard access to func-menu for tty users  ;;;;;;;;;;;;;;
@@ -2045,34 +2085,28 @@
   "Goto function prompted for in minibuffer (with completion).
 With prefix arg, jumps to function in a different window."
   (interactive "P")
-  (and (interactive-p) current-prefix-arg (setq other-window-p t))
-  (let* ((default-name (fume-what-looking-at))
+  (let* ((default-name (fume-what-looking-at t))
          (OrigBuffer (current-buffer))
-         (TargetBuffer
-          (if (eq major-mode 'fume-list-mode) fume-list-srcbuffer OrigBuffer))
-         (fume-no-prompt-on-valid-default
-          (or fume-no-prompt-on-valid-default
-              (eq major-mode 'fume-list-mode))))
+         (flistMode (eq major-mode 'fume-list-mode))
+         (no-prompt (or flistMode fume-no-prompt-on-valid-default))
+         (TargetBuffer (if flistMode fume-list-srcbuffer OrigBuffer)))
     (switch-to-buffer TargetBuffer)
-    ;; Create funclist and set defaults
-    (cond ((null fume-funclist)
-           (fume-set-defaults)
-           (fume-rescan-buffer)))
+    (fume-scan-buffer) ;; Create funclist and set defaults if required
     (let* (;; verify default-name is a valid function name
            (default-exists-p (assoc default-name fume-funclist))
            ;; Prompt for function name in minibuffer, unless there is a valid
            ;; function name at point & fume-no-prompt-on-valid-default set to t
            (function-name
-            (if (and default-exists-p
-                     fume-no-prompt-on-valid-default)
+            (if (and default-exists-p no-prompt)
                 ""
-              (completing-read
-               (format "Goto function%s%s: "
-                       (if other-window-p " other window" "")
-                       (if default-exists-p
-                           (concat " (" default-name ")")
-                         ""))
-               fume-funclist nil t)))
+              (let ((this-command last-command)) ; preserve last-command
+                (completing-read
+                 (format "Goto function%s%s: "
+                         (if other-window-p " other window" "")
+                         (if default-exists-p
+                             (concat " (" default-name ")")
+                           ""))
+                 fume-funclist nil t))))
            ;; Use default function name if just RET was pressed
            (function-name (if (and default-exists-p (string= "" function-name))
                               default-name
@@ -2082,7 +2116,10 @@
       (cond ((not (string= "" function-name))
              (if other-window-p
                  (cond ((prog1 (one-window-p)
-                          (switch-to-buffer-other-window TargetBuffer))
+                          (if (not (windowp other-window-p))
+                              (switch-to-buffer-other-window TargetBuffer)
+                            (select-window other-window-p)
+                            (switch-to-buffer TargetBuffer)))
                         (other-window 1)
                         (shrink-window-if-larger-than-buffer)
                         (other-window 1)))
@@ -2097,26 +2134,24 @@
 
 (defun fume-prompt-function-goto-other-window ()
   (interactive)
-  (let ((current-prefix-arg 1))
-    (call-interactively 'fume-prompt-function-goto)))
+  (fume-prompt-function-goto t))
 
-(defun fume-list-functions-show-fn-other-window ()
+(defun fume-list-functions-show-fn-other-window (&optional window)
   (interactive)
   (beginning-of-line)
   (select-window
-   (prog1 (selected-window)
-     (fume-prompt-function-goto-other-window))))
+   (prog1 (selected-window) (fume-prompt-function-goto (or window t)))))
 
-(defun fume-list-functions-show-prev-fn-other-window ()
+(defun fume-list-functions-show-prev-fn-other-window (&optional window)
   (interactive)
   (forward-line -1)
-  (fume-list-functions-show-fn-other-window))
+  (fume-list-functions-show-fn-other-window window))
 
-(defun fume-list-functions-show-next-fn-other-window ()
+(defun fume-list-functions-show-next-fn-other-window (&optional window)
   (interactive)
   (forward-line 1)
   (beginning-of-line)
-  (fume-list-functions-show-fn-other-window))
+  (fume-list-functions-show-fn-other-window window))
 
 (defun fume-list-functions-help ()
   (interactive)
@@ -2185,6 +2220,7 @@
 (defun fume-list-functions (&optional this-window)
   "Creates a temporary buffer listing functions found in the current buffer"
   (interactive "P")
+  (fume-scan-buffer) ;; Create funclist and set defaults if required
   (let ((func-near-point (format "^%s$" (fume-function-before-point))))
     (cond ((or fume-function-name-regexp (fume-maybe-install-modeline-feature))
            (save-excursion
@@ -2229,3 +2265,5 @@
            (error "Func-Menu is not operative in this buffer")))))
 
 (provide 'func-menu)
+
+;;; end of file
--- a/lisp/packages/hyper-apropos.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/hyper-apropos.el	Mon Aug 13 09:07:36 2007 +0200
@@ -336,8 +336,9 @@
 	buffer-read-only t
 	truncate-lines t
 	hypropos-last-regexp regexp
-	modeline-buffer-identification (concat "Hyper Apropos: "
-					       "\"" regexp "\""))
+	modeline-buffer-identification
+	(list (cons modeline-buffer-id-left-extent "Hyper Apropos: ")
+	      (cons modeline-buffer-id-right-extent (concat "\"" regexp "\""))))
   (setq mode-motion-hook 'mode-motion-highlight-line)
   (use-local-map hypropos-map)
   (run-hooks 'hyper-apropos-mode-hook))
--- a/lisp/packages/info.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/info.el	Mon Aug 13 09:07:36 2007 +0200
@@ -834,17 +834,19 @@
 
 (defun Info-set-mode-line ()
   (setq modeline-buffer-identification
-	(concat
-	 "Info:  ("
-	 (if Info-current-file
-	     (let ((name (file-name-nondirectory Info-current-file)))
-	       (if (string-match "\\.info$" name)
-		   (substring name 0 -5)
-		 name))
-	   "")
-	 ")"
-	 (or Info-current-node ""))))
-
+	(list (cons modeline-buffer-id-left-extent "Info: ")
+	      (cons modeline-buffer-id-right-extent
+		    (concat
+		     "("
+		     (if Info-current-file
+			 (let ((name (file-name-nondirectory Info-current-file)))
+			   (if (string-match "\\.info$" name)
+			       (substring name 0 -5)
+			     name))
+		       "")
+		     ")"
+		     (or Info-current-node ""))))))
+	
 ;; Go to an info node specified with a filename-and-nodename string
 ;; of the sort that is found in pointers in nodes.
 
--- a/lisp/packages/man.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/man.el	Mon Aug 13 09:07:36 2007 +0200
@@ -610,7 +610,8 @@
   ;; overran by a couple of chars.
   (setq truncate-lines t)
   ;; turn off horizontal scrollbars in this buffer
-  (set-specifier scrollbar-height (cons (current-buffer) 0))
+  (when (featurep 'scrollbar)
+    (set-specifier scrollbar-height (cons (current-buffer) 0)))
   (run-hooks 'Manual-mode-hook))
 
 (defun Manual-last-page ()
--- a/lisp/packages/mode-motion+.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/mode-motion+.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1134,8 +1134,9 @@
 				    (progn 
 				      ;; (message "%s" (event-window event))
 				      (move-to-window-line
-				       (if (< emacs-minor-version 12)
-					   (- (event-y event) 
+				       (if (and (= emacs-major-version 19)
+						(< emacs-minor-version 12))
+					   (- (event-y event)
 					      (nth 1 (window-edges window)))
 					 (event-y event)))
 				      (beginning-of-line)
--- a/lisp/packages/ps-print.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/packages/ps-print.el	Mon Aug 13 09:07:36 2007 +0200
@@ -2,51 +2,160 @@
 
 ;; Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
 
-;; Author: Jim Thompson <thompson@wg2.waii.com>
-;; Maintainer: duthen@cegelec-red.fr (Jacques Duthen Prestataire)
-;; Keywords: print, PostScript
-
-;; 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
+;; Author:     Jim Thompson (was <thompson@wg2.waii.com>)
+;; Maintainer: Jacques Duthen <duthen@cegelec-red.fr>
+;; Keywords:   print, PostScript
+;; Time-stamp: <97/01/17 16:41:00 duthen>
+;; Version:    3.05
+
+(defconst ps-print-version "3.05"
+  "ps-print.el, v 3.05 <97/01/17 duthen>
+
+Jack's last change version -- this file may have been edited as part of
+Emacs without changes to the version number.  When reporting bugs,
+please also report the version of Emacs, if any, that ps-print was
+distributed with.
+
+Please send all bug fixes and enhancements to
+	Jacques Duthen <duthen@cegelec-red.fr>.
+")
+
+;; 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.
 
-;; 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.
+;; 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 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, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;; LCD Archive Entry:
 ;; ps-print|James C. Thompson|thompson@wg2.waii.com|
 ;; Jim's Pretty-Good PostScript Generator for Emacs 19 (ps-print)|
 ;; 26-Feb-1994|2.8|~/packages/ps-print.el|
 
+;; 3.05 [jack] <97/01/16 duthen>
+;; Ben Wing <ben@666.com> took ps-print.el from the official 19.34
+;; GNU distribution:
+;; -rw-rw-r--  1 duthen      69315 Jul 22 1996 ps-print.el
+;; He patched it for XEmacs.  
+;; Steven L Baur <steve@miranova.com> sent me this version which has
+;; 26 diffs with 19.34.
+;; I merge these 26 diffs into my 3.04 version. 
+
+;; `ps-paper-type': ###autoload.
+;; `ps-print-color-p' `ps-color-values': Replace pixel-components by
+;;  color-instance-rgb-components for XEmacs.
+;; `ps-color-device': New function to dynamically test the device
+;;  color capability, added where ps-print-color-p is tested.
+;; `ps-xemacs-face-kind-p': Fixed.
+;; `ps-do-despool': Permit dynamic evaluation at print time of
+;;  ps-lpr-switches.  
+;; `ps-eval-switch' `ps-flatten-list' `ps-flatten-list-1': New for
+;;  the previous feature.
+;; `ps-gnus-print-article-from-summary': Updated for Gnus 5.
+
+
+;; 3.04 [jack] after [simon] Oct 8, 1996 Simon Marshall <simon@gnu.ai.mit.edu>
+;; `ps-print-version':
+;;  Fix value.
+;; `cl' `lisp-float-type':
+;;  Require them.
+;; `ps-number-of-columns' `ps-*-font-size':
+;;  Try to select defaults better suited when `ps-landscape-mode' is non-nil. 
+;; `ps-*-faces':
+;;  Change default for Font Lock mode faces when `ps-print-color-p' is nil. 
+;; `ps-right-header':
+;;  Replace `time-stamp-yy/mm/dd' by `time-stamp-mon-dd-yyyy'. 
+;; `ps-end-file' `ps-begin-page':
+;;  Fix bug in page count for Ghostview. 
+;; `ps-generate-postscript-with-faces':
+;;  Replace `ps-sorter' by `car-less-than-car'.  
+;; `ps-plot' `ps-generate':
+;;  Replace `%d' by `%3d'.  
+
+;; 3.03 [jack] Sept 27, 1996 Jacques Duthen <duthen@cegelec-red.fr>
+;; Merge 31 diffs between 19.29 and 19.34
+
+;; 3.02 [jack] June 26, 1996 Jacques Duthen <duthen@cegelec-red.fr>
+;; Add new page dimensions to `ps-page-dimensions-database' for `paper-type'
+;; Improve landscape mode `ps-landscape-mode' and multiple columns
+;; printing `ps-number-of-columns':
+;; The text and the margins are no more scaled.
+;; Simplify the semantics of `ps-inter-column' (space between columns).
+;; Add error checking for negative `ps-print-width' and `ps-print-height'.
+;; Change the semantics of `ps-top-margin' which is now the TOP MARGIN,
+;; and add `ps-header-offset' instead of having `ps-top-margin' split in 2.
+;; Add `ps-header-font-family', `ps-header-font-size' and 
+;; `ps-header-title-font-size' to control the header.
+;; Add `ps-header-line-pad'.
+;; Change the semantics of `ps-font-info-database' to have symbolic
+;; font families.
+;; Add new fonts to `ps-font-info-database': `Courier' `Helvetica'
+;; `Times' `Palatino' `Helvetica-Narrow' `NewCenturySchlbk'
+;; Make public `ps-font-family' and `ps-font-size' so that the user
+;; can directly control the text font and size without loading ps-print.
+;; Add error checking for unknown font families and a message giving
+;; the exhaustive list of available font families.
+;; Document how to install a new font family.
+;; Add `/ReportAllFontInfo' to get all the font families of the printer.
+;; Add the possibility to make `mixed' font families.
+;; Add `ps-setup' to get the current setup.
+;; Add tools `ps-line-lengths' `ps-nb-pages-buffer' `ps-nb-pages-region'
+;; to help choose the font size.
+;; Split `ps-print-prologue' in two to insert info from header fonts
+;; Replace indexes by macro `ps-page-dimensions-get-width'
+;; to get access to the dimensions list.
+;; Add `ps-select-font' inside `ps-get-page-dimensions'.
+;; Fix the "clumsy" `ps-page-height' management.
+;; Move `ps-get-page-dimensions' to the beginning of `ps-begin-file'
+;; to get early error checking.
+;; Add sample setup `ps-jack-setup'.
+;;
+;; Rewrite a lot of postscript code and add comments inside it
+;; (maybe they should not (or optionally) be included in the generated
+;; Postscript).
+;; Translate the origin to (lm, bm) to simplify the other moves.
+;; Fix bug in `/HeaderOffset' with `/PrintStartY'.
+;; Fix bug in `/SetHeaderLines'.
+;; Change `/ReportFontInfo' for use by `/ReportAllFontInfo'.
+
+;; 3.01 [jack] June 4, 1996 Jacques Duthen <duthen@cegelec-red.fr>
+;; Manage float value for every variable representing a size.
+;; Add `ps-font-info-database' `ps-inter-column'
+
+;; 3.00 [jack] May 17, 1996 Jacques Duthen <duthen@cegelec-red.fr>
+;;	based on 2.8 Jim's Pretty-Good version:
+;; Add `ps-landscape-mode' and `ps-number-of-columns'
+;; for dumb multi-column landscape mode.
+
 ;; Baseline-version: 2.8.  (Jim's last change version -- this
 ;; file may have been edited as part of Emacs without changes to the
 ;; version number.  When reporting bugs, please also report the
 ;; version of Emacs, if any, that ps-print was distributed with.)
 
-;;; Synched up with: FSF 19.34.
-
 ;;; Commentary:
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 ;; About ps-print
 ;; --------------
+;;
 ;; This package provides printing of Emacs buffers on PostScript
 ;; printers; the buffer's bold and italic text attributes are
 ;; preserved in the printer output.  Ps-print is intended for use with
 ;; Emacs 19 or Lucid Emacs, together with a fontifying package such as
 ;; font-lock or hilit.
 ;;
+;;
 ;; Using ps-print
 ;; --------------
 ;;
@@ -78,7 +187,7 @@
 ;;        spool      - The PostScript image is saved temporarily in an
 ;;                     Emacs buffer.  Many images may be spooled locally
 ;;                     before printing them.  To send the spooled images
-;;                     to the printer, use the command ps-despool.
+;;                     to the printer, use the command `ps-despool'.
 ;;
 ;; The spooling mechanism was designed for printing lots of small
 ;; files (mail messages or netnews articles) to save paper that would
@@ -86,7 +195,7 @@
 ;; your output at the printer (it's easier to pick up one 50-page
 ;; printout than to find 50 single-page printouts).
 ;; 
-;; Ps-print has a hook in the kill-emacs-hooks so that you won't
+;; Ps-print has a hook in the `kill-emacs-hooks' so that you won't
 ;; accidentally quit from Emacs while you have unprinted PostScript
 ;; waiting in the spool buffer.  If you do attempt to exit with
 ;; spooled PostScript, you'll be asked if you want to print it, and if
@@ -123,6 +232,7 @@
 ;;
 ;;
 ;; Invoking Ps-Print
+;; -----------------
 ;;
 ;; To print your buffer, type
 ;;
@@ -138,16 +248,16 @@
 ;; to the printer; you will be prompted for the name of the file to
 ;; save the image to.  The prefix argument is ignored by the commands
 ;; that spool their images, but you may save the spooled images to a
-;; file by giving a prefix argument to ps-despool:
+;; file by giving a prefix argument to `ps-despool':
 ;;
 ;;        C-u M-x ps-despool
 ;;
-;; When invoked this way, ps-despool will prompt you for the name of
+;; When invoked this way, `ps-despool' will prompt you for the name of
 ;; the file to save to.
 ;;
-;; Any of the ps-print- commands can be bound to keys; I recommend
-;; binding ps-spool-buffer-with-faces, ps-spool-region-with-faces, and
-;; ps-despool.  Here are the bindings I use on my Sun 4 keyboard:
+;; Any of the `ps-print-' commands can be bound to keys; I recommend
+;; binding `ps-spool-buffer-with-faces', `ps-spool-region-with-faces',
+;; and `ps-despool'.  Here are the bindings I use on my Sun 4 keyboard:
 ;;
 ;;   (global-set-key 'f22 'ps-spool-buffer-with-faces) ;f22 is prsc
 ;;   (global-set-key '(shift f22) 'ps-spool-region-with-faces)
@@ -155,111 +265,153 @@
 ;;
 ;;
 ;; The Printer Interface
+;; ---------------------
 ;;
-;; The variables ps-lpr-command and ps-lpr-switches determine what
+;; The variables `ps-lpr-command' and `ps-lpr-switches' determine what
 ;; command is used to send the PostScript images to the printer, and
-;; what arguments to give the command.  These are analogous to lpr-
-;; command and lpr-switches.
+;; what arguments to give the command.  These are analogous to
+;; `lpr-command' and `lpr-switches'.
 ;;
-;; NOTE: ps-lpr-command and ps-lpr-switches take their initial values
-;;       from the variables lpr-command and lpr-switches.  If you have
-;;       lpr-command set to invoke a pretty-printer such as enscript,
-;;       then ps-print won't work properly.  ps-lpr-command must name
+;; Make sure that they contain appropriate values for your system;
+;; see the usage notes below and the documentation of these variables.
+;;
+;; NOTE: `ps-lpr-command' and `ps-lpr-switches' take their initial values
+;;       from the variables `lpr-command' and `lpr-switches'.  If you have
+;;       `lpr-command' set to invoke a pretty-printer such as `enscript',
+;;       then ps-print won't work properly.  `ps-lpr-command' must name
 ;;       a program that does not format the files it prints.
 ;;
 ;;
-;; How Ps-Print Deals With Fonts
-;;
-;; The ps-print-*-with-faces commands attempt to determine which faces
-;; should be printed in bold or italic, but their guesses aren't
-;; always right.  For example, you might want to map colors into faces
-;; so that blue faces print in bold, and red faces in italic.
+;; The Page Layout
+;; ---------------
 ;;
-;; It is possible to force ps-print to consider specific faces bold or
-;; italic, no matter what font they are displayed in, by setting the
-;; variables ps-bold-faces and ps-italic-faces.  These variables
-;; contain lists of faces that ps-print should consider bold or
-;; italic; to set them, put code like the following into your .emacs
-;; file:
+;; All dimensions are floats in PostScript points.
+;; 1 inch  ==       2.54  cm    ==     72       points
+;; 1 cm    ==  (/ 1 2.54) inch  ==  (/ 72 2.54) points
 ;;
-;; 	(setq ps-bold-faces '(my-blue-face))
-;;      (setq ps-italic-faces '(my-red-face))
-;;
-;; Faces like bold-italic that are both bold and italic should go in
-;; *both* lists.
+;; The variable `ps-paper-type' determines the size of paper ps-print
+;; formats for; it should contain one of the symbols:
+;; `a4' `a3' `letter' `legal' `letter-small' `tabloid'
+;; `ledger' `statement' `executive' `a4small' `b4' `b5'
 ;;
-;; Ps-print does not attempt to guess the sizes of fonts; all text is
-;; rendered using the Courier font family, in 10 point size.  To
-;; change the font family, change the variables ps-font, ps-font-bold,
-;; ps-font-italic, and ps-font-bold-italic; fixed-pitch fonts work
-;; best, but are not required.  To change the font size, change the
-;; variable ps-font-size.
-;;
-;; If you change the font family or size, you MUST also change the
-;; variables ps-line-height, ps-avg-char-width, and ps-space-width, or
-;; ps-print cannot correctly place line and page breaks.
+;; The variable `ps-landscape-mode' determines the orientation
+;; of the printing on the page:
+;; nil means `portrait' mode, non-nil means `landscape' mode.
+;; There is no oblique mode yet, though this is easy to do in ps.
+
+;; In landscape mode, the text is NOT scaled: you may print 70 lines
+;; in portrait mode and only 50 lignes in landscape mode.
+;; The margins represent margins in the printed paper:
+;; the top margin is the margin between the top of the page
+;; and the printed header, whatever the orientation is.
 ;;
-;; Ps-print keeps internal lists of which fonts are bold and which are
-;; italic; these lists are built the first time you invoke ps-print.
-;; For the sake of efficiency, the lists are built only once; the same
-;; lists are referred in later invocations of ps-print.
-;;
-;; Because these lists are built only once, it's possible for them to
-;; get out of sync, if a face changes, or if new faces are added.  To
-;; get the lists back in sync, you can set the variable
-;; ps-build-face-reference to t, and the lists will be rebuilt the
-;; next time ps-print is invoked.
+;; The variable `ps-number-of-columns' determines the number of columns
+;; both in landscape and portrait mode.
+;; You can use:
+;; - (the standard) one column portrait mode
+;; - (my favorite) two columns landscape mode (which spares trees)
+;; but also
+;; - one column landscape mode for files with very long lines.
+;; - multi-column portrait or landscape mode
 ;;
 ;;
-;; How Ps-Print Deals With Color
+;; Horizontal layout
+;; -----------------
+;;
+;; The horizontal layout is determined by the variables
+;; `ps-left-margin' `ps-inter-column' `ps-right-margin'
+;; as follows:
+;;
+;;  ------------------------------------------
+;;  |    |      |    |      |    |      |    |
+;;  | lm | text | ic | text | ic | text | rm |
+;;  |    |      |    |      |    |      |    |
+;;  ------------------------------------------
+;;
+;; If `ps-number-of-columns' is 1, `ps-inter-column' is not relevant.
+;; Usually, lm = rm > 0 and ic = lm
+;; If (ic < 0), the text of adjacent columns can overlap.
+;;
+;;
+;; Vertical layout
+;; ---------------
 ;;
-;; Ps-print detects faces with foreground and background colors
-;; defined and embeds color information in the PostScript image.  The
-;; default foreground and background colors are defined by the
-;; variables ps-default-fg and ps-default-bg.  On black-and-white
-;; printers, colors are displayed in grayscale.  To turn off color
-;; output, set ps-print-color-p to nil.
+;; The vertical layout is determined by the variables
+;; `ps-bottom-margin' `ps-top-margin' `ps-header-offset'
+;; as follows:
+;;
+;; |--------|        |--------|
+;; | tm     |        | tm     |
+;; |--------|        |--------|
+;; | header |        |        |
+;; |--------|        |        |
+;; | ho     |        |        |
+;; |--------|   or   | text   |
+;; |        |        |        |
+;; | text   |        |        |
+;; |        |        |        |
+;; |--------|        |--------|
+;; | bm     |        | bm     |
+;; |--------|        |--------|
+;;
+;; If `ps-print-header' is nil, `ps-header-offset' is not relevant.
+;; The margins represent margins in the printed paper:
+;; the top margin is the margin between the top of the page
+;; and the printed header, whatever the orientation is.
 ;;
 ;;
 ;; Headers
+;; -------
 ;;
-;; Ps-print can print headers at the top of each page; the default
+;; Ps-print can print headers at the top of each column; the default
 ;; headers contain the following four items: on the left, the name of
 ;; the buffer and, if the buffer is visiting a file, the file's
-;; directory; on the right, the page number and date of printing.  The
-;; default headers look something like this:
+;; directory; on the right, the page number and date of printing.
+;; The default headers look something like this:
 ;;
 ;;     ps-print.el                                         1/21
 ;;     /home/jct/emacs-lisp/ps/new                     94/12/31
 ;; 
 ;; When printing on duplex printers, left and right are reversed so
-;; that the page numbers are toward the outside.
+;; that the page numbers are toward the outside (cf. `ps-spool-duplex').
+;;
+;; Headers are configurable:
+;; To turn them off completely, set `ps-print-header' to nil.
+;; To turn off the header's gaudy framing box,
+;; set `ps-print-header-frame' to nil.
 ;;
-;; Headers are configurable.  To turn them off completely, set
-;; ps-print-header to nil.  To turn off the header's gaudy framing
-;; box, set ps-print-header-frame to nil.  Page numbers are printed in
-;; "n/m" format, indicating page n of m pages; to omit the total page
-;; count and just print the page number, set ps-show-n-of-n to nil.
+;; The font family and size of text in the header are determined
+;; by the variables `ps-header-font-family', `ps-header-font-size' and 
+;; `ps-header-title-font-size' (see below).
+;;
+;; The variable `ps-header-line-pad' determines the portion of a header
+;; title line height to insert between the header frame and the text
+;; it contains, both in the vertical and horizontal directions:
+;; .5 means half a line.
+
+;; Page numbers are printed in `n/m' format, indicating page n of m pages;
+;; to omit the total page count and just print the page number,
+;; set `ps-show-n-of-n' to nil.
 ;;
 ;; The amount of information in the header can be changed by changing
-;; the number of lines.  To show less, set ps-header-lines to 1, and
+;; the number of lines.  To show less, set `ps-header-lines' to 1, and
 ;; the header will show only the buffer name and page number.  To show
-;; more, set ps-header-lines to 3, and the header will show the time of
+;; more, set `ps-header-lines' to 3, and the header will show the time of
 ;; printing below the date.
 ;;
 ;; To change the content of the headers, change the variables
-;; ps-left-header and ps-right-header.  These variables are lists,
-;; specifying top-to-bottom the text to display on the left or right
-;; side of the header.  Each element of the list should be a string or
-;; a symbol.  Strings are inserted directly into the PostScript
-;; arrays, and should contain the PostScript string delimiters '(' and
-;; ')'.
+;; `ps-left-header' and `ps-right-header'.
+;; These variables are lists, specifying top-to-bottom the text
+;; to display on the left or right side of the header.
+;; Each element of the list should be a string or a symbol.
+;; Strings are inserted directly into the PostScript arrays,
+;; and should contain the PostScript string delimiters '(' and ')'.
 ;;
 ;; Symbols in the header format lists can either represent functions
 ;; or variables.  Functions are called, and should return a string to
 ;; show in the header.  Variables should contain strings to display in
 ;; the header.  In either case, function or variable, the PostScript
-;; string delimeters are added by ps-print, and should not be part of
+;; string delimiters are added by ps-print, and should not be part of
 ;; the returned value.
 ;;
 ;; Here's an example: say we want the left header to display the text
@@ -277,56 +429,217 @@
 ;;
 ;;     (setq larry-var "Larry")
 ;;
-;; and a literal for "Curly".  Here's how ps-left-header should be
+;; and a literal for "Curly".  Here's how `ps-left-header' should be
 ;; set:
 ;;
 ;;     (setq ps-left-header (list 'moe-func 'larry-var "(Curly)"))
 ;;
 ;; Note that Curly has the PostScript string delimiters inside his
-;; quotes -- those aren't misplaced lisp delimiters!  Without them,
-;; PostScript would attempt to call the undefined function Curly,
-;; which would result in a PostScript error.  Since most printers
-;; don't report PostScript errors except by aborting the print job,
-;; this kind of error can be hard to track down.  Consider yourself
-;; warned.
+;; quotes -- those aren't misplaced lisp delimiters!
+;;
+;; Without them, PostScript would attempt to call the undefined
+;; function Curly, which would result in a PostScript error.
+;;
+;; Since most printers don't report PostScript errors except by
+;; aborting the print job, this kind of error can be hard to track down.
+;;
+;; Consider yourself warned!
 ;;
 ;;
 ;; Duplex Printers
+;; ---------------
 ;;
 ;; If you have a duplex-capable printer (one that prints both sides of
-;; the paper), set ps-spool-duplex to t.  Ps-print will insert blank
-;; pages to make sure each buffer starts on the correct side of the
-;; paper.  Don't forget to set ps-lpr-switches to select duplex
-;; printing for your printer.
+;; the paper), set `ps-spool-duplex' to t.
+;; Ps-print will insert blank pages to make sure each buffer starts
+;; on the correct side of the paper.
+;; Don't forget to set `ps-lpr-switches' to select duplex printing
+;; for your printer.
+;;
+;; 
+;; Font managing
+;; -------------
+;;
+;; Ps-print now knows rather precisely some fonts:
+;; the variable `ps-font-info-database' contains information
+;; for a list of font families (currently mainly `Courier' `Helvetica'
+;; `Times' `Palatino' `Helvetica-Narrow' `NewCenturySchlbk').
+;; Each font family contains the font names for standard, bold, italic
+;; and bold-italic characters, a reference size (usually 10) and the
+;; corresponding line height, width of a space and average character width.
 ;; 
+;; The variable `ps-font-family' determines which font family
+;; is to be used for ordinary text.
+;; If its value does not correspond to a known font family,
+;; an error message is printed into the `*Messages*' buffer,
+;; which lists the currently available font families.
 ;;
-;; Paper Size
+;; The variable `ps-font-size' determines the size (in points)
+;; of the font for ordinary text, when generating Postscript.
+;; Its value is a float.
+;;
+;; Similarly, the variable `ps-header-font-family' determines
+;; which font family is to be used for text in the header.
+;; The variable `ps-header-font-size' determines the font size,
+;; in points, for text in the header.
+;; The variable `ps-header-title-font-size' determines the font size,
+;; in points, for the top line of text in the header.
+;;
+;;
+;; Adding a new font family
+;; ------------------------
+;;
+;; To use a new font family, you MUST first teach ps-print
+;; this font, ie add its information to `ps-font-info-database',
+;; otherwise ps-print cannot correctly place line and page breaks.
+;;
+;; For example, assuming `Helvetica' is unkown,
+;; you first need to do the following ONLY ONCE:
+;;
+;; - create a new buffer
+;; - generate the PostScript image to a file (C-u M-x ps-print-buffer)
+;; - open this file and find the line:
+;;	`% 3 cm 20 cm moveto  10 /Courier ReportFontInfo  showpage'
+;; - delete the leading `%' (which is the Postscript comment character)
+;; - replace in this line `Courier' by the new font (say `Helvetica')
+;;   to get the line:
+;;	`3 cm 20 cm moveto  10 /Helvetica ReportFontInfo  showpage'
+;; - send this file to the printer (or to ghostscript).
+;;   You should read the following on the output page:
+;;
+;;     For Helvetica 10 point, the line height is 11.56, the space width is 2.78
+;;     and a crude estimate of average character width is 5.09243
+;;
+;; - Add these values to the `ps-font-info-database':
+;;   (setq ps-font-info-database
+;;	 (append
+;;	  '((Helvetica ; the family name
+;;	    "Helvetica" "Helvetica-Bold" "Helvetica-Oblique" "Helvetica-BoldOblique"
+;;	    10.0 11.56 2.78 5.09243))
+;;	  ps-font-info-database))
+;; - Now you can use this font family with any size:
+;;	(setq ps-font-family 'Helvetica)
+;; - if you want to use this family in another emacs session, you must
+;;   put into your `~/.emacs':
+;;	(require 'ps-print)
+;;	(setq ps-font-info-database (append ...)))
+;;   if you don't want to load ps-print, you have to copy the whole value:
+;;	(setq ps-font-info-database '(<your stuff> <the standard stuff>))
+;;   or, if you can wait until the `ps-print-hook' is implemented, do:
+;;      (add-hook 'ps-print-hook '(setq ps-font-info-database (append ...)))
+;;      This does not work yet, since there is no `ps-print-hook' yet.
 ;;
-;; The variable ps-paper-type determines the size of paper ps-print
-;; formats for; it should contain one of the symbols ps-letter,
-;; ps-legal, or ps-a4.  The default is ps-letter.
+;; You can create new `mixed' font families like:
+;;	(my-mixed-family
+;;	 "Courier-Bold" "Helvetica"
+;;	 "Zapf-Chancery-MediumItalic" "NewCenturySchlbk-BoldItalic"
+;;	 10.0 10.55 6.0 6.0)
+;; Now you can use your new font family with any size:
+;;	(setq ps-font-family 'my-mixed-family)
+;;
+;; You can get information on all the fonts resident in YOUR printer
+;; by uncommenting the line:
+;;	% 3 cm 20 cm moveto  ReportAllFontInfo           showpage
+;;
+;; The postscript file should be sent to YOUR postscript printer.
+;; If you send it to ghostscript or to another postscript printer,
+;; you may get slightly different results.
+;; Anyway, as ghostscript fonts are autoload, you won't get
+;; much font info.
+;;
+;;
+;; How Ps-Print Deals With Faces
+;; -----------------------------
+;;
+;; The ps-print-*-with-faces commands attempt to determine which faces
+;; should be printed in bold or italic, but their guesses aren't
+;; always right.  For example, you might want to map colors into faces
+;; so that blue faces print in bold, and red faces in italic.
+;;
+;; It is possible to force ps-print to consider specific faces bold or
+;; italic, no matter what font they are displayed in, by setting the
+;; variables `ps-bold-faces' and `ps-italic-faces'.  These variables
+;; contain lists of faces that ps-print should consider bold or
+;; italic; to set them, put code like the following into your .emacs
+;; file:
+;;
+;; 	(setq ps-bold-faces '(my-blue-face))
+;;      (setq ps-italic-faces '(my-red-face))
+;;
+;; Faces like bold-italic that are both bold and italic should go in
+;; *both* lists.
 ;;
-;; Make sure that the variables ps-lpr-command and ps-lpr-switches
-;; contain appropriate values for your system; see the usage notes
-;; below and the documentation of these variables.
-;; 
+;; Ps-print keeps internal lists of which fonts are bold and which are
+;; italic; these lists are built the first time you invoke ps-print.
+;; For the sake of efficiency, the lists are built only once; the same
+;; lists are referred in later invocations of ps-print.
+;;
+;; Because these lists are built only once, it's possible for them to
+;; get out of sync, if a face changes, or if new faces are added.  To
+;; get the lists back in sync, you can set the variable
+;; `ps-build-face-reference' to t, and the lists will be rebuilt the
+;; next time ps-print is invoked.
+;;
+;;
+;; How Ps-Print Deals With Color
+;; -----------------------------
+;;
+;; Ps-print detects faces with foreground and background colors
+;; defined and embeds color information in the PostScript image.
+;; The default foreground and background colors are defined by the
+;; variables `ps-default-fg' and `ps-default-bg'.
+;; On black-and-white printers, colors are displayed in grayscale.
+;; To turn off color output, set `ps-print-color-p' to nil.
+;;
+;;
+;; Utilities
+;; ---------
+;;
+;; Some tools are provided to help you customize your font setup.
+;;
+;; `ps-setup' returns (some part of) the current setup.
+;;
+;; To avoid wrapping too many lines, you may want to adjust the
+;; left and right margins and the font size.  On UN*X systems, do:
+;; pr -t file | awk '{printf "%3d %s\n", length($0), $0}' | sort -r | head
+;; to determine the longest lines of your file.
+;; Then, the command `ps-line-lengths' will give you the correspondance
+;; between a line length (number of characters) and the maximum font
+;; size which doesn't wrap such a line with the current ps-print setup.
+;;
+;; The commands `ps-nb-pages-buffer' and `ps-nb-pages-region' display
+;; the correspondance between a number of pages and the maximum font
+;; size which allow the number of lines of the current buffer or of
+;; its current region to fit in this number of pages.
+;; Note: line folding is not taken into account in this process
+;; and could change the results.
+;;
+;;
 ;; New since version 1.5
 ;; ---------------------
+;;
 ;; Color output capability.
-;;
 ;; Automatic detection of font attributes (bold, italic).
+;; Configurable headers with page numbers.
+;; Slightly faster.
+;; Support for different paper sizes.
+;; Better conformance to PostScript Document Structure Conventions.
 ;;
-;; Configurable headers with page numbers.
 ;;
-;; Slightly faster.
+;; New since version 2.8
+;; ---------------------
+;;
+;; [jack] 960517 Jacques Duthen <duthen@cegelec-red.fr>
 ;;
-;; Support for different paper sizes.
-;;
-;; Better conformance to PostScript Document Structure Conventions.
+;; Font familiy and float size for text and header.
+;; Landscape mode.
+;; Multiple columns.
+;; Tools for page setup.
 ;;
 ;;
 ;; Known bugs and limitations of ps-print:
 ;; --------------------------------------
+;;
 ;; Although color printing will work in XEmacs 19.12, it doesn't work
 ;; well; in particular, bold or italic fonts don't print in the right
 ;; background color.
@@ -335,12 +648,12 @@
 ;;
 ;; Automatic font-attribute detection doesn't work well, especially
 ;; with hilit19 and older versions of get-create-face.  Users having
-;; problems with auto-font detection should use the lists ps-italic-
-;; faces and ps-bold-faces and/or turn off automatic detection by
-;; setting ps-auto-font-detect to nil.
+;; problems with auto-font detection should use the lists
+;; `ps-italic-faces' and `ps-bold-faces' and/or turn off automatic
+;; detection by setting `ps-auto-font-detect' to nil.
 ;;
 ;; Automatic font-attribute detection doesn't work with XEmacs 19.12
-;; in tty mode; use the lists ps-italic-faces and ps-bold-faces
+;; in tty mode; use the lists `ps-italic-faces' and `ps-bold-faces'
 ;; instead.
 ;;
 ;; Still too slow; could use some hand-optimization.
@@ -354,18 +667,30 @@
 ;;
 ;; Epoch and Emacs 18 not supported.  At all.
 ;;
+;; Fixed-pitch fonts work better for line folding, but are not required.  
 ;;
-;; Features to add:
-;; ---------------
-;; 2-up and 4-up capability.
+;; `ps-nb-pages-buffer' and `ps-nb-pages-region' don't take care
+;; of folding lines.
+;;
+;;
+;; Things to change:
+;; ----------------
 ;;
-;; Line numbers.
-;;
-;; Wide-print (landscape) capability.
+;; Add `ps-print-hook' (I don't know how to do that (yet!)).
+;; Add 4-up capability (really needed?).
+;; Add line numbers (should not be too hard).
+;; Add `ps-non-bold-faces' and `ps-non-italic-faces' (should be easy).
+;; Put one header per page over the columns (easy but needed?).
+;; Improve the memory management for big files (hard?).
+;; `ps-nb-pages-buffer' and `ps-nb-pages-region' should take care
+;; of folding lines.
 ;;
 ;;
 ;; Acknowledgements
 ;; ----------------
+;; Thanks to Jim Thompson <?@?> for the 2.8 version I started from.
+;; [jack]
+;;
 ;; Thanks to Kevin Rodgers <kevinr@ihs.com> for adding support for
 ;; color and the invisible property.
 ;;
@@ -391,39 +716,116 @@
 
 ;;; Code:
 
-(defconst ps-print-version "2.8"
-  "ps-print.el,v 2.8 1995/05/04 12:06:10 jct Exp
-
-Jim's last change version -- this file may have been edited as part of
-Emacs without changes to the version number.  When reporting bugs,
-please also report the version of Emacs, if any, that ps-print was
-distributed with.
-
-Please send all bug fixes and enhancements to
-	Jim Thompson <thompson@wg2.waii.com>.")
+(eval-when-compile
+  (require 'cl))
+
+(unless (featurep 'lisp-float-type)
+  (error "`ps-print' requires floating point support"))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; User Variables:
 
+;;; Interface to the command system
+
 (defvar ps-lpr-command lpr-command
   "*The shell command for printing a PostScript file.")
 
 (defvar ps-lpr-switches lpr-switches
   "*A list of extra switches to pass to `ps-lpr-command'.")
 
-(defvar ps-spool-duplex nil		; Not many people have duplex
-					; printers, so default to nil.
-  "*Non-nil indicates spooling is for a two-sided printer.
-For a duplex printer, the `ps-spool-*' commands will insert blank pages
-as needed between print jobs so that the next buffer printed will
-start on the right page.  Also, if headers are turned on, the headers
-will be reversed on duplex printers so that the page numbers fall to
-the left on even-numbered pages.")
+;;; Page layout
+
+;; All page dimensions are in PostScript points.
+;; 1 inch  ==       2.54  cm    ==     72       points
+;; 1 cm    ==  (/ 1 2.54) inch  ==  (/ 72 2.54) points
+
+;; Letter      8.5   inch x 11.0   inch
+;; Legal       8.5   inch x 14.0   inch
+;; A4          8.26  inch x 11.69  inch = 21.0 cm x 29.7 cm
+
+;; LetterSmall 7.68  inch x 10.16  inch
+;; Tabloid    11.0   inch x 17.0   inch
+;; Ledger     17.0   inch x 11.0   inch
+;; Statement   5.5   inch x  8.5   inch
+;; Executive   7.5   inch x 10.0   inch
+;; A3         11.69  inch x 16.5   inch = 29.7 cm x 42.0 cm
+;; A4Small     7.47  inch x 10.85  inch
+;; B4         10.125 inch x 14.33  inch
+;; B5          7.16  inch x 10.125 inch
+
+(defvar ps-page-dimensions-database
+  (list (list 'a4    (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54))
+	(list 'a3    (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54))
+	(list 'letter       (* 72  8.5)   (* 72 11.0))
+	(list 'legal        (* 72  8.5)   (* 72 14.0))
+	(list 'letter-small (* 72  7.68)  (* 72 10.16))
+	(list 'tabloid      (* 72 11.0)   (* 72 17.0))
+	(list 'ledger       (* 72 17.0)   (* 72 11.0))
+	(list 'statement    (* 72  5.5)   (* 72  8.5))
+	(list 'executive    (* 72  7.5)   (* 72 10.0))
+	(list 'a4small      (* 72  7.47)  (* 72 10.85))
+	(list 'b4           (* 72 10.125) (* 72 14.33))
+	(list 'b5           (* 72  7.16)  (* 72 10.125)))
+  "*List associating a symbolic paper type to its width and height.
+see `ps-paper-type'.")
 
 ;;;###autoload
-(defvar ps-paper-type 'ps-letter
-  "*Specifies the size of paper to format for.  Should be one of
-`ps-letter', `ps-legal', or `ps-a4'.")
+(defvar ps-paper-type 'letter
+  "*Specifies the size of paper to format for.
+Should be one of the paper types defined in `ps-page-dimensions-database', for
+example `letter', `legal' or `a4'.")
+
+(defvar ps-landscape-mode 'nil
+  "*Non-nil means print in landscape mode.")
+
+(defvar ps-number-of-columns (if ps-landscape-mode 2 1)
+  "*Specifies the number of columns")
+
+;;; Horizontal layout
+
+;;  ------------------------------------------
+;;  |    |      |    |      |    |      |    |
+;;  | lm | text | ic | text | ic | text | rm |
+;;  |    |      |    |      |    |      |    |
+;;  ------------------------------------------
+
+(defvar ps-left-margin   (/ (* 72  2.0) 2.54) ;   2 cm
+  "*Left margin in points (1/72 inch).")
+
+(defvar ps-right-margin  (/ (* 72  2.0) 2.54) ;   2 cm
+  "*Right margin in points (1/72 inch).")
+
+(defvar ps-inter-column  (/ (* 72  2.0) 2.54) ;   2 cm
+  "*Horizontal space between columns in points (1/72 inch).")
+
+;;; Vertical layout
+
+;; |--------|
+;; | tm     |
+;; |--------|
+;; | header |
+;; |--------|
+;; | ho     |
+;; |--------|
+;; | text   |
+;; |--------|
+;; | bm     |
+;; |--------|
+
+(defvar ps-bottom-margin (/ (* 72  1.5) 2.54) ; 1.5 cm
+  "*Bottom margin in points (1/72 inch).")
+
+(defvar ps-top-margin    (/ (* 72  1.5) 2.54) ; 1.5 cm
+  "*Top margin in points (1/72 inch).")
+
+(defvar ps-header-offset (/ (* 72  1.0) 2.54) ; 1.0 cm
+  "*Vertical space in points (1/72 inch) between the main text and the header.")
+
+(defvar ps-header-line-pad 0.15
+  "*Portion of a header title line height to insert between the header frame
+and the text it contains, both in the vertical and horizontal directions.")
+
+;;; Header setup
 
 (defvar ps-print-header t
   "*Non-nil means print a header at the top of each page.
@@ -435,19 +837,114 @@
 (defvar ps-print-header-frame t
   "*Non-nil means draw a gaudy frame around the header.")
 
+(defvar ps-header-lines 2
+  "*Number of lines to display in page header, when generating Postscript.")
+(make-variable-buffer-local 'ps-header-lines)
+
 (defvar ps-show-n-of-n t
   "*Non-nil means show page numbers as N/M, meaning page N of M.
 Note: page numbers are displayed as part of headers, see variable
 `ps-print-headers'.")
 
+(defvar ps-spool-duplex nil		; Not many people have duplex
+					; printers, so default to nil.
+  "*Non-nil indicates spooling is for a two-sided printer.
+For a duplex printer, the `ps-spool-*' commands will insert blank pages
+as needed between print jobs so that the next buffer printed will
+start on the right page.  Also, if headers are turned on, the headers
+will be reversed on duplex printers so that the page numbers fall to
+the left on even-numbered pages.")
+
+;;; Fonts
+
+(defvar ps-font-info-database
+  '((Courier				; the family key
+     "Courier" "Courier-Bold" "Courier-Oblique" "Courier-BoldOblique"
+     10.0 10.55 6.0     6.0)
+    (Helvetica				; the family key
+     "Helvetica" "Helvetica-Bold" "Helvetica-Oblique" "Helvetica-BoldOblique"
+     10.0 11.56 2.78    5.09243)
+    (Times
+     "Times-Roman" "Times-Bold" "Times-Italic" "Times-BoldItalic"
+     10.0 11.0  2.5     4.71432)
+    (Palatino
+     "Palatino-Roman" "Palatino-Bold" "Palatino-Italic" "Palatino-BoldItalic"
+     10.0 12.1  2.5     5.08676)
+    (Helvetica-Narrow
+     "Helvetica-Narrow" "Helvetica-Narrow-Bold"
+     "Helvetica-Narrow-Oblique" "Helvetica-Narrow-BoldOblique"
+     10.0 11.56 2.2796  4.17579)
+    (NewCenturySchlbk
+     "NewCenturySchlbk-Roman" "NewCenturySchlbk-Bold"
+     "NewCenturySchlbk-Italic" "NewCenturySchlbk-BoldItalic"
+     10.0 12.15 2.78    5.31162)
+    ;; got no bold for the next ones
+    (AvantGarde-Book
+     "AvantGarde-Book" "AvantGarde-Book"
+     "AvantGarde-BookOblique" "AvantGarde-BookOblique"
+     10.0 11.77 2.77    5.45189)
+    (AvantGarde-Demi
+     "AvantGarde-Demi" "AvantGarde-Demi"
+     "AvantGarde-DemiOblique" "AvantGarde-DemiOblique"
+     10.0 12.72 2.8     5.51351)
+    (Bookman-Demi
+     "Bookman-Demi" "Bookman-Demi"
+     "Bookman-DemiItalic" "Bookman-DemiItalic"
+     10.0 11.77 3.4     6.05946)
+    (Bookman-Light
+     "Bookman-Light" "Bookman-Light"
+     "Bookman-LightItalic" "Bookman-LightItalic"
+     10.0 11.79 3.2     5.67027)
+    ;; got no bold and no italic for the next ones
+    (Symbol
+     "Symbol" "Symbol" "Symbol" "Symbol"
+     10.0 13.03 2.5     3.24324)
+    (Zapf-Dingbats
+     "Zapf-Dingbats" "Zapf-Dingbats" "Zapf-Dingbats" "Zapf-Dingbats"
+     10.0  9.63 2.78    2.78)
+    (Zapf-Chancery-MediumItalic
+     "Zapf-Chancery-MediumItalic" "Zapf-Chancery-MediumItalic"
+     "Zapf-Chancery-MediumItalic" "Zapf-Chancery-MediumItalic"
+     10.0 11.45 2.2     4.10811)
+)
+  "*Font info database: font family (the key), name, bold, italic, bold-italic,
+reference size, line height, space width, average character width.
+To get the info for another specific font (say Helvetica), do the following:
+- create a new buffer
+- generate the PostScript image to a file (C-u M-x ps-print-buffer)
+- open this file and delete the leading `%' (which is the Postscript
+  comment character) from the line
+	`% 3 cm 20 cm moveto  10 /Courier ReportFontInfo  showpage'
+  to get the line
+	`3 cm 20 cm moveto  10 /Helvetica ReportFontInfo  showpage'
+- add the values to `ps-font-info-database'.
+You can get all the fonts of YOUR printer using `ReportAllFontInfo'.")
+
+(defvar ps-font-family 'Courier
+  "Font family name for ordinary text, when generating Postscript.")
+
+(defvar ps-font-size   (if ps-landscape-mode 7 8.5)
+  "Font size, in points, for ordinary text, when generating Postscript.")
+
+(defvar ps-header-font-family      'Helvetica
+  "Font family name for text in the header, when generating Postscript.")
+
+(defvar ps-header-font-size       (if ps-landscape-mode 10 12)
+  "Font size, in points, for text in the header, when generating Postscript.")
+
+(defvar ps-header-title-font-size (if ps-landscape-mode 12 14)
+  "Font size, in points, for the top line of text in the header,
+when generating Postscript.")
+
+;;; Colors
+
 ;;;###autoload
 ;;; The 19.33 fsf version includes a test on pixel components instead
 ;;;  of color-instance-rgb-components
-(defvar ps-print-color-p (and (or (fboundp 'x-color-values)	; fsf
-				  (fboundp 'color-instance-rgb-components))
+(defvar ps-print-color-p (or (fboundp 'x-color-values)	; fsf
+			     (fboundp 'color-instance-rgb-components))
 					; xemacs
-			      (fboundp 'float))
-; Printing color requires both floating point and x-color-values.
+; Printing color requires x-color-values.
   "*If non-nil, print the buffer's text in color.")
 
 (defvar ps-default-fg '(0.0 0.0 0.0)
@@ -456,64 +953,42 @@
 (defvar ps-default-bg '(1.0 1.0 1.0)
   "*RGB values of the default background color.  Defaults to white.")
 
-(defvar ps-font-size 10
-  "*Font size, in points, for generating Postscript.")
-
-(defvar ps-font "Courier"
-  "*Font family name for ordinary text, when generating Postscript.")
-
-(defvar ps-font-bold "Courier-Bold"
-  "*Font family name for bold text, when generating Postscript.")
-
-(defvar ps-font-italic "Courier-Oblique"
-  "*Font family name for italic text, when generating Postscript.")
-
-(defvar ps-font-bold-italic "Courier-BoldOblique"
-  "*Font family name for bold italic text, when generating Postscript.")
-
-(defvar ps-avg-char-width (if (fboundp 'float) 5.6 6)
-  "*The average width, in points, of a character, for generating Postscript.
-This is the value that ps-print uses to determine the length,
-x-dimension, of the text it has printed, and thus affects the point at
-which long lines wrap around.  If you change the font or
-font size, you will probably have to adjust this value to match.")
-
-(defvar ps-space-width (if (fboundp 'float) 5.6 6)
-  "*The width of a space character, for generating Postscript.
-This value is used in expanding tab characters.")
-
-(defvar ps-line-height (if (fboundp 'float) 11.29 11)
-  "*The height of a line, for generating Postscript.
-This is the value that ps-print uses to determine the height,
-y-dimension, of the lines of text it has printed, and thus affects the
-point at which page-breaks are placed.  If you change the font or font
-size, you will probably have to adjust this value to match.  The
-line-height is *not* the same as the point size of the font.")
-
 (defvar ps-auto-font-detect t
   "*Non-nil means automatically detect bold/italic face attributes.
 nil means rely solely on the lists `ps-bold-faces', `ps-italic-faces',
 and `ps-underlined-faces'.")
 
-(defvar ps-bold-faces '()
+(defvar ps-bold-faces
+  (unless ps-print-color-p
+    '(font-lock-function-name-face
+      font-lock-builtin-face
+      font-lock-variable-name-face
+      font-lock-keyword-face
+      font-lock-warning-face))
   "*A list of the \(non-bold\) faces that should be printed in bold font.
 This applies to generating Postscript.")
 
-(defvar ps-italic-faces '()
+(defvar ps-italic-faces
+  (unless ps-print-color-p
+    '(font-lock-variable-name-face
+      font-lock-string-face
+      font-lock-comment-face
+      font-lock-warning-face))
   "*A list of the \(non-italic\) faces that should be printed in italic font.
 This applies to generating Postscript.")
 
-(defvar ps-underlined-faces '()
+(defvar ps-underlined-faces
+  (unless ps-print-color-p
+    '(font-lock-function-name-face
+      font-lock-type-face
+      font-lock-reference-face
+      font-lock-warning-face))
   "*A list of the \(non-underlined\) faces that should be printed underlined.
 This applies to generating Postscript.")
 
-(defvar ps-header-lines 2
-  "*Number of lines to display in page header, when generating Postscript.")
-(make-variable-buffer-local 'ps-header-lines)
-
 (defvar ps-left-header
   (list 'ps-get-buffer-name 'ps-header-dirpart)
-  "*The items to display on the right part of the page header.
+  "*The items to display (each on a line) on the left part of the page header.
 This applies to generating Postscript.
 
 The value should be a list of strings and symbols, each representing an
@@ -531,8 +1006,8 @@
 (make-variable-buffer-local 'ps-left-header)
 
 (defvar ps-right-header
-  (list "/pagenumberstring load" 'time-stamp-yy/mm/dd 'time-stamp-hh:mm:ss)
-  "*The items to display on the left part of the page header.
+  (list "/pagenumberstring load" 'time-stamp-mon-dd-yyyy 'time-stamp-hh:mm:ss)
+  "*The items to display (each on a line) on the right part of the page header.
 This applies to generating Postscript.
 
 See the variable `ps-left-header' for a description of the format of
@@ -689,6 +1164,85 @@
   (interactive (list (ps-print-preprint current-prefix-arg)))
   (ps-do-despool filename))
 
+;;;###autoload
+(defun ps-line-lengths ()
+  "*Display the correspondance between a line length and a font size,
+using the current ps-print setup.
+Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head"
+  (interactive)
+  (ps-line-lengths-internal))
+
+;;;###autoload
+(defun ps-nb-pages-buffer (nb-lines)
+  "*Display an approximate correspondance between a font size and the number
+of pages the current buffer would require to print
+using the current ps-print setup."
+  (interactive (list (count-lines (point-min) (point-max))))
+  (ps-nb-pages nb-lines))
+
+;;;###autoload
+(defun ps-nb-pages-region (nb-lines)
+  "*Display an approximate correspondance between a font size and the number
+of pages the current region would require to print
+using the current ps-print setup."
+  (interactive (list (count-lines (mark) (point))))
+  (ps-nb-pages nb-lines))
+
+;;;###autoload
+(defun ps-setup ()
+  "*Return the current setup"
+  (format "
+ (setq ps-print-color-p  %s
+      ps-lpr-command    \"%s\"
+      ps-lpr-switches   %s
+
+      ps-paper-type       '%s
+      ps-landscape-mode   %s
+      ps-number-of-columns %s
+
+      ps-left-margin   %s
+      ps-right-margin  %s
+      ps-inter-column  %s
+      ps-bottom-margin %s
+      ps-top-margin    %s
+      ps-header-offset %s
+      ps-header-line-pad    %s
+      ps-print-header       %s
+      ps-print-header-frame %s
+      ps-header-lines       %s
+      ps-show-n-of-n        %s
+      ps-spool-duplex       %s
+
+      ps-font-family             '%s
+      ps-font-size               %s
+      ps-header-font-family      '%s
+      ps-header-font-size        %s
+      ps-header-title-font-size  %s)
+"
+  ps-print-color-p
+  ps-lpr-command
+  ps-lpr-switches
+  ps-paper-type
+  ps-landscape-mode
+  ps-number-of-columns
+  ps-left-margin
+  ps-right-margin
+  ps-inter-column
+  ps-bottom-margin
+  ps-top-margin
+  ps-header-offset
+  ps-header-line-pad
+  ps-print-header
+  ps-print-header-frame
+  ps-header-lines
+  ps-show-n-of-n
+  ps-spool-duplex
+  ps-font-family
+  ps-font-size
+  ps-header-font-family
+  ps-header-font-size
+  ps-header-title-font-size))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Utility functions and variables:
 
@@ -705,7 +1259,10 @@
   (require 'faces))			; face-font, face-underline-p,
 					; x-font-regexp
 
-(defun xemacs-color-device ()
+;; Return t if the device (which can be changed during an emacs
+;; session) can handle colors.  
+;; This is function is not yet implemented for GNU emacs.
+(defun ps-color-device ()
   (if (and (eq ps-print-emacs-type 'xemacs)
 	   (>= emacs-minor-version 12))
       (eq (device-class) 'color)
@@ -713,12 +1270,41 @@
 
 (require 'time-stamp)
 
-(defvar ps-print-prologue "% ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4:
-% If the ISOLatin1Encoding vector isn't known, define it.
+(defvar ps-font nil
+  "Font family name for ordinary text, when generating Postscript.")
+
+(defvar ps-font-bold nil
+  "Font family name for bold text, when generating Postscript.")
+
+(defvar ps-font-italic nil
+  "Font family name for italic text, when generating Postscript.")
+
+(defvar ps-font-bold-italic nil
+  "Font family name for bold italic text, when generating Postscript.")
+
+(defvar ps-avg-char-width nil
+  "The average width, in points, of a character, for generating Postscript.
+This is the value that ps-print uses to determine the length,
+x-dimension, of the text it has printed, and thus affects the point at
+which long lines wrap around.")
+
+(defvar ps-space-width nil
+  "The width of a space character, for generating Postscript.
+This value is used in expanding tab characters.")
+
+(defvar ps-line-height nil
+  "The height of a line, for generating Postscript.
+This is the value that ps-print uses to determine the height,
+y-dimension, of the lines of text it has printed, and thus affects the
+point at which page-breaks are placed.
+The line-height is *not* the same as the point size of the font.")
+
+(defvar ps-print-prologue-1
+  "% ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4:
 /ISOLatin1Encoding where { pop } {
-% Define the ISO Latin-1 encoding vector.
-% The first half is the same as the standard encoding,
-% except for minus instead of hyphen at code 055.
+% -- The ISO Latin-1 encoding vector isn't known, so define it.
+% -- The first half is the same as the standard encoding,
+% -- except for minus instead of hyphen at code 055.
 /ISOLatin1Encoding
 StandardEncoding 0 45 getinterval aload pop
     /minus
@@ -726,12 +1312,12 @@
 %*** NOTE: the following are missing in the Adobe documentation,
 %*** but appear in the displayed table:
 %*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240.
-% ^Px
+% 0200 (128)
     /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
     /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
     /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
     /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron
-% ^Tx
+% 0240 (160)
     /space /exclamdown /cent /sterling
 	/currency /yen /brokenbar /section
     /dieresis /copyright /ordfeminine /guillemotleft
@@ -740,7 +1326,7 @@
 	/acute /mu /paragraph /periodcentered
     /cedilla /onesuperior /ordmasculine /guillemotright
 	/onequarter /onehalf /threequarters /questiondown
-% ^Xx
+% 0300 (192)
     /Agrave /Aacute /Acircumflex /Atilde
 	/Adieresis /Aring /AE /Ccedilla
     /Egrave /Eacute /Ecircumflex /Edieresis
@@ -749,7 +1335,7 @@
 	/Ocircumflex /Otilde /Odieresis /multiply
     /Oslash /Ugrave /Uacute /Ucircumflex
 	/Udieresis /Yacute /Thorn /germandbls
-% ^\\x
+% 0340 (224)
     /agrave /aacute /acircumflex /atilde
 	/adieresis /aring /ae /ccedilla
     /egrave /eacute /ecircumflex /edieresis
@@ -763,21 +1349,16 @@
 
 /reencodeFontISO { %def
   dup
-  length 5 add dict			% Make a new font (a new dict
-					% the same size as the old
-					% one) with room for our new
-					% symbols.
-
-  begin					% Make the new font the
-					% current dictionary.
+  length 5 add dict	% Make a new font (a new dict the same size
+			% as the old one) with room for our new symbols.
+
+  begin			% Make the new font the current dictionary.
 
 
     { 1 index /FID ne
       { def } { pop pop } ifelse
-    } forall				% Copy each of the symbols
-					% from the old dictionary to
-					% the new except for the font
-					% ID.
+    } forall		% Copy each of the symbols from the old dictionary
+			% to the new one except for the font ID.
 
     /Encoding ISOLatin1Encoding def	% Override the encoding with
 					% the ISOLatin1 encoding.
@@ -785,14 +1366,27 @@
     % Use the font's bounding box to determine the ascent, descent,
     % and overall height; don't forget that these values have to be
     % transformed using the font's matrix.
-    FontBBox
-    FontMatrix transform /Ascent exch def pop
+
+%          ^    (x2 y2)
+%          |       |
+%          |       v
+%          |  +----+ - -
+%          |  |    |   ^
+%          |  |    |   | Ascent (usually > 0)
+%          |  |    |   |
+% (0 0) -> +--+----+-------->
+%             |    |   |
+%             |    |   v Descent (usually < 0)
+% (x1 y1) --> +----+ - -
+
+    FontBBox				% -- x1 y1 x2 y2
+    FontMatrix transform /Ascent  exch def pop
     FontMatrix transform /Descent exch def pop
-    /FontHeight Ascent Descent sub def
-
-    % Define these in case they're not in the FontInfo (also, here
-    % they're easier to get to.
-    /UnderlinePosition 1 def
+    /FontHeight Ascent Descent sub def	% use `sub' because descent < 0
+
+    % Define these in case they're not in the FontInfo
+    % (also, here they're easier to get to.
+    /UnderlinePosition  1 def
     /UnderlineThickness 1 def
 
     % Get the underline position and thickness if they're defined.
@@ -813,28 +1407,22 @@
 
     } if
 
-    currentdict				% Leave the new font on the
-					% stack
-
-    end					% Stop using the font as the
-					% current dictionary.
-
-    definefont				% Put the font into the font
-					% dictionary
-
-    pop					% Discard the returned font.
+    currentdict		% Leave the new font on the stack
+    end			% Stop using the font as the current dictionary.
+    definefont		% Put the font into the font dictionary
+    pop			% Discard the returned font.
 } bind def
 
-/Font {
+/DefFont {				% Font definition
   findfont exch scalefont reencodeFontISO
 } def
 
-/F {					% Font select
+/F {					% Font selection
   findfont
-  dup /Ascent get /Ascent exch def
-  dup /Descent get /Descent exch def
-  dup /FontHeight get /FontHeight exch def
-  dup /UnderlinePosition get /UnderlinePosition exch def
+  dup /Ascent             get /Ascent             exch def
+  dup /Descent            get /Descent            exch def
+  dup /FontHeight         get /FontHeight         exch def
+  dup /UnderlinePosition  get /UnderlinePosition  exch def
   dup /UnderlineThickness get /UnderlineThickness exch def
   setfont
 } def
@@ -847,15 +1435,23 @@
   { mark 4 1 roll ] /bgcolor exch def } if
 } def
 
+%  B    width    C
+%   +-----------+
+%               | Ascent  (usually > 0)
+% A +           +
+%               | Descent (usually < 0)
+%   +-----------+
+%  E    width    D
+
 /dobackground {				% width --
-  currentpoint
+  currentpoint				% -- width x y
   gsave
     newpath
-    moveto
-    0 Ascent rmoveto
-    dup 0 rlineto
-    0 Descent Ascent sub rlineto
-    neg 0 rlineto
+    moveto				% A (x y)
+    0 Ascent rmoveto			% B
+    dup 0 rlineto			% C
+    0 Descent Ascent sub rlineto	% D
+    neg 0 rlineto			% E
     closepath
     bgcolor aload pop setrgbcolor
     fill
@@ -878,20 +1474,23 @@
   grestore
 } def
 
-/eolbg {
-  currentpoint pop
-  PrintWidth LeftMargin add exch sub dobackground
+/eolbg {				% dobackground until right margin
+  PrintWidth				% -- x-eol
+  currentpoint pop			% -- cur-x
+  sub					% -- width until eol
+  dobackground
 } def
 
-/eolul {
-  currentpoint exch pop
-  PrintWidth LeftMargin add exch dounderline
+/eolul {				% idem for underline
+  PrintWidth				% -- x-eol
+  currentpoint exch pop			% -- x-eol cur-y
+  dounderline
 } def
 
 /SL {					% Soft Linefeed
   bg { eolbg } if
   ul { eolul } if
-  currentpoint LineHeight sub LeftMargin exch moveto pop
+  0  currentpoint exch pop LineHeight sub  moveto
 } def
 
 /HL /SL load def			% Hard Linefeed
@@ -912,18 +1511,48 @@
 
 /W {
   ul { sp1 } if
-  ( ) stringwidth			% Get the width of a space
-  pop					% Discard the Y component
-  mul					% Multiply the width of a
-					% space by the number of
-					% spaces to plot
+  ( ) stringwidth	% Get the width of a space in the current font.
+  pop			% Discard the Y component.
+  mul			% Multiply the width of a space
+			% by the number of spaces to plot
   bg { dup dobackground } if
   0 rmoveto
   ul { dounderline } if
 } def
 
+/BeginDoc {
+  % ---- save the state of the document (useful for ghostscript!)
+  /docState save def
+  % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7
+  /JackGhostscript where {
+    pop 1 27.7 29.7 div scale
+  } if
+  LandscapeMode {
+    % ---- translate to bottom-right corner of Portrait page
+    LandscapePageHeight 0 translate
+    90 rotate
+    } if
+  /ColumnWidth PrintWidth InterColumn add def
+  % ---- translate to lower left corner of TEXT
+  LeftMargin BottomMargin translate
+  % ---- define where  printing will start
+  /f0 F					% this installs Ascent
+  /PrintStartY PrintHeight Ascent sub def
+  /ColumnIndex 1 def
+} def
+
+/EndDoc {
+  % ---- on last page but not last column, spit out the page
+  ColumnIndex 1 eq not { showpage } if
+  % ---- restore the state of the document (useful for ghostscript!)
+  docState restore
+} def
+
 /BeginDSCPage {
-  /vmstate save def
+  % ---- when 1st column, save the state of the page
+  ColumnIndex 1 eq { /pageState save def } if
+  % ---- save the state of the column
+  /columnState save def
 } def
 
 /BeginPage {
@@ -931,71 +1560,90 @@
     PrintHeaderFrame { HeaderFrame } if
     HeaderText
   } if
-  LeftMargin
-  BottomMargin PrintHeight add
-  moveto				% move to where printing will
-					% start.
+  0 PrintStartY moveto			% move to where printing will start
 } def
 
 /EndPage {
   bg { eolbg } if
   ul { eolul } if
-  showpage				% Spit out a page
 } def
 
 /EndDSCPage {
-  vmstate restore
+  ColumnIndex NumberOfColumns eq {
+    % ---- on last column, spit out the page
+    showpage
+    % ---- restore the state of the page
+    pageState restore
+    /ColumnIndex 1 def
+  } { % else
+    % ---- restore the state of the current column
+    columnState restore
+    % ---- and translate to the next column
+    ColumnWidth 0 translate
+    /ColumnIndex ColumnIndex 1 add def
+  } ifelse
 } def
 
 /ul false def
 
 /UL { /ul exch def } def
 
-/h0 14 /Helvetica-Bold Font
-/h1 12 /Helvetica Font
-
-/h1 F
-
-/HeaderLineHeight FontHeight def
-/HeaderDescent Descent def
-/HeaderPad 2 def
-
-/SetHeaderLines {
-  /HeaderOffset TopMargin 2 div def
+/SetHeaderLines {			% nb-lines --
   /HeaderLines exch def
-  /HeaderHeight HeaderLines HeaderLineHeight mul HeaderPad 2 mul add def
-  /PrintHeight PrintHeight HeaderHeight sub def
+  % ---- bottom up
+  HeaderPad
+  HeaderLines 1 sub HeaderLineHeight mul add
+  HeaderTitleLineHeight add
+  HeaderPad add
+  /HeaderHeight exch def
 } def
 
-/HeaderFrameStart {
-  LeftMargin BottomMargin PrintHeight add HeaderOffset add
+% |---------|
+% |  tm     |
+% |---------|
+% |  header |
+% |-+-------| <-- (x y)
+% |  ho     |
+% |---------|
+% |  text   |
+% |-+-------| <-- (0 0)
+% |  bm     |
+% |---------|
+
+/HeaderFrameStart {			% -- x y
+  0  PrintHeight HeaderOffset add
 } def
 
 /HeaderFramePath {
-  PrintWidth 0 rlineto
-  0 HeaderHeight rlineto
-  PrintWidth neg 0 rlineto
-  0 HeaderHeight neg rlineto
+  PrintWidth	 0			rlineto
+  0		 HeaderHeight		rlineto
+  PrintWidth neg 0			rlineto
+  0		 HeaderHeight neg	rlineto
 } def
 
 /HeaderFrame {
   gsave
     0.4 setlinewidth
+    % ---- fill a black rectangle (the shadow of the next one)
     HeaderFrameStart moveto
     1 -1 rmoveto
     HeaderFramePath
     0 setgray fill
+    % ---- do the next rectangle ...
     HeaderFrameStart moveto
     HeaderFramePath
-    gsave 0.9 setgray fill grestore
-    gsave 0 setgray stroke grestore
+    gsave 0.9 setgray fill grestore	% filled with grey
+    gsave 0 setgray stroke grestore	% drawn  with black
   grestore
 } def
 
 /HeaderStart {
   HeaderFrameStart
-  exch HeaderPad add exch
-  HeaderLineHeight HeaderLines 1 sub mul add HeaderDescent sub HeaderPad add
+  exch HeaderPad add exch	% horizontal pad
+  % ---- bottom up
+  HeaderPad add			% vertical   pad
+  HeaderDescent sub
+  HeaderLineHeight HeaderLines 1 sub mul add
 } def
 
 /strcat {
@@ -1015,10 +1663,14 @@
 /HeaderText {
   HeaderStart moveto
 
-  HeaderLinesRight HeaderLinesLeft
+  HeaderLinesRight HeaderLinesLeft	% -- rightLines leftLines
+
+  % ---- hack: `PN 1 and'  ==  `PN 2 modulo'
+
+  % ---- if duplex and even page number, then exchange left and right
   Duplex PageNumber 1 and 0 eq and { exch } if
 
-  {
+  { % ---- process the left lines
     aload pop
     exch F
     gsave
@@ -1030,7 +1682,7 @@
 
   HeaderStart moveto
 
-   {
+  { % ---- process the right lines
     aload pop
     exch F
     gsave
@@ -1045,15 +1697,14 @@
 
 /ReportFontInfo {
   2 copy
-  /t0 3 1 roll Font
+  /t0 3 1 roll DefFont
   /t0 F
   /lh FontHeight def
   /sw ( ) stringwidth pop def
   /aw (01234567890abcdefghijklmnopqrstuvwxyz) dup length exch
   stringwidth pop exch div def
-  /t1 12 /Helvetica-Oblique Font
+  /t1 12 /Helvetica-Oblique DefFont
   /t1 F
-  72 72 moveto
   gsave
     (For ) show
     128 string cvs show
@@ -1066,13 +1717,43 @@
     (,) show
   grestore
   0 FontHeight neg rmoveto
-  (and a crude estimate of average character width is ) show
-  aw 32 string cvs show
-  (.) show
-  showpage
+  gsave
+    (and a crude estimate of average character width is ) show
+    aw 32 string cvs show
+    (.) show
+  grestore
+  0 FontHeight neg rmoveto
+} def
+
+/cm { % cm to point
+  72 mul 2.54 div
+} def
+
+/ReportAllFontInfo {
+  FontDirectory
+  { % key = font name  value = font dictionary
+    pop 10 exch ReportFontInfo
+  } forall
 } def
 
-% 10 /Courier ReportFontInfo
+% 3 cm 20 cm moveto  10 /Courier ReportFontInfo  showpage
+% 3 cm 20 cm moveto  ReportAllFontInfo           showpage
+
+")
+
+(defvar ps-print-prologue-2
+  "
+% ---- These lines must be kept together because...
+
+/h0 F
+/HeaderTitleLineHeight FontHeight def
+
+/h1 F
+/HeaderLineHeight FontHeight def
+/HeaderDescent    Descent def
+
+% ---- ...because `F' has a side-effect on `FontHeight' and `Descent'
+
 ")
 
 ;; Start Editing Here:
@@ -1095,64 +1776,39 @@
 
 (defvar ps-razchunk 0)
 
-(defvar ps-color-format (if (eq ps-print-emacs-type 'emacs)
-
-			    ;;Emacs understands the %f format; we'll
-			    ;;use it to limit color RGB values to
-			    ;;three decimals to cut down some on the
-			    ;;size of the PostScript output.
-			    "%0.3f %0.3f %0.3f"
-
-			  ;; Lucid emacsen will have to make do with
-			  ;; %s (princ) for floats.
-			  "%s %s %s"))
+(defvar ps-color-format
+  (if (eq ps-print-emacs-type 'emacs)
+
+    ;;Emacs understands the %f format; we'll
+    ;;use it to limit color RGB values to
+    ;;three decimals to cut down some on the
+    ;;size of the PostScript output.
+    "%0.3f %0.3f %0.3f"
+
+    ;; Lucid emacsen will have to make do with
+    ;; %s (princ) for floats.
+    "%s %s %s"))
 
 ;; These values determine how much print-height to deduct when headers
 ;; are turned on.  This is a pretty clumsy way of handling it, but
 ;; it'll do for now.
-(defvar ps-header-title-line-height (if (fboundp 'float) 16.0 16));Helvetica 14
-(defvar ps-header-line-height (if (fboundp 'float) 13.7 14));Helvetica 12
-(defvar ps-header-pad 2)
-
-;; LetterSmall 7.68 inch 10.16 inch
-;; Tabloid 11.0 inch 17.0 inch
-;; Ledger 17.0 inch 11.0 inch
-;; Statement 5.5 inch 8.5 inch
-;; Executive 7.5 inch 10.0 inch
-;; A3 11.69 inch 16.5 inch
-;; A4Small 7.47 inch 10.85 inch
-;; B4 10.125 inch 14.33 inch
-;; B5 7.16 inch 10.125 inch
-
-;; All page dimensions are in PostScript points.
-
-(defvar ps-left-margin 72)		; 1 inch
-(defvar ps-right-margin 72)		; 1 inch
-(defvar ps-bottom-margin 36)		; 1/2 inch
-(defvar ps-top-margin 72)		; 1 inch
-
-;; Letter 8.5 inch x 11.0 inch
-(defvar ps-letter-page-height 792)	; 11 inches
-(defvar ps-letter-page-width 612)	; 8.5 inches
-
-;; Legal 8.5 inch x 14.0 inch
-(defvar ps-legal-page-height 1008)	; 14.0 inches
-(defvar ps-legal-page-width 612)	; 8.5 inches
-
-;; A4 8.26 inch x 11.69 inch
-(defvar ps-a4-page-height 842)	; 11.69 inches
-(defvar ps-a4-page-width 595)	; 8.26 inches
-
-(defvar ps-pages-alist
-  (list (list 'ps-letter ps-letter-page-width ps-letter-page-height)
-	(list 'ps-legal ps-legal-page-width ps-legal-page-height)
-	(list 'ps-a4 ps-a4-page-width ps-a4-page-height)))
-
-;; Define some constants to index into the page lists.
-(defvar ps-page-width-i 1)
-(defvar ps-page-height-i 2)
-
-(defvar ps-page-dimensions nil)
+
+(defvar ps-header-font)
+(defvar ps-header-title-font)
+
+(defvar ps-header-line-height)
+(defvar ps-header-title-line-height)
+(defvar ps-header-pad 0
+  "Vertical and horizontal space in points (1/72 inch) between the header frame
+and the text it contains.")
+
+;; Define accessors to the dimensions list.
+
+(defmacro ps-page-dimensions-get-width  (dims) `(nth 0 ,dims))
+(defmacro ps-page-dimensions-get-height (dims) `(nth 1 ,dims))
+
+(defvar ps-landscape-page-height)
+
 (defvar ps-print-width nil)
 (defvar ps-print-height nil)
 
@@ -1163,15 +1819,239 @@
 (defvar ps-ref-italic-faces nil)
 (defvar ps-ref-underlined-faces nil)
 
+(defvar ps-print-color-scale nil)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Internal functions
 
+(defun ps-line-lengths-internal ()
+  "Display the correspondance between a line length and a font size,
+using the current ps-print setup.
+Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head"
+  (let ((buf (get-buffer-create "*Line-lengths*"))
+	(ifs ps-font-size)		; initial font size
+	(icw ps-avg-char-width)		; initial character width
+	(print-width (progn (ps-get-page-dimensions)
+			    ps-print-width))
+	(ps-setup (ps-setup))		; setup for the current buffer
+	(fs-min 5)			; minimum font size
+	cw-min				; minimum character width
+	nb-cpl-max			; maximum nb of characters per line
+	(fs-max 14)			; maximum font size
+	cw-max				; maximum character width
+	nb-cpl-min			; minimum nb of characters per line
+	fs				; current font size
+	cw				; current character width
+	nb-cpl				; current nb of characters per line
+	)
+    (setq cw-min     (/ (* icw fs-min) ifs)
+	  nb-cpl-max (floor (/ print-width cw-min))
+	  cw-max     (/ (* icw fs-max) ifs)
+	  nb-cpl-min (floor (/ print-width cw-max)))
+    (setq nb-cpl nb-cpl-min)
+    (set-buffer buf)
+    (goto-char (point-max))
+    (if (not (bolp)) (insert "\n"))
+    (insert ps-setup)
+    (insert "nb char per line / font size\n")
+    (while (<= nb-cpl nb-cpl-max)
+      (setq cw     (/ print-width (float nb-cpl))
+	    fs     (/ (* ifs cw) icw))
+      (insert (format "%3s %s\n" nb-cpl fs))
+      (setq nb-cpl (1+ nb-cpl)))
+    (insert "\n")
+    (display-buffer buf 'not-this-window)))
+
+(defun ps-nb-pages (nb-lines)
+  "Display an approximate correspondance between a font size and the number
+of pages the number of lines would require to print
+using the current ps-print setup."
+  (let ((buf (get-buffer-create "*Nb-Pages*"))
+	(ifs ps-font-size)		; initial font size
+	(ilh ps-line-height)		; initial line height
+	(page-height (progn (ps-get-page-dimensions)
+			    ps-print-height))
+	(ps-setup (ps-setup))		; setup for the current buffer
+	(fs-min 4)			; minimum font size
+	lh-min				; minimum line height
+	nb-lpp-max			; maximum nb of lines per page
+	nb-page-min			; minimum nb of pages
+	(fs-max 14)			; maximum font size
+	lh-max				; maximum line height
+	nb-lpp-min			; minimum nb of lines per page
+	nb-page-max			; maximum nb of pages
+	fs				; current font size
+	lh				; current line height
+	nb-lpp				; current nb of lines per page
+	nb-page				; current nb of pages
+	)
+    (setq lh-min      (/ (* ilh fs-min) ifs)
+	  nb-lpp-max  (floor (/ page-height lh-min))
+	  nb-page-min (ceiling (/ (float nb-lines) nb-lpp-max))
+	  lh-max      (/ (* ilh fs-max) ifs)
+	  nb-lpp-min  (floor (/ page-height lh-max))
+	  nb-page-max (ceiling (/ (float nb-lines) nb-lpp-min)))
+    (setq nb-page nb-page-min)
+    (set-buffer buf)
+    (goto-char (point-max))
+    (if (not (bolp)) (insert "\n"))
+    (insert ps-setup)
+    (insert (format "%d lines\n" nb-lines))
+    (insert "nb page / font size\n")
+    (while (<= nb-page nb-page-max)
+      (setq nb-lpp (ceiling (/ nb-lines (float nb-page)))
+	    lh     (/ page-height nb-lpp)
+	    fs     (/ (* ifs lh) ilh))
+      (insert (format "%s %s\n" nb-page fs))
+      (setq nb-page (1+ nb-page)))
+    (insert "\n")
+    (display-buffer buf 'not-this-window)))
+
+(defun ps-select-font ()
+  "Choose the font name and size (scaling data)."
+  (let ((assoc (assq ps-font-family ps-font-info-database))
+	l fn fb fi bi sz lh sw aw)
+    (if (null assoc)
+	(error "Don't have data to scale font %s. Known fonts families are %s"
+	       ps-font-family
+	       (mapcar 'car ps-font-info-database)))
+    (setq l  (cdr assoc)
+	  fn (prog1 (car l) (setq l (cdr l))) ; need `pop'
+	  fb (prog1 (car l) (setq l (cdr l)))
+	  fi (prog1 (car l) (setq l (cdr l)))
+	  bi (prog1 (car l) (setq l (cdr l)))
+	  sz (prog1 (car l) (setq l (cdr l)))
+	  lh (prog1 (car l) (setq l (cdr l)))
+	  sw (prog1 (car l) (setq l (cdr l)))
+	  aw (prog1 (car l) (setq l (cdr l))))
+
+    (setq ps-font             fn)
+    (setq ps-font-bold        fb)
+    (setq ps-font-italic      fi)
+    (setq ps-font-bold-italic bi)
+    ;; These data just need to be rescaled:
+    (setq ps-line-height    (/ (* lh ps-font-size) sz))
+    (setq ps-space-width    (/ (* sw ps-font-size) sz))
+    (setq ps-avg-char-width (/ (* aw ps-font-size) sz))
+    ps-font-family))
+
+(defun ps-select-header-font ()
+  "Choose the font name and size (scaling data) for the header."
+  (let ((assoc (assq ps-header-font-family ps-font-info-database))
+	l fn fb fi bi sz lh sw aw)
+    (if (null assoc)
+	(error "Don't have data to scale font %s. Known fonts families are %s"
+	       ps-font-family
+	       (mapcar 'car ps-font-info-database)))
+    (setq l  (cdr assoc)
+	  fn (prog1 (car l) (setq l (cdr l))) ; need `pop'
+	  fb (prog1 (car l) (setq l (cdr l)))
+	  fi (prog1 (car l) (setq l (cdr l)))
+	  bi (prog1 (car l) (setq l (cdr l)))
+	  sz (prog1 (car l) (setq l (cdr l)))
+	  lh (prog1 (car l) (setq l (cdr l)))
+	  sw (prog1 (car l) (setq l (cdr l)))
+	  aw (prog1 (car l) (setq l (cdr l))))
+
+    ;; Font name
+    (setq ps-header-font             fn)
+    (setq ps-header-title-font       fb)
+    ;; Line height: These data just need to be rescaled:
+    (setq ps-header-title-line-height (/ (* lh ps-header-title-font-size) sz))
+    (setq ps-header-line-height       (/ (* lh ps-header-font-size)       sz))
+    ps-header-font-family))
+
 (defun ps-get-page-dimensions ()
-  (setq ps-page-dimensions (assq ps-paper-type ps-pages-alist))
-  (let ((ps-page-width (nth ps-page-width-i ps-page-dimensions))
-	(ps-page-height (nth ps-page-height-i ps-page-dimensions)))
-    (setq ps-print-height (- ps-page-height ps-top-margin ps-bottom-margin))
-    (setq ps-print-width (- ps-page-width ps-left-margin ps-right-margin))))
+  (let ((page-dimensions (cdr (assq ps-paper-type ps-page-dimensions-database)))
+	page-width page-height)
+    (cond
+     ((null page-dimensions)
+      (error "`ps-paper-type' must be one of:\n%s"
+	     (mapcar 'car ps-page-dimensions-database)))
+     ((< ps-number-of-columns 1)
+      (error "The number of columns %d should not be negative")))
+
+    (ps-select-font)
+    (ps-select-header-font)
+
+    (setq page-width  (ps-page-dimensions-get-width  page-dimensions)
+	  page-height (ps-page-dimensions-get-height page-dimensions))
+
+    ;; Landscape mode
+    (if ps-landscape-mode
+	;; exchange width and height
+	(setq page-width (prog1 page-height (setq page-height page-width))))
+
+    ;; It is used to get the lower right corner (only in landscape mode)
+    (setq ps-landscape-page-height page-height)
+
+    ;; | lm | text | ic | text | ic | text | rm |
+    ;; page-width == lm  +  n * pw  +  (n - 1) * ic  +  rm
+    ;; => pw == (page-width - lm -rm - (n - 1) * ic) / n
+    (setq ps-print-width
+	  (/ (- page-width
+		ps-left-margin ps-right-margin
+		(* (1- ps-number-of-columns) ps-inter-column))
+	     ps-number-of-columns))
+    (if (<= ps-print-width 0)
+	(error "Bad horizontal layout:
+page-width           == %s
+ps-left-margin       == %s
+ps-right-margin      == %s
+ps-inter-column      == %s
+ps-number-of-columns == %s
+| lm | text | ic | text | ic | text | rm |
+page-width == lm  +  n * print-width  +  (n - 1) * ic  +  rm
+=> print-width == %d !"
+	       page-width
+	       ps-left-margin
+	       ps-right-margin
+	       ps-inter-column
+	       ps-number-of-columns
+	       ps-print-width))
+
+    (setq ps-print-height
+	  (- page-height ps-bottom-margin ps-top-margin))
+    (if (<= ps-print-height 0)
+	(error "Bad vertical layout:
+ps-top-margin    == %s
+ps-bottom-margin == %s
+page-height == bm + print-height + tm
+=> print-height == %d !"
+	       ps-top-margin
+	       ps-bottom-margin
+	       ps-print-height))
+    ;; If headers are turned on, deduct the height of the header from
+    ;; the print height.
+    (cond
+     (ps-print-header
+      (setq ps-header-pad
+	    (* ps-header-line-pad ps-header-title-line-height))
+      (setq ps-print-height
+	    (- ps-print-height
+	       ps-header-offset
+	       ps-header-pad
+	       ps-header-title-line-height
+	       (* ps-header-line-height (- ps-header-lines 1))
+	       ps-header-pad))))
+    (if (<= ps-print-height 0)
+	(error "Bad vertical layout:
+ps-top-margin    == %s
+ps-bottom-margin == %s
+ps-header-offset == %s
+ps-header-pad    == %s
+header-height    == %s
+page-height == bm + print-height + tm - ho - hh
+=> print-height == %d !"
+	       ps-top-margin
+	       ps-bottom-margin
+	       ps-header-offset
+	       ps-header-pad
+	       (+ ps-header-pad
+		  ps-header-title-line-height
+		  (* ps-header-line-height (- ps-header-lines 1))
+		  ps-header-pad)
+	       ps-print-height))))
 
 (defun ps-print-preprint (&optional filename)
   (if (and filename
@@ -1284,6 +2164,7 @@
   (ps-output (format "/%s %s def\n" name (if bool "true" "false"))))
 
 (defun ps-begin-file ()
+  (ps-get-page-dimensions)
   (setq ps-showpage-count 0)
 
   (ps-output ps-adobe-tag)
@@ -1292,36 +2173,53 @@
   (ps-output "%%Creator: " (user-full-name) "\n")
   (ps-output "%%CreationDate: " 
 	     (time-stamp-hh:mm:ss) " " (time-stamp-mon-dd-yyyy) "\n")
-  (ps-output "%% DocumentFonts: Helvetica Helvetica-Bold "
+  (ps-output "%% DocumentFonts: "
 	     ps-font " " ps-font-bold " " ps-font-italic " "
-	     ps-font-bold-italic "\n")
+	     ps-font-bold-italic " "
+	     ps-header-font " " ps-header-title-font "\n")
   (ps-output "%%Pages: (atend)\n")
   (ps-output "%%EndComments\n\n")
 
-  (ps-output-boolean "Duplex" ps-spool-duplex)
-  (ps-output-boolean "PrintHeader" ps-print-header)
+  (ps-output-boolean "LandscapeMode"             ps-landscape-mode)
+  (ps-output (format "/NumberOfColumns %d def\n" ps-number-of-columns))
+
+  (ps-output (format "/LandscapePageHeight %s def\n" ps-landscape-page-height))
+  (ps-output (format "/PrintWidth   %s def\n" ps-print-width))
+  (ps-output (format "/PrintHeight  %s def\n" ps-print-height))
+
+  (ps-output (format "/LeftMargin   %s def\n" ps-left-margin))
+  (ps-output (format "/RightMargin  %s def\n" ps-right-margin)) ; not used
+  (ps-output (format "/InterColumn  %s def\n" ps-inter-column))
+
+  (ps-output (format "/BottomMargin %s def\n" ps-bottom-margin))
+  (ps-output (format "/TopMargin    %s def\n" ps-top-margin)) ; not used
+  (ps-output (format "/HeaderOffset %s def\n" ps-header-offset))
+  (ps-output (format "/HeaderPad    %s def\n" ps-header-pad))
+  
+  (ps-output-boolean "PrintHeader"      ps-print-header)
   (ps-output-boolean "PrintHeaderFrame" ps-print-header-frame)
-  (ps-output-boolean "ShowNofN" ps-show-n-of-n)
-
-  (ps-output (format "/LeftMargin %d def\n" ps-left-margin))
-  (ps-output (format "/RightMargin %d def\n" ps-right-margin))
-  (ps-output (format "/BottomMargin %d def\n" ps-bottom-margin))
-  (ps-output (format "/TopMargin %d def\n" ps-top-margin))
-
-  (ps-get-page-dimensions)
-  (ps-output (format "/PrintWidth %d def\n" ps-print-width))
-  (ps-output (format "/PrintHeight %d def\n" ps-print-height))
-  
-  (ps-output (format "/LineHeight %s def\n" ps-line-height))
-  
-  (ps-output ps-print-prologue)
-
-  (ps-output (format "/f0 %d /%s Font\n" ps-font-size ps-font))
-  (ps-output (format "/f1 %d /%s Font\n" ps-font-size ps-font-bold))
-  (ps-output (format "/f2 %d /%s Font\n" ps-font-size ps-font-italic))
-  (ps-output (format "/f3 %d /%s Font\n" ps-font-size
-		     ps-font-bold-italic))
-
+  (ps-output-boolean "ShowNofN"         ps-show-n-of-n)
+  (ps-output-boolean "Duplex"           ps-spool-duplex)
+
+  (ps-output (format "/LineHeight   %s def\n" ps-line-height))
+
+  (ps-output ps-print-prologue-1)
+
+  ;; Header fonts
+  (ps-output				; /h0 14 /Helvetica-Bold Font
+   (format "/h0 %s /%s DefFont\n" ps-header-title-font-size ps-header-title-font))
+  (ps-output				; /h1 12 /Helvetica Font
+   (format "/h1 %s /%s DefFont\n" ps-header-font-size       ps-header-font))
+
+  (ps-output ps-print-prologue-2)
+
+  ;; Text fonts
+  (ps-output (format "/f0 %s /%s DefFont\n" ps-font-size ps-font))
+  (ps-output (format "/f1 %s /%s DefFont\n" ps-font-size ps-font-bold))
+  (ps-output (format "/f2 %s /%s DefFont\n" ps-font-size ps-font-italic))
+  (ps-output (format "/f3 %s /%s DefFont\n" ps-font-size ps-font-bold-italic))
+
+  (ps-output "\nBeginDoc\n\n")
   (ps-output "%%EndPrologue\n"))
 
 (defun ps-header-dirpart ()
@@ -1333,17 +2231,23 @@
       "")))
 
 (defun ps-get-buffer-name ()
-  ;; Indulge me this little easter egg:
-  (if (string= (buffer-name) "ps-print.el")
-      "Hey, Cool!  It's ps-print.el!!!"
-    (buffer-name)))
+  (cond
+   ;; Indulge Jim this little easter egg:
+   ((string= (buffer-name) "ps-print.el")
+    "Hey, Cool!  It's ps-print.el!!!")
+   ;; Indulge Jack this other little easter egg:
+   ((string= (buffer-name) "sokoban.el")
+    "Super! C'est sokoban.el!")
+   (t (buffer-name))))
 
 (defun ps-begin-job ()
   (setq ps-page-count 0))
 
 (defun ps-end-file ()
+  (ps-output "\nEndDoc\n\n")
   (ps-output "%%Trailer\n")
-  (ps-output "%%Pages: " (format "%d\n" ps-showpage-count)))
+  (ps-output (format "%%%%Pages: %d\n" (1+ (/ (1- ps-page-count)
+					      ps-number-of-columns)))))
 
 (defun ps-next-page ()
   (ps-end-page)
@@ -1352,36 +2256,28 @@
 
 (defun ps-begin-page (&optional dummypage)
   (ps-get-page-dimensions)
-  (setq ps-width-remaining ps-print-width)
+  (setq ps-width-remaining  ps-print-width)
   (setq ps-height-remaining ps-print-height)
 
-  ;; If headers are turned on, deduct the height of the header from
-  ;; the print height remaining.  Clumsy clumsy clumsy.
-  (if ps-print-header
-      (setq ps-height-remaining
-	    (- ps-height-remaining
-	       ps-header-title-line-height
-	       (* ps-header-line-height (- ps-header-lines 1))
-	       (* 2 ps-header-pad))))
-
-  (setq ps-page-count (+ ps-page-count 1))
-
-  (ps-output "\n%%Page: " 
-	     (format "%d %d\n" ps-page-count (+ 1 ps-showpage-count)))
+  ;; Print only when a new real page begins.
+  (when (zerop (mod ps-page-count ps-number-of-columns))
+    (ps-output (format "\n%%%%Page: %d %d\n"
+		       (1+ (/ ps-page-count ps-number-of-columns))
+		       (1+ (/ ps-page-count ps-number-of-columns)))))
+
   (ps-output "BeginDSCPage\n")
-  (ps-output (format "/PageNumber %d def\n" ps-page-count))
+  (ps-output (format "/PageNumber %d def\n" (incf ps-page-count)))
   (ps-output "/PageCount 0 def\n")
 
-  (if ps-print-header
-      (progn
-	(ps-generate-header "HeaderLinesLeft" ps-left-header)
-	(ps-generate-header "HeaderLinesRight" ps-right-header)
-	(ps-output (format "%d SetHeaderLines\n" ps-header-lines))))
+  (when ps-print-header
+    (ps-generate-header "HeaderLinesLeft"    ps-left-header)
+    (ps-generate-header "HeaderLinesRight"   ps-right-header)
+    (ps-output (format "%d SetHeaderLines\n" ps-header-lines)))
 
   (ps-output "BeginPage\n")
-  (ps-set-font ps-current-font)
-  (ps-set-bg ps-current-bg)
-  (ps-set-color ps-current-color)
+  (ps-set-font      ps-current-font)
+  (ps-set-bg        ps-current-bg)
+  (ps-set-color     ps-current-color)
   (ps-set-underline ps-current-underline-p))
 
 (defun ps-end-page ()
@@ -1401,17 +2297,19 @@
 (defun ps-next-line ()
   (if (< ps-height-remaining ps-line-height)
       (ps-next-page)
-    (setq ps-width-remaining ps-print-width)
+    (setq ps-width-remaining  ps-print-width)
     (setq ps-height-remaining (- ps-height-remaining ps-line-height))
     (ps-hard-lf)))
 
 (defun ps-continue-line ()
   (if (< ps-height-remaining ps-line-height)
       (ps-next-page)
-    (setq ps-width-remaining ps-print-width)
+    (setq ps-width-remaining  ps-print-width)
     (setq ps-height-remaining (- ps-height-remaining ps-line-height))
     (ps-soft-lf)))
 
+;; [jack] Why hard and soft ?
+
 (defun ps-hard-lf ()
   (ps-output "HL\n"))
 
@@ -1430,7 +2328,7 @@
 	 (to (car wrappoint))
 	 (string (buffer-substring from to)))
     (ps-output-string string)
-    (ps-output " S\n")			;
+    (ps-output " S\n")
     wrappoint))
 
 (defun ps-basic-plot-whitespace (from to &optional bg-color)
@@ -1461,14 +2359,12 @@
 		    (if (< q-todo 100)
 			(/ (* 100 q-done) q-todo)
 		      (/ q-done (/ q-todo 100))))
-	      (message "Formatting...%d%%" foo))))))
+	      (message "Formatting...%3d%%" foo))))))
 
 (defun ps-set-font (font)
   (setq ps-current-font font)
   (ps-output (format "/f%d F\n" ps-current-font)))
 
-(defvar ps-print-color-scale nil)
-
 (defun ps-set-bg (color)
   (if (setq ps-current-bg color)
       (ps-output (format ps-color-format (nth 0 color) (nth 1 color)
@@ -1548,11 +2444,8 @@
 (defun ps-color-values (x-color)
   (cond ((fboundp 'x-color-values)
 	 (x-color-values x-color))
-        ;; From fsf 19.33
-        ;; ((fboundp 'pixel-components)
-	;;  (pixel-components x-color))
 	((and (fboundp 'color-instance-rgb-components)
-	      (xemacs-color-device))
+	      (ps-color-device))
 	 (color-instance-rgb-components
 	  (if (color-instance-p x-color) x-color
 	    (if (color-specifier-p x-color)
@@ -1597,13 +2490,13 @@
 	     (foreground (nth 3 face-attr))
 	     (background (nth 4 face-attr))
 	     (fg-color (if (and ps-print-color-p
-				(xemacs-color-device) 
+				(ps-color-device) 
 				foreground)
 			   (mapcar 'ps-color-value
 				   (ps-color-values foreground))
 			 ps-default-color))
 	     (bg-color (if (and ps-print-color-p
-				(xemacs-color-device)
+				(ps-color-device)
 				background)
 			   (mapcar 'ps-color-value
 				   (ps-color-values background)))))
@@ -1630,9 +2523,6 @@
      (memq face kind-list))))
 
 (defun ps-xemacs-face-kind-p (face kind kind-regex kind-list)
-  ;; fsf 19.33:
-  ;; (let* ((frame-font (or (face-font face) (face-font 'default)))
-  ;;       (kind-cons (assq kind (x-font-properties frame-font)))
   (let* ((frame-font
 	  (or (face-font-instance face) (face-font-instance 'default)))
 	 (kind-cons (and frame-font
@@ -1694,17 +2584,14 @@
                     (list (extent-end-position extent) 'pull extent)))
   nil)
 
-(defun ps-sorter (a b)
-  (< (car a) (car b)))
-
 (defun ps-extent-sorter (a b)
   (< (extent-priority a) (extent-priority b)))
 
 (defun ps-print-ensure-fontified (start end)
   (if (and (boundp 'lazy-lock-mode) lazy-lock-mode)
       (if (fboundp 'lazy-lock-fontify-region)
-          (lazy-lock-fontify-region start end)
-        (lazy-lock-fontify-buffer))))
+          (lazy-lock-fontify-region start end) ; the new
+        (lazy-lock-fontify-buffer))))	       ; the old
 
 (defun ps-generate-postscript-with-faces (from to)
   ;; Build the reference lists of faces if necessary.
@@ -1717,7 +2604,7 @@
   ;; that ps-print can be dumped into emacs.  This expression can't be
   ;; evaluated at dump-time because X isn't initialized.
   (setq ps-print-color-scale
-	(if (and ps-print-color-p (xemacs-color-device))
+	(if (and ps-print-color-p (ps-color-device))
 	    (float (car (ps-color-values "white")))
 	  1.0))
   ;; Generate some PostScript.
@@ -1726,13 +2613,13 @@
     (let ((face 'default)
 	  (position to))
       (ps-print-ensure-fontified from to)
-      (cond ((or (eq ps-print-emacs-type 'lucid) (eq ps-print-emacs-type 'xemacs))
+      (cond ((or (eq ps-print-emacs-type 'lucid)
+		 (eq ps-print-emacs-type 'xemacs))
 	   ;; Build the list of extents...
 	   (let ((a (cons 'dummy nil))
 		 record type extent extent-list)
 	     (map-extents 'ps-mapper nil from to a)
-	     (setq a (cdr a))
-	     (setq a (sort a 'ps-sorter))
+	     (setq a (sort (cdr a) 'car-less-than-car))
 	   
 	     (setq extent-list nil)
 	   
@@ -1843,7 +2730,7 @@
     (save-restriction
       (narrow-to-region from to)
       (if ps-razzle-dazzle
-	  (message "Formatting...%d%%" (setq ps-razchunk 0)))
+	  (message "Formatting...%3d%%" (setq ps-razchunk 0)))
       (set-buffer buffer)
       (setq ps-source-buffer buffer)
       (setq ps-spool-buffer (get-buffer-create ps-spool-buffer-name))
@@ -1899,13 +2786,10 @@
       (if ps-razzle-dazzle
 	  (message "Formatting...done")))))
 
-;; XEmacs change
-(require 'message)	; Until We can get some sensible autoloads, or
-			; message-flatten-list gets put somewhere decent.
 ;; Permit dynamic evaluation at print time of ps-lpr-switches
 (defun ps-do-despool (filename)
   (if (or (not (boundp 'ps-spool-buffer))
-	  (not ps-spool-buffer))
+	  (not (symbol-value 'ps-spool-buffer)))
       (message "No spooled PostScript to print")
     (ps-end-file)
     (ps-flush-output)
@@ -1926,15 +2810,8 @@
 	(if (and (eq system-type 'ms-dos) (stringp dos-ps-printer))
 	    (write-region (point-min) (point-max) dos-ps-printer t 0)
 	  (let ((binary-process-input t)  ; for MS-DOS
-		(ps-lpr-sw (message-flatten-list    ; XEmacs
-			    (mapcar '(lambda (arg)  ; Dynamic evaluation
-				       (cond ((stringp arg) arg)
-					     ((functionp arg) (apply arg nil))
-					     ((symbolp arg) (eval arg))
-					     ((consp arg) (apply (car arg)
-								 (cdr arg)))
-					     (t nil)))
-				    ps-lpr-switches))))
+		(ps-lpr-sw ; Dynamic evaluation
+		 (ps-flatten-list (mapcar 'ps-eval-switch ps-lpr-switches))))
 	    (apply 'call-process-region
 		   (point-min) (point-max) ps-lpr-command nil
 		   (if (fboundp 'start-process) 0 nil)
@@ -1944,6 +2821,32 @@
 	  (message "Printing...done")))
     (kill-buffer ps-spool-buffer)))
 
+;; Dynamic evaluation
+(defun ps-eval-switch (arg)
+  (cond ((stringp arg) arg)
+	((functionp arg) (apply arg nil))
+	((symbolp arg) (symbol-value arg))
+	((consp arg) (apply (car arg) (cdr arg)))
+	(t nil)))
+
+;; `ps-flatten-list' is defined here (copied from "message.el" and
+;; enhanced to handle dotted pairs as well) until we can get some
+;; sensible autoloads, or `flatten-list' gets put somewhere decent.
+
+;; (ps-flatten-list '((a . b) c (d . e) (f g h) i . j))
+;; => (a b c d e f g h i j)
+
+(defun ps-flatten-list (&rest list)
+  (ps-flatten-list-1 list))
+
+(defun ps-flatten-list-1 (list)
+  (cond
+    ((null list) (list))
+    ((consp list)
+     (append (ps-flatten-list-1 (car list))
+	     (ps-flatten-list-1 (cdr list))))
+    (t (list list))))
+
 (defun ps-kill-emacs-check ()
   (let (ps-buffer)
     (if (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
@@ -2057,9 +2960,9 @@
 ;; same thing for vm.
 (defun ps-vm-print-message-from-summary ()
   (interactive)
-  (if vm-mail-buffer
+  (if (and (boundp 'vm-mail-buffer) (symbol-value 'vm-mail-buffer))
       (save-excursion
-	(set-buffer vm-mail-buffer)
+	(set-buffer (symbol-value 'vm-mail-buffer))
 	(ps-spool-buffer-with-faces))))
 
 ;; A hook to bind to bind to gnus-summary-setup-buffer to locally bind
@@ -2092,8 +2995,8 @@
 
 ;; WARNING! The following function is a *sample* only, and is *not*
 ;; meant to be used as a whole unless you understand what the effects
-;; will be!  (In fact, this is a copy if my setup for ps-print -- I'd
-;; be very surprised if it was useful to *anybody*, without
+;; will be!  (In fact, this is a copy of Jim's setup for ps-print --
+;; I'd be very surprised if it was useful to *anybody*, without
 ;; modification.)
 
 (defun ps-jts-ps-setup ()
@@ -2108,7 +3011,43 @@
   (setq ps-spool-duplex t)
   (setq ps-print-color-p nil)
   (setq ps-lpr-command "lpr")
-  (setq ps-lpr-switches '("-Jjct,duplex_long")))
+  (setq ps-lpr-switches '("-Jjct,duplex_long"))
+  'ps-jts-ps-setup)
+
+;; WARNING! The following function is a *sample* only, and is *not*
+;; meant to be used as a whole unless it corresponds to your needs.
+;; (In fact, this is a copy of Jack's setup for ps-print --
+;; I would not be that surprised if it was useful to *anybody*,
+;; without modification.)
+
+(defun ps-jack-setup ()
+  (setq ps-print-color-p  'nil
+	ps-lpr-command    "lpr"
+	ps-lpr-switches   (list)
+
+	ps-paper-type       'a4
+	ps-landscape-mode   't
+	ps-number-of-columns 2
+
+	ps-left-margin   (/ (* 72  1.0) 2.54) ;  1.0 cm
+	ps-right-margin  (/ (* 72  1.0) 2.54) ;  1.0 cm
+	ps-inter-column  (/ (* 72  1.0) 2.54) ;  1.0 cm
+	ps-bottom-margin (/ (* 72  1.5) 2.54) ;  1.5 cm
+	ps-top-margin    (/ (* 72  1.5) 2.54) ;  1.5 cm
+	ps-header-offset (/ (* 72  1.0) 2.54) ;  1.0 cm
+	ps-header-line-pad    .15
+	ps-print-header       t
+	ps-print-header-frame t
+	ps-header-lines       2
+	ps-show-n-of-n        t
+	ps-spool-duplex       nil
+
+	ps-font-family             'Courier
+	ps-font-size               5.5
+	ps-header-font-family      'Helvetica
+	ps-header-font-size        6
+	ps-header-title-font-size  8)
+  'ps-jack-setup)
 
 (provide 'ps-print)
 
--- a/lisp/prim/auto-autoloads.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/prim/auto-autoloads.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1207,13 +1207,18 @@
 
 ;;;***
 
-;;;### (autoloads (ediff-toggle-multiframe) "ediff-util" "ediff/ediff-util.el")
+;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe) "ediff-util" "ediff/ediff-util.el")
 
 (autoload 'ediff-toggle-multiframe "ediff-util" "\
-Switch from the multiframe display to single-frame display and back.
-For a permanent change, set the variable `ediff-window-setup-function',
+Switch from multiframe display to single-frame display and back.
+To change the default, set the variable `ediff-window-setup-function',
 which see." t nil)
 
+(autoload 'ediff-toggle-use-toolbar "ediff-util" "\
+Enable or disable Ediff toolbar.
+Works only in versions of Emacs that support toolbars.
+To change the default, set the variable `ediff-use-toolbar-p', which see." t nil)
+
 ;;;***
 
 ;;;### (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")
@@ -3654,7 +3659,7 @@
 ;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el")
 
 (autoload 'ksh-mode "ksh-mode" "\
-ksh-mode $Revision: 1.4 $ - Major mode for editing (Bourne, Korn or Bourne again)
+ksh-mode $Revision: 1.5 $ - Major mode for editing (Bourne, Korn or Bourne again)
 shell scripts.
 Special key bindings and commands:
 \\{ksh-mode-map}
@@ -4951,7 +4956,7 @@
 
 (autoload 'vhdl-mode "vhdl-mode" "\
 Major mode for editing VHDL code.
-vhdl-mode $Revision: 1.4 $
+vhdl-mode $Revision: 1.5 $
 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
@@ -7010,13 +7015,14 @@
 
 ;;;***
 
-;;;### (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")
-
-(defvar ps-paper-type 'ps-letter "\
-*Specifies the size of paper to format for.  Should be one of
-`ps-letter', `ps-legal', or `ps-a4'.")
-
-(defvar ps-print-color-p (and (or (fboundp 'x-color-values) (fboundp 'color-instance-rgb-components)) (fboundp 'float)) "\
+;;;### (autoloads (ps-setup ps-nb-pages-region ps-nb-pages-buffer ps-line-lengths 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")
+
+(defvar ps-paper-type 'letter "\
+*Specifies the size of paper to format for.
+Should be one of the paper types defined in `ps-page-dimensions-database', for
+example `letter', `legal' or `a4'.")
+
+(defvar ps-print-color-p (or (fboundp 'x-color-values) (fboundp 'color-instance-rgb-components)) "\
 *If non-nil, print the buffer's text in color.")
 
 (autoload 'ps-print-buffer "ps-print" "\
@@ -7088,6 +7094,25 @@
 the PostScript image in a file with that name.  If FILENAME is a
 number, prompt the user for the name of the file to save in." t nil)
 
+(autoload 'ps-line-lengths "ps-print" "\
+*Display the correspondance between a line length and a font size,
+using the current ps-print setup.
+Try: pr -t file | awk '{printf \"%3d %s
+\", length($0), $0}' | sort -r | head" t nil)
+
+(autoload 'ps-nb-pages-buffer "ps-print" "\
+*Display an approximate correspondance between a font size and the number
+of pages the current buffer would require to print
+using the current ps-print setup." t nil)
+
+(autoload 'ps-nb-pages-region "ps-print" "\
+*Display an approximate correspondance between a font size and the number
+of pages the current region would require to print
+using the current ps-print setup." t nil)
+
+(autoload 'ps-setup "ps-print" "\
+*Return the current setup" nil nil)
+
 ;;;***
 
 ;;;### (autoloads (remote-compile) "rcompile" "packages/rcompile.el")
@@ -9479,13 +9504,8 @@
 
 (autoload 'w3-fetch "w3" "\
 Retrieve a document over the World Wide Web.
-The World Wide Web is a global hypertext system started by CERN in
-Switzerland in 1991.
-
-The document should be specified by its fully specified
-Uniform Resource Locator.  The document will be parsed, printed, or
-passed to an external viewer as appropriate.  Variable
-`mm-mime-info' specifies viewers for particular file types." t nil)
+Defaults to URL of the current document, if any.
+With prefix argument, use the URL of the hyperlink under point instead." t nil)
 
 (autoload 'w3-maybe-follow-link-mouse "w3" "\
 Maybe follow a hypertext link under point.
--- a/lisp/prim/files.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/prim/files.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1430,7 +1430,7 @@
 	;; Parse the -*- line into the `result' alist.
 	(cond ((not (search-forward "-*-" end t))
 	       ;; doesn't have one.
-	       nil)
+	       (setq force t))
 	      ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)")
 	       ;; Antiquated form: "-*- ModeName -*-".
 	       (setq result
--- a/lisp/prim/window.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/prim/window.el	Mon Aug 13 09:07:36 2007 +0200
@@ -294,23 +294,25 @@
 		      ;			       'menu-bar-lines params)
 		      0)))
 	  (unwind-protect
-	      (progn
-		(select-window (or window w))
+	      (let ((shrinkee (or window w)))
+		(set-buffer (window-buffer shrinkee))
 		(goto-char (point-min))
 		(while (pos-visible-in-window-p
 			(- (point-max)
-			   (if ignore-final-newline 1 0)))
+			   (if ignore-final-newline 1 0))
+			shrinkee)
 		  ;; defeat file locking... don't try this at home, kids!
 		  (setq buffer-file-name nil)
 		  (insert ?\n) (setq n (1+ n)))
 		(if (> n 0)
 		    (shrink-window (min (1- n)
-					(- (window-height)
-					   window-min-height)))))
+					(- (window-height shrinkee)
+					   window-min-height))
+				   nil
+				   shrinkee)))
 	    (delete-region (point-min) (point))
 	    (set-buffer-modified-p modified)
 	    (goto-char p)
-	    (select-window w)
 	    ;; Make sure we unbind buffer-read-only
 	    ;; with the proper current buffer.
 	    (set-buffer buffer))))))
--- a/lisp/psgml/ChangeLog	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/psgml/ChangeLog	Mon Aug 13 09:07:36 2007 +0200
@@ -1,3 +1,7 @@
+Thu Jan 16 18:23:51 1997  Steven L Baur  <steve@miranova.com>
+
+	* psgml.el: Use newer interface form of nsgmls.
+
 Wed Nov 20 19:40:05 1996  Lennart Staflin  <lenst@lysator.liu.se>
 
 	* psgml-parse.el (sgml-modify-dtd): set sgml-current-tree to
--- a/lisp/psgml/psgml.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/psgml/psgml.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,5 +1,5 @@
 ;;; psgml.el --- SGML-editing mode with parsing support
-;; $Id: psgml.el,v 1.2 1997/01/03 03:10:28 steve Exp $
+;; $Id: psgml.el,v 1.3 1997/01/23 05:29:40 steve Exp $
 
 ;; Copyright (C) 1993, 1994, 1995, 1996 Lennart Staflin
 ;; Copyright (C) 1992 Free Software Foundation, Inc.
@@ -455,7 +455,9 @@
 ;;; Its error messages can be parsed by next-error.
 ;;; The -s option suppresses output.
 
-(defvar sgml-validate-command "nsgmls -s %s %s"
+(defvar sgml-validate-command (concat "nsgmls -s -m "
+				      data-directory
+				      "CATALOG %s %s")
   "*The shell command to validate an SGML document.
 
 This is a `format' control string that by default should contain two
--- a/lisp/tl/emu-x20.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/tl/emu-x20.el	Mon Aug 13 09:07:36 2007 +0200
@@ -4,7 +4,7 @@
 ;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: emu-x20.el,v 1.1.1.2 1996/12/21 20:50:48 steve Exp $
+;; Version: $Id: emu-x20.el,v 1.2 1997/01/23 05:29:40 steve Exp $
 ;; Keywords: emulation, compatibility, Mule, XEmacs
 
 ;; This file is part of tl (Tiny Library).
@@ -170,24 +170,24 @@
 ;;; @ character
 ;;;
 
-(defun char-bytes (chr) 1)
+;(defun char-bytes (chr) 1)
 
-(defun char-length (character)
-  "Return number of elements a CHARACTER occupies in a string or buffer.
-\[emu-x20.el]"
-  1)
+;(defun char-length (character)
+;  "Return number of elements a CHARACTER occupies in a string or buffer.
+;\[emu-x20.el]"
+;  1)
 
-(defun char-columns (character)
-  "Return number of columns a CHARACTER occupies when displayed.
-\[emu-x20.el]"
-  (charset-columns (char-charset character))
-  )
+;(defun char-columns (character)
+;  "Return number of columns a CHARACTER occupies when displayed.
+;\[emu-x20.el]"
+;  (charset-columns (char-charset character))
+;  )
 
 ;;; @@ Mule emulating aliases
 ;;;
 ;;; You should not use them.
 
-(defalias 'char-width 'char-columns)
+;(defalias 'char-width 'char-columns)
 
 (defalias 'char-leading-char 'char-charset)
 
@@ -206,34 +206,34 @@
 ;;; @ string
 ;;;
 
-(defun string-columns (string)
-  "Return number of columns STRING occupies when displayed.
-\[emu-x20.el]"
-  (let ((col 0)
-	(len (length string))
-	(i 0))
-    (while (< i len)
-      (setq col (+ col (char-columns (aref string i))))
-      (setq i (1+ i))
-      )
-    col))
+;(defun string-columns (string)
+;  "Return number of columns STRING occupies when displayed.
+;\[emu-x20.el]"
+;  (let ((col 0)
+;	(len (length string))
+;	(i 0))
+;    (while (< i len)
+;      (setq col (+ col (char-columns (aref string i))))
+;      (setq i (1+ i))
+;      )
+;    col))
 
-(defalias 'string-width 'string-columns)
+;(defalias 'string-width 'string-columns)
 
 (defun string-to-int-list (str)
   (mapcar #'char-int str)
   )
 
-(defalias 'sref 'aref)
+;(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-x20.el; Mule 2.3 emulating function]"
-  (or start-column
-      (setq start-column 0))
-  (substring str start-column width)
-  )
+;(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-x20.el; Mule 2.3 emulating function]"
+;  (or start-column
+;      (setq start-column 0))
+;  (substring str start-column width)
+;  )
 
 
 ;;; @ end
--- a/lisp/tl/tl-str.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/tl/tl-str.el	Mon Aug 13 09:07:36 2007 +0200
@@ -4,7 +4,7 @@
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Version:
-;;	$Id: tl-str.el,v 1.1.1.2 1996/12/21 20:50:49 steve Exp $
+;;	$Id: tl-str.el,v 1.2 1997/01/23 05:29:41 steve Exp $
 ;; Keywords: string
 
 ;; This file is part of tl (Tiny Library).
@@ -206,8 +206,8 @@
       (substring filename 0 (match-beginning 0))
     filename))
 
-(autoload 'replace-as-filename "filename")
-
+(autoload 'replace-as-filename "filename"
+  "Return safety filename from STRING. [filename.el]")
 
 ;;; @ symbol
 ;;;
--- a/lisp/tm/tm-edit.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/tm/tm-edit.el	Mon Aug 13 09:07:36 2007 +0200
@@ -6,7 +6,7 @@
 ;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Created: 1994/08/21 renamed from mime.el
-;; Version: $Revision: 1.4 $
+;; Version: $Revision: 1.5 $
 ;; Keywords: mail, news, MIME, multimedia, multilingual
 
 ;; This file is part of tm (Tools for MIME).
@@ -119,7 +119,7 @@
 ;;;
 
 (defconst mime-editor/RCS-ID
-  "$Id: tm-edit.el,v 1.4 1997/01/11 20:14:11 steve Exp $")
+  "$Id: tm-edit.el,v 1.5 1997/01/23 05:29:42 steve Exp $")
 
 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
 
@@ -649,14 +649,6 @@
 ;;; @ functions
 ;;;
 
-;; The following text was removed from the docstring of the subsequent
-;; functions due to problems with the resulting autoload file. -sb
-
-;;	--[[text/plain; charset=ISO-2022-JP]]
-;;	$B$3$l$O(B charset $B$r(B ISO-2022-JP $B$K;XDj$7$?F|K\8l$N(B plain $B%F%-%9(B
-;;	$B%H$G$9(B.
-
-
 ;;;###autoload
 (defun mime/editor-mode ()
   "MIME minor mode for editing the tagged MIME message.
--- a/lisp/utils/bench.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/utils/bench.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,11 +1,11 @@
 ;;; bench.el --- benchmarking utility for emacsen
 
 ;; Copyright (C) 1987,88,89,90,93,94,95,96 Free Software Foundation, Inc.
-;; $Id: bench.el,v 1.2 1997/01/11 20:14:12 steve Exp $	
+;; $Id: bench.el,v 1.3 1997/01/23 05:29:43 steve Exp $	
 ;; $Source: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/utils/Attic/bench.el,v $
-;; $Revision: 1.2 $
+;; $Revision: 1.3 $
 ;; $Author: steve $
-;; $Date: 1997/01/11 20:14:12 $
+;; $Date: 1997/01/23 05:29:43 $
 
 ;; Author: Shane Holder <holder@rsn.hp.com>
 ;; Adapted-By: Steve Baur <steve@altair.xemacs.org>
@@ -325,7 +325,7 @@
 ;-----------------------------------------------------------------------------
 (defconst bench-mark-insert-into-empty-buffer-num-words 100000)
 
-(defun bench-handler-insert-into-empty-buffer ()
+(defun bench-handler-insert-into-empty-buffer (times)
   (set-buffer (get-buffer-create "*tmp*"))
   (bench-mark-insert-into-empty-buffer)
   (erase-buffer)
@@ -340,7 +340,7 @@
 )
 
 ;=============================================================================
-(defconst bench-version (let ((rcsvers "$Revision: 1.2 $"))
+(defconst bench-version (let ((rcsvers "$Revision: 1.3 $"))
 			  (substring rcsvers 11 (- (length rcsvers) 2)))
   "*Version number of bench.el")
 
--- a/lisp/utils/finder.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/utils/finder.el	Mon Aug 13 09:07:36 2007 +0200
@@ -210,7 +210,7 @@
 
 (defun finder-insert-at-column (column &rest strings)
   "Insert list of STRINGS, at column COLUMN."
-  (if (> (current-column) column) (insert "\n"))
+  (if (>= (current-column) column) (insert "\n"))
   (move-to-column column)
   (let ((col (current-column)))
     (if (< col column)
--- a/lisp/utils/timezone.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/utils/timezone.el	Mon Aug 13 09:07:36 2007 +0200
@@ -191,7 +191,16 @@
 		(substring date (match-beginning year) (match-end year)))
 	  ;; It is now Dec 1992.  8 years before the end of the World.
 	  (if (< (length year) 4)
-	      (setq year (concat "19" (substring year -2 nil))))
+	      ;; 2 digit years are bogus, so guess the century
+	      (let ((yr (string-to-int year)))
+		(when (>= yr 100)
+		  ;; What does a three digit year mean?
+		  (setq yr (- yr 100)))
+		(setq year (format "%d%02d"
+				   (if (< yr 70)
+				       20
+				     19)
+				   yr))))
 	  (let ((string (substring date
 				   (match-beginning month)
 				   (+ (match-beginning month) 3))))
--- a/lisp/version.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/version.el	Mon Aug 13 09:07:36 2007 +0200
@@ -25,7 +25,7 @@
 (defconst emacs-version "20.0"
   "Version numbers of this version of Emacs.")
 
-(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta90)")))
+(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta91)")))
 
 (defconst emacs-major-version
   (progn (or (string-match "^[0-9]+" emacs-version)
--- a/lisp/viper/Makefile	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/Makefile	Mon Aug 13 09:07:36 2007 +0200
@@ -26,9 +26,9 @@
 
 # --------- ONLY AUTHORIZED PERSONNEL BEYOND THIS POINT!!! ------------
 VIPER = viper.el viper-util.el viper-mous.el viper-ex.el \
-        viper-macs.el viper-keym.el
+        viper-macs.el viper-keym.el viper-init.el
 VIPERelc = viper-util.elc viper-mous.elc viper-ex.elc viper-macs.elc \
-	   viper-keym.elc viper.elc
+	   viper-keym.elc viper.elc viper-init.elc
 
 all: dvi info hello elc goodbye
 
@@ -89,27 +89,31 @@
 	@echo ""
 	$(TeX) viperCard.tex
 
-viper-util.elc: viper-util.el
+viper-init.elc: viper-init.el
+	@echo ""
+	$(EMACS) -batch -f batch-byte-compile viper-init.el
+
+viper-util.elc: viper-util.el viper-init.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile viper-util.el
 
-viper-ex.elc: viper-ex.el viper-util.el
+viper-ex.elc: viper-ex.el viper-util.el viper-init.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile viper-ex.el
 
-viper-mous.elc: viper-mous.el viper-util.el
+viper-mous.elc: viper-mous.el viper-util.el viper-init.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile viper-mous.el
 
-viper-macs.elc: viper-macs.el viper-util.el
+viper-macs.elc: viper-macs.el viper-util.el viper-init.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile viper-macs.el
 
-viper-keym.elc: viper-keym.el viper-util.el
+viper-keym.elc: viper-keym.el viper-util.el viper-init.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile viper-keym.el
 
-viper.elc: viper.el viper-util.el
+viper.elc: viper.el viper-util.el viper-init.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile viper.el
 
--- a/lisp/viper/README	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/README	Mon Aug 13 09:07:36 2007 +0200
@@ -8,6 +8,7 @@
 viper.el    	-- Viper Emacs Lisp code
 viper-macs.el	-- Viper Emacs Lisp code
 viper-ex.el	-- Viper Emacs Lisp code
+viper-init.el	-- Viper Emacs Lisp code
 viper-util.el	-- Viper Emacs Lisp code
 viper-mous.el	-- Viper Emacs Lisp code
 viper-keym.el	-- Viper Emacs Lisp code
@@ -75,41 +76,7 @@
    mentioned in LISPDIR, INFODIR, and ETCDIR.
    
 6. XEmacs users must invoke make with the parameter EMACS=xemacs
-   or whatever name is used to invoke XEmacs (some sites still use xemacs
-   for Emacs 18). An even better thing would be to edit Makefile directly
-   as indicated in the comments there.
-
-For manual installation, copy viper.elc into a directory on your load-path.
-
-To install on-line documentation, you need to install the Info files
-by copying the files
-
-viper.info*
-
-into your Info directory (which is emacs-root-dir/info,
-if emacs-root-dir is the root directory of the installation).
-
-Then edit the file 
-
-emacs-root-dir/info/dir
+   or whatever name is used to invoke XEmacs (some backward sites
+   still use xemacs for Emacs 18). An even better thing would be to
+   edit Makefile directly as indicated in the comments there.
 
-to include the root menu item for Viper (check how other menu
-items look like in this file).
-
-In Emacs, this item should look like this:
-
-* Viper: (viper.info).    A VI Plan to Rescue Emacs and a venomous VI PERil
-
-In XEmacs, it should look like:
-
-* Viper::	A VI Plan to Rescue Emacs and a venomous VI PERil
-
-
-If you need a hard copy of the documentation, the files
-
-viper.dvi
-viperCard.dvi
-
-contain the Viper manual and the quick reference card, respectively.
-
-
--- a/lisp/viper/viper-ex.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/viper-ex.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; viper-ex.el --- functions implementing the Ex commands for Viper
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -36,15 +36,16 @@
 (defvar vip-case-fold-search)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'viper-util)
 	(load "viper-util.el" nil nil 'nosuffix))
     (or (featurep 'viper-keym)
 	(load "viper-keym.el" nil nil 'nosuffix))
+    (or (featurep 'viper)
+	(load "viper.el" nil nil 'nosuffix))
     ))
 ;; end pacifier
 
-
 (require 'viper-util)
 
 
@@ -657,7 +658,8 @@
 
 ;; Get an ex-address as a marker and set ex-flag if a flag is found
 (defun vip-get-ex-address ()
-  (let ((address (point-marker)) (cont t))
+  (let ((address (point-marker))
+	(cont t))
     (setq ex-token "")
     (setq ex-flag nil)
     (while cont
@@ -1872,7 +1874,11 @@
 (defun ex-write (q-flag)
   (vip-default-ex-addresses t)
   (vip-get-ex-file)
-  (let ((end (car ex-addresses)) (beg (car (cdr ex-addresses))) 
+  (let ((end (car ex-addresses))
+	(beg (car (cdr ex-addresses))) 
+	(orig-buf (current-buffer))
+	(orig-buf-file-name (buffer-file-name))
+	(buff-changed-p (buffer-modified-p))
 	temp-buf writing-same-file region
 	file-exists writing-whole-file)
     (if (> beg end) (error vip-FirstAddrExceedsSecond))
@@ -1895,8 +1901,9 @@
 	       buffer-file-name
 	       (not (file-directory-p buffer-file-name)))
 	  (setq ex-file
-		(concat ex-file (file-name-nondirectory buffer-file-name))))
-
+		(concat (file-name-as-directory ex-file)
+			(file-name-nondirectory buffer-file-name))))
+      
       (setq file-exists (file-exists-p ex-file)
 	    writing-same-file (string= ex-file (buffer-file-name)))
 
@@ -1904,34 +1911,52 @@
 	  (if (not (buffer-modified-p))
 	      (message "(No changes need to be saved)")
 	    (save-buffer)
-	    (ex-write-info file-exists ex-file beg end))
-	;; writing some other file or portion of the currents
-	;; file---create temp buffer for it
-	;; disable undo in that buffer, for efficiency
-	(buffer-disable-undo (setq temp-buf (create-file-buffer ex-file)))
-	(unwind-protect 
-	    (save-excursion
-	      (if (and file-exists
-		       (not writing-same-file)
-		       (not (yes-or-no-p
-			     (format "File %s exists. Overwrite? " ex-file))))
-		  (error "Quit")
-		(vip-enlarge-region beg end)
-		(setq region (buffer-substring (point) (mark t)))
-		(set-buffer temp-buf)
-		(set-visited-file-name ex-file)
-		(erase-buffer)
-		(if (and file-exists ex-append)
-		    (insert-file-contents ex-file))
-		(goto-char (point-max))
-		(insert region)
-		(save-buffer)
-		(ex-write-info file-exists ex-file (point-min) (point-max))
-		))
-	  (set-buffer temp-buf)
-	  (set-buffer-modified-p nil)
-	  (kill-buffer temp-buf)
-	  ))
+	    (save-restriction
+		 (widen)
+		 (ex-write-info file-exists ex-file (point-min) (point-max))
+		 ))
+	;; writing some other file or portion of the current file
+	(cond ((and file-exists
+		    (not writing-same-file)
+		    (not (yes-or-no-p
+			  (format "File %s exists. Overwrite? " ex-file))))
+	       (error "Quit"))
+	      ((and writing-whole-file (not ex-append))
+	       (unwind-protect
+		   (progn
+		     (set-visited-file-name ex-file)
+		     (set-buffer-modified-p t)
+		     (save-buffer))
+		 ;; restore the buffer file name
+		 (set-visited-file-name orig-buf-file-name)
+		 (set-buffer-modified-p buff-changed-p))
+	       (save-restriction
+		 (widen)
+		 (ex-write-info
+		  file-exists ex-file (point-min) (point-max))))
+	      (t ; writing a region
+	       (unwind-protect 
+		   (save-excursion
+		     (vip-enlarge-region beg end)
+		     (setq region (buffer-substring (point) (mark t)))
+		     ;; create temp buffer for the region
+		     (setq temp-buf (get-buffer-create " *ex-write*"))
+		     (set-buffer temp-buf)
+		     (set-visited-file-name ex-file 'noquerry)
+		     (erase-buffer)
+		     (if (and file-exists ex-append)
+			 (insert-file-contents ex-file))
+		     (goto-char (point-max))
+		     (insert region)
+		     (save-buffer)
+		     (ex-write-info
+		      file-exists ex-file (point-min) (point-max))
+		     ))
+	       (set-buffer temp-buf)
+	       (set-buffer-modified-p nil)
+	       (kill-buffer temp-buf))
+	      ))
+      (set-buffer orig-buf)
       ;; this prevents the loss of data if writing part of the buffer
       (if (and (buffer-file-name) writing-same-file)
 	  (set-visited-file-modtime))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/viper/viper-init.el	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,674 @@
+;;; viper-init.el --- some common definitions for Viper
+
+;; Copyright (C) 1997 Free Software Foundation, Inc.
+
+;; 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.
+
+;; Code
+
+(provide 'viper-init)
+
+;; compiler pacifier
+(defvar mark-even-if-inactive)
+;; end pacifier
+
+;; Is it XEmacs?
+(defconst vip-xemacs-p (string-match "\\(Lucid\\|XEmacs\\)" emacs-version))
+;; Is it Emacs?
+(defconst vip-emacs-p (not vip-xemacs-p))
+;; Tell whether we are running as a window application or on a TTY
+(defsubst vip-device-type ()
+  (if vip-emacs-p
+      window-system
+    (device-type (selected-device))))
+;; in XEmacs: device-type is tty on tty and stream in batch.
+(defun vip-window-display-p ()
+  (and (vip-device-type) (not (memq (vip-device-type) '(tty stream pc)))))
+
+(defvar vip-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95))
+  "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95.")
+(defvar vip-vms-os-p (memq system-type '(vax-vms axp-vms))
+  "Tells if Emacs is running under VMS.")
+
+(defvar vip-force-faces nil
+  "If t, Viper will think that it is running on a display that supports faces.
+This is provided as a temporary relief for users of face-capable displays
+that Viper doesn't know about.")
+
+(defun vip-has-face-support-p ()
+  (cond ((vip-window-display-p))
+	(vip-force-faces)
+	(vip-emacs-p (memq (vip-device-type) '(pc)))
+	(vip-xemacs-p (memq (vip-device-type) '(tty pc)))))
+
+(defun vip-convert-standard-file-name (fname)
+  (if vip-emacs-p
+      (convert-standard-filename fname)
+    ;; hopefully, XEmacs adds this functionality
+    fname))
+
+
+;;; Macros
+
+(defmacro vip-deflocalvar (var default-value &optional documentation)
+  (` (progn
+       (defvar (, var) (, default-value)
+	       (, (format "%s\n\(buffer local\)" documentation)))
+       (make-variable-buffer-local '(, var))
+     )))
+
+(defmacro vip-loop (count body)
+  "(vip-loop COUNT BODY) Execute BODY COUNT times."
+  (list 'let (list (list 'count count))
+	(list 'while '(> count 0)
+	      body
+	      '(setq count (1- count))
+	      )))
+
+(defmacro vip-buffer-live-p (buf)
+  (` (and (, buf) (get-buffer (, buf)) (buffer-name (get-buffer (, buf))))))
+  
+;; return buffer-specific macro definition, given a full macro definition
+(defmacro vip-kbd-buf-alist (macro-elt)
+  (` (nth 1 (, macro-elt))))
+;; get a pair: (curr-buffer . macro-definition)
+(defmacro vip-kbd-buf-pair (macro-elt)
+  (` (assoc (buffer-name) (vip-kbd-buf-alist (, macro-elt)))))
+;; get macro definition for current buffer
+(defmacro vip-kbd-buf-definition (macro-elt)
+  (` (cdr (vip-kbd-buf-pair (, macro-elt)))))
+  
+;; return mode-specific macro definitions, given a full macro definition
+(defmacro vip-kbd-mode-alist (macro-elt)
+  (` (nth 2 (, macro-elt))))
+;; get a pair: (major-mode . macro-definition)
+(defmacro vip-kbd-mode-pair (macro-elt)
+  (` (assoc major-mode (vip-kbd-mode-alist (, macro-elt)))))
+;; get macro definition for the current major mode
+(defmacro vip-kbd-mode-definition (macro-elt)
+  (` (cdr (vip-kbd-mode-pair (, macro-elt)))))
+  
+;; return global macro definition, given a full macro definition
+(defmacro vip-kbd-global-pair (macro-elt)
+  (` (nth 3 (, macro-elt))))
+;; get global macro definition from an elt of macro-alist
+(defmacro vip-kbd-global-definition (macro-elt)
+  (` (cdr (vip-kbd-global-pair (, macro-elt)))))
+  
+;; last elt of a sequence
+(defsubst vip-seq-last-elt (seq)
+  (elt seq (1- (length seq))))
+  
+
+(defvar vip-minibuffer-overlay-priority 300)
+(defvar vip-replace-overlay-priority 400)
+(defvar vip-search-overlay-priority 500)
+  
+
+;;; Viper minor modes
+
+;; This is not local in Emacs, so we make it local.
+;; This must be local because although the stack of minor modes can be the same
+;; for all buffers, the associated *keymaps* can be different. In Viper,
+;; vip-vi-local-user-map, vip-insert-local-user-map, and others can have
+;; different keymaps for different buffers.
+;; Also, the keymaps associated with vip-vi/insert-state-modifier-minor-mode
+;; can be different.
+(make-variable-buffer-local 'minor-mode-map-alist)
+
+;; Mode for vital things like \e, C-z.
+(vip-deflocalvar vip-vi-intercept-minor-mode nil)
+
+(vip-deflocalvar vip-vi-basic-minor-mode nil
+  "Viper's minor mode for Vi bindings.")
+  
+(vip-deflocalvar vip-vi-local-user-minor-mode nil
+  "Auxiliary minor mode for user-defined local bindings in Vi state.")
+
+(vip-deflocalvar vip-vi-global-user-minor-mode nil
+  "Auxiliary minor mode for user-defined global bindings in Vi state.")
+
+(vip-deflocalvar vip-vi-state-modifier-minor-mode nil
+  "Minor mode used to make major-mode-specific modification to Vi state.")
+
+(vip-deflocalvar vip-vi-diehard-minor-mode nil
+  "This minor mode is in effect when the user wants Viper to be Vi.")
+
+(vip-deflocalvar vip-vi-kbd-minor-mode nil
+  "Minor mode for Ex command macros in Vi state.
+The corresponding keymap stores key bindings of Vi macros defined with
+the Ex command :map.")
+
+;; Mode for vital things like \e, C-z.
+(vip-deflocalvar vip-insert-intercept-minor-mode nil)
+
+(vip-deflocalvar vip-insert-basic-minor-mode nil
+  "Viper's minor mode for bindings in Insert mode.")
+
+(vip-deflocalvar vip-insert-local-user-minor-mode nil
+  "Auxiliary minor mode for buffer-local user-defined bindings in Insert state.
+This is a way to overshadow normal Insert mode bindings locally to certain
+designated buffers.")
+
+(vip-deflocalvar vip-insert-global-user-minor-mode nil
+  "Auxiliary minor mode for global user-defined bindings in Insert state.")
+
+(vip-deflocalvar vip-insert-state-modifier-minor-mode nil
+  "Minor mode used to make major-mode-specific modification to Insert state.")
+
+(vip-deflocalvar vip-insert-diehard-minor-mode nil
+  "Minor mode that simulates Vi very closely.
+Not recommened, except for the novice user.")
+
+(vip-deflocalvar vip-insert-kbd-minor-mode nil
+"Minor mode for Ex command macros Insert state.
+The corresponding keymap stores key bindings of Vi macros defined with
+the Ex command :map!.")
+
+(vip-deflocalvar vip-replace-minor-mode nil
+  "Minor mode in effect in replace state (cw, C, and the like commands).")
+
+;; Mode for vital things like \C-z and \C-x)
+;; This is t, by default. So, any new buffer will have C-z defined as
+;; switch to Vi, unless we switched states in this buffer
+(vip-deflocalvar vip-emacs-intercept-minor-mode t)
+  
+(vip-deflocalvar vip-emacs-local-user-minor-mode t
+  "Minor mode for local user bindings effective in Emacs state.
+Users can use it to override Emacs bindings when Viper is in its Emacs
+state.")  
+  
+(vip-deflocalvar vip-emacs-global-user-minor-mode t
+  "Minor mode for global user bindings in effect in Emacs state.
+Users can use it to override Emacs bindings when Viper is in its Emacs
+state.")  
+
+(vip-deflocalvar vip-emacs-kbd-minor-mode t
+  "Minor mode for Vi style macros in Emacs state.
+The corresponding keymap stores key bindings of Vi macros defined with
+`vip-record-kbd-macro' command. There is no Ex-level command to do this
+interactively.")
+
+(vip-deflocalvar vip-emacs-state-modifier-minor-mode t
+  "Minor mode used to make major-mode-specific modification to Emacs state.
+For instance, a Vi purist may want to bind `dd' in Dired mode to a function
+that deletes a file.")
+
+(vip-deflocalvar vip-vi-minibuffer-minor-mode nil
+   "Minor mode that forces Vi-style when the Minibuffer is in Vi state.")
+
+(vip-deflocalvar vip-insert-minibuffer-minor-mode nil
+   "Minor mode that forces Vi-style when the Minibuffer is in Insert state.")
+  
+
+
+;; Some common error messages
+
+(defconst vip-SpuriousText "Spurious text after command"  "")
+(defconst vip-BadExCommand "Not an editor command"   "")
+(defconst vip-InvalidCommandArgument "Invalid command argument"   "")
+(defconst vip-NoPrevSearch "No previous search string"   "")
+(defconst vip-EmptyRegister "`%c': Nothing in this register"   "")
+(defconst vip-InvalidRegister "`%c': Invalid register"   "")
+(defconst vip-EmptyTextmarker "`%c': Text marker doesn't point anywhere"   "")
+(defconst vip-InvalidTextmarker "`%c': Invalid text marker"   "")
+(defconst vip-InvalidViCommand "Invalid command"   "")
+(defconst vip-BadAddress "Ill-formed address"   "")
+(defconst vip-FirstAddrExceedsSecond "First address exceeds second"   "")
+(defconst vip-NoFileSpecified "No file specified"   "")
+
+;; Is t until viper-mode executes for the very first time. 
+;; Prevents recursive descend into startup messages.
+(defvar vip-first-time t)
+
+(defvar vip-expert-level 0
+  "User's expert level.
+The minor mode vip-vi-diehard-minor-mode is in effect when
+vip-expert-level is 1 or 2 or when vip-want-emacs-keys-in-vi is t.
+The minor mode vip-insert-diehard-minor-mode is in effect when
+vip-expert-level is 1 or 2 or if vip-want-emacs-keys-in-insert is t.
+Use `M-x vip-set-expert-level' to change this.")
+
+;; Max expert level supported by Viper. This is NOT a user option.
+;; It is here to make it hard for the user from resetting it.
+(defconst vip-max-expert-level 5)
+
+;; Contains user settings for vars affected by vip-set-expert-level function.
+;; Not a user option.
+(defvar vip-saved-user-settings nil)
+	       
+
+;;; ISO characters
+  
+(vip-deflocalvar vip-automatic-iso-accents nil
+  "*If non-nil, ISO accents will be turned on in insert/replace emacs states and turned off in vi-state. 
+For some users, this behavior may be too primitive. In this case, use
+insert/emacs/vi state hooks.")
+  
+
+;; VI-style Undo
+
+;; Used to 'undo' complex commands, such as replace and insert commands.
+(vip-deflocalvar vip-undo-needs-adjustment nil)
+(put 'vip-undo-needs-adjustment 'permanent-local t)
+
+;; A mark that Viper puts on buffer-undo-list.  Marks the beginning of a
+;; complex command that must be undone atomically. If inserted, it is
+;; erased by vip-change-state-to-vi and vip-repeat.
+(defconst vip-buffer-undo-list-mark 'viper)
+
+(defvar vip-keep-point-on-undo nil
+  "*Non-nil means not to move point while undoing commands.
+This style is different from Emacs and Vi. Try it to see if
+it better fits your working style.")  
+
+;; Replace mode and changing text
+
+;; Viper's own after/before change functions, which get vip-add-hook'ed to
+;; Emacs's
+(vip-deflocalvar vip-after-change-functions nil "")
+(vip-deflocalvar vip-before-change-functions nil "")
+(vip-deflocalvar vip-post-command-hooks nil "")
+(vip-deflocalvar vip-pre-command-hooks nil "")
+
+;; Can be used to pass global states around for short period of time
+(vip-deflocalvar vip-intermediate-command nil "")
+
+;; Indicates that the current destructive command has started in replace mode.
+(vip-deflocalvar vip-began-as-replace nil "")
+
+(defvar vip-allow-multiline-replace-regions t
+  "If non-nil, Viper will allow multi-line replace regions.
+This is an extension to standard Vi.
+If nil, commands that attempt to replace text spanning multiple lines first
+delete the text being replaced, as in standard Vi.")
+
+(defvar vip-replace-overlay-cursor-color "Red"
+  "*Cursor color to use in Replace state")
+(defvar vip-insert-state-cursor-color nil
+  "Cursor color for Viper insert state.")
+(put 'vip-insert-state-cursor-color 'permanent-local t)
+;; place to save cursor colow when switching to insert mode
+(vip-deflocalvar vip-saved-cursor-color nil "")
+  
+(vip-deflocalvar vip-replace-overlay nil "")
+(put 'vip-replace-overlay 'permanent-local t)
+
+(defvar vip-replace-overlay-pixmap "gray3"
+  "Pixmap to use for search face on non-color displays.")
+(defvar vip-search-face-pixmap "gray3"
+  "Pixmap to use for search face on non-color displays.")
+
+
+(defvar vip-replace-region-end-delimiter "$"
+  "A string marking the end of replacement regions.
+It is used only with TTYs or if `vip-use-replace-region-delimiters'
+is non-nil.")
+(defvar vip-replace-region-start-delimiter ""
+  "A string marking the beginning of replacement regions.
+It is used only with TTYs or if `vip-use-replace-region-delimiters'
+is non-nil.")
+(defvar vip-use-replace-region-delimiters (not (vip-has-face-support-p))
+  "*If non-nil, Viper will always use `vip-replace-region-end-delimiter' and
+`vip-replace-region-start-delimiter' to delimit replacement regions, even on
+color displays. By default, the delimiters are used only on TTYs.")
+  
+;; XEmacs requires glyphs
+(if vip-xemacs-p
+    (progn
+      (or (glyphp vip-replace-region-end-delimiter)
+	  (setq vip-replace-region-end-delimiter
+		(make-glyph vip-replace-region-end-delimiter)))
+      (or (glyphp vip-replace-region-start-delimiter)
+	  (setq vip-replace-region-start-delimiter
+		(make-glyph vip-replace-region-start-delimiter)))
+      ))
+      
+  
+;; These are local marker that must be initialized to nil and moved with
+;; `vip-move-marker-locally'
+;;
+;; Remember the last position inside the replace region.
+(vip-deflocalvar vip-last-posn-in-replace-region nil)
+;; Remember the last position while inserting
+(vip-deflocalvar vip-last-posn-while-in-insert-state nil)
+(put 'vip-last-posn-in-replace-region 'permanent-local t)
+(put 'vip-last-posn-while-in-insert-state 'permanent-local t)
+
+(vip-deflocalvar vip-sitting-in-replace nil "")
+(put 'vip-sitting-in-replace 'permanent-local t)
+  
+;; Remember the number of characters that have to be deleted in replace
+;; mode to compensate for the inserted characters.
+(vip-deflocalvar vip-replace-chars-to-delete 0 "")
+(vip-deflocalvar vip-replace-chars-deleted 0 "")
+
+;; Insertion ring and command ring
+(defvar vip-insertion-ring-size 14
+  "The size of the insertion ring.")
+;; The insertion ring.
+(defvar vip-insertion-ring nil)
+;; This is temp insertion ring. Used to do rotation for display purposes.
+;; When rotation just started, it is initialized to vip-insertion-ring.
+(defvar vip-temp-insertion-ring nil)
+(defvar vip-last-inserted-string-from-insertion-ring "")
+
+(defvar vip-command-ring-size 14
+  "The size of the command ring.")
+;; The command ring.
+(defvar vip-command-ring nil)
+;; This is temp command ring. Used to do rotation for display purposes.
+;; When rotation just started, it is initialized to vip-command-ring.
+(defvar vip-temp-command-ring nil)
+
+;; Modes and related variables
+
+;; Current mode.  One of: `emacs-state', `vi-state', `insert-state'
+(vip-deflocalvar vip-current-state 'emacs-state)
+
+
+;; Autoindent in insert
+
+;; Variable that keeps track of whether C-t has been pressed.
+(vip-deflocalvar vip-cted nil "")
+
+;; Preserve the indent value, used by C-d in insert mode.
+(vip-deflocalvar vip-current-indent 0)
+
+;; Whether to preserve the indent, used by C-d in insert mode.
+(vip-deflocalvar vip-preserve-indent nil)
+
+(vip-deflocalvar vip-auto-indent nil
+  "*Autoindent if t.")
+(vip-deflocalvar vip-electric-mode t
+  "*If t, enable electric behavior. 
+Currently only enables auto-indentation `according to mode'.")
+
+(defconst vip-shift-width 8
+  "*The shiftwidth variable.")
+
+;; Variables for repeating destructive commands
+
+(defconst vip-keep-point-on-repeat t
+  "*If t, don't move point when repeating previous command.
+This is useful for doing repeated changes with the '.' key.
+The user can change this to nil, if she likes when the cursor moves
+to a new place after repeating previous Vi command.") 
+
+;; Remember insert point as a marker.  This is a local marker that must be
+;; initialized to nil and moved with `vip-move-marker-locally'.
+(vip-deflocalvar vip-insert-point nil)
+(put 'vip-insert-point 'permanent-local t)
+
+;; This remembers the point before dabbrev-expand was called.
+;; If vip-insert-point turns out to be bigger than that, it is reset
+;; back to vip-pre-command-point.
+;; The reason this is needed is because dabbrev-expand (and possibly
+;; others) may jump to before the insertion point, delete something and
+;; then reinsert a bigger piece. For instance:  bla^blo
+;; If dabbrev-expand is called after `blo' and ^ undicates vip-insert-point,
+;; then point jumps to the beginning of `blo'. If expansion is found, `blablo'
+;; is deleted, and we have |^, where | denotes point. Next, dabbrev-expand
+;; will insert the expansion, and we get: blablo^
+;; Whatever we insert next goes before the ^, i.e., before the
+;; vip-insert-point marker. So, Viper will think that nothing was
+;; inserted. Remembering the orig position of the marker circumvents the
+;; problem.
+;; We don't know of any command, except dabbrev-expand, that has the same
+;; problem. However, the same trick can be used if such a command is
+;; discovered later.
+;;
+(vip-deflocalvar vip-pre-command-point nil)
+(put 'vip-pre-command-point 'permanent-local t) ; this is probably an overkill
+
+;; This is used for saving inserted text.
+(defvar vip-last-insertion  nil)
+  
+;; Remembers the last replaced region.
+(defvar vip-last-replace-region "")
+  
+;; Remember com point as a marker.
+;; This is a local marker. Should be moved with `vip-move-marker-locally'
+(vip-deflocalvar vip-com-point nil)
+
+;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys)
+;; It is used to re-execute last destructive command.
+;; M-COM is a Lisp symbol representing the function to be executed.
+;; VAL is the prefix argument that was used with that command.
+;; COM is an internal descriptor, such as ?r, ?c, ?C, which contains
+;; additional information on how the function in M-COM is to be handled.
+;; REG is the register used by command
+;; INSERTED-TEXT is text inserted by that command (in case of o, c, C, i, r
+;; commands).
+;; COMMAND-KEYS are the keys that were typed to invoke the command.
+(defvar vip-d-com nil)
+
+;; The character remembered by the Vi `r' command.
+(defvar vip-d-char nil)
+
+;; Name of register to store deleted or yanked strings
+(defvar vip-use-register nil)
+
+
+
+;; Variables for Moves and Searches
+
+;; For use by `;' command.
+(defvar vip-f-char nil)
+
+;; For use by `.' command.
+(defvar vip-F-char nil)
+
+;; For use by `;' command.
+(defvar vip-f-forward nil)
+
+;; For use by `;' command.
+(defvar vip-f-offset nil)
+
+;; Last search string
+(defvar vip-s-string "")
+
+(defvar vip-quote-string "> "
+  "String inserted at the beginning of quoted region.")
+
+;; If t, search is forward.
+(defvar vip-s-forward nil)
+
+(defconst vip-case-fold-search nil
+  "*If not nil, search ignores cases.")
+
+(defconst vip-re-search t
+  "*If not nil, search is reg-exp search, otherwise vanilla search.")
+
+(defvar vip-search-scroll-threshold 2
+  "*If search lands within this threshnold from the window top/bottom,
+the window will be scrolled up or down appropriately, to reveal context.
+If you want Viper search to behave as usual in Vi, set this variable to a
+negative number.")
+
+(defconst vip-re-query-replace t
+  "*If t then do regexp replace, if nil then do string replace.")
+
+(defconst vip-re-replace t
+  "*If t, do regexp replace. nil means do string replace.")
+
+(vip-deflocalvar vip-ex-style-motion t
+  "*Ex-style: the commands l,h do not cross lines, etc.")
+
+(vip-deflocalvar vip-ex-style-editing-in-insert t
+  "*The keys ^H, ^? don't jump lines in insert, ESC moves cursor back, etc.
+Note: this doesn't preclude ^H and ^? from deleting characters by moving
+past the insertion point. This is a feature, not a bug. ")
+
+(vip-deflocalvar vip-delete-backwards-in-replace nil
+  "*If t, DEL key will delete characters while moving the cursor backwards.
+If nil, the cursor will move backwards without deleting anything.")
+
+(defconst vip-buffer-search-char nil
+  "*Key bound for buffer-searching.")
+
+(defconst vip-search-wrap-around-t t
+  "*If t, search wraps around.")
+  
+(vip-deflocalvar vip-related-files-and-buffers-ring nil
+  "*Ring of file and buffer names that are considered to be related to the
+current buffer.
+These buffers can be cycled through via :R and :P commands.")
+(put 'vip-related-files-and-buffers-ring 'permanent-local t)
+
+;; Used to find out if we are done with searching the current buffer.
+(vip-deflocalvar vip-local-search-start-marker nil)
+;; As above, but global
+(defvar vip-search-start-marker (make-marker))
+
+;; the search overlay
+(vip-deflocalvar vip-search-overlay nil)
+
+
+(defvar vip-heading-start 
+  (concat "^\\s-*(\\s-*defun\\s-\\|"			        ; lisp
+	  "^{\\s-*$\\|^[_a-zA-Z][^()]*[()].*{\\s-*$\\|"	        ; C/C++
+	  "^\\s-*class.*{\\|^\\s-*struct.*{\\|^\\s-*enum.*{\\|"
+	  "^\\\\[sb][a-z]*{.*}\\s-*$\\|"	    		; latex
+	  "^@node\\|@table\\|^@m?enu\\|^@itemize\\|^@if\\|"	; texinfo
+	  "^.+:-")			                        ; prolog
+  "*Regexps for Headings. Used by \[\[ and \]\].")
+
+(defvar vip-heading-end 
+  (concat "^}\\|"						; C/C++
+	  "^\\\\end{\\|"					; latex
+	  "^@end \\|"						; texinfo
+	  ")\n\n[ \t\n]*\\|"					; lisp
+	  "\\.\\s-*$")						; prolog
+      "*Regexps to end Headings/Sections. Used by \[\].")
+
+
+;; These two vars control the interaction of jumps performed by ' and `.
+;; In this new version, '' doesn't erase the marks set by ``, so one can
+;; use both kinds of jumps interchangeably and without loosing positions
+;; inside the lines.
+
+;; Remembers position of the last jump done using ``'.
+(vip-deflocalvar vip-last-jump  nil)
+;; Remembers position of the last jump done using `''.
+(vip-deflocalvar vip-last-jump-ignore 0)
+
+;; History variables
+
+;; History of search strings.
+(defvar vip-search-history  (list ""))
+;; History of query-replace strings used as a source.
+(defvar vip-replace1-history nil)
+;; History of query-replace strings used as replacement.
+(defvar vip-replace2-history nil)
+;; History of region quoting strings.
+(defvar vip-quote-region-history (list vip-quote-string))
+;; History of Ex-style commands.
+(defvar vip-ex-history nil)
+;; History of shell commands.
+(defvar vip-shell-history nil)
+
+
+;; Last shell command. There are two of these, one for Ex (in viper-ex)
+;; and one for Vi.
+
+;; Last shell command executed with ! command.
+(defvar vip-last-shell-com nil)
+
+
+
+;;; Miscellaneous
+
+;; don't bark when mark is inactive
+(setq mark-even-if-inactive t)
+
+(defvar vip-inhibit-startup-message nil
+  "Whether Viper startup message should be inhibited.")
+
+(defvar vip-always t
+  "t means, arrange that vi-state will be a default.")
+
+(defvar vip-custom-file-name (vip-convert-standard-file-name "~/.vip")
+  "Viper customisation file.
+This variable must be set _before_ loading Viper.")
+
+
+(defvar vip-spell-function 'ispell-region
+  "Spell function used by #s<move> command to spell.")
+
+(defvar vip-tags-file-name "TAGS"
+  "The tags file used by Viper.")
+
+;; Indicates if we are in the middle of executing a command that takes another
+;; command as an argument, e.g., cw, dw, etc.
+(defvar vip-inside-command-argument-action nil)
+
+;; Minibuffer
+
+(defvar vip-vi-style-in-minibuffer t
+  "If t, use vi-style editing in minibuffer.
+Should be set in `~/.vip' file.")
+  
+;; overlay used in the minibuffer to indicate which state it is in
+(vip-deflocalvar vip-minibuffer-overlay nil)
+
+;; Hook, specific to Viper, which is run just *before* exiting the minibuffer.
+;; Beginning with Emacs 19.26, the standard `minibuffer-exit-hook' is run
+;; *after* exiting the minibuffer
+(defvar vip-minibuffer-exit-hook nil)
+
+;; setup emacs-supported vi-style feel
+(setq next-line-add-newlines nil
+      require-final-newline t)
+
+(make-variable-buffer-local 'require-final-newline)
+       
+
+;; Mode line
+(defconst vip-vi-state-id  	"<V> "
+  "Mode line tag identifying the Vi mode of Viper.")
+(defconst vip-emacs-state-id	"<E> "
+  "Mode line tag identifying the Emacs mode of Viper.")
+(defconst vip-insert-state-id	"<I> "
+  "Mode line tag identifying the Insert mode of Viper.")
+(defconst vip-replace-state-id	"<R> "
+  "Mode line tag identifying the Replace mode of Viper.")
+
+;; Viper changes the default mode-line-buffer-identification
+(setq-default mode-line-buffer-identification '(" %b"))
+
+;; Variable displaying the current Viper state in the mode line.
+(vip-deflocalvar vip-mode-string vip-emacs-state-id)
+(or (memq 'vip-mode-string global-mode-string)
+    (setq global-mode-string
+	  (append '("" vip-mode-string) (cdr global-mode-string))))
+
+
+(defvar vip-vi-state-hook nil
+  "*Hooks run just before the switch to Vi mode is completed.")
+(defvar vip-insert-state-hook nil
+  "*Hooks run just before the switch to Insert mode is completed.")
+(defvar vip-replace-state-hook nil
+  "*Hooks run just before the switch to Replace mode is completed.")
+(defvar vip-emacs-state-hook nil
+  "*Hooks run just before the switch to Emacs mode is completed.")
+  
+(defvar vip-load-hook nil
+  "Hooks run just after loading Viper.")
+  
+;;;  viper-ex.el ends here
--- a/lisp/viper/viper-keym.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/viper-keym.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; viper-keym.el --- Viper keymaps
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -32,7 +32,7 @@
 (defvar vip-ex-style-motion)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'viper-util)
 	(load "viper-util.el" nil nil 'nosuffix))
     ))
@@ -40,6 +40,7 @@
 
 (require 'viper-util)
 
+
 ;;; Variables
 
 (defvar vip-toggle-key "\C-z"
@@ -239,8 +240,8 @@
 
 ;; Replace keymap
 (define-key vip-replace-map "\C-t" 'vip-forward-indent)
-(define-key vip-replace-map "\C-j" 'vip-replace-state-exit-cmd)
-(define-key vip-replace-map "\C-m" 'vip-replace-state-exit-cmd)
+(define-key vip-replace-map "\C-j" 'vip-replace-state-carriage-return)
+(define-key vip-replace-map "\C-m" 'vip-replace-state-carriage-return)
 (define-key vip-replace-map "\C-?" 'vip-del-backward-char-in-replace)
 
 
--- a/lisp/viper/viper-macs.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/viper-macs.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; viper-macs.el --- functions implementing keyboard macros for Viper
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -29,13 +29,15 @@
 (defvar vip-current-state)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'viper-util)
 	(load "viper-util.el" nil nil 'nosuffix))
     (or (featurep 'viper-keym)
 	(load "viper-keym.el" nil nil 'nosuffix))
     (or (featurep 'viper-mous)
 	(load "viper-mous.el" nil nil 'nosuffix))
+    (or (featurep 'viper)
+	(load "viper.el" nil nil 'nosuffix))
     ))
 ;; end pacifier
 
--- a/lisp/viper/viper-mous.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/viper-mous.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; viper-mous.el --- mouse support for Viper
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -33,14 +33,17 @@
 (defvar vip-re-search)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'viper-util)
 	(load "viper-util.el" nil nil 'nosuffix))
+    (or (featurep 'viper)
+	(load "viper.el" nil nil 'nosuffix))
     ))
 ;; end pacifier
 
 (require 'viper-util)
 
+
 
 ;;; Variables
   
--- a/lisp/viper/viper-util.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/viper-util.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,6 +1,6 @@
 ;;; viper-util.el --- Utilities used by viper.el
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -22,254 +22,32 @@
 
 ;; Code
 
-(require 'ring)
-
 ;; Compiler pacifier
 (defvar vip-overriding-map)
 (defvar pm-color-alist)
 (defvar zmacs-region-stays)
-(defvar vip-search-face)
 (defvar vip-minibuffer-current-face)
 (defvar vip-minibuffer-insert-face)
 (defvar vip-minibuffer-vi-face)
 (defvar vip-minibuffer-emacs-face)
 (defvar vip-replace-overlay-face)
-(defvar vip-minibuffer-overlay)
-(defvar vip-replace-overlay)
-(defvar vip-search-overlay)
-(defvar vip-replace-overlay-cursor-color)
-(defvar vip-intermediate-command)
-(defvar vip-use-replace-region-delimiters)
 (defvar vip-fast-keyseq-timeout)
-(defvar vip-related-files-and-buffers-ring)
-(defvar vip-saved-cursor-color)
 (defvar ex-unix-type-shell)
 (defvar ex-unix-type-shell-options)
 (defvar vip-ex-tmp-buf-name)
+
+(require 'cl)
+(require 'ring)
+
+(and noninteractive
+     (eval-when-compile
+       (let ((load-path (cons (expand-file-name ".") load-path)))
+	 (or (featurep 'viper-init)
+	     (load "viper-init.el" nil nil 'nosuffix))
+	 )))
 ;; end pacifier
 
-;; Is it XEmacs?
-(defconst vip-xemacs-p (string-match "\\(Lucid\\|XEmacs\\)" emacs-version))
-;; Is it Emacs?
-(defconst vip-emacs-p (not vip-xemacs-p))
-;; Tell whether we are running as a window application or on a TTY
-(defsubst vip-device-type ()
-  (if vip-emacs-p
-      window-system
-    (device-type (selected-device))))
-;; in XEmacs: device-type is tty on tty and stream in batch.
-(defun vip-window-display-p ()
-  (and (vip-device-type) (not (memq (vip-device-type) '(tty stream pc)))))
-
-(defvar vip-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95))
-  "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95.")
-(defvar vip-vms-os-p (memq system-type '(vax-vms axp-vms))
-  "Tells if Emacs is running under VMS.")
-
-(defvar vip-force-faces nil
-  "If t, Viper will think that it is running on a display that supports faces.
-This is provided as a temporary relief for users of face-capable displays
-that Viper doesn't know about.")
-
-(defun vip-has-face-support-p ()
-  (cond ((vip-window-display-p))
-	(vip-force-faces)
-	(vip-emacs-p (memq (vip-device-type) '(pc)))
-	(vip-xemacs-p (memq (vip-device-type) '(tty pc)))))
-
-
-;;; Macros
-
-(defmacro vip-deflocalvar (var default-value &optional documentation)
-  (` (progn
-       (defvar (, var) (, default-value)
-	       (, (format "%s\n\(buffer local\)" documentation)))
-       (make-variable-buffer-local '(, var))
-     )))
-
-(defmacro vip-loop (count body)
-  "(vip-loop COUNT BODY) Execute BODY COUNT times."
-  (list 'let (list (list 'count count))
-	(list 'while '(> count 0)
-	      body
-	      '(setq count (1- count))
-	      )))
-
-(defmacro vip-buffer-live-p (buf)
-  (` (and (, buf) (get-buffer (, buf)) (buffer-name (get-buffer (, buf))))))
-  
-;; return buffer-specific macro definition, given a full macro definition
-(defmacro vip-kbd-buf-alist (macro-elt)
-  (` (nth 1 (, macro-elt))))
-;; get a pair: (curr-buffer . macro-definition)
-(defmacro vip-kbd-buf-pair (macro-elt)
-  (` (assoc (buffer-name) (vip-kbd-buf-alist (, macro-elt)))))
-;; get macro definition for current buffer
-(defmacro vip-kbd-buf-definition (macro-elt)
-  (` (cdr (vip-kbd-buf-pair (, macro-elt)))))
-  
-;; return mode-specific macro definitions, given a full macro definition
-(defmacro vip-kbd-mode-alist (macro-elt)
-  (` (nth 2 (, macro-elt))))
-;; get a pair: (major-mode . macro-definition)
-(defmacro vip-kbd-mode-pair (macro-elt)
-  (` (assoc major-mode (vip-kbd-mode-alist (, macro-elt)))))
-;; get macro definition for the current major mode
-(defmacro vip-kbd-mode-definition (macro-elt)
-  (` (cdr (vip-kbd-mode-pair (, macro-elt)))))
-  
-;; return global macro definition, given a full macro definition
-(defmacro vip-kbd-global-pair (macro-elt)
-  (` (nth 3 (, macro-elt))))
-;; get global macro definition from an elt of macro-alist
-(defmacro vip-kbd-global-definition (macro-elt)
-  (` (cdr (vip-kbd-global-pair (, macro-elt)))))
-  
-;; last elt of a sequence
-(defsubst vip-seq-last-elt (seq)
-  (elt seq (1- (length seq))))
-  
-;; Check if arg is a valid character for register
-;; TYPE is a list that can contain `letter', `Letter', and `digit'.
-;; Letter means lowercase letters, Letter means uppercase letters, and
-;; digit means digits from 1 to 9.
-;; If TYPE is nil, then down/uppercase letters and digits are allowed.
-(defun vip-valid-register (reg &optional type)
-  (or type (setq type '(letter Letter digit)))
-  (or (if (memq 'letter type)
-	  (and (<= ?a reg) (<= reg ?z)))
-      (if (memq 'digit type)
-	  (and (<= ?1 reg) (<= reg ?9)))
-      (if (memq 'Letter type)
-	  (and (<= ?A reg) (<= reg ?Z)))
-      ))
-      
-;; checks if object is a marker, has a buffer, and points to within that buffer
-(defun vip-valid-marker (marker)
-  (if (and (markerp marker) (marker-buffer marker))
-      (let ((buf (marker-buffer marker))
-	    (pos (marker-position marker)))
-	(save-excursion
-	  (set-buffer buf)
-	  (and (<= pos (point-max)) (<= (point-min) pos))))))
-  
-
-(defvar vip-minibuffer-overlay-priority 300)
-(defvar vip-replace-overlay-priority 400)
-(defvar vip-search-overlay-priority 500)
-  
-
-;;; Viper minor modes
-
-;; This is not local in Emacs, so we make it local.
-;; This must be local because although the stack of minor modes can be the same
-;; for all buffers, the associated *keymaps* can be different. In Viper,
-;; vip-vi-local-user-map, vip-insert-local-user-map, and others can have
-;; different keymaps for different buffers.
-;; Also, the keymaps associated with vip-vi/insert-state-modifier-minor-mode
-;; can be different.
-(make-variable-buffer-local 'minor-mode-map-alist)
-
-;; Mode for vital things like \e, C-z.
-(vip-deflocalvar vip-vi-intercept-minor-mode nil)
-
-(vip-deflocalvar vip-vi-basic-minor-mode nil
-  "Viper's minor mode for Vi bindings.")
-  
-(vip-deflocalvar vip-vi-local-user-minor-mode nil
-  "Auxiliary minor mode for user-defined local bindings in Vi state.")
-
-(vip-deflocalvar vip-vi-global-user-minor-mode nil
-  "Auxiliary minor mode for user-defined global bindings in Vi state.")
-
-(vip-deflocalvar vip-vi-state-modifier-minor-mode nil
-  "Minor mode used to make major-mode-specific modification to Vi state.")
-
-(vip-deflocalvar vip-vi-diehard-minor-mode nil
-  "This minor mode is in effect when the user wants Viper to be Vi.")
-
-(vip-deflocalvar vip-vi-kbd-minor-mode nil
-  "Minor mode for Ex command macros in Vi state.
-The corresponding keymap stores key bindings of Vi macros defined with
-the Ex command :map.")
-
-;; Mode for vital things like \e, C-z.
-(vip-deflocalvar vip-insert-intercept-minor-mode nil)
-
-(vip-deflocalvar vip-insert-basic-minor-mode nil
-  "Viper's minor mode for bindings in Insert mode.")
-
-(vip-deflocalvar vip-insert-local-user-minor-mode nil
-  "Auxiliary minor mode for buffer-local user-defined bindings in Insert state.
-This is a way to overshadow normal Insert mode bindings locally to certain
-designated buffers.")
-
-(vip-deflocalvar vip-insert-global-user-minor-mode nil
-  "Auxiliary minor mode for global user-defined bindings in Insert state.")
-
-(vip-deflocalvar vip-insert-state-modifier-minor-mode nil
-  "Minor mode used to make major-mode-specific modification to Insert state.")
-
-(vip-deflocalvar vip-insert-diehard-minor-mode nil
-  "Minor mode that simulates Vi very closely.
-Not recommened, except for the novice user.")
-
-(vip-deflocalvar vip-insert-kbd-minor-mode nil
-"Minor mode for Ex command macros Insert state.
-The corresponding keymap stores key bindings of Vi macros defined with
-the Ex command :map!.")
-
-(vip-deflocalvar vip-replace-minor-mode nil
-  "Minor mode in effect in replace state (cw, C, and the like commands).")
-
-;; Mode for vital things like \C-z and \C-x)
-;; This is t, by default. So, any new buffer will have C-z defined as
-;; switch to Vi, unless we switched states in this buffer
-(vip-deflocalvar vip-emacs-intercept-minor-mode t)
-  
-(vip-deflocalvar vip-emacs-local-user-minor-mode t
-  "Minor mode for local user bindings effective in Emacs state.
-Users can use it to override Emacs bindings when Viper is in its Emacs
-state.")  
-  
-(vip-deflocalvar vip-emacs-global-user-minor-mode t
-  "Minor mode for global user bindings in effect in Emacs state.
-Users can use it to override Emacs bindings when Viper is in its Emacs
-state.")  
-
-(vip-deflocalvar vip-emacs-kbd-minor-mode t
-  "Minor mode for Vi style macros in Emacs state.
-The corresponding keymap stores key bindings of Vi macros defined with
-`vip-record-kbd-macro' command. There is no Ex-level command to do this
-interactively.")
-
-(vip-deflocalvar vip-emacs-state-modifier-minor-mode t
-  "Minor mode used to make major-mode-specific modification to Emacs state.
-For instance, a Vi purist may want to bind `dd' in Dired mode to a function
-that deletes a file.")
-
-(vip-deflocalvar vip-vi-minibuffer-minor-mode nil
-   "Minor mode that forces Vi-style when the Minibuffer is in Vi state.")
-
-(vip-deflocalvar vip-insert-minibuffer-minor-mode nil
-   "Minor mode that forces Vi-style when the Minibuffer is in Insert state.")
-  
-
-
-;; Some common error messages
-
-(defconst vip-SpuriousText "Spurious text after command"  "")
-(defconst vip-BadExCommand "Not an editor command"   "")
-(defconst vip-InvalidCommandArgument "Invalid command argument"   "")
-(defconst vip-NoPrevSearch "No previous search string"   "")
-(defconst vip-EmptyRegister "`%c': Nothing in this register"   "")
-(defconst vip-InvalidRegister "`%c': Invalid register"   "")
-(defconst vip-EmptyTextmarker "`%c': Text marker doesn't point anywhere"   "")
-(defconst vip-InvalidTextmarker "`%c': Invalid text marker"   "")
-(defconst vip-InvalidViCommand "Invalid command"   "")
-(defconst vip-BadAddress "Ill-formed address"   "")
-(defconst vip-FirstAddrExceedsSecond "First address exceeds second"   "")
-(defconst vip-NoFileSpecified "No file specified"   "")
+(require 'viper-init)
 
 
 
@@ -360,7 +138,7 @@
       (modify-frame-parameters
        (selected-frame) (list (cons 'cursor-color new-color)))))
 	 
-(defsubst vip-save-cursor-color ()
+(defun vip-save-cursor-color ()
   (if (and (vip-window-display-p) (vip-color-display-p))
       (let ((color (vip-get-cursor-color)))
 	(if (and (stringp color) (vip-color-defined-p color)
@@ -375,6 +153,115 @@
   (vip-change-cursor-color vip-saved-cursor-color))
 	 
 
+;; Face-saving tricks
+
+(defvar vip-search-face
+  (if (vip-has-face-support-p)
+      (progn
+	(make-face 'vip-search-face)
+	(vip-hide-face 'vip-search-face)
+	(or (face-differs-from-default-p 'vip-search-face)
+	    ;; face wasn't set in .vip or .Xdefaults
+	    (if (vip-can-use-colors "Black" "khaki")
+		(progn
+		  (set-face-background 'vip-search-face "khaki")
+		  (set-face-foreground 'vip-search-face "Black"))
+	      (set-face-underline-p 'vip-search-face t)
+	      (vip-set-face-pixmap 'vip-search-face vip-search-face-pixmap)))
+	'vip-search-face))
+  "*Face used to flash out the search pattern.")
+  
+(defvar vip-replace-overlay-face
+  (if (vip-has-face-support-p)
+      (progn
+	(make-face 'vip-replace-overlay-face)
+	(vip-hide-face 'vip-replace-overlay-face)
+	(or (face-differs-from-default-p 'vip-replace-overlay-face)
+	    (progn
+	      (if (vip-can-use-colors "darkseagreen2" "Black")
+		  (progn
+		    (set-face-background
+		     'vip-replace-overlay-face "darkseagreen2")
+		    (set-face-foreground 'vip-replace-overlay-face "Black")))
+	      (set-face-underline-p 'vip-replace-overlay-face t)
+	      (vip-set-face-pixmap
+	       'vip-replace-overlay-face vip-replace-overlay-pixmap)))
+	'vip-replace-overlay-face))
+  "*Face for highlighting replace regions on a window display.")
+
+(defvar vip-minibuffer-emacs-face
+  (if (vip-has-face-support-p)
+      (progn
+	(make-face 'vip-minibuffer-emacs-face)
+	(vip-hide-face 'vip-minibuffer-emacs-face)
+	(or (face-differs-from-default-p 'vip-minibuffer-emacs-face)
+	    ;; face wasn't set in .vip or .Xdefaults
+	    (if vip-vi-style-in-minibuffer
+		;; emacs state is an exception in the minibuffer
+		(if (vip-can-use-colors "darkseagreen2" "Black")
+		    (progn
+		      (set-face-background
+		       'vip-minibuffer-emacs-face "darkseagreen2")
+		      (set-face-foreground
+		       'vip-minibuffer-emacs-face "Black"))
+		  (copy-face 'modeline 'vip-minibuffer-emacs-face))
+	      ;; emacs state is the main state in the minibuffer
+	      (if (vip-can-use-colors "Black" "pink")
+		  (progn
+		    (set-face-background 'vip-minibuffer-emacs-face "pink") 
+		    (set-face-foreground
+		     'vip-minibuffer-emacs-face "Black"))
+		(copy-face 'italic 'vip-minibuffer-emacs-face))
+	      ))
+	'vip-minibuffer-emacs-face))
+  "Face used in the Minibuffer when it is in Emacs state.")
+    
+(defvar vip-minibuffer-insert-face
+  (if (vip-has-face-support-p)
+      (progn
+	(make-face 'vip-minibuffer-insert-face)
+	(vip-hide-face 'vip-minibuffer-insert-face)
+	(or (face-differs-from-default-p 'vip-minibuffer-insert-face)
+	    (if vip-vi-style-in-minibuffer
+		(if (vip-can-use-colors "Black" "pink")
+		    (progn
+		      (set-face-background 'vip-minibuffer-insert-face "pink") 
+		      (set-face-foreground
+		       'vip-minibuffer-insert-face "Black"))
+		  (copy-face 'italic 'vip-minibuffer-insert-face))
+	      ;; If Insert state is an exception
+	      (if (vip-can-use-colors "darkseagreen2" "Black")
+		  (progn
+		    (set-face-background
+		     'vip-minibuffer-insert-face "darkseagreen2")
+		    (set-face-foreground
+		     'vip-minibuffer-insert-face "Black"))
+		(copy-face 'modeline 'vip-minibuffer-insert-face))
+	      (vip-italicize-face 'vip-minibuffer-insert-face)))
+	'vip-minibuffer-insert-face))
+  "Face used in the Minibuffer when it is in Insert state.")
+    
+(defvar vip-minibuffer-vi-face
+  (if (vip-has-face-support-p)
+      (progn
+	(make-face 'vip-minibuffer-vi-face)
+	(vip-hide-face 'vip-minibuffer-vi-face)
+	(or (face-differs-from-default-p 'vip-minibuffer-vi-face)
+	    (if vip-vi-style-in-minibuffer
+		(if (vip-can-use-colors "Black" "grey")
+		    (progn
+		      (set-face-background 'vip-minibuffer-vi-face "grey")
+		      (set-face-foreground 'vip-minibuffer-vi-face "Black"))
+		  (copy-face 'bold 'vip-minibuffer-vi-face))
+	      (copy-face 'bold 'vip-minibuffer-vi-face)
+	      (invert-face 'vip-minibuffer-vi-face)))
+	'vip-minibuffer-vi-face))
+  "Face used in the Minibuffer when it is in Vi state.")
+    
+;; the current face to be used in the minibuffer
+(vip-deflocalvar vip-minibuffer-current-face vip-minibuffer-emacs-face "")
+   
+
 ;; Check the current version against the major and minor version numbers
 ;; using op: cur-vers op major.minor If emacs-major-version or
 ;; emacs-minor-version are not defined, we assume that the current version
@@ -403,8 +290,8 @@
 	  ((memq op '(< <=)) t))))
 	  
 ;;;; warn if it is a wrong version of emacs
-;;(if (or (vip-check-version '< 19 29 'emacs)
-;;	(vip-check-version '< 19 12 'xemacs))
+;;(if (or (vip-check-version '< 19 35 'emacs)
+;;	(vip-check-version '< 19 15 'xemacs))
 ;;    (progn
 ;;      (with-output-to-temp-buffer " *vip-info*"
 ;;	(switch-to-buffer " *vip-info*")
@@ -413,9 +300,9 @@
 ;;
 ;;This version of Viper requires 
 ;;
-;;\t Emacs 19.29 and higher
+;;\t Emacs 19.35 and higher
 ;;\t OR
-;;\t XEmacs 19.12 and higher
+;;\t XEmacs 19.15 and higher
 ;;
 ;;It is unlikely to work under Emacs version %s
 ;;that you are using... " emacs-version))
@@ -674,13 +561,6 @@
       (setq tmp (cdr tmp)))
     (reverse (apply 'append tmp2))))
 
-(defun vip-convert-standard-file-name (fname)
-  (if vip-emacs-p
-      (convert-standard-filename fname)
-    ;; hopefully, XEmacs adds this functionality
-    fname))
-
-
 
 ;;; Insertion ring
 
@@ -892,7 +772,15 @@
     (vip-overlay-put
      vip-replace-overlay (if vip-emacs-p 'evaporate 'detachable) nil)
     (vip-overlay-put 
-     vip-replace-overlay 'priority vip-replace-overlay-priority)) 
+     vip-replace-overlay 'priority vip-replace-overlay-priority)
+    ;; If Emacs will start supporting overlay maps, as it currently supports
+    ;; text-property maps, we could do away with vip-replace-minor-mode and
+    ;; just have keymap attached to replace overlay.
+    ;;(vip-overlay-put
+    ;; vip-replace-overlay
+    ;; (if vip-xemacs-p 'keymap 'local-map)
+    ;; vip-replace-map)
+    ) 
   (if (vip-has-face-support-p)
       (vip-overlay-put vip-replace-overlay 'face vip-replace-overlay-face))
   (vip-save-cursor-color)
@@ -900,7 +788,7 @@
   )
   
       
-(defsubst vip-set-replace-overlay-glyphs (before-glyph after-glyph)
+(defun vip-set-replace-overlay-glyphs (before-glyph after-glyph)
   (if (or (not (vip-has-face-support-p))
 	  vip-use-replace-region-delimiters)
       (let ((before-name (if vip-xemacs-p 'begin-glyph 'before-string))
@@ -908,7 +796,7 @@
 	(vip-overlay-put vip-replace-overlay before-name before-glyph)
 	(vip-overlay-put vip-replace-overlay after-name after-glyph))))
   
-(defsubst vip-hide-replace-overlay ()
+(defun vip-hide-replace-overlay ()
   (vip-set-replace-overlay-glyphs nil nil)
   (vip-restore-cursor-color-after-replace)
   (vip-restore-cursor-color-after-insert)
@@ -979,7 +867,15 @@
   (let ((ESC-keys '(?\e (control \[) escape))
 	(key (vip-event-key event)))
     (member key ESC-keys)))
-	
+
+;; checks if object is a marker, has a buffer, and points to within that buffer
+(defun vip-valid-marker (marker)
+  (if (and (markerp marker) (marker-buffer marker))
+      (let ((buf (marker-buffer marker))
+	    (pos (marker-position marker)))
+	(save-excursion
+	  (set-buffer buf)
+	  (and (<= pos (point-max)) (<= (point-min) pos))))))
   
 (defsubst vip-mark-marker ()
   (if vip-xemacs-p
@@ -1004,6 +900,21 @@
   (if vip-xemacs-p
       (setq zmacs-region-stays t)))
 
+;; Check if arg is a valid character for register
+;; TYPE is a list that can contain `letter', `Letter', and `digit'.
+;; Letter means lowercase letters, Letter means uppercase letters, and
+;; digit means digits from 1 to 9.
+;; If TYPE is nil, then down/uppercase letters and digits are allowed.
+(defun vip-valid-register (reg &optional type)
+  (or type (setq type '(letter Letter digit)))
+  (or (if (memq 'letter type)
+	  (and (<= ?a reg) (<= reg ?z)))
+      (if (memq 'digit type)
+	  (and (<= ?1 reg) (<= reg ?9)))
+      (if (memq 'Letter type)
+	  (and (<= ?A reg) (<= reg ?Z)))
+      ))
+
     
 (defsubst vip-events-to-keys (events)
   (cond (vip-xemacs-p (events-to-keys events))
@@ -1103,40 +1014,44 @@
 (defun vip-event-key (event)
   (or (and event (eventp event))
       (error "vip-event-key: Wrong type argument, eventp, %S" event))
-  (let ((mod (event-modifiers event))
-	basis)
-    (setq basis
-	  (cond
-	   (vip-xemacs-p
-	    (cond ((key-press-event-p event)
-		   (event-key event))
-		  ((button-event-p event)
-		   (concat "mouse-" (prin1-to-string (event-button event))))
-		  (t 
-		   (error "vip-event-key: Unknown event, %S" event))))
-	   (t 
-	    ;; Emacs doesn't handle capital letters correctly, since
-	    ;; \S-a isn't considered the same as A (it behaves as
-	    ;; plain `a' instead). So we take care of this here
-	    (cond ((and (vip-characterp event) (<= ?A event) (<= event ?Z))
-		   (setq mod nil
-			 event event))
-		  ;; Emacs has the oddity whereby characters 128+char
-		  ;; represent M-char *if* this appears inside a string.
-		  ;; So, we convert them manually to (meta char).
-		  ((and (vip-characterp event) (< ?\C-? event) (<= event 255))
-		   (setq mod '(meta)
-			 event (- event ?\C-? 1)))
-		  (t (event-basic-type event)))
-	    )))
-    (if (vip-characterp basis)
-	(setq basis
-	      (if (= basis ?\C-?)
-		  (list 'control '\?) ; taking care of an emacs bug
-		(intern (char-to-string basis)))))
-    (if mod
-	(append mod (list basis))
-      basis)))
+  (when (cond (vip-xemacs-p (or (key-press-event-p event)
+				(mouse-event-p event)))
+	      (t t))
+    (let ((mod (event-modifiers event))
+	  basis)
+      (setq basis
+	    (cond
+	     (vip-xemacs-p
+	      (cond ((key-press-event-p event)
+		     (event-key event))
+		    ((button-event-p event)
+		     (concat "mouse-" (prin1-to-string (event-button event))))
+		    (t 
+		     (error "vip-event-key: Unknown event, %S" event))))
+	     (t 
+	      ;; Emacs doesn't handle capital letters correctly, since
+	      ;; \S-a isn't considered the same as A (it behaves as
+	      ;; plain `a' instead). So we take care of this here
+	      (cond ((and (vip-characterp event) (<= ?A event) (<= event ?Z))
+		     (setq mod nil
+			   event event))
+		    ;; Emacs has the oddity whereby characters 128+char
+		    ;; represent M-char *if* this appears inside a string.
+		    ;; So, we convert them manually to (meta char).
+		    ((and (vip-characterp event)
+			  (< ?\C-? event) (<= event 255))
+		     (setq mod '(meta)
+			   event (- event ?\C-? 1)))
+		    (t (event-basic-type event)))
+	      )))
+      (if (vip-characterp basis)
+	  (setq basis
+		(if (= basis ?\C-?)
+		    (list 'control '\?) ; taking care of an emacs bug
+		  (intern (char-to-string basis)))))
+      (if mod
+	  (append mod (list basis))
+	basis))))
     
 (defun vip-key-to-emacs-key (key)
   (let (key-name char-p modifiers mod-char-list base-key base-key-name)
@@ -1303,7 +1218,7 @@
 		    (append (vconcat vip-ALPHA-char-class) nil)))))
     ))
 
-(defsubst vip-looking-at-separator ()
+(defun vip-looking-at-separator ()
   (let ((char (char-after (point))))
     (if char
 	(or (eq char ?\n) ; RET is always a separator in Vi
@@ -1313,7 +1228,7 @@
 (defsubst vip-looking-at-alphasep (&optional addl-chars)
   (or (vip-looking-at-separator) (vip-looking-at-alpha addl-chars)))
 
-(defsubst vip-skip-alpha-forward (&optional addl-chars)
+(defun vip-skip-alpha-forward (&optional addl-chars)
   (or (stringp addl-chars) (setq addl-chars ""))
   (vip-skip-syntax
    'forward 
@@ -1324,7 +1239,7 @@
 	  (concat vip-strict-ALPHA-chars addl-chars))
 	 (t addl-chars))))
 
-(defsubst vip-skip-alpha-backward (&optional addl-chars)
+(defun vip-skip-alpha-backward (&optional addl-chars)
   (or (stringp addl-chars) (setq addl-chars ""))
   (vip-skip-syntax
    'backward 
@@ -1351,14 +1266,14 @@
     (funcall func (concat "^" vip-SEP-char-class)
 	     (vip-line-pos (if (eq direction 'forward) 'end 'start)))))
 
-(defsubst vip-skip-nonalphasep-forward ()
+(defun vip-skip-nonalphasep-forward ()
   (if (eq vip-syntax-preference 'strict-vi)
       (skip-chars-forward
        (concat "^" vip-strict-SEP-chars vip-strict-ALPHA-chars))
     (skip-syntax-forward
      (concat
       "^" vip-ALPHA-char-class vip-SEP-char-class) (vip-line-pos 'end))))
-(defsubst vip-skip-nonalphasep-backward ()
+(defun vip-skip-nonalphasep-backward ()
   (if (eq vip-syntax-preference 'strict-vi)
       (skip-chars-backward
        (concat "^" vip-strict-SEP-chars vip-strict-ALPHA-chars))
--- a/lisp/viper/viper.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/viper/viper.el	Mon Aug 13 09:07:36 2007 +0200
@@ -6,9 +6,9 @@
 ;;  Keywords: emulations
 ;;  Author: Michael Kifer <kifer@cs.sunysb.edu>
 
-;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
-
-(defconst viper-version "2.92 of January 3, 1997"
+;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+
+(defconst viper-version "2.92 of January 10, 1997"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -312,7 +312,7 @@
 (defvar mark-even-if-inactive)
 
 (eval-when-compile
-  (let ((load-path (cons "." load-path)))
+  (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'viper-util)
 	(load "viper-util.el" nil nil 'nosuffix))
     (or (featurep 'viper-keym)
@@ -326,6 +326,7 @@
     ))
 ;; end pacifier
 
+
 (require 'viper-util)
 (require 'viper-keym)
 (require 'viper-mous)
@@ -334,462 +335,6 @@
 
 
 
-;;; Variables
-	      
-;; Is t until viper-mode executes for the very first time. 
-;; Prevents recursive descend into startup messages.
-(defvar vip-first-time t)
-
-(defvar vip-expert-level 0
-  "User's expert level.
-The minor mode vip-vi-diehard-minor-mode is in effect when
-vip-expert-level is 1 or 2 or when vip-want-emacs-keys-in-vi is t.
-The minor mode vip-insert-diehard-minor-mode is in effect when
-vip-expert-level is 1 or 2 or if vip-want-emacs-keys-in-insert is t.
-Use `M-x vip-set-expert-level' to change this.")
-
-;; Max expert level supported by Viper. This is NOT a user option.
-;; It is here to make it hard for the user from resetting it.
-(defconst vip-max-expert-level 5)
-
-;; Contains user settings for vars affected by vip-set-expert-level function.
-;; Not a user option.
-(defvar vip-saved-user-settings nil)
-	       
-
-;;; ISO characters
-  
-(vip-deflocalvar vip-automatic-iso-accents nil
-  "*If non-nil, ISO accents will be turned on in insert/replace emacs states and turned off in vi-state. 
-For some users, this behavior may be too primitive. In this case, use
-insert/emacs/vi state hooks.")
-  
-
-;; VI-style Undo
-
-;; Used to 'undo' complex commands, such as replace and insert commands.
-(vip-deflocalvar vip-undo-needs-adjustment nil)
-(put 'vip-undo-needs-adjustment 'permanent-local t)
-
-;; A mark that Viper puts on buffer-undo-list.  Marks the beginning of a
-;; complex command that must be undone atomically. If inserted, it is
-;; erased by vip-change-state-to-vi and vip-repeat.
-(defconst vip-buffer-undo-list-mark 'viper)
-
-(defvar vip-keep-point-on-undo nil
-  "*Non-nil means not to move point while undoing commands.
-This style is different from Emacs and Vi. Try it to see if
-it better fits your working style.")  
-
-;; Replace mode and changing text
-
-;; Viper's own after/before change functions, which get vip-add-hook'ed to
-;; Emacs's
-(vip-deflocalvar vip-after-change-functions nil "")
-(vip-deflocalvar vip-before-change-functions nil "")
-(vip-deflocalvar vip-post-command-hooks nil "")
-(vip-deflocalvar vip-pre-command-hooks nil "")
-
-;; Can be used to pass global states around for short period of time
-(vip-deflocalvar vip-intermediate-command nil "")
-
-;; Indicates that the current destructive command has started in replace mode.
-(vip-deflocalvar vip-began-as-replace nil "")
-
-(defvar vip-replace-overlay-cursor-color "Red"
-  "*Cursor color to use in Replace state")
-(defvar vip-insert-state-cursor-color nil
-  "Cursor color for Viper insert state.")
-(put 'vip-insert-state-cursor-color 'permanent-local t)
-;; place to save cursor colow when switching to insert mode
-(vip-deflocalvar vip-saved-cursor-color nil "")
-  
-(vip-deflocalvar vip-replace-overlay nil "")
-(put 'vip-replace-overlay 'permanent-local t)
-
-(defvar vip-replace-overlay-pixmap "gray3"
-  "Pixmap to use for search face on non-color displays.")
-(defvar vip-search-face-pixmap "gray3"
-  "Pixmap to use for search face on non-color displays.")
-
-
-(defun vip-set-replace-overlay-face ()
-  (if (vip-has-face-support-p)
-      (defvar vip-replace-overlay-face
-	(progn
-	  (make-face 'vip-replace-overlay-face)
-	  (vip-hide-face 'vip-replace-overlay-face)
-	(or (face-differs-from-default-p 'vip-replace-overlay-face)
-	    (progn
-	      (if (vip-can-use-colors "darkseagreen2" "Black")
-		  (progn
-		    (set-face-background
-		     'vip-replace-overlay-face "darkseagreen2")
-		    (set-face-foreground 'vip-replace-overlay-face "Black")))
-	      (set-face-underline-p 'vip-replace-overlay-face t)
-	      (vip-set-face-pixmap
-	       'vip-replace-overlay-face vip-replace-overlay-pixmap)))
-	'vip-replace-overlay-face)
-	"*Face for highlighting replace regions on a window display.")
-    ))
-  
-(defvar vip-replace-region-end-delimiter "$"
-  "A string marking the end of replacement regions.
-It is used only with TTYs or if `vip-use-replace-region-delimiters'
-is non-nil.")
-(defvar vip-replace-region-start-delimiter ""
-  "A string marking the beginning of replacement regions.
-It is used only with TTYs or if `vip-use-replace-region-delimiters'
-is non-nil.")
-(defvar vip-use-replace-region-delimiters (not (vip-has-face-support-p))
-  "*If non-nil, Viper will always use `vip-replace-region-end-delimiter' and
-`vip-replace-region-start-delimiter' to delimit replacement regions, even on
-color displays. By default, the delimiters are used only on TTYs.")
-  
-;; XEmacs requires glyphs
-(if vip-xemacs-p
-    (progn
-      (or (glyphp vip-replace-region-end-delimiter)
-	  (setq vip-replace-region-end-delimiter
-		(make-glyph vip-replace-region-end-delimiter)))
-      (or (glyphp vip-replace-region-start-delimiter)
-	  (setq vip-replace-region-start-delimiter
-		(make-glyph vip-replace-region-start-delimiter)))
-      ))
-      
-  
-;; These are local marker that must be initialized to nil and moved with
-;; `vip-move-marker-locally'
-;;
-;; Remember the last position inside the replace region.
-(vip-deflocalvar vip-last-posn-in-replace-region nil)
-;; Remember the last position while inserting
-(vip-deflocalvar vip-last-posn-while-in-insert-state nil)
-(put 'vip-last-posn-in-replace-region 'permanent-local t)
-(put 'vip-last-posn-while-in-insert-state 'permanent-local t)
-
-(vip-deflocalvar vip-sitting-in-replace nil "")
-(put 'vip-sitting-in-replace 'permanent-local t)
-  
-;; Remember the number of characters that have to be deleted in replace
-;; mode to compensate for the inserted characters.
-(vip-deflocalvar vip-replace-chars-to-delete 0 "")
-(vip-deflocalvar vip-replace-chars-deleted 0 "")
-
-;; Insertion ring and command ring
-(defvar vip-insertion-ring-size 14
-  "The size of the insertion ring.")
-;; The insertion ring.
-(defvar vip-insertion-ring nil)
-;; This is temp insertion ring. Used to do rotation for display purposes.
-;; When rotation just started, it is initialized to vip-insertion-ring.
-(defvar vip-temp-insertion-ring nil)
-(defvar vip-last-inserted-string-from-insertion-ring "")
-
-(defvar vip-command-ring-size 14
-  "The size of the command ring.")
-;; The command ring.
-(defvar vip-command-ring nil)
-;; This is temp command ring. Used to do rotation for display purposes.
-;; When rotation just started, it is initialized to vip-command-ring.
-(defvar vip-temp-command-ring nil)
-
-;; Modes and related variables
-
-;; Current mode.  One of: `emacs-state', `vi-state', `insert-state'
-(vip-deflocalvar vip-current-state 'emacs-state)
-
-
-;; Autoindent in insert
-
-;; Variable that keeps track of whether C-t has been pressed.
-(vip-deflocalvar vip-cted nil "")
-
-;; Preserve the indent value, used by C-d in insert mode.
-(vip-deflocalvar vip-current-indent 0)
-
-;; Whether to preserve the indent, used by C-d in insert mode.
-(vip-deflocalvar vip-preserve-indent nil)
-
-(vip-deflocalvar vip-auto-indent nil
-  "*Autoindent if t.")
-(vip-deflocalvar vip-electric-mode t
-  "*If t, enable electric behavior. 
-Currently only enables auto-indentation `according to mode'.")
-
-(defconst vip-shift-width 8
-  "*The shiftwidth variable.")
-
-;; Variables for repeating destructive commands
-
-(defconst vip-keep-point-on-repeat t
-  "*If t, don't move point when repeating previous command.
-This is useful for doing repeated changes with the '.' key.
-The user can change this to nil, if she likes when the cursor moves
-to a new place after repeating previous Vi command.") 
-
-;; Remember insert point as a marker.  This is a local marker that must be
-;; initialized to nil and moved with `vip-move-marker-locally'.
-(vip-deflocalvar vip-insert-point nil)
-(put 'vip-insert-point 'permanent-local t)
-
-;; This remembers the point before dabbrev-expand was called.
-;; If vip-insert-point turns out to be bigger than that, it is reset
-;; back to vip-pre-command-point.
-;; The reason this is needed is because dabbrev-expand (and possibly
-;; others) may jump to before the insertion point, delete something and
-;; then reinsert a bigger piece. For instance:  bla^blo
-;; If dabbrev-expand is called after `blo' and ^ undicates vip-insert-point,
-;; then point jumps to the beginning of `blo'. If expansion is found, `blablo'
-;; is deleted, and we have |^, where | denotes point. Next, dabbrev-expand
-;; will insert the expansion, and we get: blablo^
-;; Whatever we insert next goes before the ^, i.e., before the
-;; vip-insert-point marker. So, Viper will think that nothing was
-;; inserted. Remembering the orig position of the marker circumvents the
-;; problem.
-;; We don't know of any command, except dabbrev-expand, that has the same
-;; problem. However, the same trick can be used if such a command is
-;; discovered later.
-;;
-(vip-deflocalvar vip-pre-command-point nil)
-(put 'vip-pre-command-point 'permanent-local t) ; this is probably an overkill
-
-;; This is used for saving inserted text.
-(defvar vip-last-insertion  nil)
-  
-;; Remembers the last replaced region.
-(defvar vip-last-replace-region "")
-  
-;; Remember com point as a marker.
-;; This is a local marker. Should be moved with `vip-move-marker-locally'
-(vip-deflocalvar vip-com-point nil)
-
-;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys)
-;; It is used to re-execute last destructive command.
-;; M-COM is a Lisp symbol representing the function to be executed.
-;; VAL is the prefix argument that was used with that command.
-;; COM is an internal descriptor, such as ?r, ?c, ?C, which contains
-;; additional information on how the function in M-COM is to be handled.
-;; REG is the register used by command
-;; INSERTED-TEXT is text inserted by that command (in case of o, c, C, i, r
-;; commands).
-;; COMMAND-KEYS are the keys that were typed to invoke the command.
-(defvar vip-d-com nil)
-
-;; The character remembered by the Vi `r' command.
-(defvar vip-d-char nil)
-
-;; Name of register to store deleted or yanked strings
-(defvar vip-use-register nil)
-
-
-
-;; Variables for Moves and Searches
-
-;; For use by `;' command.
-(defvar vip-f-char nil)
-
-;; For use by `.' command.
-(defvar vip-F-char nil)
-
-;; For use by `;' command.
-(defvar vip-f-forward nil)
-
-;; For use by `;' command.
-(defvar vip-f-offset nil)
-
-;; Last search string
-(defvar vip-s-string "")
-
-(defvar vip-quote-string "> "
-  "String inserted at the beginning of quoted region.")
-
-;; If t, search is forward.
-(defvar vip-s-forward nil)
-
-(defconst vip-case-fold-search nil
-  "*If not nil, search ignores cases.")
-
-(defconst vip-re-search t
-  "*If not nil, search is reg-exp search, otherwise vanilla search.")
-
-(defvar vip-search-scroll-threshold 2
-  "*If search lands within this threshnold from the window top/bottom,
-the window will be scrolled up or down appropriately, to reveal context.
-If you want Viper search to behave as usual in Vi, set this variable to a
-negative number.")
-
-(defconst vip-re-query-replace t
-  "*If t then do regexp replace, if nil then do string replace.")
-
-(defconst vip-re-replace t
-  "*If t, do regexp replace. nil means do string replace.")
-
-(vip-deflocalvar vip-ex-style-motion t
-  "*Ex-style: the commands l,h do not cross lines, etc.")
-
-(vip-deflocalvar vip-ex-style-editing-in-insert t
-  "*The keys ^H, ^? don't jump lines in insert, ESC moves cursor back, etc.
-Note: this doesn't preclude ^H and ^? from deleting characters by moving
-past the insertion point. This is a feature, not a bug. ")
-
-(vip-deflocalvar vip-delete-backwards-in-replace nil
-  "*If t, DEL key will delete characters while moving the cursor backwards.
-If nil, the cursor will move backwards without deleting anything.")
-
-(defconst vip-buffer-search-char nil
-  "*Key bound for buffer-searching.")
-
-(defconst vip-search-wrap-around-t t
-  "*If t, search wraps around.")
-  
-(vip-deflocalvar vip-related-files-and-buffers-ring nil
-  "*Ring of file and buffer names that are considered to be related to the
-current buffer.
-These buffers can be cycled through via :R and :P commands.")
-(put 'vip-related-files-and-buffers-ring 'permanent-local t)
-
-;; Used to find out if we are done with searching the current buffer.
-(vip-deflocalvar vip-local-search-start-marker nil)
-;; As above, but global
-(defvar vip-search-start-marker (make-marker))
-
-;; the search overlay
-(vip-deflocalvar vip-search-overlay nil)
-
-
-(defvar vip-heading-start 
-  (concat "^\\s-*(\\s-*defun\\s-\\|"			        ; lisp
-	  "^{\\s-*$\\|^[_a-zA-Z][^()]*[()].*{\\s-*$\\|"	        ; C/C++
-	  "^\\s-*class.*{\\|^\\s-*struct.*{\\|^\\s-*enum.*{\\|"
-	  "^\\\\[sb][a-z]*{.*}\\s-*$\\|"	    		; latex
-	  "^@node\\|@table\\|^@m?enu\\|^@itemize\\|^@if\\|"	; texinfo
-	  "^.+:-")			                        ; prolog
-  "*Regexps for Headings. Used by \[\[ and \]\].")
-
-(defvar vip-heading-end 
-  (concat "^}\\|"						; C/C++
-	  "^\\\\end{\\|"					; latex
-	  "^@end \\|"						; texinfo
-	  ")\n\n[ \t\n]*\\|"					; lisp
-	  "\\.\\s-*$")						; prolog
-      "*Regexps to end Headings/Sections. Used by \[\].")
-
-
-;; These two vars control the interaction of jumps performed by ' and `.
-;; In this new version, '' doesn't erase the marks set by ``, so one can
-;; use both kinds of jumps interchangeably and without loosing positions
-;; inside the lines.
-
-;; Remembers position of the last jump done using ``'.
-(vip-deflocalvar vip-last-jump  nil)
-;; Remembers position of the last jump done using `''.
-(vip-deflocalvar vip-last-jump-ignore 0)
-
-;; History variables
-
-;; History of search strings.
-(defvar vip-search-history  (list ""))
-;; History of query-replace strings used as a source.
-(defvar vip-replace1-history nil)
-;; History of query-replace strings used as replacement.
-(defvar vip-replace2-history nil)
-;; History of region quoting strings.
-(defvar vip-quote-region-history (list vip-quote-string))
-;; History of Ex-style commands.
-(defvar vip-ex-history nil)
-;; History of shell commands.
-(defvar vip-shell-history nil)
-
-
-;; Last shell command. There are two of these, one for Ex (in viper-ex)
-;; and one for Vi.
-
-;; Last shell command executed with ! command.
-(defvar vip-last-shell-com nil)
-
-
-
-;;; Miscellaneous
-
-;; don't bark when mark is inactive
-(setq mark-even-if-inactive t)
-
-(defvar vip-inhibit-startup-message nil
-  "Whether Viper startup message should be inhibited.")
-
-(defvar vip-always t
-  "t means, arrange that vi-state will be a default.")
-
-(defvar vip-custom-file-name (vip-convert-standard-file-name "~/.vip")
-  "Viper customisation file.
-This variable must be set _before_ loading Viper.")
-
-
-(defvar vip-spell-function 'ispell-region
-  "Spell function used by #s<move> command to spell.")
-
-(defvar vip-tags-file-name "TAGS"
-  "The tags file used by Viper.")
-
-;; Indicates if we are in the middle of executing a command that takes another
-;; command as an argument, e.g., cw, dw, etc.
-(defvar vip-inside-command-argument-action nil)
-
-;; Minibuffer
-
-(defvar vip-vi-style-in-minibuffer t
-  "If t, use vi-style editing in minibuffer.
-Should be set in `~/.vip' file.")
-  
-;; overlay used in the minibuffer to indicate which state it is in
-(vip-deflocalvar vip-minibuffer-overlay nil)
-
-;; Hook, specific to Viper, which is run just *before* exiting the minibuffer.
-;; Beginning with Emacs 19.26, the standard `minibuffer-exit-hook' is run
-;; *after* exiting the minibuffer
-(defvar vip-minibuffer-exit-hook nil)
-
-;; setup emacs-supported vi-style feel
-(setq next-line-add-newlines nil
-      require-final-newline t)
-
-(make-variable-buffer-local 'require-final-newline)
-       
-
-;; Mode line
-(defconst vip-vi-state-id  	"<V> "
-  "Mode line tag identifying the Vi mode of Viper.")
-(defconst vip-emacs-state-id	"<E> "
-  "Mode line tag identifying the Emacs mode of Viper.")
-(defconst vip-insert-state-id	"<I> "
-  "Mode line tag identifying the Insert mode of Viper.")
-(defconst vip-replace-state-id	"<R> "
-  "Mode line tag identifying the Replace mode of Viper.")
-
-;; Viper changes the default mode-line-buffer-identification
-(setq-default mode-line-buffer-identification '(" %b"))
-
-;; Variable displaying the current Viper state in the mode line.
-(vip-deflocalvar vip-mode-string vip-emacs-state-id)
-(or (memq 'vip-mode-string global-mode-string)
-    (setq global-mode-string
-	  (append '("" vip-mode-string) (cdr global-mode-string))))
-
-
-(defvar vip-vi-state-hook nil
-  "*Hooks run just before the switch to Vi mode is completed.")
-(defvar vip-insert-state-hook nil
-  "*Hooks run just before the switch to Insert mode is completed.")
-(defvar vip-replace-state-hook nil
-  "*Hooks run just before the switch to Replace mode is completed.")
-(defvar vip-emacs-state-hook nil
-  "*Hooks run just before the switch to Emacs mode is completed.")
-  
-(defvar vip-load-hook nil
-  "Hooks run just after loading Viper.")
-  
-
 ;; Generic predicates
 
 ;; These test functions are shamelessly lifted from vip 4.4.2 by Aamod Sane
@@ -828,6 +373,11 @@
 ;; define vip-movement-command-p
 (vip-test-com-defun vip-movement-command)
 
+(defconst vip-digit-commands '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
+  "Digit commands")
+;; define vip-digit-command-p
+(vip-test-com-defun vip-digit-command)
+
 ;; Commands that can be repeated by . (dotted)
 (defconst vip-dotable-commands '(?c ?d ?C ?s ?S ?D ?> ?<))
 ;; define vip-dotable-command-p
@@ -844,6 +394,7 @@
 (vip-test-com-defun vip-regsuffix-command)
 
 (defconst vip-vi-commands (append vip-movement-commands
+				  vip-digit-commands
 				  vip-dotable-commands
 				  vip-charpair-commands
 				  vip-hash-commands
@@ -1490,7 +1041,12 @@
   (let ((buff (current-buffer))
 	result)
     (vip-set-mode-vars-for 'vi-state)
-    (setq result (eval form))
+
+    (condition-case nil
+	(setq result (eval form))
+      (error
+       (signal 'quit nil)))
+
     (if (not (equal buff (current-buffer))) ; cmd switched buffer
 	(save-excursion
 	  (set-buffer buff)
@@ -1708,6 +1264,7 @@
 		    (t 'vip-change-state-to-vi)
 		    )))
     (call-interactively cmd)))
+
 	   
 
 
@@ -1838,6 +1395,9 @@
 	  (setq char (read-char)))
 	;; `char' is a movement command or a digit arg command---so we execute
 	;; it at the very end 
+	(or (vip-movement-command-p char)
+	    (vip-digit-command-p char)
+	    (error ""))
 	(setq mv-or-digit-cmd
 	      (vip-exec-form-in-vi 
 	       (` (key-binding (char-to-string (, char)))))))
@@ -1870,7 +1430,10 @@
 	(setq last-command-event 
 	      (vip-copy-event
 	       (if vip-xemacs-p (character-to-event char) char)))
-	(funcall mv-or-digit-cmd cmd-info)))
+	(condition-case nil
+	    (funcall mv-or-digit-cmd cmd-info)
+	  (error
+	   (error "")))))
   ))
 
 (defun vip-describe-arg (arg)
@@ -2538,100 +2101,6 @@
 	(command-execute command)
       (exit-minibuffer))))
   
-
-(defun vip-set-search-face ()
-  (if (vip-has-face-support-p)
-      (defvar vip-search-face
-	(progn
-	  (make-face 'vip-search-face)
-	  (vip-hide-face 'vip-search-face)
-	  (or (face-differs-from-default-p 'vip-search-face)
-	      ;; face wasn't set in .vip or .Xdefaults
-	      (if (vip-can-use-colors "Black" "khaki")
-		  (progn
-		    (set-face-background 'vip-search-face "khaki")
-		    (set-face-foreground 'vip-search-face "Black"))
-		(set-face-underline-p 'vip-search-face t)
-		(vip-set-face-pixmap 'vip-search-face vip-search-face-pixmap)))
-	  'vip-search-face)
-        "*Face used to flash out the search pattern.")
-    ))
-  
-  
-(defun vip-set-minibuffer-faces ()
-  (if (not (vip-has-face-support-p))
-      ()
-    (defvar vip-minibuffer-emacs-face
-      (progn
-	(make-face 'vip-minibuffer-emacs-face)
-	(vip-hide-face 'vip-minibuffer-emacs-face)
-	(or (face-differs-from-default-p 'vip-minibuffer-emacs-face)
-	    ;; face wasn't set in .vip or .Xdefaults
-	    (if vip-vi-style-in-minibuffer
-		;; emacs state is an exception in the minibuffer
-		(if (vip-can-use-colors "darkseagreen2" "Black")
-		    (progn
-		      (set-face-background
-		       'vip-minibuffer-emacs-face "darkseagreen2")
-		      (set-face-foreground
-		       'vip-minibuffer-emacs-face "Black"))
-		  (copy-face 'modeline 'vip-minibuffer-emacs-face))
-	      ;; emacs state is the main state in the minibuffer
-	      (if (vip-can-use-colors "Black" "pink")
-		  (progn
-		    (set-face-background 'vip-minibuffer-emacs-face "pink") 
-		    (set-face-foreground
-		     'vip-minibuffer-emacs-face "Black"))
-		(copy-face 'italic 'vip-minibuffer-emacs-face))
-	      ))
-	'vip-minibuffer-emacs-face)
-      "Face used in the Minibuffer when it is in Emacs state.")
-    
-    (defvar vip-minibuffer-insert-face
-      (progn
-	(make-face 'vip-minibuffer-insert-face)
-	(vip-hide-face 'vip-minibuffer-insert-face)
-	(or (face-differs-from-default-p 'vip-minibuffer-insert-face)
-	    (if vip-vi-style-in-minibuffer
-		(if (vip-can-use-colors "Black" "pink")
-		    (progn
-		      (set-face-background 'vip-minibuffer-insert-face "pink") 
-		      (set-face-foreground
-		       'vip-minibuffer-insert-face "Black"))
-		  (copy-face 'italic 'vip-minibuffer-insert-face))
-	      ;; If Insert state is an exception
-	      (if (vip-can-use-colors "darkseagreen2" "Black")
-		  (progn
-		    (set-face-background
-		     'vip-minibuffer-insert-face "darkseagreen2")
-		    (set-face-foreground
-		     'vip-minibuffer-insert-face "Black"))
-		(copy-face 'modeline 'vip-minibuffer-insert-face))
-	      (vip-italicize-face 'vip-minibuffer-insert-face)))
-	'vip-minibuffer-insert-face)
-      "Face used in the Minibuffer when it is in Insert state.")
-    
-    (defvar vip-minibuffer-vi-face
-      (progn
-	(make-face 'vip-minibuffer-vi-face)
-	(vip-hide-face 'vip-minibuffer-vi-face)
-	(or (face-differs-from-default-p 'vip-minibuffer-vi-face)
-	    (if vip-vi-style-in-minibuffer
-		(if (vip-can-use-colors "Black" "grey")
-		    (progn
-		      (set-face-background 'vip-minibuffer-vi-face "grey")
-		      (set-face-foreground 'vip-minibuffer-vi-face "Black"))
-		  (copy-face 'bold 'vip-minibuffer-vi-face))
-	      (copy-face 'bold 'vip-minibuffer-vi-face)
-	      (invert-face 'vip-minibuffer-vi-face)))
-	'vip-minibuffer-vi-face)
-      "Face used in the Minibuffer when it is in Vi state.")
-    
-    ;; the current face used in the minibuffer
-    (vip-deflocalvar vip-minibuffer-current-face vip-minibuffer-emacs-face "")
-    ))
-    
-  
 
 ;;; Reading string with history  
     
@@ -2873,6 +2342,10 @@
    'vip-post-command-hooks 'vip-replace-state-post-command-sentinel t)
   (vip-add-hook
    'vip-pre-command-hooks 'vip-replace-state-pre-command-sentinel t)
+  ;; guard against a smartie who switched from R-replace to normal replace
+  (vip-remove-hook
+   'vip-post-command-hooks 'vip-R-state-post-command-sentinel)
+  (if overwrite-mode (overwrite-mode nil))
   )
   
 
@@ -2948,9 +2421,11 @@
 	    ))
       
       (setq vip-replace-chars-to-delete
-	    (max 0 (min vip-replace-chars-to-delete
-			(- (vip-replace-end)
-			   vip-last-posn-in-replace-region))))
+	    (max 0
+		 (min vip-replace-chars-to-delete
+		      (- (vip-replace-end) vip-last-posn-in-replace-region)
+		      (- (vip-line-pos 'end) vip-last-posn-in-replace-region)
+		      )))
       )))
 
 
@@ -3002,6 +2477,9 @@
    'vip-post-command-hooks 'vip-R-state-post-command-sentinel t)
   (vip-add-hook
    'vip-pre-command-hooks 'vip-replace-state-pre-command-sentinel t)
+  ;; guard against a smartie who switched from R-replace to normal replace
+  (vip-remove-hook
+   'vip-post-command-hooks 'vip-replace-state-post-command-sentinel)
   )
 
 
@@ -3026,6 +2504,29 @@
     )
   (vip-hide-replace-overlay))
 
+(defun vip-replace-state-carriage-return ()
+  "Implements carriage return in Viper replace state."
+  (interactive)
+  ;; If Emacs start supporting overlay maps, as it currently supports
+  ;; text-property maps, we could do away with vip-replace-minor-mode and
+  ;; just have keymap attached to replace overlay. Then the "if part" of this
+  ;; statement can be deleted.
+  (if (or (< (point) (vip-replace-start))
+	  (> (point) (vip-replace-end)))
+      (let (vip-replace-minor-mode com)
+	(vip-set-unread-command-events last-input-char)
+	(setq com (key-binding (read-key-sequence nil)))
+	(condition-case conds
+	    (command-execute com)
+	  (error
+	   (vip-message-conditions conds))))
+    (if (not vip-allow-multiline-replace-regions)
+	(vip-replace-state-exit-cmd)
+      (if (vip-same-line (point) (vip-replace-end))
+	  (vip-replace-state-exit-cmd)
+	(vip-kill-line nil)
+	(vip-next-line-at-bol nil)))))
+
   
 ;; This is the function bound to 'R'---unlimited replace.
 ;; Similar to Emacs's own overwrite-mode.
@@ -4633,8 +4134,9 @@
   ;; protect against error while inserting "@" and other disasters
   ;; (e.g., read-only buff)
   (condition-case conds
-      (if (vip-same-line (vip-replace-start)
-			 (vip-replace-end))
+      (if (or vip-allow-multiline-replace-regions
+	      (vip-same-line (vip-replace-start)
+			     (vip-replace-end)))
 	  (progn
 	    ;; tabs cause problems in replace, so untabify
 	    (goto-char (vip-replace-end))
@@ -5733,9 +5235,6 @@
 	      
 
 (vip-set-minibuffer-style)
-(vip-set-minibuffer-faces)
-(vip-set-search-face)
-(vip-set-replace-overlay-face)
 (if vip-buffer-search-char
     (vip-buffer-search-enable))
 (vip-update-alphanumeric-class)
--- a/lisp/w3/ChangeLog	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/ChangeLog	Mon Aug 13 09:07:36 2007 +0200
@@ -1,5 +1,317 @@
+Wed Jan 22 08:28:13 1997  William M. Perry  <wmperry@aventail.com>
+
+* Emacs-W3 3.0.50 released
+
+* base64.el (base64-encode-region): Pulled in code from VM for quicker
+  encoding/decoding
+
+* mm.el (mm-content-transfer-encodings): Better base64 decoding
+
+Wed Jan 22 07:31:03 1997  Alf-Ivar Holm <alfh@ifi.uio.no>
+
+* w3-emulate.el (w3-lynx-emulation-minor-mode-map): Lynx [up] and [down]
+  bound to non-existing functions.
+
+* w3.el (w3-do-setup): Fixed installation of lynx emulation modes keymap.
+
+Tue Jan 21 07:56:51 1997  William M. Perry  <wmperry@aventail.com>
+
+* url-misc.el (url-data): Make sure to url-decode the data before
+  inserting it into the buffer.
+
+* w3-menu.el (w3-toggle-minibuffer): better version
+
+* w3-forms.el (w3-form-create-integer): New form entry type
+  (w3-form-create-float): new form entry type
+  (w3-form-encode-helper): deal with the new integer/float types
+
+* w3-display.el (w3-display-node): Reimplemented <select multiple> as a
+  list of checkboxes
+
+Mon Jan 20 06:29:07 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-display.el (w3-display-node): Keep track of the last form's action,
+  for theoretically 'naked' input fields that we want to try and handle as
+  best we can anyway.
+
+* w3-parse.el: Much more lenient about where form elements can be found.
+
+* w3-forms.el: summarizer functions now take the widget as an extra
+  parameter.
+
+* w3.el (w3-find-etc-directory): New function - not used yet.
+
+* w3.txi: Warning!  You now need a very new version of texinfo to compile
+  the .info or .dvi file yourself.
+
+* url-mail.el (url-mail): Now tries to use message-mail if it is bound
+  instead of just plain old 'mail'.
+
+* w3-forms.el (w3-form-add-element): Duh, fix hidden form fields.
+
+* font.el (font-normalize-color): Hopefully fixed color lossage under OS/2
+  and Windows
+
+* w3-forms.el (w3-form-summarize-field): Actually 'message' the string as
+  a workaround for emacspeak 5.0
+
+Sun Jan 19 09:32:15 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-xemac.el (w3-mouse-handler): Ditto
+
+* w3-e19.el (w3-mouse-handler): Protect against 'bad format string' errors
+  when showing a hexified URL
+
+* w3-forms.el (w3-form-mark-widget): Be super paranoid and mark all
+  children and their children's children, and the parents of a widget.
+  (w3-form-create-radio-button): Make sure radio button children always
+  get updated via w3-form-mark-widget.
+  (w3-form-summarize-radio-button): Slightly better summarization of radio
+  buttons.
+
+* Emacs-W3 3.0.49 released
+
+* Synch'ed up with widget 1.18
+
+Fri Jan 17 06:25:36 1997  Dave Love <d.love@dl.ac.uk>
+
+* w3-display.el: w3-echo-link now prefers the URL to the text of a link
+
+Fri Jan 17 06:25:36 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-display.el: Fixed handling of inlined styles
+
+* w3-mouse.el: Some fixes for XEmacs when built with no X support
+
+* default.css: Now uses the new @media directives instead of the old
+  :blah: stuff
+
+* css.el (css-handle-media-directive): New function to handle @media
+  directives.
+  (css-parse): Deprecate the old :mediatype: way of specifying media
+  dependent styles.
+
+* w3-style.el (w3-handle-style): Now gets passed a plist instead of an
+  assoc list.
+  (w3-handle-style): Pay attention to the new 'media' attribute on
+  stylesheet links, and don't load the stylesheet if we aren't currently
+  running on that type of media.
+
+* css.el (css-properties): Added proposed printing properties from a W3C
+  draft.
+
+Thu Jan 16 06:06:45 1997  William M. Perry  <wmperry@aventail.com>
+
+* css.el (css-handle-media-directive): Implemented the @media processing
+  instruction.
+
+* w3-forms.el (w3-form-summarize-option-list): Changed the summarize
+  function for option lists.  Much saner now.
+
+* w3.el (w3-read-url-with-default): Use the URL at point before falling
+  back to http://www.
+  (w3-source-document): When sourcing a document, let set-auto-mode do the
+  right thing.  .html comes up in html-mode, or whatever now.
+
+* url-cookie.el: Fixed some compile warnings under Emacs
+
+* w3-forms.el (w3-form-summarize-option-list): Make each choice-item have
+  emacspeak-help set.
+
+* w3-speak.el (w3-widget-backward): New advice
+(w3-widget-forward): New advice
+
+* w3-forms.el (w3-form-create-option-list): Renamed function
+
+* Emacs-W3 3.0.48 released
+
+* w3-display.el (w3-face-for-element): Use background-color instead of
+  just background for css property.
+
+* w3-forms.el (w3-form-encode-helper): Fixed radio buttons, duh.
+
+* url-misc.el (url-do-terminal-emulator): Fixed bad var reference left
+  from old code.
+
+* url-gw.el: Moved all the gateway variables into their own namespace to
+  make it easier to turn this into a standalone package.
+
+* dist.Makefile (SOURCES): Added url-gw and w3 to the build targets.
+
+Wed Jan 15 08:00:37 1997  William M. Perry  <wmperry@aventail.com>
+
+* Emacs-W3 3.0.47 released
+
+* url.el (url-expand-file-name): Make sure to remove \r from the URL as
+  well as \n
+
+* url-gw.el (url-open-stream): Added in 'telnet' and 'rlogin' methods for
+  url-gateway-method.  Code stolen from GNUS.  Thanks lars! :)  It would
+  be nice to make this file its own package and be able to override
+  open-network-stream so that all apps could get this for free.
+
+* url-misc.el (url-generic-emulator-loader): Consolidated the tn3270,
+  telnet, and rlogin URL loaders into one smarter function
+
+* url.el: Made cookie and auth modules autoloaded, removed some old autoloads
+(url-open-stream) Moved to url-gw.el
+
+Mon Jan 13 22:11:00 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-display.el (w3-widget-echo): w3-echo-link can now be a list, so the
+  user can explicitly control fallback behaviour.
+
+* w3.txi: Added some pointers to CSS documentation
+
+* mule-sysdp.el (mule-code-convert-region): ditto
+
+* w3.el (w3-convert-code-for-mule): Fixed bug in XEmacs 20.0 mule
+
+Mon Jan 13 11:14:29 1997  T. V. Raman <raman@Adobe.COM>
+
+* w3.el (w3-widget-forward): Call widget-forward interactively so that
+  emacspeak will hook it correctly.
+
+Mon Jan 13 11:14:29 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-display.el (w3-refresh-buffer): Finally reimplemented
+  w3-refresh-buffer.
+
+Sun Jan 12 10:32:50 1997  Karl Eichwalder  <ke@ke.Central.DE>
+
+* w3.txi: Add @dircategory and @direntry... @end.  `install-info'
+  from texinfo-3.9 know about those.
+
+Sun Jan 12 21:49:44 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3.el (w3-save-as): Can now save a page as postscript again
+
+* w3-display.el (w3-display-node): inline styles work again
+
+* url-misc.el (url-data): Updated data: URL to the spec.
+  ftp://ietf.org/internet-drafts/draft-masinter-url-data-02.txt
+
+Sat Jan 11 20:47:24 1997  William M. Perry  <wmperry@aventail.com>
+
+* Emacs-w3 3.0.45 released
+
+* url-misc.el (url-data): Now supports the 'data' URL type, which just
+  'fetches' everything after the data: chunk of the URL
+
+Fri Jan 10 11:49:43 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-display.el (w3-display-node): Multicolumn works, but puts things
+  across instead of down
+
+* w3-parse.el: Basic support for parsing <multicol>
+
+* w3-display.el (w3-display-node): Make our semi-widgety hyperlinks
+  start/end open under XEmacs.
+
+* w3.el (w3-complete-link): Make sure we take case into account when doing
+  link completion.  The user can use 'test' to complete to link titled
+  'Test'.  Uses try-completion for this, which seems to work since we
+  require a match.  Is this the best way to do this?  Other than not being
+  case-insensitive at this point?
+
+* w3-forms.el (w3-form-default-widget-creator): Better way of handling
+  updates to text entry fields.
+  (w3-revert-form): Everything should be reverted correctly, both in
+  internal storage and in the buffer
+  (w3-form-create-radio-button): Get a more unique identifier to store
+  radio elements by - old way could theoretically get collisions.
+
+* w3-display.el (w3-display-handle-list-type): Updated use of 'list-style'
+  to use new property 'list-style-type'
+  (w3-prepare-buffer): Now kills the source buffer before it starts
+  drawing the tree, to avoid *URL-n* buffers when not really necessary.
+
+* css.el (css-properties): Updated all the properties to the W3C's latest
+  'recommendation' level CSS specification.
+  (css-handle-import): much better handling of @import
+  (css-parse): Better handling of '@' directives in general
+  (css-expand-value): General cleanup, reference the CSS and ACSS specs
+  for how/why we are parsing something the way we are.
+
+Thu Jan  9 06:17:08 1997  William M. Perry  <wmperry@aventail.com>
+
+* Updated all copyright notices.  Happy belated new year!
+
+* w3-display.el (w3-region): Fixed a few bugs with nuking too much of a
+  buffer when using w3-region
+
+* w3.el (w3-read-url-with-default): Use new variable.
+
+* w3-vars.el (w3-fetch-with-default): New variable to control whether or
+  not w3-fetch will figure out a good default value for the URL or not.
+
+* w3-forms.el (w3-form-mark-widget): New function to mark a widget and all
+  its children with an appropriate :emacspeak-help and 'w3-form-data
+  Now defines a few keywords to look more widget-y
+
+Wed Jan  8 09:27:47 1997  William M. Perry  <wmperry@aventail.com>
+
+* css.el (css-expand-value): Added elevation, angle, and time units.
+
+* w3-display.el (w3-display-node): Turn on voice-lock-mode by default in
+  all w3 buffers.
+
+* css.el (css-properties): Added in new speech properties from the ACSS
+  note from the W3C.  Please see
+  http://www.w3.org/pub/WWW/Style/CSS/Speech/NOTE-ACSS for more
+  information.
+
+* w3-forms.el: Moved all the form entry summarization functions from
+  w3-speak.el into w3-forms.  Easier to keep in synch this way.
+
+* w3-display.el (w3-display-node): Reimplimented the 'keygen' form entry
+  type for netscape compatibility.
+
+Tue Jan  7 07:20:08 1997  William M. Perry  <wmperry@aventail.com>
+
+* w3-display.el (w3-region): New function that parses the HTML in a region
+  'in-place', so that things like MIME mailers/gnus readers can show HTML
+  inline a lot easier.
+
+* w3-forms.el (w3-form-resurrect-widgets): Fixed case where a widget goes
+  all the way to point-max and next-single-property-change will return
+  nil.  Would pass bad args to delete-region.
+  (w3-form-summarize-field): Moved some of the smarts about summarizing W3
+  widgets from w3-speak into the core forms code.
+
+* font.el (define-font-keywords): New function for defining keywords that
+  will actually work across Emacs and XEmacs
+
+* w3-display.el (w3-display-node): Reimplemented 'note' functionality, by
+  converting it into a two-cell table.
+  (w3-display-node): Implemented <dir> as multi-column, as-per the RFC and
+  HTML 3.x specifications
+
+* default.css: Added default display type for dir and menu
+
+Mon Jan  6 21:49:52 1997  William M. Perry  <wmperry@aventail.com>
+
+* url-http.el (url-create-mime-request): Fixed yet another stupid problem
+  in Host: header handling.  Was never sending the right information if
+  you were not going through a proxy this time.  *sigh*
+
+* w3-forms.el (w3-form-add-element): Fixed hidden form fields
+
+Sun Jan  5 22:38:54 1997  William M. Perry  <wmperry@aventail.com>
+
+* url-vars.el (url-proxy-services): updated documentation string
+
+* w3-widget.el (widget-image-notify): Fixed client side handling of
+imagemaps on a TTY or a delayed/broken image. Duhhh
+
+Fri Jan  3  Dave Love  <d.love@dl.ac.uk>
+
+* w3-e19.el (w3-mouse-handler): Fix link echoing.
+
 Fri Jan  3 08:43:56 1997  William M. Perry  <wmperry@aventail.com>
 
+* Emacs-W3 3.0.43 released
+
 * font.el (make-font): Treat args as a plist, just for sanity's sake.
 
 Thu Jan  2 12:19:31 1997  William M. Perry  <wmperry@aventail.com>
--- a/lisp/w3/Makefile	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/Makefile	Mon Aug 13 09:07:36 2007 +0200
@@ -35,33 +35,25 @@
 URLSOURCES = \
 	url-nfs.el url-file.el url-cookie.el url-parse.el url-irc.el	\
 	url-gopher.el url-http.el url-mail.el url-misc.el url-news.el	\
-	url-pgp.el url-vars.el url-wais.el urlauth.el mm.el md5.el	\
-	ssl.el base64.el url.el socks.el
+	url-pgp.el url-vars.el url-wais.el url-auth.el mm.el md5.el	\
+	url-gw.el ssl.el base64.el url.el socks.el
 
 CUSTOMSOURCES = widget.el widget-edit.el
 CUSTOMOBJECTS = $(CUSTOMSOURCES:.el=.elc)
 URLOBJECTS    = $(URLSOURCES:.el=.elc)
 
 SOURCES = \
-	w3.el w3-display.el w3-e19.el w3-parse.el w3-print.el		\
-	w3-vars.el w3-xemac.el w3-style.el w3-about.el w3-hot.el	\
-	w3-toolbar.el font.el w3-sysdp.el w3-annotat.el w3-auto.el	\
-	w3-forms.el images.el w3-imap.el w3-emulate.el w3-menu.el	\
-	w3-keyword.el w3-mouse.el w3-widget.el w3-speak.el w3-prefs.el	\
-	w3-latex.el dsssl.el css.el mule-sysdp.el $(CUSTOMSOURCES)	\
-	$(URLSOURCES)
+	$(CUSTOMSOURCES) $(URLSOURCES) mule-sysdp.el w3-widget.el	\
+	w3-imap.el css.el dsssl.el font.el images.el w3-vars.el		\
+	w3-style.el w3-keyword.el w3-forms.el w3-emulate.el		\
+	w3-annotat.el w3-auto.el w3-menu.el w3-mouse.el w3-toolbar.el	\
+	w3-prefs.el w3-speak.el w3-latex.el w3-parse.el w3-display.el	\
+	w3-print.el w3-about.el w3-hot.el w3-e19.el w3-xemac.el w3.el
 
-OBJECTS = \
-	w3.elc w3-display.elc w3-e19.elc w3-parse.elc w3-print.elc	\
-	w3-vars.elc w3-xemac.elc w3-style.elc w3-about.elc w3-hot.elc	\
-	w3-toolbar.elc font.elc w3-annotat.elc w3-auto.elc		\
-	w3-forms.elc images.elc w3-imap.elc w3-emulate.elc w3-menu.elc	\
-	w3-keyword.elc w3-mouse.elc w3-widget.elc w3-speak.elc		\
-	w3-prefs.elc w3-latex.elc css.elc dsssl.elc mule-sysdp.elc	\
-	$(CUSTOMOBJECTS) $(URLOBJECTS)
+OBJECTS = $(SOURCES:.el=.elc)
 
-DISTFILES     = Makefile ChangeLog $(SOURCES) w3.txi docomp.el	\
-		clean-cache default.css
+# Warning!  Currently, the following file can _NOT_ be bytecompiled.
+EXTRAS = w3-sysdp.el
 
 .SUFFIXES: .elc .el .el,v
 
@@ -79,6 +71,7 @@
 	@( if [ ! -d $(infodir) ]; then mkdir -p $(infodir); fi )
 	@( if [ ! -d $(confdir) ]; then mkdir -p $(confdir);  fi )
 	$(INSTALL) -m 644 $(SOURCES) $(OBJECTS) $(lispdir)
+	$(INSTALL) -m 644 $(EXTRAS) $(lispdir)
 	$(INSTALL) -m 644 w3.info* $(infodir)
 	$(INSTALL) -m 644 default.css $(confdir)/stylesheet
 	$(INSTALL) -m 644 html32.dsl $(confdir)/
--- a/lisp/w3/base64.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/base64.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,18 +1,11 @@
 ;;; base64.el,v --- Base64 encoding functions
-;; Author: wmperry
-;; Created: 1996/04/22 15:08:08
-;; Version: 1.7
+;; Author: Kyle E. Jones
+;; Created: 1997/01/23 00:13:17
+;; Version: 1.4
 ;; Keywords: extensions
 
-;;; LCD Archive Entry:
-;;; base64.el|William M. Perry|wmperry@cs.indiana.edu|
-;;; Package for encoding/decoding base64 data (MIME)|
-;;; 1996/04/22 15:08:08|1.7|Location Undetermined
-;;;
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
-;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
+;;; Copyright (C) 1997 Kyle E. Jones
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -32,162 +25,250 @@
 ;;; Boston, MA 02111-1307, USA.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Base 64 encoding functions
-;;; This code was converted to lisp code by me from the C code in
-;;; ftp://cs.utk.edu/pub/MIME/b64encode.c
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; For non-MULE
+(if (not (fboundp 'char-int))
+    (fset 'char-int 'identity))
+
+(defvar base64-alphabet
+  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
 
-(defvar base64-code-string
-  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
-  "Character set used for base64 decoding")
+(defvar base64-decoder-program nil
+  "*Non-nil value should be a string that names a MIME base64 decoder.
+The program should expect to read base64 data on its standard
+input and write the converted data to its standard output.")
+
+(defvar base64-decoder-switches nil
+  "*List of command line flags passed to the command named by
+base64-decoder-program.")
 
-(defvar base64-decode-vector
-  (let ((vec (make-vector 256 nil))
-	(i 0)
-	(case-fold-search nil))
-    (while (< i 256)
-      (aset vec i (string-match (regexp-quote (char-to-string i))
-				base64-code-string))
-      (setq i (1+ i)))
-    vec))
+(defvar base64-encoder-program nil
+  "*Non-nil value should be a string that names a MIME base64 encoder.
+The program should expect arbitrary data on its standard
+input and write base64 data to its standard output.")
+
+(defvar base64-encoder-switches nil
+  "*List of command line flags passed to the command named by
+base64-encoder-program.")
 
-(defvar base64-max-line-length 64)
+(defconst base64-alphabet-decoding-alist
+  '(
+    ( ?A . 00) ( ?B . 01) ( ?C . 02) ( ?D . 03) ( ?E . 04) ( ?F . 05)
+    ( ?G . 06) ( ?H . 07) ( ?I . 08) ( ?J . 09) ( ?K . 10) ( ?L . 11)
+    ( ?M . 12) ( ?N . 13) ( ?O . 14) ( ?P . 15) ( ?Q . 16) ( ?R . 17)
+    ( ?S . 18) ( ?T . 19) ( ?U . 20) ( ?V . 21) ( ?W . 22) ( ?X . 23)
+    ( ?Y . 24) ( ?Z . 25) ( ?a . 26) ( ?b . 27) ( ?c . 28) ( ?d . 29)
+    ( ?e . 30) ( ?f . 31) ( ?g . 32) ( ?h . 33) ( ?i . 34) ( ?j . 35)
+    ( ?k . 36) ( ?l . 37) ( ?m . 38) ( ?n . 39) ( ?o . 40) ( ?p . 41)
+    ( ?q . 42) ( ?r . 43) ( ?s . 44) ( ?t . 45) ( ?u . 46) ( ?v . 47)
+    ( ?w . 48) ( ?x . 49) ( ?y . 50) ( ?z . 51) ( ?0 . 52) ( ?1 . 53)
+    ( ?2 . 54) ( ?3 . 55) ( ?4 . 56) ( ?5 . 57) ( ?6 . 58) ( ?7 . 59)
+    ( ?8 . 60) ( ?9 . 61) ( ?+ . 62) ( ?/ . 63)
+   ))
 
-;(defun b0 (x) (aref base64-code-string (logand (lsh x -18) 63)))
-;(defun b1 (x) (aref base64-code-string (logand (lsh x -12) 63)))
-;(defun b2 (x) (aref base64-code-string (logand (lsh x -6) 63)))
-;(defun b3 (x) (aref base64-code-string (logand x 63)))
-
-(defmacro b0 (x) (` (aref base64-code-string (logand (lsh (, x) -18) 63))))
-(defmacro b1 (x) (` (aref base64-code-string (logand (lsh (, x) -12) 63))))
-(defmacro b2 (x) (` (aref base64-code-string (logand (lsh (, x) -6) 63))))
-(defmacro b3 (x) (` (aref base64-code-string (logand (, x) 63))))
+(defvar base64-alphabet-decoding-vector
+  (let ((v (make-vector 123 nil))
+	(p base64-alphabet-decoding-alist))
+    (while p
+      (aset v (car (car p)) (cdr (car p)))
+      (setq p (cdr p)))
+    v))
 
-(defun base64-encode (str)
-  "Do base64 encoding on string STR and return the encoded string.
-This code was converted to lisp code by me from the C code in
-ftp://cs.utk.edu/pub/MIME/b64encode.c.  Returns a string that is
-broken into `base64-max-line-length' byte lines."
-  (or str (setq str (buffer-string)))
-  (let ((x (base64-encode-internal str))
-	(y ""))
-    (while (> (length x) base64-max-line-length)
-      (setq y (concat y (substring x 0 base64-max-line-length) "\n")
-	    x (substring x base64-max-line-length nil)))
-    (setq y (concat y x))
-    y))
+(defun base64-run-command-on-region (start end output-buffer command
+					   &rest arg-list)
+  (let ((tempfile nil) status errstring)
+    (unwind-protect
+	(progn
+	  (setq tempfile (make-temp-name "base64"))
+	  (setq status
+		(apply 'call-process-region
+		       start end command nil
+		       (list output-buffer tempfile)
+		       nil arg-list))
+	  (cond ((equal status 0) t)
+		((zerop (save-excursion
+			  (set-buffer (find-file-noselect tempfile))
+			  (buffer-size)))
+		 t)
+		(t (save-excursion
+		     (set-buffer (find-file-noselect tempfile))
+		     (setq errstring (buffer-string))
+		     (kill-buffer nil)
+		     (cons status errstring)))))
+      (condition-case ()
+	  (delete-file tempfile)
+	(error nil)))))
+
+(defun base64-insert-char (char &optional count ignored buffer)
+  (condition-case nil
+      (progn
+	(insert-char char count ignored buffer)
+	(fset 'vm-insert-char 'insert-char))
+    (wrong-number-of-arguments
+     (fset 'base64-insert-char 'base64-xemacs-insert-char)
+     (base64-insert-char char count ignored buffer))))
+
+(defun base64-xemacs-insert-char (char &optional count ignored buffer)
+  (if (and buffer (eq buffer (current-buffer)))
+      (insert-char char count)
+    (save-excursion
+      (set-buffer buffer)
+      (insert-char char count))))
 
-(defun base64-encode-internal (str)
-  "Do base64 encoding on string STR and return the encoded string.
-This code was converted to lisp code by me from the C code in
-ftp://cs.utk.edu/pub/MIME/b64encode.c.  Returns the entire string,
-not broken up into `base64-max-line-length' byte lines."
-  (let (
-	(word 0)			; The word to translate
-	w1 w2 w3
-	)
-    (cond
-     ((> (length str) 3)
-      (concat
-       (base64-encode-internal (substring str 0 3))
-       (base64-encode-internal (substring str 3 nil))))
-     ((= (length str) 3)
-      (setq w1 (aref str 0)
-	    w2 (aref str 1)
-	    w3 (aref str 2)
-	    word (logior
-		  (lsh (logand w1 255) 16)
-		  (lsh (logand w2 255) 8)
-		  (logand w3 255)))
-      (format "%c%c%c%c" (b0 word) (b1 word) (b2 word) (b3 word)))
-     ((= (length str) 2)
-      (setq w1 (aref str 0)
-	    w2 (aref str 1)
-	    word (logior
-		  (lsh (logand w1 255) 16)
-		  (lsh (logand w2 255) 8)
-		  0))
-      (format "%c%c%c=" (b0 word) (b1 word) (b2 word)))
-     ((= (length str) 1)
-      (setq w1 (aref str 0)
-	    word (logior
-		  (lsh (logand w1 255) 16)
-		  0))
-      (format "%c%c==" (b0 word) (b1 word)))
-     (t ""))))
+(defun base64-decode-region (start end)
+  (interactive "r")
+  (message "Decoding base64...")
+  (let ((work-buffer nil)
+	(done nil)
+	(counter 0)
+	(bits 0)
+	(lim 0) inputpos
+	(non-data-chars (concat "^=" base64-alphabet)))
+    (unwind-protect
+	(save-excursion
+	  (setq work-buffer (generate-new-buffer " *base64-work*"))
+	  (buffer-disable-undo work-buffer)
+	  (if base64-decoder-program
+	      (let* ((binary-process-output t) ; any text already has CRLFs
+		     (status (apply 'command-on-region
+				   start end work-buffer
+				   base64-decoder-program
+				   base64-decoder-switches)))
+		(if (not (eq status t))
+		    (error "%s" (cdr status))))
+	    (goto-char start)
+	    (skip-chars-forward non-data-chars end)
+	    (while (not done)
+	      (setq inputpos (point))
+	      (cond
+	       ((> (skip-chars-forward base64-alphabet end) 0)
+		(setq lim (point))
+		(while (< inputpos lim)
+		  (setq bits (+ bits 
+				(aref base64-alphabet-decoding-vector
+				      (char-int (char-after inputpos)))))
+		  (setq counter (1+ counter)
+			inputpos (1+ inputpos))
+		  (cond ((= counter 4)
+			 (base64-insert-char (lsh bits -16) 1 nil work-buffer)
+			 (base64-insert-char (logand (lsh bits -8) 255) 1 nil
+					 work-buffer)
+			 (base64-insert-char (logand bits 255) 1 nil
+					     work-buffer)
+			 (setq bits 0 counter 0))
+			(t (setq bits (lsh bits 6)))))))
+	      (cond
+	       ((= (point) end)
+		(if (not (zerop counter))
+		    (error "at least %d bits missing at end of base64 encoding"
+			   (* (- 4 counter) 6)))
+		(setq done t))
+	       ((= (char-after (point)) ?=)
+		(setq done t)
+		(cond ((= counter 1)
+		       (error "at least 2 bits missing at end of base64 encoding"))
+		      ((= counter 2)
+		       (base64-insert-char (lsh bits -10) 1 nil work-buffer))
+		      ((= counter 3)
+		       (base64-insert-char (lsh bits -16) 1 nil work-buffer)
+		       (base64-insert-char (logand (lsh bits -8) 255)
+					   1 nil work-buffer))
+		      ((= counter 0) t)))
+	       (t (skip-chars-forward non-data-chars end)))))
+	  (or (markerp end) (setq end (set-marker (make-marker) end)))
+	  (goto-char start)
+	  (insert-buffer-substring work-buffer)
+	  (delete-region (point) end))
+      (and work-buffer (kill-buffer work-buffer))))
+  (message "Decoding base64... done"))
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Base64 decoding functions
-;;; Most of the decoding code is courtesy Francesco Potorti`
-;;; <F.Potorti@cnuce.cnr.it>
-;;; this is much faster than my original code - thanks!
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defun base64-decode-region (beg end)
+(defun base64-encode-region (start end)
   (interactive "r")
-  (barf-if-buffer-read-only)
-  (let
-      ((exchange (= (point) beg))
-       (endchars 0)
-       (list) (code))
-    (goto-char beg)
-    (while (< (point) end)
-      (setq list (mapcar
-		  (function
-		   (lambda (c)
-		     (cond
-		      ((aref base64-decode-vector c))
-		      ((char-equal c ?=)
-		       (setq endchars (1+ endchars))
-		       0)
-		      (nil
-		       (error
-			"Character %c does not match Mime base64 coding" c)))))
-		  (buffer-substring (point) (+ (point) 4))))
-      (setq code (+ (nth 3 list) (lsh (nth 2 list) 6)
-		    (lsh (nth 1 list) 12) (lsh (car list) 18)))
-      (delete-char 4)
-      (cond
-       ((zerop endchars)
-	(insert (% (lsh code -16) 256) (% (lsh code -8) 256) (% code 256)))
-       ((= endchars 1)
-	(insert (% (lsh code -16) 256) (% (lsh code -8) 256))
-	(setq end (point)))
-       ((= endchars 2)
-	(insert (% (lsh code -16) 256))
-	(setq end (point))))
-      (if (char-equal (following-char) ?\n)
-	  (progn (delete-char 1)
-		 (setq end (- end 2)))
-	(setq end (1- end))))
-    ))
-;    (if exchange
-;	(exchange-point-and-mark))))
+  (message "Encoding base64...")
+  (let ((work-buffer nil)
+	(counter 0)
+	(cols 0)
+	(bits 0)
+	(alphabet base64-alphabet)
+	inputpos)
+    (unwind-protect
+	(save-excursion
+	  (setq work-buffer (generate-new-buffer " *base64-work*"))
+	  (buffer-disable-undo work-buffer)
+	  (if base64-encoder-program
+	      (let ((status (apply 'base64-run-command-on-region
+				   start end work-buffer
+				   base64-encoder-program
+				   base64-encoder-switches)))
+		(if (not (eq status t))
+		    (error "%s" (cdr status))))
+	    (setq inputpos start)
+	    (while (< inputpos end)
+	      (setq bits (+ bits (char-int (char-after inputpos))))
+	      (setq counter (1+ counter))
+	      (cond ((= counter 3)
+		     (base64-insert-char (aref alphabet (lsh bits -18)) 1 nil
+					 work-buffer)
+		     (base64-insert-char
+		      (aref alphabet (logand (lsh bits -12) 63))
+		      1 nil work-buffer)
+		     (base64-insert-char
+		      (aref alphabet (logand (lsh bits -6) 63))
+		      1 nil work-buffer)
+		     (base64-insert-char
+		      (aref alphabet (logand bits 63))
+		      1 nil work-buffer)
+		     (setq cols (+ cols 4))
+		     (cond ((= cols 72)
+			    (base64-insert-char ?\n 1 nil work-buffer)
+			    (setq cols 0)))
+		     (setq bits 0 counter 0))
+		    (t (setq bits (lsh bits 8))))
+	      (setq inputpos (1+ inputpos)))
+	    ;; write out any remaining bits with appropriate padding
+	    (if (= counter 0)
+		nil
+	      (setq bits (lsh bits (- 16 (* 8 counter))))
+	      (base64-insert-char (aref alphabet (lsh bits -18)) 1 nil
+				  work-buffer)
+	      (base64-insert-char (aref alphabet (logand (lsh bits -12) 63))
+				  1 nil work-buffer)
+	      (if (= counter 1)
+		  (base64-insert-char ?= 2 nil work-buffer)
+		(base64-insert-char (aref alphabet (logand (lsh bits -6) 63))
+				    1 nil work-buffer)
+		(base64-insert-char ?= 1 nil work-buffer)))
+	    (if (> cols 0)
+		(base64-insert-char ?\n 1 nil work-buffer)))
+	  (or (markerp end) (setq end (set-marker (make-marker) end)))
+	  (goto-char start)
+	  (insert-buffer-substring work-buffer)
+	  (delete-region (point) end))
+      (and work-buffer (kill-buffer work-buffer))))
+  (message "Encoding base64... done"))
 
-(defun base64-decode (st &optional nd)
-  "Do base64 decoding on string STR and return the original string.
-If given buffer positions, destructively decodes that area of the
-current buffer."
-  (let ((replace-p nil)
-	(retval nil))
-    (if (stringp st)
-	nil
-      (setq st (prog1
-		   (buffer-substring st (or nd (point-max)))
-		 (delete-region st (or nd (point-max))))
-	    replace-p t))
-    (setq retval
-	  (save-excursion
-	    (set-buffer (get-buffer-create " *b64decode*"))
-	    (erase-buffer)
-	    (insert st)
-	    (goto-char (point-min))
-	    (while (re-search-forward "\r*\n" nil t)
-	      (replace-match ""))
-	    (goto-char (point-min))
-	    (base64-decode-region (point-min) (point-max))
-	    (buffer-string)))
-    (if replace-p (insert retval))
-    retval))
+(defun base64-encode (string)
+  (save-excursion
+    (set-buffer (get-buffer-create " *base64-encode*"))
+    (erase-buffer)
+    (insert string)
+    (base64-encode-region (point-min) (point-max))
+    (skip-chars-backward " \t\r\n")
+    (delete-region (point-max) (point))
+    (prog1
+	(buffer-string)
+      (kill-buffer (current-buffer)))))
+
+(defun base64-decode (string)
+  (save-excursion
+    (set-buffer (get-buffer-create " *base64-decode*"))
+    (erase-buffer)
+    (insert string)
+    (base64-decode-region (point-min) (point-max))
+    (goto-char (point-max))
+    (skip-chars-backward " \t\r\n")
+    (delete-region (point-max) (point))
+    (prog1
+	(buffer-string)
+      (kill-buffer (current-buffer)))))  
 
 (provide 'base64)
--- a/lisp/w3/css.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/css.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; css.el -- Cascading Style Sheet parser
 ;; Author: wmperry
-;; Created: 1996/12/26 16:49:58
-;; Version: 1.18
+;; Created: 1997/01/17 14:30:54
+;; Version: 1.25
 ;; Keywords: 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -38,46 +38,110 @@
 
 (defconst css-properties
   '(;; Property name    Inheritable?   Type of data
-    [font-family      nil            string-list]
-    [font-style       nil            string]
-    [font-variant     nil            symbol-list]
-    [font-weight      nil            weight]
-    [font-size        nil            length]
+    ;; Base CSS level 1 properties: http://www.w3.org/pub/WWW/TR/REC-CSS1
+    ;; Font properties, Section 5.2
+    [font-family      t              string-list]
+    [font-style       t              symbol]
+    [font-variant     t              symbol]
+    [font-weight      t              weight]
+    [font-size        t              length]
     [font             nil            font]
-    [color            nil            color]
-    [background       nil            color]
-    [word-spacing     nil            length] ; CBI
-    [letter-spacing   nil            length] ; CBI
-    [text-decoration  nil            symbol-list]
-    [vertical-align   nil            symbol] ; CBI
-    [text-transform   nil            string]
+
+    ;; Color and background properties, Section 5.3
+    [color            t              color]
+    [background       nil            color-shorthand]
+    [background-color nil            color]
+    [background-image nil            url]    ; NYI
+    [background-repeat nil           symbol] ; CBI
+    [background-attachment nil       symbol] ; CBI
+    [background-position nil         symbol] ; CBI
+
+    ;; Text properties, Section 5.4
+    [word-spacing     t              length] ; CBI
+    [letter-spacing   t              length] ; CBI
+    [text-decoration  t              symbol-list]
+    [vertical-align   nil            symbol]
+    [text-transform   t              symbol]
     [text-align       t              symbol]
     [text-indent      t              length] ; NYI
     [line-height      t              length] ; CBI
-    [margin           nil            margin]
-    [margin-left      nil            margin]
-    [margin-right     nil            margin]
-    [margin-top       nil            margin]
-    [margin-bottom    nil            margin]
-    [padding          nil            padding]
-    [padding-left     nil            padding]
-    [padding-right    nil            padding]
-    [padding-top      nil            padding]
-    [padding-bottom   nil            padding]
-    [border           nil            border]
+
+    ;; Box properties, Section 5.5
+    [margin           nil            boundary-shorthand]
+    [margin-left      nil            length]
+    [margin-right     nil            length]
+    [margin-top       nil            length]
+    [margin-bottom    nil            length]
+    [padding          nil            boundary-shorthand]
+    [padding-left     nil            length]
+    [padding-right    nil            length]
+    [padding-top      nil            length]
+    [padding-bottom   nil            length]
+    [border           nil            border-shorthand]
     [border-left      nil            border]
     [border-right     nil            border]
     [border-top       nil            border]
     [border-bottom    nil            border]
+    [border-top-width nil            nil]
+    [border-right-width nil          nil]
+    [border-bottom-width nil         nil]
+    [border-left-width nil           nil]
+    [border-width     nil            boundary-shorthand]
+    [border-color     nil            color]
+    [border-style     nil            symbol]
     [width            nil            length] ; NYPI
     [height           nil            length] ; NYPI
     [float            nil            symbol]
     [clear            nil            symbol]
+
+    ;; Classification properties, Section 5.6
     [display          nil            symbol]
-    [list-style       t              symbol] ;!! can't specify 'inside|outside'
+    [list-style-type  t              symbol]
+    [list-style-image t              url]
+    [list-style-position t           symbol]
+    [list-style       nil            list-style]
     [white-space      t              symbol]
 
-    ;; These are for specifying speech properties
+    ;; These are for specifying speech properties (ACSS-style)
+    ;; http://www.w3.org/pub/WWW/Style/CSS/Speech/NOTE-ACSS
+
+    ;; General audio properties, Section 3
+    [volume           t              string] ; Needs its own type?
+    [pause-before     nil            time]
+    [pause-after      nil            time]
+    [pause            nil            pause]
+    [cue-before       nil            string]
+    [cue-after        nil            string]
+    [cue-during       nil            string]
+    [cue              nil            string] ; Needs its own type?
+
+    ;; Spatial properties, Section 4
+    [azimuth          t              angle]
+    [elevation        t              elevation]
+
+    ;; Speech properties, Section 5
+    [speed            t              string]
+    [voice-family     t              string-list]
+    [pitch            t              string]
+    [pitch-range      t              percentage]
+    [stress           t              percentage]
+    [richness         t              percentage]
+    [speak-punctuation t             symbol]
+    [speak-date       t              symbol]
+    [speak-numeral    t              symbol]
+    [speak-time       t              symbol]
+
+    ;; Proposed printing extensions
+    ;; http://www.w3.org/pub/WWW/Style/Group/WD-PRINT-961220
+    ;; These apply only to pages (@page directive)
+    [size             nil            symbol]
+    [orientation      nil            symbol]
+    [margin-inside    nil            length]
+    ;; These apply to the document
+    [page-break-before nil           symbol]
+    [page-break-after  nil           symbol]
+    
+    ;; These are for specifying speech properties (Raman-style)
     [voice-family     t              string]
     [gain             t              integer]
     [left-volume      t              integer]
@@ -89,6 +153,13 @@
     )
   "A description of the various CSS properties and how to interpret them.")
 
+(put 'font 'css-shorthand t)
+(put 'background 'css-shorthand t)
+(put 'margin 'css-shorthand t)
+(put 'padding 'css-shorthand t)
+(put 'border 'css-shorthand t)
+(put 'list-style 'css-shorthand t)
+
 (mapcar
  (lambda (entry)
    (put (aref entry 0) 'css-inherit (aref entry 1))
@@ -133,10 +204,6 @@
   (string-match "XEmacs" (emacs-version))
   "Whether we are running in XEmacs or not.")
 
-(defvar css-ie-compatibility t
-  "Whether we want to do Internet Explorer 3.0 compatible parsing of
-CSS stylesheets.")
-
 (defsubst css-replace-regexp (regexp to-string)
   (goto-char (point-min))
   (while (re-search-forward regexp nil t)
@@ -328,6 +395,13 @@
 	    ord (1- ord)))
     rval))
 
+(defmacro css-symbol-list-as-regexp (&rest keys)
+  (` (eval-when-compile
+       (concat "^\\("
+	       (mapconcat 'symbol-name
+			  (quote (, keys))
+			  "\\|") "\\)$"))))
+
 (defun css-expand-color (color)
   (cond
    ((string-match "^#" color)
@@ -370,15 +444,6 @@
 	    g (round (* g 2.55))
 	    b (round (* b 2.55))
 	    color (vector 'rgb r g b))))
-   ((string-match "url *(\\([^ )]+\\) *)" color)
-    ;; A picture in the background
-    (let ((pixmap (match-string 1 color))
-	  (attributes nil))
-      (setq color (concat (substring color 0 (match-beginning 0))
-			  (substring color (match-end 0) nil))
-	    attributes (split-string color " "))
-      )
-    )
     (t
      ;; Hmmm... pass it through unmangled and hope the underlying
      ;; windowing system can handle it.
@@ -388,50 +453,138 @@
   )
 
 (defun css-expand-value (type value)
-  (case type
-    ((symbol integer)			; Read it in
-     (setq value (read (downcase value))))
-    (symbol-list
-     (setq value (downcase value)
-	   value (split-string value "[ ,]+")
-	   value (mapcar 'intern value)))
-    (string-list
-     (setq value (split-string value " *, *")))
-    (color				; A color, possibly with URLs
-     (setq value (css-expand-color value)))
-    (length				; Pixels, picas, ems, etc.
-     (setq value (css-expand-length value)))
-    (font				; Font shorthand
-     (setq value (css-split-font-shorthand value)))
-    ((margin padding)			; length|percentage|auto {1,4}
-     (setq value (split-string value "[ ,]+"))
-     (if (/= 1 (length value))
-	 ;; More than one value - a shortcut
+  (if value
+      (case type
+	(length				; CSS, Section 6.1
+	 (setq value (css-expand-length value)))
+	(percentage			; CSS, Section 6.2
+	 (setq value (/ (string-to-number value)
+			(if (fboundp 'float) (float 100) 1))))
+	(color				; CSS, Section 6.3
+	 (setq value (css-expand-color value)))
+	(url				; CSS, Section 6.4
+	 (declare (special url purl))
+	 (if (string-match "url *(\\([^ )]+\\) *)" value)
+	     (setq value (match-string 1 value)))
+	 (if (string-match " *\\([^ ]+\\) *" value)
+	     (setq value (match-string 1 value)))
+	 (setq value (url-expand-file-name value (or url purl))))
+	(angle				; ACSS, Section 2.2.1
+	 )
+	(time				; ACSS, Section 2.2.2
+	 (let ((val (string-to-number value))
+	       (units 'ms))
+	   (if (string-match "^[0-9]+ *\\([a-zA-Z.]+\\)" value)
+	       (setq units (intern (downcase (match-string 1 value)))))
+	   (setq value (case units
+			 ((s second seconds)
+			  val)
+			 ((min minute minutes)
+			  (* val 60))
+			 ((hr hour hours)
+			  (* val 60 60))
+			 ((day days)
+			  (* val 24 60 60))
+			 (otherwise
+			  (/ val (float 1000)))))))
+	(elevation			; ACSS, Section 4.2
+	 (if (string-match
+	      (css-symbol-list-as-regexp below level above higher lower) value)
+	     (setq value (intern (downcase (match-string value 1)))
+		   value (case value
+			   (below -90)
+			   (above 90)
+			   (level 0)
+			   (higher 45)
+			   (lower -45)
+			   ))
+	   (setq value (css-expand-value 'angle value))))
+	(color-shorthand		; CSS, Section 5.3.7
+	 ;; color|image|repeat|attach|position
+	 (let ((keys (split-string value " +"))
+	       cur color image repeat attach position)
+	   (while (setq cur (pop keys))
+	     (cond
+	      ((string-match "url" cur)	; Only image can have a URL
+	       (setq image (css-expand-value 'url cur)))
+	      ((string-match "%" cur)	; Only position can have a perc.
+	       (setq position (css-expand-value 'percentage cur)))
+	      ((string-match "repeat" cur) ; Only repeat
+	       (setq repeat (intern (downcase cur))))
+	      ((string-match "scroll\\|fixed" cur)
+	       (setq attach (intern (downcase (substring cur
+							 (match-beginning 0)
+							 (match-end 0))))))
+	      ((string-match (css-symbol-list-as-regexp
+			      top center bottom left right) cur)
+	       )
+	      (t
+	       (setq color cur))))
+	   (setq value (list (cons 'background-color color)
+			     (cons 'background-image image)
+			     (cons 'background-repeat repeat)
+			     (cons 'background-attachment attach)
+			     (cons 'background-position position)))))
+	(font				; CSS, Section 5.2.7
+	 ;; [style | variant | weight]? size[/line-height]? family
+	 (setq value (css-split-font-shorthand value)))
+	(border				; width | style | color
+	 ;; FIX
+	 )
+	(border-shorthand		; width | style | color
+	 ;; FIX
+	 )
+	(list-style			; CSS, Section 5.6.6
+	 ;; keyword | position | url
+	 (setq value (split-string value "[ ,]+"))
+	 (if (= (length value) 1)
+	     (setq value (list (cons 'list-style-type
+				     (intern (downcase (car value))))))
+	   (setq value (list (cons 'list-style-type
+				   (css-expand-value 'symbol (nth 0 value)))
+			     (cons 'list-style-position
+				   (css-expand-value 'symbol (nth 1 value)))
+			     (cons 'list-style-image
+				   (css-expand-value 'url (nth 2 value)))))))
+	(boundary-shorthand		; CSS, Section 5.5.x
+	 ;; length|percentage|auto {1,4}
+	 (setq value (split-string value "[ ,]+"))
 	 (let* ((top (intern (format "%s-top" type)))
 		(bottom (intern (format "%s-bottom" type)))
 		(left (intern (format "%s-left" type)))
 		(right (intern (format "%s-right" type))))
-	   (setq top (cons top (css-expand-length (nth 0 value)))
-		 right (cons right (css-expand-length (nth 1 value)))
-		 bottom (cons bottom (css-expand-length (nth 2 value)))
-		 left (cons left (css-expand-length (nth 3 value)))
-		 value (list top right bottom left)))
-       (setq value (css-expand-length (car value)))))
-    (border
-     (cond
-      ((member (downcase value) '("none" "dotted" "dashed" "solid"
-				  "double" "groove" "ridge" "inset" "outset"))
-       (setq value (intern (downcase value))))
-      ((string-match "^[0-9]+" value)
-       (setq value (font-spatial-to-canonical value)))
-      (t nil)))
-    (weight				; normal|bold|bolder|lighter|[1-9]00
-     (if (string-match "^[0-9]+" value)
-	 (setq value (/ (read value) 100)
-	       value (or (nth value css-weights) :bold))
-       (setq value (intern (downcase (concat ":" value))))))
-    (otherwise				; Leave it as is
-     t)
+	   (setq top (cons top (css-expand-value (get top 'css-type)
+						 (nth 0 value)))
+		 right (cons right (css-expand-value (get right 'css-type)
+						     (nth 1 value)))
+		 bottom (cons bottom (css-expand-value (get bottom 'css-type)
+						       (nth 2 value)))
+		 left (cons left (css-expand-value (get left 'css-type)
+						   (nth 3 value)))
+		 value (list top right bottom left))))
+	(weight				; CSS, Section 5.2.5
+	 ;; normal|bold|bolder|lighter|[1-9]00
+	 (cond
+	  ((string-match "^[0-9]+" value)
+	   (setq value (/ (string-to-number value) 100)
+		 value (or (nth value css-weights) :bold)))
+	  ((string-match (css-symbol-list-as-regexp normal bold bolder lighter)
+			 value)
+	   (setq value (intern (downcase (concat ":" value)))))
+	  (t setq value (intern ":bold"))))
+
+	;; The rest of these deal with how we handle things internally
+	((symbol integer)		; Read it in
+	 (setq value (read (downcase value))))
+	(symbol-list			; A space/comma delimited symlist
+	 (setq value (downcase value)
+	       value (split-string value "[ ,]+")
+	       value (mapcar 'intern value)))
+	(string-list			; A space/comma delimited list
+	 (setq value (split-string value " *, *")))
+	(otherwise			; Leave it as is
+	 t)
+	)
     )
   value
   )
@@ -485,43 +638,46 @@
 		   (t
 		    (buffer-substring val-pos
 				      (progn
-					(if css-ie-compatibility
-					    (skip-chars-forward "^;")
-					  (skip-chars-forward "^,;"))
+					(skip-chars-forward "^;")
 					(skip-chars-backward " \t")
 					(point)))))))
 	  (setq value (css-expand-value (get name 'css-type) value))
-	  (if (eq (get name 'css-type) 'font)
+	  (if (get name 'css-shorthand)
 	      (setq results (append value results))
 	    (setq results (cons (cons name value) results)))
 	  (skip-chars-forward ";, \n\t"))
 	results))))
 
-(defun css-handle-import ()
-  (let ((url nil)
-	(save-pos (point)))
-    (if (looking-at "'\"")
-	(condition-case ()
-	    (forward-sexp 1)
-	  (error (skip-chars-forward "^ \t\r\n;")))
-      (skip-chars-forward "^ \t\r\n;"))
-    (setq url (url-expand-file-name (buffer-substring save-pos (point))))
-    (skip-chars-forward "\"; \t\r\n")
-    (setq save-pos (point))
-    (let ((url-working-buffer (generate-new-buffer-name " *styleimport*"))
-	  (url-mime-accept-string
-	   "text/css ; level=2")
-	  (sheet nil))
-      (save-excursion
-	(set-buffer (get-buffer-create url-working-buffer))
-	(setq url-be-asynchronous nil)
-	(url-retrieve url)
-	(css-clean-buffer)
-	(setq sheet (buffer-string))
-	(set-buffer-modified-p nil)
-	(kill-buffer (current-buffer)))
-      (insert sheet)
-      (goto-char save-pos))))
+(defun css-handle-media-directive (data active)
+  (let (type)
+    (if (string-match "\\([^ \t\r\n{]+\\)" data)
+	(setq type (intern (downcase (substring data (match-beginning 1)
+						(match-end 1))))
+	      data (substring data (match-end 1)))
+      (setq type 'unknown))
+    (if (string-match "^[ \t\r\n]*{" data)
+	(setq data (substring data (match-end 0))))
+    (if (memq type active)
+	(save-excursion
+	  (insert data)))))
+
+(defun css-handle-import (data)
+  (let (url)
+    (setq url (css-expand-value 'url data))
+    (and url
+	 (let ((url-working-buffer (generate-new-buffer-name " *styleimport*"))
+	       (url-mime-accept-string
+		"text/css ; level=2")
+	       (sheet nil))
+	   (save-excursion
+	     (set-buffer (get-buffer-create url-working-buffer))
+	     (setq url-be-asynchronous nil)
+	     (url-retrieve url)
+	     (css-clean-buffer)
+	     (setq sheet (buffer-string))
+	     (set-buffer-modified-p nil)
+	     (kill-buffer (current-buffer)))
+	   (insert sheet)))))
 
 (defun css-clean-buffer ()
   ;; Nuke comments, etc.
@@ -541,7 +697,7 @@
   (goto-char (point-min)))
 
 (defun css-active-device-types (&optional device)
-  (let ((types (list 'normal 'default (if css-running-xemacs 'xemacs 'emacs)))
+  (let ((types (list 'all (if css-running-xemacs 'xemacs 'emacs)))
 	(type (device-type device)))
     (cond
      ((featurep 'emacspeak)
@@ -634,7 +790,7 @@
     )
   )
 
-(defun css-parse (fname &optional string inherit)
+(defun css-parse (url &optional string inherit)
   (let (
 	(url-mime-accept-string
 	 "text/css ; level=2")
@@ -645,6 +801,7 @@
 	(cur nil)
 	(val nil)
 	(device-type nil)
+	(purl (url-view-url t))
 	(active-device-types (css-active-device-types (selected-device)))
 	(sheet inherit))
     (if (not sheet)
@@ -654,7 +811,7 @@
 		   (generate-new-buffer-name " *style*")))
       (set-syntax-table css-syntax-table)
       (erase-buffer)
-      (if fname (url-insert-file-contents fname))
+      (if url (url-insert-file-contents url))
       (goto-char (point-max))
       (if string (insert string))
       (css-clean-buffer)
@@ -668,25 +825,40 @@
 	      (looking-at "--+>"))	; end
 	  (goto-char (match-end 0)))
 	 ;; C++ style comments, and we are doing IE compatibility
-	 ((and (looking-at "//") css-ie-compatibility)
+	 ((looking-at "//")
 	  (end-of-line))
 	 ;; Pre-Processor directives
 	 ((looking-at "[ \t\r]*@\\([^ \t\r\n]\\)")
-	  (let ((directive nil))
+	  (let (data directive)
 	    (skip-chars-forward " @\t\r") ; Past any leading whitespace
 	    (setq save-pos (point))
 	    (skip-chars-forward "^ \t\r\n") ; Past the @ directive
 	    (downcase-region save-pos (point))
-	    (setq directive (buffer-substring save-pos (point)))
-	    (skip-chars-forward " \t\r") ; Past any trailing whitespace
+	    (setq directive (intern (buffer-substring save-pos (point))))
+	    (skip-chars-forward " \t\r")
 	    (setq save-pos (point))
 	    (cond
-	     ((string= directive "import")
-	      (css-handle-import))
+	     ((looking-at ".*\\({\\)")
+	      (goto-char (match-beginning 1))
+	      (forward-sexp 1)
+	      (setq data (buffer-substring save-pos (1- (point)))))
+	     ((looking-at "[\"']+")
+	      (setq save-pos (1+ save-pos))
+	      (forward-sexp 1)
+	      (setq data (buffer-substring save-pos (1- (point)))))
 	     (t
-	      (message "Unknown directive in stylesheet: @%s" directive)))))
+	      (skip-chars-forward "^;")))
+	    (if (not data)
+		(setq data (buffer-substring save-pos (point))))
+	    (setq save-pos (point))
+	    (case directive
+	     (import (css-handle-import data))
+	     (media (css-handle-media-directive data active-device-types))
+	     (t (message "Unknown directive in stylesheet: @%s" directive)))))
 	 ;; Giving us some output device information
 	 ((looking-at "[ \t\r]*:\\([^: \n]+\\):")
+	  (message "You are using the old way of specifying device-dependent stylesheets!  Please upgrade!")
+	  (sleep-for 2)
 	  (downcase-region (match-beginning 1) (match-end 1))
 	  (setq device-type (intern (buffer-substring (match-beginning 1)
 						      (match-end 1))))
--- a/lisp/w3/default.css	Mon Aug 13 09:06:45 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/******************************************************************************
-**       File: default.css
-**    Purpose: Default Stylesheet for Emacs-W3
-**       Info: Copyright (c) 1995 William M. Perry <wmperry@spry.com>
-**    Created: William M. Perry <wmperry@spry.com>, Aug-31-1995
-** Maintainer: William M. Perry <wmperry@spry.com>
-**
-**  This contains the top level fallback default styles for Emacs-w3
-**
-******************************************************************************
-**
-** To specify device-dependent styles, you must mark a section with
-** :devicetype:
-** If you are not using 'devicetype', then anything up to the next
-** :xxx: media descriptor is ignored.
-**
-** There are a few special Emacs-W3 sections
-**
-**  emacs - only include this chunk if you are using Emacs 19
-** speech - only include this chunk if you are using Emacspeak for audio
-** xemacs - only include this chunk if you are using XEmacs
-** normal - always include this chunk (useful for switching out of another 
-**          device-type block
-******************************************************************************/
-
-/*
-** Headers
-*/
-
-h1,h2,h3,
-h4,h5,h6  {
-	    display: block;
-            font-family : serif;
-            font-weight : bold;
-          }
-
-/*
-** Since Emacs-19 doesn't handle mixed-sized fonts very well just yet,
-** we only use them under XEmacs.  Hopefully, this will change soon.
-*/
-
-:xemacs:
-      h1  { font-size : +12pt }
-      h2  { font-size : +6pt  }
-      h3  { font-size : +4pt  }
-      h5  { font-size : -2pt  }
-      h6  { font-size : -4pt  }
-
-/*
-** Emacs-19 also doesn't handle how Emacs-W3 changes this type of font
-** very well, so lets only do it under XEmacs for now.  Emacs-19 can only
-** do monospaced fonts anyway, so its redundant.
-*/
-   pre,xmp,
-  plaintext { font-family: monospace }
-key,code,tt { font-family: monospace }
-
-/*
-** Best we can do under Emacs-19 is use the default font and try to make
-** the headers stand out somehow.
-*/
-
-:emacs:
-h1,h2,h3,
-h4,h5,h6  { 
-            font-style: small-caps;
-            text-decoration: underline;
-	    color: blue;
-          }
-
-strong,em { color: red         }
-      dfn { font-style: italic }
- s,strike { color: green       }
-
-:normal:
-       p  { display: block }
- pre,xmp  { display: block; white-space: pre; }
-blockquote{ display: block; margin-left: 5; margin-right: 5; }
-
-/*
-** List formatting instructions
-*/
-
-       ul { display: block;     }
-       ol { display: block;     }
-       dl { display: block;     }
-       dt { font-weight: bold; display: list-item }
-       dd { display: list-item; margin-left: 5; }
-       li { display: list-item; margin-left: 5; }
-    ul li { list-style: circle; }
-    ol li { list-style: decimal; }
-
-/* These are to make nested list items look better */
-ul ul,ol ul,ol ol,ul ol { display: line; }
-
-/*
-** All logical emphasis tags, the way god intended
-*/
-
-        div { display: line;                }
-  strong,em { font-weight: bold             }
-        dfn { font-style: italic            }
-   s,strike { text-decoration: line-through }
-        sub { text-position: sub            }
-        sup { text-position: sup            }
-     secret { text-transform: rot13         }
-
-/*
-** Physical emphasis - spawn of evil
-*/
-          b { font-weight: bold }
-	  i { font-style: italic }
-          u { text-decoration: underline }
-      blink { text-decoration: blink }
-     center { display: line; text-align: center; }
-/*
-** Various and sundry
-*/
-         br { display: line }
-         hr { display: line; text-align: center; }
-
-
-/*
-** Hypertext link coloring
-*/
-
-a         { cursor: hand2  }
-a:link    { color: #FF0000 }
-a:visited { color: #B22222 }
-a:active  { color: #FF0000 }
-
-/*
-** Table formatting
-*/
-table     { display: block;    }
-   th     { display: block; font-weight: bold; text-align: center; }
-   td     { display: block; text-align: left; }
-caption   { display: block; text-align: center; }
-
-/*
-** Various other character-level formatting issues
-*/
-
- address { text-align: right; display: line; }
-abstract { font-style: bold & italic ; text-align : indent }
-   quote { font-style: italic ; text-align : indent }
-
-/*
-** Now for monochrome defaults
-*/
-:mono:
-   a:link { color: black; text-decoration: underline }
-a:visited { color: black; text-decoration: underline }
- a:active { color: white }
-
-/*
-** All the TTY specific formatting
-*/
-
-:tty:
-/*
-** First, handle some stuff for generic TTYs to emulate our old
-** behaviour with w3-delimit-links and a subset of w3-delimit-emphasis
-*/
-
-h1,h2,h3,
-h4,h5,h6 {
-           insert-before: *;
-           insert-after: *
-         }
-
-a:visited{
-           insert-before: "{{";
-           insert-after: "}}"
-         }
-
-a:link   {
-           insert-before: "[[";
-           insert-after: "]]"
-         }
-
-/* End Generic TTY */
-
-:ansi-tty:
-
-/*
-** Now comes the cool TTY stuff.  You will need to be using XEmacs 19.14
-** or later (or Emacs 19.30 under DOS) in order to get any benefit from
-** these whatsoever.  But if you are using one of these, wow, cool, eh?
-**
-** ANSI specifies these colors, and most (all?) TTYs that support color
-** will generally have 2 versions.  One normal and one bright or 'standout'
-** version.
-**
-**  Color     R     G     B
-** --------------------------
-**   white - 1.0 , 1.0 , 1.0
-**    cyan - 0.0 , 1.0 , 1.0
-** magenta - 1.0 , 0.0 , 1.0
-**    blue - 0.0 , 0.0 , 1.0
-**  yellow - 1.0 , 1.0 , 0.0
-**   green - 0.0 , 1.0 , 0.0
-**     red - 1.0 , 0.0 , 0.0
-**   black - 0.0 , 0.0 , 0.0
-*/
-
-h1,h2,h3,
-h4,h5,h6  { color : cyan     }
-a:visited { color : magenta  }
-   a:link { color : red      }
- a:active { color : yellow   }
-
-:speech:
-h1,h2,h3,
-h4,h5,h6 { voice-family: paul; stress: 2; richness: 9; }
-      h1 { pitch: 1; pitch-range: 9; }
-      h2 { pitch: 2; pitch-range: 8; }
-      h3 { pitch: 3; pitch-range: 7; }
-      h4 { pitch: 4; pitch-range: 6; }
-      h5 { pitch: 5; pitch-range: 5; }
-      h6 { pitch: 6; pitch-range: 4; }
-
-li,dt,dd { pitch: 6; richness: 6; }
-      dt { stress: 8; }
-
-pre,xmp,plaintext,key,code,tt { pitch: 1; 
-				pitch-range: 1;
-				stress: 1;
-				richness: 8;
-			      }
-      em { pitch: 6; pitch-range: 6; stress: 6; richness: 5; }
-  strong { pitch: 6; pitch-range: 6; stress: 9; richness: 9; }
-     dfn { pitch: 7; pitch-range: 6; stress: 6; }
-s,strike { richness: 0; }
-       i { pitch: 6; pitch-range: 6; stress: 6; richness: 5 }
-       b { pitch: 6; pitch-range: 6; stress: 9; richness: 9; }
-       u { richness: 0; }
-   a:link { voice-family: harry; }
-a:visited { voice-family: betty;}
- a:active { voice-family: betty; pitch-range: 8; pitch: 8 }
--- a/lisp/w3/dsssl.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/dsssl.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,11 +1,12 @@
 ;;; dsssl.el --- DSSSL parser
 ;; Author: wmperry
-;; Created: 1996/12/18 21:10:58
-;; Version: 1.11
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.12
 ;; Keywords: 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
+;;; Copyright (c) 1996, 1997 by William M. Perry (wmperry@cs.indiana.edu)
+;;; Copyright (c) 1997 by Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/font.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/font.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; font.el --- New font model
 ;; Author: wmperry
-;; Created: 1997/01/03 16:43:49
-;; Version: 1.22
+;; Created: 1997/01/22 19:31:17
+;; Version: 1.26
 ;; Keywords: faces
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -48,13 +48,20 @@
 (defconst font-running-xemacs (string-match "XEmacs" (emacs-version))
   "Whether we are running in XEmacs or not.")
 
-(defmacro defkeyword (keyword &optional docstring)
-  (list 'defconst keyword (list 'quote keyword)
-	(or docstring "A keyword")))
+(defmacro define-font-keywords (&rest keys)
+  (`
+   (eval-and-compile
+     (let ((keywords (quote (, keys))))
+       (while keywords
+	 (or (boundp (car keywords))
+	     (set (car keywords) (car keywords)))
+	 (setq keywords (cdr keywords)))))))  
 
 (defconst font-window-system-mappings
   '((x        . (x-font-create-name x-font-create-object))
     (ns       . (ns-font-create-name ns-font-create-object))
+    (win32    . (x-font-create-name x-font-create-object)) ; Change? FIXME
+    (pm       . (x-font-create-name x-font-create-object)) ; Change? FIXME
     (tty      . (tty-font-create-plist tty-font-create-object)))
   "An assoc list mapping device types to the function used to create
 a font name from a font structure.")
@@ -127,22 +134,11 @@
     )
   "A list of font family mappings.")
 
-(defkeyword :family "Keyword specifying the font family of a FONTOBJ.")
+(define-font-keywords :family :style :size :registry :encoding)
 
-(defkeyword :weight "Keyword specifying the font weight of a FONTOBJ.")
- (defkeyword :extra-light)
- (defkeyword :light)
- (defkeyword :demi-light)
- (defkeyword :medium)
- (defkeyword :normal)
- (defkeyword :demi-bold)
- (defkeyword :bold)
- (defkeyword :extra-bold)
-
-(defkeyword :style "Keyword specifying the font style of a FONTOBJ.")
-(defkeyword :size "Keyword specifying the font size of a FONTOBJ.")
-(defkeyword :registry "Keyword specifying the registry of a FONTOBJ.")
-(defkeyword :encoding "Keyword specifying the encoding of a FONTOBJ.")
+(define-font-keywords
+  :weight :extra-light :light :demi-light :medium :normal :demi-bold
+  :bold :extra-bold)
 
 (defvar font-style-keywords nil)
 
@@ -1058,16 +1054,16 @@
 (defun font-normalize-color (color &optional device)
   "Return an RGB tuple, given any form of input.  If an error occurs, black
 is returned."
-  (cond
-   ((eq (device-type device) 'x)
+  (case (device-type device)
+   ((x pm win32)
     (apply 'format "#%02x%02x%02x" (font-color-rgb-components color)))
-   ((eq (device-type device) 'tty)
+   (tty
     (apply 'font-tty-find-closest-color (font-color-rgb-components color)))
-   ((eq (device-type device) 'ns)
+   (ns
     (let ((vals (mapcar (function (lambda (x) (>> x 8)))
 			(font-color-rgb-components color))))
       (apply 'format "RGB%02x%02x%02xff" vals)))
-   (t "black")))
+   (otherwise "black")))
 
 (defun font-set-face-background (&optional face color &rest args)
   (interactive)
--- a/lisp/w3/images.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/images.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; images.el --- Automatic image converters
 ;; Author: wmperry
-;; Created: 1996/11/14 22:39:11
-;; Version: 1.5
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.6
 ;; Keywords: images
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1995 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/md5.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/md5.el	Mon Aug 13 09:07:36 2007 +0200
@@ -48,7 +48,7 @@
 
 ;;; Copyright and licence: ----------------------------------------------------
 
-;; Copyright (C) 1995 by Gareth Rees
+;; Copyright (C) 1995, 1996, 1997 by Gareth Rees
 ;; Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm
 ;; 
 ;; md5.el is free software; you can redistribute it and/or modify it
--- a/lisp/w3/mm.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/mm.el	Mon Aug 13 09:07:36 2007 +0200
@@ -6,7 +6,7 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1994, 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -298,7 +298,7 @@
 not.")
 
 (defvar mm-content-transfer-encodings
-  '(("base64"     . base64-decode)
+  '(("base64"     . base64-decode-region)
     ("7bit"       . ignore)
     ("8bit"       . ignore)
     ("binary"     . ignore)
--- a/lisp/w3/mule-sysdp.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/mule-sysdp.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,8 +1,8 @@
 ;;; mule-sysdp.el --- consolidate MULE-version dependencies in one file.
 
-;; Copyright (C) 1996 William Perry
+;; Copyright (c) 1996, 1997 William Perry
 
-;; Author: William Perry <wmperry@aventail.com>
+;; Author: William Perry <wmperry@cs.indiana.edu>
 ;; Keywords: lisp, tools
 
 ;; The purpose of this file is to eliminate the cruftiness that
@@ -51,6 +51,8 @@
     (otherwise nil)))
 
 (defun mule-code-convert-region (st nd code)
+  (if (and (listp code) (car code))
+      (setq code (car code)))
   (case mule-sysdep-version
     (2.3
      (setq mc-flag t)
@@ -58,11 +60,13 @@
      (set-file-coding-system code))
     (2.4
      (setq enable-multibyte-characters t)
-     (if (eq code 'coding-system-automatic)
+     (if (memq code '(autodetect coding-system-automatic))
 	 nil
        (decode-coding-region st nd code)
        (set-buffer-file-coding-system code)))
     (xemacs
+     (if (and (listp code) (not (car code)))
+	 (setq code 'autodetect))
      (decode-coding-region (point-min) (point-max) code)
      (set-file-coding-system code))
     (otherwise
--- a/lisp/w3/socks.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/socks.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,11 +1,11 @@
 ;;; socks.el --- A Socks v5 Client for Emacs
 ;; Author: wmperry
-;; Created: 1996/12/14 06:59:31
-;; Version: 1.2
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.3
 ;; Keywords: comm, firewalls
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
+;;; Copyright (c) 1996, 1997 by William M. Perry (wmperry@cs.indiana.edu)
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/ssl.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/ssl.el	Mon Aug 13 09:07:36 2007 +0200
@@ -6,7 +6,7 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/todo	Mon Aug 13 09:06:45 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-BUGS:
-----
-- <br> in <dd> hosed - margins in general tend to be too big sometimes.
-- too much space after an ordered list item - can't fix without
-  completely screwing up the spacing algorithm.  *sigh*
-- tags in <title> elements crap out.  Check out
-  http://www.uni-mainz.de/~steffens/html-public/usrguide_3.html#0 for a
-  sample.
-- Interaction with Emacspeak is inexcusably weak
-  - Need option to turn off table rendering and print it out as a
-    table that is viewable with emacspeak-table-ui.el
-  - Reimplement <label> support for form items
-  - Better/more information stored in each hypertext link
-  - Better/more information stored in each form entry area
-- Need at least bare-bones frames support where you can at least
-  convert a frameset into a list of destinations and display those for
-  the user.
-- <link> handling should keep track of the 'title' attribute of the link
-- sometimes images delete a large chunk of the buffer they are in.  Check out 
-  http://cs-www.uchicago.edu/ - seems to be the <img alt=" "> stuff.  Ack.
-- should use 'editable-field' widget type for 'text' and 'multiline' widgets.
-- ebola warnings when using gopher in XEmacs 20.0
-- Resetting a form resets the internal structures, but not the buffer
-  representation.  This one will be ugly.
-- cannot save a page as postscript
-- cannot dump an XEmacs w/W3 - attempt to modify read-only object.
-  Apparently a problem somewhere in w3-parse, as if it is reloaded
-  after dumping, the problem goes away.
-- client side imagemaps have to be in the same buffer (actually in the
-  smae buffer, _BEFORE_ the usemap directive on an image) - fix to be
-  able to use imagemaps in different files, any position, etc, etc.
-- filename handling bug in OS/2 - the c:\ stuff confuses it.
-- some way of specifying in a stylesheet whether certain text is
-  inaudible.  use the 'inaudible text property for this.
-- w3-fetch should take its prefix arg in the standard way and it
-  should be documented in the doc string
-- Should make cache directory private by default.
-- When fetching a compressed file with "C-u RET", W3 seems to uncompress
-  before saving on disk, but suggests a save file name with the ".gz"
-  extension.  It should either not uncompress in this case, or remove the
-  ".gz" extension from the suggested save file name.  (My personal
-  preference is that it should not uncompress.  Emacs has no trouble
-  looking at compressed files and they take up less disk space.)
-- w3-complete-link ensures that the input matches one of the links,
-  except for case.  If there is a link named "XX", you can enter "xx".
-  You will then get the error "Wrong type argument: stringp, nil".
-- Sometimes widget keybindings get thrown in the minibuffer map.  Try M-: C-M-i
-- We do not like a separate minibuffer frame at all under Emacs
-
-FEATURES:
-- font.elc is still not cross-emacsen.  Damn keyword lossage.
-- Widget library merging
-  - Using {TAB} to move to the next hyperlink moves to the first
-    character of the line if the hyperlink button is centered.  In
-    such cases, a lot of whitespace can precede the first character of
-    the link and although the button can be activated from this
-    whitespace, visually it would make much more sense to move to the
-    first non-whitespace character within the field.
-  - Add support for using real images for checkboxes, etc. in widget library
-  - Clean up the image widget, and make it play nice with emacspeak
-  - Write a tabcontrol widget and use it for preferences panel
-  - Write a font selection widget
-  - Write a voice selection widget
-  - Write a password entry widget
-  - Write a mailcap entry widget
-- Custom library merging
-  - Add custom support for W3, URL, MM
-- Proxy support
-  - The URL proxy checking is now able to use a function instead of
-    using an alist.  Perhaps have some basic javascript->elisp converter
-    so that people can use netscape-style auto-proxy configuration.
-  - Provide functions comparable to those provided to netscape
-    javascript proxy auto configuration.  See
-    http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
-- LaTeX backend
-  - Stylesheet support
-  - Table support
-- Display code
-  - Support recommended rendering of <dir> as multi-column
-  - Support multi-column somehow
-  - Support <dl compact>
-  - implement <spacer> from netscape 3.0b5
-  - reimplement w3-show-headers
-  - Handle math environment using the calc library
-  - Better integration with the paresr
-  - Better user feedback
-  - Better incremental display (page-by-page drawing?)
-- People want to see size and last-modified of remote ftp directories.
-  Only if ange-ftp or efs start returning valid data for file-attributes.
-  Either that, or some integration work needs to happen with dired.  Perhaps
-  a w3-dired-minor-mode that rebinds return, button1-3, etc.  hmmmm....
-- Write a new major mode for handling CSS style sheets
-- Support the <object> tag
-- Deal with frames right
-- Add back in the 'host' method for url-gateway-method - perhaps steal
-  code from GNUS
-
-MAINTENANCE CRAP
-- Create a FAQ
-- Revamp the entire documentation
-  - More info on stylesheets
-  - Update chapter organization
-  - Remove old variables
-  - Add new ones
-  - General cleanup
-- Change w3-download script to point to new XEmacs ftp site
-- Revamp the entire web site.
-- Do fun things with the new name 'GNET'
-  - GNETs Not Excessively Tacky
-  - GNET N'est pas Excessivement Tare'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/w3/url-auth.el	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,305 @@
+;;; url-auth.el --- Uniform Resource Locator authorization modules
+;; Author: wmperry
+;; Created: 1997/01/19 01:17:29
+;; Version: 1.5
+;; Keywords: comm, data, processes, hypermedia
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
+;;;
+;;; This file is not part of GNU Emacs, but the same permissions apply.
+;;;
+;;; 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(require 'url-vars)
+(require 'url-parse)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Basic authorization code
+;;; ------------------------
+;;; This implements the BASIC authorization type.  See the online
+;;; documentation at
+;;; http://www.w3.org/hypertext/WWW/AccessAuthorization/Basic.html
+;;; for the complete documentation on this type.
+;;;
+;;; This is very insecure, but it works as a proof-of-concept
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defvar url-basic-auth-storage nil
+  "Where usernames and passwords are stored.  Its value is an assoc list of
+assoc lists.  The first assoc list is keyed by the server name.  The cdr of
+this is an assoc list based on the 'directory' specified by the url we are
+looking up.")
+
+(defun url-basic-auth (url &optional prompt overwrite realm args)
+  "Get the username/password for the specified URL.
+If optional argument PROMPT is non-nil, ask for the username/password
+to use for the url and its descendants.  If optional third argument
+OVERWRITE is non-nil, overwrite the old username/password pair if it
+is found in the assoc list.  If REALM is specified, use that as the realm
+instead of the pathname inheritance method."
+  (let* ((href (if (stringp url)
+		   (url-generic-parse-url url)
+		 url))
+	 (server (or (url-host href) url-current-server))
+	 (port (or (url-port href) "80"))
+	 (path (url-filename href))
+	 user pass byserv retval data)
+    (setq server (concat server ":" port)
+	  path (cond
+		(realm realm)
+		((string-match "/$" path) path)
+		(t (url-basepath path)))
+	  byserv (cdr-safe (assoc server url-basic-auth-storage)))
+    (cond
+     ((and prompt (not byserv))
+      (setq user (read-string "Username: " (user-real-login-name))
+	    pass (funcall url-passwd-entry-func "Password: ")
+	    url-basic-auth-storage
+	    (cons (list server
+			(cons path
+			      (setq retval
+				    (base64-encode
+				     (format "%s:%s" user pass)))))
+		  url-basic-auth-storage)))
+     (byserv
+      (setq retval (cdr-safe (assoc path byserv)))
+      (if (and (not retval)
+	       (string-match "/" path))
+ 	  (while (and byserv (not retval))
+	    (setq data (car (car byserv)))
+	    (if (or (not (string-match "/" data)) ; Its a realm - take it!
+		    (and
+		     (>= (length path) (length data))
+		     (string= data (substring path 0 (length data)))))
+		(setq retval (cdr (car byserv))))
+	    (setq byserv (cdr byserv))))
+      (if (or (and (not retval) prompt) overwrite)
+	  (progn
+	    (setq user (read-string "Username: " (user-real-login-name))
+		  pass (funcall url-passwd-entry-func "Password: ")
+		  retval (base64-encode (format "%s:%s" user pass))
+		  byserv (assoc server url-basic-auth-storage))
+	    (setcdr byserv
+		    (cons (cons path retval) (cdr byserv))))))
+     (t (setq retval nil)))
+    (if retval (setq retval (concat "Basic " retval)))
+    retval))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Digest authorization code
+;;; ------------------------
+;;; This implements the DIGEST authorization type.  See the internet draft
+;;; ftp://ds.internic.net/internet-drafts/draft-ietf-http-digest-aa-01.txt
+;;; for the complete documentation on this type.
+;;;
+;;; This is very secure
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defvar url-digest-auth-storage nil
+  "Where usernames and passwords are stored.  Its value is an assoc list of
+assoc lists.  The first assoc list is keyed by the server name.  The cdr of
+this is an assoc list based on the 'directory' specified by the url we are
+looking up.")
+
+(defun url-digest-auth-create-key (username password realm method uri)
+  "Create a key for digest authentication method"
+  (let* ((info (if (stringp uri)
+		   (url-generic-parse-url uri)
+		 uri))
+	 (a1 (md5 (concat username ":" realm ":" password)))
+	 (a2 (md5 (concat method ":" (url-filename info)))))
+    (list a1 a2)))
+
+(defun url-digest-auth (url &optional prompt overwrite realm args)
+  "Get the username/password for the specified URL.
+If optional argument PROMPT is non-nil, ask for the username/password
+to use for the url and its descendants.  If optional third argument
+OVERWRITE is non-nil, overwrite the old username/password pair if it
+is found in the assoc list.  If REALM is specified, use that as the realm
+instead of hostname:portnum."
+  (if args
+      (let* ((href (if (stringp url)
+		       (url-generic-parse-url url)
+		     url))
+	     (server (or (url-host href) url-current-server))
+	     (port (or (url-port href) "80"))
+	     (path (url-filename href))
+	     user pass byserv retval data)
+	(setq path (cond
+		    (realm realm)
+		    ((string-match "/$" path) path)
+		    (t (url-basepath path)))
+	      server (concat server ":" port)
+	      byserv (cdr-safe (assoc server url-digest-auth-storage)))
+	(cond
+	 ((and prompt (not byserv))
+	  (setq user (read-string "Username: " (user-real-login-name))
+		pass (funcall url-passwd-entry-func "Password: ")
+		url-digest-auth-storage
+		(cons (list server
+			    (cons path
+				  (setq retval
+					(cons user
+					      (url-digest-auth-create-key
+					       user pass realm
+					       (or url-request-method "GET")
+					       url)))))
+		      url-digest-auth-storage)))
+	 (byserv
+	  (setq retval (cdr-safe (assoc path byserv)))
+	  (if (and (not retval)		; no exact match, check directories
+		   (string-match "/" path)) ; not looking for a realm
+	      (while (and byserv (not retval))
+		(setq data (car (car byserv)))
+		(if (or (not (string-match "/" data))
+			(and
+			 (>= (length path) (length data))
+			 (string= data (substring path 0 (length data)))))
+		    (setq retval (cdr (car byserv))))
+		(setq byserv (cdr byserv))))
+	  (if (or (and (not retval) prompt) overwrite)
+	      (progn
+		(setq user (read-string "Username: " (user-real-login-name))
+		      pass (funcall url-passwd-entry-func "Password: ")
+		      retval (setq retval
+				   (cons user
+					 (url-digest-auth-create-key
+					  user pass realm
+					  (or url-request-method "GET")
+					  url)))
+		      byserv (assoc server url-digest-auth-storage))
+		(setcdr byserv
+			(cons (cons path retval) (cdr byserv))))))
+	 (t (setq retval nil)))
+	(if retval
+	    (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))
+		  (opaque (or (cdr-safe (assoc "opaque" args)) "nonegiven")))
+	      (format
+	       (concat "Digest username=\"%s\", realm=\"%s\","
+		       "nonce=\"%s\", uri=\"%s\","
+		       "response=\"%s\", opaque=\"%s\"")
+	       (nth 0 retval) realm nonce (url-filename href)
+	       (md5 (concat (nth 1 retval) ":" nonce ":"
+			    (nth 2 retval))) opaque))))))
+
+(defvar url-registered-auth-schemes nil
+  "A list of the registered authorization schemes and various and sundry
+information associated with them.")
+
+;;###autoload
+(defun url-get-authentication (url realm type prompt &optional args)
+  "Return an authorization string suitable for use in the WWW-Authenticate
+header in an HTTP/1.0 request.
+
+URL    is the url you are requesting authorization to.  This can be either a
+       string representing the URL, or the parsed representation returned by
+       `url-generic-parse-url'
+REALM  is the realm at a specific site we are looking for.  This should be a
+       string specifying the exact realm, or nil or the symbol 'any' to
+       specify that the filename portion of the URL should be used as the
+       realm
+TYPE   is the type of authentication to be returned.  This is either a string
+       representing the type (basic, digest, etc), or nil or the symbol 'any'
+       to specify that any authentication is acceptable.  If requesting 'any'
+       the strongest matching authentication will be returned.  If this is
+       wrong, its no big deal, the error from the server will specify exactly
+       what type of auth to use
+PROMPT is boolean - specifies whether to ask the user for a username/password
+       if one cannot be found in the cache"
+  (if (not realm)
+      (setq realm (cdr-safe (assoc "realm" args))))
+  (if (stringp url)
+      (setq url (url-generic-parse-url url)))
+  (if (or (null type) (eq type 'any))
+      ;; Whooo doogies!
+      ;; Go through and get _all_ the authorization strings that could apply
+      ;; to this URL, store them along with the 'rating' we have in the list
+      ;; of schemes, then sort them so that the 'best' is at the front of the
+      ;; list, then get the car, then get the cdr.
+      ;; Zooom zooom zoooooom
+      (cdr-safe
+       (car-safe
+	(sort
+	 (mapcar
+	  (function
+	   (lambda (scheme)
+	     (if (fboundp (car (cdr scheme)))
+		 (cons (cdr (cdr scheme))
+		       (funcall (car (cdr scheme)) url nil nil realm))
+	       (cons 0 nil))))
+	  url-registered-auth-schemes)
+	 (function
+	  (lambda (x y)
+	    (cond
+	     ((null (cdr x)) nil)
+	     ((and (cdr x) (null (cdr y))) t)
+	     ((and (cdr x) (cdr y))
+	      (>= (car x) (car y)))
+	     (t nil)))))))
+    (if (symbolp type) (setq type (symbol-name type)))
+    (let* ((scheme (car-safe
+		    (cdr-safe (assoc (downcase type)
+				     url-registered-auth-schemes)))))
+      (if (and scheme (fboundp scheme))
+	  (funcall scheme url prompt
+		   (and prompt
+			(funcall scheme url nil nil realm args))
+		   realm args)))))
+
+;;###autoload
+(defun url-register-auth-scheme (type &optional function rating)
+  "Register an HTTP authentication method.
+
+TYPE     is a string or symbol specifying the name of the method.   This
+         should be the same thing you expect to get returned in an Authenticate
+         header in HTTP/1.0 - it will be downcased.
+FUNCTION is the function to call to get the authorization information.  This
+         defaults to `url-?-auth', where ? is TYPE
+RATING   a rating between 1 and 10 of the strength of the authentication.
+         This is used when asking for the best authentication for a specific
+         URL.  The item with the highest rating is returned."
+  (let* ((type (cond
+		((stringp type) (downcase type))
+		((symbolp type) (downcase (symbol-name type)))
+		(t (error "Bad call to `url-register-auth-scheme'"))))
+	 (function (or function (intern (concat "url-" type "-auth"))))
+	 (rating (cond
+		  ((null rating) 2)
+		  ((stringp rating) (string-to-int rating))
+		  (t rating)))
+	 (node (assoc type url-registered-auth-schemes)))
+    (if (not (fboundp function))
+	(url-warn 'security
+		  (format (eval-when-compile
+			    "Tried to register `%s' as an auth scheme"
+			    ", but it is not a function!") function)))
+
+    (if node
+	(progn
+	  (setcdr node (cons function rating))
+	  (url-warn 'security
+		    (format
+		     "Replacing authorization method `%s' - this could be bad."
+		     type)))
+      (setq url-registered-auth-schemes
+	    (cons (cons type (cons function rating))
+		  url-registered-auth-schemes)))))
+
+(defun url-auth-registered (scheme)
+  ;; Return non-nil iff SCHEME is registered as an auth type
+  (assoc scheme url-registered-auth-schemes))
+
+(provide 'urlauth)
--- a/lisp/w3/url-cookie.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-cookie.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-cookie.el --- Netscape Cookie support
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.5
+;; Created: 1997/01/16 22:34:30
+;; Version: 1.9
 ;; Keywords: comm, data, processes, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -29,12 +29,13 @@
 (require 'timezone)
 (require 'cl)
 
-(let ((keywords 
-       '(:name :value :expires :path :domain :test :secure)))
-  (while keywords
-    (or (boundp (car keywords))
-	(set (car keywords) (car keywords)))
-    (setq keywords (cdr keywords))))
+(eval-and-compile
+  (let ((keywords 
+	 '(:name :value :expires :path :domain :test :secure)))
+    (while keywords
+      (or (boundp (car keywords))
+	  (set (car keywords) (car keywords)))
+      (setq keywords (cdr keywords)))))
 
 ;; See http://home.netscape.com/newsref/std/cookie_spec.html for the
 ;; 'open standard' defining this crap.
@@ -68,10 +69,6 @@
     (url-cookie-set-secure retval (url-cookie-retrieve-arg :secure args))
     retval))
 
-(defvar url-cookie-storage nil         "Where cookies are stored.")
-(defvar url-cookie-secure-storage nil  "Where secure cookies are stored.")
-(defvar url-cookie-file nil            "*Where cookies are stored on disk.")
-
 (defun url-cookie-p (obj)
   (and (vectorp obj) (= (length obj) 7) (eq (aref obj 0) 'cookie)))
 
@@ -110,6 +107,7 @@
 	(setq new (cons cur new))))
     (set var new)))
 
+;;###autoload
 (defun url-cookie-write-file (&optional fname)
   (setq fname (or fname url-cookie-file))
   (url-cookie-clean-up)
@@ -208,6 +206,7 @@
 			  (*   1 (string-to-int (aref exp-time 0))))))
 	(> (- cur-norm exp-norm) 1))))))
 
+;;###autoload
 (defun url-cookie-retrieve (host path &optional secure)
   "Retrieves all the netscape-style cookies for a specified HOST and PATH"
   (let ((storage (if secure
@@ -235,6 +234,7 @@
 		(setq retval (cons cur retval))))))
     retval))
 
+;;###autolaod
 (defun url-cookie-generate-header-lines (host path secure)
   (let* ((cookies (url-cookie-retrieve host path secure))
 	(retval nil)
@@ -290,6 +290,7 @@
 (defun url-header-comparison (x y)
   (string= (downcase x) (downcase y)))
 
+;;###autoload
 (defun url-cookie-handle-set-cookie (str)
   (let* ((args (mm-parse-args str nil t)) ; Don't downcase names
 	 (case-fold-search t)
--- a/lisp/w3/url-file.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-file.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-file.el --- File retrieval code
 ;; Author: wmperry
-;; Created: 1996/12/30 14:25:26
-;; Version: 1.7
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.8
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url-gopher.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-gopher.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-gopher.el --- Gopher Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.3
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.4
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/w3/url-gw.el	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,241 @@
+;;; url-gw.el --- Gateway munging for URL loading
+;; Author: wmperry
+;; Created: 1997/01/16 14:17:34
+;; Version: 1.3
+;; Keywords: comm, data, processes
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Copyright (c) 1997 Free Software Foundation, Inc.
+;;;
+;;; This file is not part of GNU Emacs, but the same permissions apply.
+;;;
+;;; 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(require 'cl)
+
+(defvar url-gateway-local-host-regexp nil
+  "*A regular expression specifying local hostnames/machines.")
+
+(defvar url-gateway-prompt-pattern
+  "^[^#$%>;]*[#$%>;] *" ;; "bash\\|\$ *\r?$\\|> *\r?"
+  "*A regular expression matching a shell prompt.")
+
+(defvar url-gateway-rlogin-host nil
+  "*What hostname to actually rlog into before doing a telnet.")
+
+(defvar url-gateway-rlogin-user-name nil
+  "*Username to log into the remote machine with when using rlogin.")
+
+(defvar url-gateway-rlogin-parameters '("telnet" "-8")
+  "*Parameters to `url-open-rlogin'.
+This list will be used as the parameter list given to rsh.")
+
+(defvar url-gateway-telnet-host nil
+  "*What hostname to actually login to before doing a telnet.")
+
+(defvar url-gateway-telnet-parameters '("exec" "telnet" "-8")
+  "*Parameters to `url-open-telnet'.
+This list will be executed as a command after logging in via telnet.")
+
+(defvar url-gateway-telnet-login-prompt "^\r*.?login:"
+  "*Prompt that tells us we should send our username when loggin in w/telnet.")
+
+(defvar url-gateway-telnet-password-prompt "^\r*.?password:"
+  "*Prompt that tells us we should send our password when loggin in w/telnet.")
+
+(defvar url-gateway-telnet-user-name nil
+  "User name to log in via telnet with.")
+
+(defvar url-gateway-telnet-password nil
+  "Password to use to log in via telnet with.")
+
+(defvar url-gateway-broken-resolution nil
+  "*Whether to use nslookup to resolve hostnames.
+This should be used when your version of Emacs cannot correctly use DNS,
+but your machine can.  This usually happens if you are running a statically
+linked Emacs under SunOS 4.x")
+
+(defvar url-gateway-nslookup-program nil
+  "*If non-NIL then a string naming nslookup program." )
+
+;; Stolen from ange-ftp
+(defun url-gateway-nslookup-host (host)
+  "Attempt to resolve the given HOSTNAME using nslookup if possible."
+  (interactive "sHost:  ")
+  (if url-gateway-nslookup-program
+      (let ((proc (start-process " *nslookup*" " *nslookup*"
+				 url-gateway-nslookup-program host))
+	    (res host))
+	(process-kill-without-query proc)
+	(save-excursion
+	  (set-buffer (process-buffer proc))
+	  (while (memq (process-status proc) '(run open))
+	    (accept-process-output proc))
+	  (goto-char (point-min))
+	  (if (re-search-forward "Name:.*\nAddress: *\\(.*\\)$" nil t)
+	      (setq res (buffer-substring (match-beginning 1)
+					  (match-end 1))))
+	  (kill-buffer (current-buffer)))
+	res)
+    host))
+
+;; Stolen from red gnus nntp.el
+(defun url-wait-for-string (regexp proc)
+  "Wait until string arrives in the buffer."
+  (let ((buf (current-buffer)))
+    (goto-char (point-min))
+    (while (not (re-search-forward regexp nil t))
+      (accept-process-output proc)
+      (set-buffer buf)
+      (goto-char (point-min)))))
+
+;; Stolen from red gnus nntp.el
+(defun url-open-rlogin (name buffer host service)
+  "Open a connection using rsh."
+  (if (not (stringp service))
+      (setq service (into-to-string service)))
+  (let ((proc (if url-gateway-rlogin-user-name
+		  (start-process
+		   name buffer "rsh"
+		   url-gateway-rlogin-host "-l" url-gateway-rlogin-user-name
+		   (mapconcat 'identity
+			      (append url-gateway-rlogin-parameters
+				      (list host service)) " "))
+		(start-process
+		 name buffer "rsh" url-gateway-rlogin-host
+		 (mapconcat 'identity
+			    (append url-gateway-rlogin-parameters
+				    (list host service))
+			    " ")))))
+    (set-buffer buffer)
+    (url-wait-for-string "^\r*200" proc)
+    (beginning-of-line)
+    (delete-region (point-min) (point))
+    proc))
+
+;; Stolen from red gnus nntp.el
+(defun url-open-telnet (name buffer host service)
+  (if (not (stringp service))
+      (setq service (into-to-string service)))
+  (save-excursion
+    (set-buffer (get-buffer-create buffer))
+    (erase-buffer)
+    (let ((proc (start-process name buffer "telnet" "-8"))
+	  (case-fold-search t))
+      (when (memq (process-status proc) '(open run))
+	(process-send-string proc "set escape \^X\n")
+	(process-send-string proc (concat
+				   "open " url-gateway-telnet-host "\n"))
+	(url-wait-for-string url-gateway-telnet-login-prompt proc)
+	(process-send-string
+	 proc (concat
+	       (or url-gateway-telnet-user-name
+		   (setq url-gateway-telnet-user-name (read-string "login: ")))
+	       "\n"))
+	(url-wait-for-string url-gateway-telnet-password-prompt proc)
+	(process-send-string
+	 proc (concat
+	       (or url-gateway-telnet-password
+		   (setq url-gateway-telnet-password
+			 (funcall url-passwd-entry-func "Password: ")))
+	       "\n"))
+	(erase-buffer)
+	(url-wait-for-string url-gateway-prompt-pattern proc)
+	(process-send-string
+	 proc (concat (mapconcat 'identity
+				 (append url-gateway-telnet-parameters
+					 (list host service)) " ") "\n"))
+	(url-wait-for-string "^\r*Escape character.*\r*\n+" proc)
+	(delete-region (point-min) (match-end 0))
+	(process-send-string proc "\^]\n")
+	(url-wait-for-string "^telnet" proc)
+	(process-send-string proc "mode character\n")
+	(accept-process-output proc 1)
+	(sit-for 1)
+	(goto-char (point-min))
+	(forward-line 1)
+	(delete-region (point) (point-max)))
+      proc)))
+
+;;###autoload
+(defun url-open-stream (name buffer host service)
+  "Open a stream to a host"
+  (let ((gw-method (if (and url-gateway-local-host-regexp
+			    (not (eq 'ssl url-gateway-method))
+			    (string-match
+			     url-gateway-local-host-regexp
+			     host))
+		       'native
+		     url-gateway-method))
+	;; This hack is for OS/2 Emacs so that it will not do bogus CRLF
+	;; conversions while trying to be 'helpful'
+	(tcp-binary-process-output-services (if (stringp service)
+						(list service)
+					      (list service
+						    (int-to-string service))))
+
+	;; An attempt to deal with denied connections, and attempt to reconnect
+	(max-retries url-connection-retries)
+	(cur-retries 0)
+	(retry t)
+	(errobj nil)
+	(conn nil))
+
+    ;; If the user told us to do DNS for them, do it.
+    (if url-gateway-broken-resolution
+	(setq host (url-nslookup-host host)))
+
+    (while (and (not conn) retry)
+      (condition-case errobj
+	  (setq conn (case gw-method
+		       (ssl
+			(open-ssl-stream name buffer host service))
+		       ((tcp native)
+			(and (eq 'tcp gw-method) (require 'tcp))
+			(open-network-stream name buffer host service))
+		       (socks
+			(socks-open-network-stream name buffer host service))
+		       (telnet
+			(url-open-telnet name buffer host service))
+		       (rlogin
+			(url-open-rlogin name buffer host service))
+		       (otherwise
+			(error "Bad setting of url-gateway-method: %s"
+			       url-gateway-method))))
+	(error
+	 (url-save-error errobj)
+	 (save-window-excursion
+	   (save-excursion
+	     (switch-to-buffer-other-window " *url-error*")
+	     (shrink-window-if-larger-than-buffer)
+	     (goto-char (point-min))
+	     (if (and (re-search-forward "in use" nil t)
+		      (< cur-retries max-retries))
+		 (progn
+		   (setq retry t
+			 cur-retries (1+ cur-retries))
+		   (sleep-for 0.5))
+	       (setq cur-retries 0
+		     retry (funcall url-confirmation-func
+				    (concat "Connection to " host
+					    " failed, retry? "))))
+	     (kill-buffer (current-buffer)))))))
+    (if (not conn)
+	(error "Unable to connect to %s:%s" host service)
+      (mule-inhibit-code-conversion conn)
+      conn)))
+
+(provide 'url-gw)
--- a/lisp/w3/url-http.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-http.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-http.el --- HTTP Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1996/12/18 00:38:45
-;; Version: 1.7
+;; Created: 1997/01/15 15:55:48
+;; Version: 1.10
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -133,9 +133,9 @@
 		       (let ((url-basic-auth-storage
 			      url-proxy-basic-authentication))
 			 (url-get-authentication url nil 'any nil))))
-	 (host (if (boundp 'proxy-info)
-		   (url-host (url-generic-parse-url proxy-info))
-		 url-current-server))
+	 (host (or (and (boundp 'proxy-info)
+			(url-host (url-generic-parse-url proxy-info)))
+		   url-current-server))
 	 (auth (if (cdr-safe (assoc "Authorization" url-request-extra-headers))
 		   nil
 		 (url-get-authentication (or
@@ -601,12 +601,9 @@
 		  (process-kill-without-query process)
 		  (process-send-string process request)
 		  (url-lazy-message "Request sent, waiting for response...")
-		  (if url-show-http2-transfer
-		      (progn
-			(make-local-variable 'after-change-functions)
-			(setq url-current-content-length nil)
-			(add-hook 'after-change-functions
-				  'url-after-change-function)))
+		  (setq url-current-content-length nil)
+		  (make-local-variable 'after-change-functions)
+		  (add-hook 'after-change-functions 'url-after-change-function)
 		  (if url-be-asynchronous
 		      (set-process-sentinel process 'url-sentinel)
 		    (unwind-protect
--- a/lisp/w3/url-irc.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-irc.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-irc.el --- IRC URL interface
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.4
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.5
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url-mail.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-mail.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-mail.el --- Mail Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1996/10/21 21:27:36
-;; Version: 1.4
+;; Created: 1997/01/20 19:52:07
+;; Version: 1.7
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -36,8 +36,10 @@
 
 (defun url-mail (&rest args)
   (interactive "P")
-  (or (apply 'mail args)
-      (error "Mail aborted")))
+  (if (fboundp 'message-mail)
+      (apply 'message-mail args)
+    (or (apply 'mail args)
+	(error "Mail aborted"))))
 
 (defun url-mail-goto-field (field)
   (if (not field)
--- a/lisp/w3/url-misc.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-misc.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,11 +1,12 @@
 ;;; url-misc.el --- Misc Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.3
+;; Created: 1997/01/21 21:14:56
+;; Version: 1.9
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -78,152 +79,46 @@
 	      " </body>\n"
 	      "</html>\n"))))
 
-(defun url-rlogin (url)
-  ;; Open up an rlogin connection
-  (if (get-buffer url-working-buffer)
-      (kill-buffer url-working-buffer))
-  (or (string-match "rlogin:/*\\(.*@\\)*\\([^/]*\\)/*" url)
-      (error "Malformed RLOGIN URL."))
-  (let* ((server (substring url (match-beginning 2) (match-end 2)))
-	 (name (if (match-beginning 1)
-		   (substring url (match-beginning 1) (1- (match-end 1)))
-		 nil))
-	 (title (format "%s%s" (if name (concat name "@") "") server))
-	 (thebuf (string-match ":" server))
-	 (port (if thebuf
-		   (prog1
-		       (substring server (1+ thebuf) nil)
-		     (setq server (substring server 0 thebuf))) "23")))
-    (cond
-     ((not (eq (device-type) 'tty))
-      (apply 'start-process
-	     "htmlsub"
-	     nil
-	     (url-string-to-tokens
-	      (format url-xterm-command title 
-		      (if (and url-gateway-local-host-regexp
-			       (string-match url-gateway-local-host-regexp
-					     server))
-			  url-local-rlogin-prog
-			url-remote-rlogin-prog) server
-			(concat "-l " name)) ? )))
-     (url-use-transparent
-      (require 'transparent)
-      (sit-for 1)
-      (transparent-window (get-buffer-create
-			   (format "%s%s:%s" (if name (concat name "@") "")
-				   server port))
-			  (if (and url-gateway-local-host-regexp
-				   (string-match url-gateway-local-host-regexp
-						 server))
-			      url-local-rlogin-prog
-			    url-remote-rlogin-prog)
-			  (list server "-l" name) nil
-			  "Press any key to return to emacs"))
-     (t
-      (terminal-emulator
-       (get-buffer-create (format "%s%s:%s" (if name (concat name "@") "")
-				  server port))
-       (if (and url-gateway-local-host-regexp
-		(string-match url-gateway-local-host-regexp
-			      server))
-	   url-local-rlogin-prog
-	 url-remote-rlogin-prog)
-       (list server "-l" name))))))
+(defun url-do-terminal-emulator (type server port user)
+  (terminal-emulator
+   (generate-new-buffer (format "%s%s" (if user (concat user "@") "") server))
+   (case type
+     (rlogin "rlogin")
+     (telnet "telnet")
+     (tn3270 "tn3270")
+     (otherwise
+      (error "Unknown terminal emulator required: %s" type)))
+   (if user
+       (case type
+	 (rlogin
+	  (list server "-l" user))
+	 (telnet
+	  (if user (message "Please log in as user: %s" user))
+	  (if port
+	      (list server port)
+	    (list server)))
+	 (tn3270
+	  (if user (message "Please log in as user: %s" user))
+	  (list server))))))
 
-(defun url-telnet (url)
-  ;; Open up a telnet connection
+(defun url-generic-emulator-loader (url)
   (if (get-buffer url-working-buffer)
       (kill-buffer url-working-buffer))
-  (or (string-match "telnet:/*\\(.*@\\)*\\([^/]*\\)/*" url)
-      (error "Malformed telnet URL: %s" url))
-  (let* ((server (substring url (match-beginning 2) (match-end 2)))
-	 (name (if (match-beginning 1)
-		   (substring url (match-beginning 1) (1- (match-end 1)))
-		 nil))
-	 (title (format "%s%s" (if name (concat name "@") "") server))
-	 (thebuf (string-match ":" server))
-	 (port (if thebuf
+  (or (string-match "^\\([^:]+\\):/*\\(.*@\\)*\\([^/]*\\)/*" url)
+      (error "Invalid URL: %s" url))
+  (let* ((type (intern (downcase (match-string 1 url))))
+	 (server (match-string 3 url))
+	 (name (if (match-beginning 2)
+		   (substring url (match-beginning 2) (1- (match-end 2)))))
+	 (port (if (string-match ":" server)
 		   (prog1
-		       (substring server (1+ thebuf) nil)
-		     (setq server (substring server 0 thebuf))) "23")))
-    (cond
-     ((not (eq (device-type) 'tty))
-      (apply 'start-process
-	     "htmlsub"
-	     nil
-	     (url-string-to-tokens
-	      (format url-xterm-command title 
-		      (if (and url-gateway-local-host-regexp
-			       (string-match url-gateway-local-host-regexp
-					     server))
-			  url-local-telnet-prog
-			url-remote-telnet-prog) server port) ? ))
-      (if name (message "Please log in as %s" name)))
-     (url-use-transparent
-      (require 'transparent)
-      (if name (message "Please log in as %s" name))
-      (sit-for 1)
-      (transparent-window (get-buffer-create
-			   (format "%s%s:%s" (if name (concat name "@") "")
-				   server port))
-			  (if (and url-gateway-local-host-regexp
-				   (string-match url-gateway-local-host-regexp
-						 server))
-			      url-local-telnet-prog
-			    url-remote-telnet-prog)
-			  (list server port) nil
-			  "Press any key to return to emacs"))
-     (t
-      (terminal-emulator
-       (get-buffer-create (format "%s%s:%s" (if name (concat name "@") "")
-				  server port))
-       (if (and url-gateway-local-host-regexp
-		(string-match url-gateway-local-host-regexp
-			      server))
-	   url-local-telnet-prog
-	 url-remote-telnet-prog)
-       (list server port))
-      (if name (message "Please log in as %s" name))))))
+		       (substring server (match-end 0))
+		     (setq server (substring server 0 (match-beginning 0)))))))
+    (url-do-terminal-emulator type server port name)))
 
-(defun url-tn3270 (url)
-  ;; Open up a tn3270 connection
-  (if (get-buffer url-working-buffer)
-      (kill-buffer url-working-buffer))
-  (string-match "tn3270:/*\\(.*@\\)*\\([^/]*\\)/*" url)
-  (let* ((server (substring url (match-beginning 2) (match-end 2)))
-	 (name (if (match-beginning 1)
-		   (substring url (match-beginning 1) (1- (match-end 1)))
-		 nil))
-	 (thebuf (string-match ":" server))
-	 (title (format "%s%s" (if name (concat name "@") "") server))
-	 (port (if thebuf
-		   (prog1
-		       (substring server (1+ thebuf) nil)
-		     (setq server (substring server 0 thebuf))) "23")))
-    (cond
-     ((not (eq (device-type) 'tty))
-      (start-process "htmlsub" nil url-xterm-command
-		     "-title" title
-		     "-ut" "-e" url-tn3270-emulator server port)
-      (if name (message "Please log in as %s" name)))
-     (url-use-transparent
-      (require 'transparent)
-      (if name (message "Please log in as %s" name))
-      (sit-for 1)
-      (transparent-window (get-buffer-create
-			   (format "%s%s:%s" (if name (concat name "@") "")
-				   server port))
-			  url-tn3270-emulator
-			  (list server port) nil
-			  "Press any key to return to emacs"))
-     (t
-      (terminal-emulator
-       (get-buffer-create (format "%s%s:%s" (if name (concat name "@") "")
-				  server port))
-       url-tn3270-emulator
-       (list server port))
-      (if name (message "Please log in as %s" name))))))
+(fset 'url-rlogin 'url-generic-emulator-loader)
+(fset 'url-telnet 'url-generic-emulator-loader)
+(fset 'url-tn3270 'url-generic-emulator-loader)
 
 (defun url-proxy (url)
   ;; Retrieve URL from a proxy.
@@ -310,4 +205,25 @@
 	(insert "HTTP/1.0 404 Not Found\n"
 		"Server: " url-package-name "/x-exec\n"))))))
 
+;; ftp://ietf.org/internet-drafts/draft-masinter-url-data-02.txt
+(defun url-data (url)
+  (set-buffer (get-buffer-create url-working-buffer))
+  (let ((content-type nil)
+	(encoding nil)
+	(data nil))
+    (cond
+     ((string-match "^data:\\([^;,]*\\);*\\([^,]*\\)," url)
+      (setq content-type (match-string 1 url)
+	    encoding (match-string 2 url)
+	    data (url-unhex-string (substring url (match-end 0))))
+      (if (= 0 (length content-type)) (setq content-type "text/plain"))
+      (if (= 0 (length encoding)) (setq encoding "8bit")))
+     (t nil))
+    (setq url-current-content-length (length data)
+	  url-current-mime-type content-type
+	  url-current-mime-encoding encoding
+	  url-current-mime-headers (list (cons "content-type" content-type)
+					 (cons "content-encoding" encoding)))
+    (and data (insert data))))
+
 (provide 'url-misc)
--- a/lisp/w3/url-news.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-news.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-news.el --- News Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1996/11/05 05:26:07
-;; Version: 1.5
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.6
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url-nfs.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-nfs.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-nfs.el --- NFS URL interface
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.2
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.3
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url-parse.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-parse.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-parse.el --- Uniform Resource Locator parser
 ;; Author: wmperry
-;; Created: 1996/12/26 23:25:55
-;; Version: 1.3
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.4
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url-pgp.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-pgp.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-pgp.el --- PGP encapsulation of HTTP
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.2
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.3
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url-vars.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-vars.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-vars.el --- Variables for Uniform Resource Locator tool
 ;; Author: wmperry
-;; Created: 1996/12/30 14:25:24
-;; Version: 1.19
+;; Created: 1997/01/16 14:13:05
+;; Version: 1.24
 ;; Keywords: comm, data, processes, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -64,6 +64,10 @@
 				      url-current-user
 				      ))
 
+(defvar url-cookie-storage nil         "Where cookies are stored.")
+(defvar url-cookie-secure-storage nil  "Where secure cookies are stored.")
+(defvar url-cookie-file nil            "*Where cookies are stored on disk.")
+
 (defvar url-default-retrieval-proc 'url-default-callback
   "*The default action to take when an asynchronous retrieval completes.")
 
@@ -102,9 +106,6 @@
 
 (defvar url-expected-md5 nil "What md5 we expect to see.")
 
-(defvar url-broken-resolution nil
-  "*Whether to use [ange|efs]-ftp-nslookup-host.")
-
 (defvar url-bug-address "wmperry@cs.indiana.edu" "Where to send bug reports.")
 
 (defvar url-cookie-confirmation nil
@@ -201,7 +202,7 @@
 
 (defvar url-proxy-services nil
   "*An assoc list of access types and servers that gateway them.
-Looks like ((\"http\" . \"url://for/proxy/server/\") ....)  This is set up
+Looks like ((\"http\" . \"hostname:portnumber\") ....)  This is set up
 from the ACCESS_proxy environment variables in url-do-setup.")
 
 (defvar url-global-history-file nil
@@ -434,67 +435,25 @@
 
 (defvar url-find-this-link nil "Link to go to within a document.")
 
-(defvar url-show-http2-transfer t
-  "*Whether to show the total # of bytes, size of file, and percentage
-transferred when retrieving a document over HTTP/1.0 and it returns a
-valid content-length header.  This can mess up some people behind
-gateways.")
-
 (defvar url-gateway-method 'native
   "*The type of gateway support to use.
 Should be a symbol specifying how we are to get a connection off of the
 local machine.
 
 Currently supported methods:
-'program	:: Run a program in a subprocess to connect
-                   (examples are itelnet, an expect script, etc)
-'native		:: Use the native open-network-stream in emacs
+'telnet   	:: Run telnet in a subprocess to connect
+'rlogin         :: Rlogin to another machine to connect
+'socks          :: Connects through a socks server
+'ssl            :: Connection should be made with SSL
 'tcp            :: Use the excellent tcp.el package from gnus.
                    This simply does a (require 'tcp), then sets
-                   url-gateway-method to be 'native.")
-
-(defvar url-gateway-shell-is-telnet nil
-  "*Whether the login shell of the remote host is telnet.")
-
-(defvar url-gateway-program-interactive nil
-  "*Whether url needs to hand-hold the login program on the remote machine.")
-
-(defvar url-gateway-handholding-login-regexp "ogin:"
-  "*Regexp for when to send the username to the remote process.")
-
-(defvar url-gateway-handholding-password-regexp "ord:"
-  "*Regexp for when to send the password to the remote process.")
-
-(defvar url-gateway-host-prompt-pattern "^[^#$%>;]*[#$%>;] *"
-  "*Regexp used to detect when the login is finished on the remote host.")
-
-(defvar url-gateway-telnet-ready-regexp "Escape character is .*"
-  "*A regular expression that signifies url-gateway-telnet-program is
-ready to accept input.")
-
-(defvar url-local-rlogin-prog "rlogin"
-  "*Program for local telnet connections.")
-
-(defvar url-remote-rlogin-prog "rlogin"
-  "*Program for remote telnet connections.")
-
-(defvar url-local-telnet-prog "telnet"
-  "*Program for local telnet connections.")
-
-(defvar url-remote-telnet-prog "telnet"
-  "*Program for remote telnet connections.")  
+                   url-gateway-method to be 'native.
+'native		:: Use the native open-network-stream in emacs
+")
 
 (defvar url-running-xemacs (string-match "XEmacs" emacs-version)
   "*In XEmacs?.")
 
-(defvar url-gateway-telnet-program "itelnet"
-  "*Program to run in a subprocess when using gateway-method 'program.")
-
-(defvar url-gateway-local-host-regexp nil
-  "*If a host being connected to matches this regexp then the
-connection is done natively, otherwise the process is started on
-`url-gateway-host' instead.")
-
 (defvar url-use-hypertext-dired t
   "*How to format directory listings.
 
--- a/lisp/w3/url-wais.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url-wais.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; url-wais.el --- WAIS Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.3
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.4
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/url.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/url.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,18 +1,18 @@
 ;;; url.el --- Uniform Resource Locator retrieval tool
 ;; Author: wmperry
-;; Created: 1996/12/19 21:53:03
-;; Version: 1.40
+;; Created: 1997/01/19 01:12:24
+;; Version: 1.46
 ;; Keywords: comm, data, processes, hypermedia
 
 ;;; LCD Archive Entry:
 ;;; url|William M. Perry|wmperry@cs.indiana.edu|
-;;; Major mode for manipulating URLs|
-;;; 1996/12/19 21:53:03|1.40|Location Undetermined
+;;; Functions for retrieving/manipulating URLs|
+;;; 1997/01/19 01:12:24|1.46|Location Undetermined
 ;;;
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -36,11 +36,7 @@
 (require 'cl)
 (require 'url-vars)
 (require 'url-parse)
-(require 'urlauth)
-(require 'url-cookie)
 (require 'mm)
-(require 'md5)
-(require 'base64)
 (require 'mule-sysdp)
 (or (featurep 'efs)
     (featurep 'efs-auto)
@@ -91,6 +87,7 @@
 (autoload 'url-info "url-misc")
 (autoload 'url-shttp "url-http")
 (autoload 'url-https "url-http")
+(autoload 'url-data "url-misc")
 (autoload 'url-finger "url-misc")
 (autoload 'url-rlogin "url-misc")
 (autoload 'url-telnet "url-misc")
@@ -102,9 +99,7 @@
 (autoload 'url-decode-pgp/pem "url-pgp")
 (autoload 'url-wais "url-wais")
 
-(autoload 'url-save-newsrc "url-news")
-(autoload 'url-news-generate-reply-form "url-news")
-(autoload 'url-parse-newsrc "url-news")
+(autoload 'url-open-stream "url-gw")
 (autoload 'url-mime-response-p "url-http")
 (autoload 'url-parse-mime-headers "url-http")
 (autoload 'url-handle-refresh-header "url-http")
@@ -112,6 +107,16 @@
 (autoload 'url-create-message-id "url-http")
 (autoload 'url-create-multipart-request "url-http")
 (autoload 'url-parse-viewer-types "url-http")
+
+(autoload 'url-get-authentication "url-auth")
+(autoload 'url-register-auth-scheme "url-auth")
+(autoload 'url-cookie-write-file "url-cookie")
+(autoload 'url-cookie-retrieve "url-cookie")
+(autoload 'url-cookie-generate-header-lines "url-cookie")
+(autoload 'url-cookie-handle-set-cookie "url-cookie")
+
+(require 'md5)
+(require 'base64)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; File-name-handler-alist functions
@@ -743,18 +748,10 @@
     (apply 'message args)))
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Gateway Support
-;;; ---------------
-;;; Fairly good/complete gateway support
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun url-kill-process (proc)
   "Kill the process PROC - knows about all the various gateway types,
 and acts accordingly."
-  (cond
-   ((eq url-gateway-method 'native) (delete-process proc))
-   ((eq url-gateway-method 'program) (kill-process proc))
-   (t (error "Unknown url-gateway-method %s" url-gateway-method))))
+  (delete-process proc))
 
 (defun url-accept-process-output (proc)
   "Allow any pending output from subprocesses to be read by Emacs.
@@ -765,91 +762,7 @@
 
 (defun url-process-status (proc)
   "Return the process status of a url buffer"
-  (cond
-   ((memq url-gateway-method '(native ssl program)) (process-status proc))
-   (t (error "Unkown url-gateway-method %s" url-gateway-method))))  
-
-(defun url-open-stream (name buffer host service)
-  "Open a stream to a host"
-  (let ((tmp-gateway-method (if (and url-gateway-local-host-regexp
-				     (not (eq 'ssl url-gateway-method))
-				     (string-match
-				      url-gateway-local-host-regexp
-				      host))
-				'native
-			      url-gateway-method))
-	(tcp-binary-process-output-services (if (stringp service)
-						(list service)
-					      (list service
-						    (int-to-string service)))))
-    (and (eq url-gateway-method 'tcp)
-	 (require 'tcp)
-	 (setq url-gateway-method 'native
-	       tmp-gateway-method 'native))
-    (cond
-     ((eq tmp-gateway-method 'ssl)
-      (open-ssl-stream name buffer host service))
-     ((eq tmp-gateway-method 'native)
-      (if url-broken-resolution
-	  (setq host
-		(cond
-		 ((featurep 'ange-ftp) (ange-ftp-nslookup-host host))
-		 ((featurep 'efs) (efs-nslookup-host host))
-		 ((featurep 'efs-auto) (efs-nslookup-host host))
-		 (t host))))
-      (let ((max-retries url-connection-retries)
-	    (cur-retries 0)
-	    (retry t)
-	    (errobj nil)
-	    (conn nil))
-	(while (and (not conn) retry)
-	  (condition-case errobj
-	      (setq conn (open-network-stream name buffer host service))
-	    (error
-	     (url-save-error errobj)
-	     (save-window-excursion
-	       (save-excursion
-		 (switch-to-buffer-other-window " *url-error*")
-		 (shrink-window-if-larger-than-buffer)
-		 (goto-char (point-min))
-		 (if (and (re-search-forward "in use" nil t)
-			  (< cur-retries max-retries))
-		     (progn
-		       (setq retry t
-			     cur-retries (1+ cur-retries))
-		       (sleep-for 0.5))
-		   (setq cur-retries 0
-			 retry (funcall url-confirmation-func
-					(concat "Connection to " host
-						" failed, retry? "))))
-		 (kill-buffer (current-buffer)))))))
-	(if (not conn)
-	    (error "Unable to connect to %s:%s" host service)
-	  (mule-inhibit-code-conversion conn)
-	  conn)))
-     ((eq tmp-gateway-method 'program)
-      (let ((proc (start-process name buffer url-gateway-telnet-program host
-				 (int-to-string service)))
-	    (tmp nil))
-	(save-excursion
-	  (set-buffer buffer)
-	  (setq tmp (point))
-	  (while (not (progn
-			(goto-char (point-min))
-			(re-search-forward 
-			 url-gateway-telnet-ready-regexp nil t)))
-	    (url-accept-process-output proc))
-	  (delete-region tmp (point))
-	  (goto-char (point-min))
-	  (if (re-search-forward "connect:" nil t)
-	      (progn
-		(condition-case ()
-		    (delete-process proc)
-		  (error nil))
-		(url-replace-regexp ".*connect:.*" "")
-		nil)
-	    proc))))
-     (t (error "Unknown url-gateway-method %s" url-gateway-method)))))
+  (process-status proc))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -974,6 +887,7 @@
     (url-register-protocol 'news       nil 'url-identity-expander "119")
     (url-register-protocol 'nntp       nil 'url-identity-expander "119")
     (url-register-protocol 'irc        nil 'url-identity-expander "6667")
+    (url-register-protocol 'data       nil 'url-identity-expander)
     (url-register-protocol 'rlogin)
     (url-register-protocol 'shttp      nil nil "80")
     (url-register-protocol 'telnet)
@@ -1425,7 +1339,9 @@
 path components followed by `..' are removed, along with the `..' itself."
   (if url
       (setq url (mapconcat (function (lambda (x)
-				       (if (= x ?\n) "" (char-to-string x))))
+				       (if (memq x '(?\n ?\r))
+					   ""
+					 (char-to-string x))))
 			   (url-strip-leading-spaces
 			    (url-eat-trailing-space url)) "")))
   (cond
--- a/lisp/w3/urlauth.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/urlauth.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,303 +0,0 @@
-;;; urlauth.el --- Uniform Resource Locator authorization modules
-;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.2
-;; Keywords: comm, data, processes, hypermedia
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
-;;;
-;;; This file is not part of GNU Emacs, but the same permissions apply.
-;;;
-;;; 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.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'url-vars)
-(require 'url-parse)
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Basic authorization code
-;;; ------------------------
-;;; This implements the BASIC authorization type.  See the online
-;;; documentation at
-;;; http://www.w3.org/hypertext/WWW/AccessAuthorization/Basic.html
-;;; for the complete documentation on this type.
-;;;
-;;; This is very insecure, but it works as a proof-of-concept
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar url-basic-auth-storage nil
-  "Where usernames and passwords are stored.  Its value is an assoc list of
-assoc lists.  The first assoc list is keyed by the server name.  The cdr of
-this is an assoc list based on the 'directory' specified by the url we are
-looking up.")
-
-(defun url-basic-auth (url &optional prompt overwrite realm args)
-  "Get the username/password for the specified URL.
-If optional argument PROMPT is non-nil, ask for the username/password
-to use for the url and its descendants.  If optional third argument
-OVERWRITE is non-nil, overwrite the old username/password pair if it
-is found in the assoc list.  If REALM is specified, use that as the realm
-instead of the pathname inheritance method."
-  (let* ((href (if (stringp url)
-		   (url-generic-parse-url url)
-		 url))
-	 (server (or (url-host href) url-current-server))
-	 (port (or (url-port href) "80"))
-	 (path (url-filename href))
-	 user pass byserv retval data)
-    (setq server (concat server ":" port)
-	  path (cond
-		(realm realm)
-		((string-match "/$" path) path)
-		(t (url-basepath path)))
-	  byserv (cdr-safe (assoc server url-basic-auth-storage)))
-    (cond
-     ((and prompt (not byserv))
-      (setq user (read-string "Username: " (user-real-login-name))
-	    pass (funcall url-passwd-entry-func "Password: ")
-	    url-basic-auth-storage
-	    (cons (list server
-			(cons path
-			      (setq retval
-				    (base64-encode
-				     (format "%s:%s" user pass)))))
-		  url-basic-auth-storage)))
-     (byserv
-      (setq retval (cdr-safe (assoc path byserv)))
-      (if (and (not retval)
-	       (string-match "/" path))
- 	  (while (and byserv (not retval))
-	    (setq data (car (car byserv)))
-	    (if (or (not (string-match "/" data)) ; Its a realm - take it!
-		    (and
-		     (>= (length path) (length data))
-		     (string= data (substring path 0 (length data)))))
-		(setq retval (cdr (car byserv))))
-	    (setq byserv (cdr byserv))))
-      (if (or (and (not retval) prompt) overwrite)
-	  (progn
-	    (setq user (read-string "Username: " (user-real-login-name))
-		  pass (funcall url-passwd-entry-func "Password: ")
-		  retval (base64-encode (format "%s:%s" user pass))
-		  byserv (assoc server url-basic-auth-storage))
-	    (setcdr byserv
-		    (cons (cons path retval) (cdr byserv))))))
-     (t (setq retval nil)))
-    (if retval (setq retval (concat "Basic " retval)))
-    retval))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Digest authorization code
-;;; ------------------------
-;;; This implements the DIGEST authorization type.  See the internet draft
-;;; ftp://ds.internic.net/internet-drafts/draft-ietf-http-digest-aa-01.txt
-;;; for the complete documentation on this type.
-;;;
-;;; This is very secure
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar url-digest-auth-storage nil
-  "Where usernames and passwords are stored.  Its value is an assoc list of
-assoc lists.  The first assoc list is keyed by the server name.  The cdr of
-this is an assoc list based on the 'directory' specified by the url we are
-looking up.")
-
-(defun url-digest-auth-create-key (username password realm method uri)
-  "Create a key for digest authentication method"
-  (let* ((info (if (stringp uri)
-		   (url-generic-parse-url uri)
-		 uri))
-	 (a1 (md5 (concat username ":" realm ":" password)))
-	 (a2 (md5 (concat method ":" (url-filename info)))))
-    (list a1 a2)))
-
-(defun url-digest-auth (url &optional prompt overwrite realm args)
-  "Get the username/password for the specified URL.
-If optional argument PROMPT is non-nil, ask for the username/password
-to use for the url and its descendants.  If optional third argument
-OVERWRITE is non-nil, overwrite the old username/password pair if it
-is found in the assoc list.  If REALM is specified, use that as the realm
-instead of hostname:portnum."
-  (if args
-      (let* ((href (if (stringp url)
-		       (url-generic-parse-url url)
-		     url))
-	     (server (or (url-host href) url-current-server))
-	     (port (or (url-port href) "80"))
-	     (path (url-filename href))
-	     user pass byserv retval data)
-	(setq path (cond
-		    (realm realm)
-		    ((string-match "/$" path) path)
-		    (t (url-basepath path)))
-	      server (concat server ":" port)
-	      byserv (cdr-safe (assoc server url-digest-auth-storage)))
-	(cond
-	 ((and prompt (not byserv))
-	  (setq user (read-string "Username: " (user-real-login-name))
-		pass (funcall url-passwd-entry-func "Password: ")
-		url-digest-auth-storage
-		(cons (list server
-			    (cons path
-				  (setq retval
-					(cons user
-					      (url-digest-auth-create-key
-					       user pass realm
-					       (or url-request-method "GET")
-					       url)))))
-		      url-digest-auth-storage)))
-	 (byserv
-	  (setq retval (cdr-safe (assoc path byserv)))
-	  (if (and (not retval)		; no exact match, check directories
-		   (string-match "/" path)) ; not looking for a realm
-	      (while (and byserv (not retval))
-		(setq data (car (car byserv)))
-		(if (or (not (string-match "/" data))
-			(and
-			 (>= (length path) (length data))
-			 (string= data (substring path 0 (length data)))))
-		    (setq retval (cdr (car byserv))))
-		(setq byserv (cdr byserv))))
-	  (if (or (and (not retval) prompt) overwrite)
-	      (progn
-		(setq user (read-string "Username: " (user-real-login-name))
-		      pass (funcall url-passwd-entry-func "Password: ")
-		      retval (setq retval
-				   (cons user
-					 (url-digest-auth-create-key
-					  user pass realm
-					  (or url-request-method "GET")
-					  url)))
-		      byserv (assoc server url-digest-auth-storage))
-		(setcdr byserv
-			(cons (cons path retval) (cdr byserv))))))
-	 (t (setq retval nil)))
-	(if retval
-	    (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))
-		  (opaque (or (cdr-safe (assoc "opaque" args)) "nonegiven")))
-	      (format
-	       (concat "Digest username=\"%s\", realm=\"%s\","
-		       "nonce=\"%s\", uri=\"%s\","
-		       "response=\"%s\", opaque=\"%s\"")
-	       (nth 0 retval) realm nonce (url-filename href)
-	       (md5 (concat (nth 1 retval) ":" nonce ":"
-			    (nth 2 retval))) opaque))))))
-
-(defvar url-registered-auth-schemes nil
-  "A list of the registered authorization schemes and various and sundry
-information associated with them.")
-
-(defun url-get-authentication (url realm type prompt &optional args)
-  "Return an authorization string suitable for use in the WWW-Authenticate
-header in an HTTP/1.0 request.
-
-URL    is the url you are requesting authorization to.  This can be either a
-       string representing the URL, or the parsed representation returned by
-       `url-generic-parse-url'
-REALM  is the realm at a specific site we are looking for.  This should be a
-       string specifying the exact realm, or nil or the symbol 'any' to
-       specify that the filename portion of the URL should be used as the
-       realm
-TYPE   is the type of authentication to be returned.  This is either a string
-       representing the type (basic, digest, etc), or nil or the symbol 'any'
-       to specify that any authentication is acceptable.  If requesting 'any'
-       the strongest matching authentication will be returned.  If this is
-       wrong, its no big deal, the error from the server will specify exactly
-       what type of auth to use
-PROMPT is boolean - specifies whether to ask the user for a username/password
-       if one cannot be found in the cache"
-  (if (not realm)
-      (setq realm (cdr-safe (assoc "realm" args))))
-  (if (stringp url)
-      (setq url (url-generic-parse-url url)))
-  (if (or (null type) (eq type 'any))
-      ;; Whooo doogies!
-      ;; Go through and get _all_ the authorization strings that could apply
-      ;; to this URL, store them along with the 'rating' we have in the list
-      ;; of schemes, then sort them so that the 'best' is at the front of the
-      ;; list, then get the car, then get the cdr.
-      ;; Zooom zooom zoooooom
-      (cdr-safe
-       (car-safe
-	(sort
-	 (mapcar
-	  (function
-	   (lambda (scheme)
-	     (if (fboundp (car (cdr scheme)))
-		 (cons (cdr (cdr scheme))
-		       (funcall (car (cdr scheme)) url nil nil realm))
-	       (cons 0 nil))))
-	  url-registered-auth-schemes)
-	 (function
-	  (lambda (x y)
-	    (cond
-	     ((null (cdr x)) nil)
-	     ((and (cdr x) (null (cdr y))) t)
-	     ((and (cdr x) (cdr y))
-	      (>= (car x) (car y)))
-	     (t nil)))))))
-    (if (symbolp type) (setq type (symbol-name type)))
-    (let* ((scheme (car-safe
-		    (cdr-safe (assoc (downcase type)
-				     url-registered-auth-schemes)))))
-      (if (and scheme (fboundp scheme))
-	  (funcall scheme url prompt
-		   (and prompt
-			(funcall scheme url nil nil realm args))
-		   realm args)))))
-
-(defun url-register-auth-scheme (type &optional function rating)
-  "Register an HTTP authentication method.
-
-TYPE     is a string or symbol specifying the name of the method.   This
-         should be the same thing you expect to get returned in an Authenticate
-         header in HTTP/1.0 - it will be downcased.
-FUNCTION is the function to call to get the authorization information.  This
-         defaults to `url-?-auth', where ? is TYPE
-RATING   a rating between 1 and 10 of the strength of the authentication.
-         This is used when asking for the best authentication for a specific
-         URL.  The item with the highest rating is returned."
-  (let* ((type (cond
-		((stringp type) (downcase type))
-		((symbolp type) (downcase (symbol-name type)))
-		(t (error "Bad call to `url-register-auth-scheme'"))))
-	 (function (or function (intern (concat "url-" type "-auth"))))
-	 (rating (cond
-		  ((null rating) 2)
-		  ((stringp rating) (string-to-int rating))
-		  (t rating)))
-	 (node (assoc type url-registered-auth-schemes)))
-    (if (not (fboundp function))
-	(url-warn 'security
-		  (format (eval-when-compile
-			    "Tried to register `%s' as an auth scheme"
-			    ", but it is not a function!") function)))
-
-    (if node
-	(progn
-	  (setcdr node (cons function rating))
-	  (url-warn 'security
-		    (format
-		     "Replacing authorization method `%s' - this could be bad."
-		     type)))
-      (setq url-registered-auth-schemes
-	    (cons (cons type (cons function rating))
-		  url-registered-auth-schemes)))))
-
-(defun url-auth-registered (scheme)
-  ;; Return non-nil iff SCHEME is registered as an auth type
-  (assoc scheme url-registered-auth-schemes))
-
-(provide 'urlauth)
--- a/lisp/w3/w3-about.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-about.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-about.el --- About pages for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/12/16 16:44:46
-;; Version: 1.6
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.7
 ;; Keywords: hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-annotat.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-annotat.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-annotat.el --- Annotation functions for Emacs-W3
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.5
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.6
 ;; Keywords: faces, help, comm, news, mail, processes, mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-auto.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-auto.el	Mon Aug 13 09:07:36 2007 +0200
@@ -32,7 +32,7 @@
 
 ;; Stylesheet stuff
 (autoload 'w3-handle-style "w3-style")
-(autoload 'w3-display-stylesheet "w3-style")
+(autoload 'w3-display-stylesheet "w3-style" "" t)
 
 ;; Setup stuff
 (autoload 'url-do-setup "url")
--- a/lisp/w3/w3-display.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-display.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-display.el --- display engine v99999
 ;; Author: wmperry
-;; Created: 1997/01/02 20:20:45
-;; Version: 1.90
+;; Created: 1997/01/21 19:45:13
+;; Version: 1.110
 ;; Keywords: faces, help, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; This file is part of GNU Emacs.
@@ -38,14 +38,14 @@
 (w3-d-s-var-def w3-display-open-element-stack)
 (w3-d-s-var-def w3-display-alignment-stack)
 (w3-d-s-var-def w3-display-list-stack)
-(w3-d-s-var-def w3-display-form-stack)
+(w3-d-s-var-def w3-display-form-id)
 (w3-d-s-var-def w3-display-whitespace-stack)
 (w3-d-s-var-def w3-display-font-family-stack)
 (w3-d-s-var-def w3-display-font-weight-stack)
 (w3-d-s-var-def w3-display-font-variant-stack)
 (w3-d-s-var-def w3-display-font-size-stack)
 (w3-d-s-var-def w3-face-color)
-(w3-d-s-var-def w3-face-background)
+(w3-d-s-var-def w3-face-background-color)
 (w3-d-s-var-def w3-active-faces)
 (w3-d-s-var-def w3-active-voices)
 (w3-d-s-var-def w3-current-form-number)
@@ -85,7 +85,7 @@
        (w3-get-face-info text-decoration)
        ;;(w3-get-face-info pixmap)
        (w3-get-face-info color)
-       (w3-get-face-info background)
+       (w3-get-face-info background-color)
        (setq w3-face-font-spec (make-font
 				:weight (car w3-face-font-weight)
 				:family (car w3-face-font-family)
@@ -101,10 +101,11 @@
        (w3-pop-face-info text-decoration)
        ;;(w3-pop-face-info pixmap)
        (w3-pop-face-info color)
-       (w3-pop-face-info background))))
+       (w3-pop-face-info background-color))))
 
   )
 
+(defvar w3-display-same-buffer nil)
 (defvar w3-face-cache nil  "Cache for w3-face-for-element")
 (defvar w3-face-index 0)
 (defvar w3-image-widgets-waiting nil)
@@ -233,10 +234,10 @@
 				  (car w3-face-font-variant)))
   (setq w3-face-descr (list w3-face-font-spec
 			    (car w3-face-color)
-			    (car w3-face-background))
+			    (car w3-face-background-color))
 	w3-face-face (cdr-safe (assoc w3-face-descr w3-face-cache)))
   (if (or w3-face-face (not (or (car w3-face-color)
-				(car w3-face-background)
+				(car w3-face-background-color)
 				w3-face-font-spec)))
       nil				; Do nothing, we got it already
     (setq w3-face-face
@@ -247,8 +248,8 @@
 	(set-face-font w3-face-face w3-face-font-spec))
     (if (car w3-face-color)
 	(set-face-foreground w3-face-face (car w3-face-color)))
-    (if (car w3-face-background)
-	(set-face-background w3-face-face (car w3-face-background)))
+    (if (car w3-face-background-color)
+	(set-face-background w3-face-face (car w3-face-background-color)))
     ;;(set-face-background-pixmap w3-face-face w3-face-pixmap)
     (setq w3-face-cache (cons
 			 (cons w3-face-descr w3-face-face)
@@ -274,6 +275,7 @@
   '((disc   . ?*)
     (circle . ?o)
     (square . ?#)
+    (none   . ? )
     )
   "*An assoc list of unordered list types mapping to characters to use
 as the bullet character.")    
@@ -358,21 +360,25 @@
   )
 
 (defun w3-widget-echo (widget &rest ignore)
-  (let ((href (widget-get widget 'href))
+  (let ((url (widget-get widget 'href))
 	(name (widget-get widget 'name))
 	(text (buffer-substring (widget-get widget :from)
 				(widget-get widget :to)))
 	(title (widget-get widget 'title))
+	(check w3-echo-link)
 	(msg nil))
-    (if href
-	(setq href (url-truncate-url-for-viewing href)))
+    (if url
+	(setq url (url-truncate-url-for-viewing url)))
     (if name
 	(setq name (concat "anchor:" name)))
-    (case w3-echo-link
-      (url (or href title text name))
-      (text (or text title href name))
-      (title (or title text href name))
-      (otherwise nil))))
+    (if (not (listp check))
+	(setq check (cons check '(title url text name))))
+    (catch 'exit
+      (while check
+	(and (boundp (car check))
+	     (stringp (symbol-value (car check)))
+	     (throw 'exit (symbol-value (car check))))
+	(pop check)))))
 
 (defun w3-follow-hyperlink (widget &rest ignore)
   (let* ((target (widget-get widget 'target))
@@ -423,7 +429,7 @@
     (`
      (case (car break-style)
        (list-item
-	(let ((list-style (w3-get-style-info 'list-style node))
+	(let ((list-style (w3-get-style-info 'list-style-type node))
 	      (list-num (if (car w3-display-list-stack)
 			    (incf (car w3-display-list-stack))
 			  1))
@@ -572,7 +578,7 @@
     (setq desc (and desc (intern dc-desc)))
     (case desc
       ((style stylesheet)
-       (w3-handle-style args))
+       (w3-handle-style plist))
       (otherwise
        )
       )
@@ -1389,6 +1395,25 @@
 		)
       "HoplesSLYCoNfUSED")))
 
+(defun w3-display-chop-into-table (node cols)
+  ;; Chop the content of 'node' up into 'cols' columns suitable for inclusion
+  ;; as the content of a table
+  (let ((content (nth 2 node))
+	(items nil)
+	(rows nil))
+    (setq cols (max cols 1))
+    (while content
+      (push (list 'td nil (list (pop content))) items)
+      (if (= (length items) cols)
+	  (setq rows (cons (nreverse items) rows)
+		items nil)))
+    (if items				; Store any leftovers
+	(setq rows (cons (nreverse items) rows)
+	      items nil))
+    (while rows
+      (push (list 'tr nil (pop rows)) items))
+    items))
+
 (defun w3-display-node (node &optional nofaces)
   (let (
 	(content-stack (list (list node)))
@@ -1421,6 +1446,9 @@
 				(list
 				 'mouse-face 'highlight
 				 'duplicable t
+				 'start-open t
+				 'end-open t
+				 'rear-nonsticky t
 				 'help-echo 'w3-balloon-help-callback
 				 'balloon-help 'w3-balloon-help-callback))
 	   (fillin-text-property (car hyperlink-info) (point)
@@ -1428,8 +1456,6 @@
 	   (widget-put (cadr hyperlink-info) :to (set-marker
 						  (make-marker) (point))))
 	 (setq hyperlink-info nil))
-	(form
-	 (pop w3-display-form-stack))
 	((ol ul dl dir menu)
 	 (pop w3-display-list-stack))
 	(otherwise
@@ -1454,14 +1480,20 @@
 	  (if (w3-get-attribute 'style)
 	      (let ((unique-id (or (w3-get-attribute 'id)
 				   (w3-display-create-unique-id)))
-		    (sheet ""))
+		    (sheet "")
+		    (class (assq 'class args)))
 		(setq sheet (format "%s.%s { %s }\n" tag unique-id
 				    (w3-get-attribute 'style)))
-		(setf (nth 1 node) (cons (cons 'id unique-id) args))
-		(w3-handle-style (list (cons 'data sheet)
-				       (cons 'notation "css")))))
+		(if class
+		    (setcdr class (cons unique-id (cdr class)))
+		  (setf (nth 1 node) (cons (cons 'class (list unique-id))
+					   (nth 1 node))))
+		(setf (nth 1 node) (cons (cons 'id unique-id) (nth 1 node)))
+		(w3-handle-style (list 'data sheet
+				       'notation "css"))))
 	  (setq w3-display-css-properties (css-get
-					   (nth 0 node) (nth 1 node)
+					   (nth 0 node)
+					   (nth 1 node)
 					   w3-current-stylesheet
 					   w3-display-open-element-stack))
 	  (if nofaces
@@ -1514,8 +1546,22 @@
 	       (w3-handle-content node)
 	       )
 	     )
-	    ((ol ul dl dir menu)
+	    ((ol ul dl menu)
+	     (push 0 w3-display-list-stack)
+	     (w3-handle-content node))
+	    (dir
 	     (push 0 w3-display-list-stack)
+	     (setq node
+		   (list tag args
+			 (list
+			  (list 'table nil
+				(w3-display-chop-into-table node 3)))))
+	     (w3-handle-content node))
+	    (multicol
+	     (setq node (list tag args
+			      (list
+			       (list 'table nil
+				     (w3-display-chop-into-table node 2)))))
 	     (w3-handle-content node))
 	    (img			; inlined image
 	     (w3-handle-image)
@@ -1565,7 +1611,27 @@
 	       (setq w3-imagemaps (cons (cons name areas) w3-imagemaps)))
 	     (w3-handle-empty-tag)
 	     )
-	    (table			; Yeeee-hah!
+	    (note
+	     ;; Ewwwwhhh.  Looks gross, but it works.  This converts a
+	     ;; <note> into a two-cell table, so that things look all
+	     ;; pretty.
+	     (setq node
+		   (list 'note nil
+			 (list
+			  (list 'table nil
+				(list
+				 (list 'tr nil
+				       (list
+					(list 'td (list 'align 'right)
+					      (list
+					       (concat
+						(or (w3-get-attribute 'role)
+						    "CAUTION") ":")))
+					(list 'td nil
+					      (nth 2 node)))))))))
+	     (w3-handle-content node)
+	     )
+	    (table
 	     (w3-display-table node)
 	     (setq w3-last-fill-pos (point))
 	     (w3-handle-empty-tag)
@@ -1599,7 +1665,8 @@
 	    (*document
 	     (let ((info (mapcar (lambda (x) (cons x (symbol-value x)))
 				 w3-persistent-variables)))
-	       (set-buffer (generate-new-buffer "Untitled"))
+	       (if (not w3-display-same-buffer)
+		   (set-buffer (generate-new-buffer "Untitled")))
 	       (setq w3-current-form-number 0
 		     w3-display-open-element-stack nil
 		     w3-last-fill-pos (point-min)
@@ -1613,6 +1680,7 @@
 	       ;; ACK!  We don't like filladapt mode!
 	       (set (make-local-variable 'filladapt-mode) nil)
 	       (set (make-local-variable 'adaptive-fill-mode) nil)
+	       (set (make-local-variable 'voice-lock-mode) t)
 	       (setq w3-current-stylesheet (css-copy-stylesheet
 					    w3-user-stylesheet)
 		     w3-last-fill-pos (point)
@@ -1660,7 +1728,8 @@
 		 (setq potential-title (concat potential-title (car content))
 		       content (cdr content)))
 	       (setq potential-title (w3-normalize-spaces potential-title))
-	       (if (string-match "^[ \t]*$" potential-title)
+	       (if (or w3-display-same-buffer
+		       (string-match "^[ \t]*$" potential-title))
 		   nil
 		 (rename-buffer (generate-new-buffer-name
 				 (w3-fix-spaces potential-title)))))
@@ -1672,134 +1741,157 @@
 		    (url nil))
 	       (if (not action)
 		   (setq args (cons (cons 'action (url-view-url t)) args)))
-	       (push (cons
-		      (cons 'form-number
-			    w3-current-form-number)
-		      args) w3-display-form-stack)
+	       (setq w3-display-form-id (cons
+					 (cons 'form-number
+					       w3-current-form-number)
+					 args))
 	       (w3-handle-content node)))
+	    (keygen
+	     (w3-form-add-element 'keygen
+				  (or (w3-get-attribute 'name)
+				      (w3-get-attribute 'id)
+				      "keygen")
+				  nil	; value
+				  nil	; size
+				  nil	; maxlength
+				  nil   ; default
+				  w3-display-form-id ; action
+				  nil	; options
+				  w3-current-form-number
+				  (w3-get-attribute 'id) ; id
+				  nil	; checked
+				  (car w3-active-faces)))
 	    (input
-	     (if (not (assq 'form w3-display-open-element-stack))
-		 (message "Input field outside of a <form>")
-	       (let* (
-		      (type (intern (downcase (or (w3-get-attribute 'type)
-						  "text"))))
-		      (name (w3-get-attribute 'name))
-		      (value (or (w3-get-attribute 'value) ""))
-		      (size (if (w3-get-attribute 'size)
-				(string-to-int (w3-get-attribute 'size))))
-		      (maxlength (cdr (assoc 'maxlength args)))
-		      (default value)
-		      (action (car w3-display-form-stack))
-		      (options)
-		      (id (w3-get-attribute 'id))
-		      (checked (assq 'checked args)))
-		 (if (and (string-match "^[ \t\n\r]+$" value)
-			  (not (eq type 'hidden)))
-		     (setq value ""))
-		 (if maxlength (setq maxlength (string-to-int maxlength)))
-		 (if (and name (string-match "[\r\n]" name))
-		     (setq name (mapconcat (function
-					    (lambda (x)
-					      (if (memq x '(?\r ?\n))
-						  ""
-						(char-to-string x))))
-					   name "")))
-		 (if (memq type '(checkbox radio)) (setq default checked))
-		 (if (and (eq type 'checkbox) (string= value ""))
-		     (setq value "on"))
-		 (w3-form-add-element type name
-				      value size maxlength default action
-				      options w3-current-form-number id checked
-				      (car w3-active-faces))
-		 )
+	     (let* (
+		    (type (intern (downcase (or (w3-get-attribute 'type)
+						"text"))))
+		    (name (w3-get-attribute 'name))
+		    (value (or (w3-get-attribute 'value) ""))
+		    (size (if (w3-get-attribute 'size)
+			      (string-to-int (w3-get-attribute 'size))))
+		    (maxlength (cdr (assoc 'maxlength args)))
+		    (default value)
+		    (action w3-display-form-id)
+		    (options)
+		    (id (w3-get-attribute 'id))
+		    (checked (assq 'checked args)))
+	       (if (and (string-match "^[ \t\n\r]+$" value)
+			(not (eq type 'hidden)))
+		   (setq value ""))
+	       (if maxlength (setq maxlength (string-to-int maxlength)))
+	       (if (and name (string-match "[\r\n]" name))
+		   (setq name (mapconcat (function
+					  (lambda (x)
+					    (if (memq x '(?\r ?\n))
+						""
+					      (char-to-string x))))
+					 name "")))
+	       (if (memq type '(checkbox radio)) (setq default checked))
+	       (if (and (eq type 'checkbox) (string= value ""))
+		   (setq value "on"))
+	       (w3-form-add-element type name
+				    value size maxlength default action
+				    options w3-current-form-number id checked
+				    (car w3-active-faces))
 	       )
 	     (w3-handle-empty-tag)
 	     )
 	    (select
-	     (if (not (assq 'form w3-display-open-element-stack))
-		 (message "Input field outside of a <form>")
-	       (let* (
-		      (name (w3-get-attribute 'name))
-		      (size (string-to-int (or (w3-get-attribute 'size)
-					       "20")))
-		      (maxlength (cdr (assq 'maxlength args)))
-		      (value nil)
-		      (tmp nil)
-		      (action (car w3-display-form-stack))
-		      (options)
-		      (id (w3-get-attribute 'id))
-		      (checked (assq 'checked args)))
-		 (if maxlength (setq maxlength (string-to-int maxlength)))
-		 (if (and name (string-match "[\r\n]" name))
-		     (setq name (mapconcat (function
-					    (lambda (x)
-					      (if (memq x '(?\r ?\n))
-						  ""
-						(char-to-string x))))
-					   name "")))
-		 (setq options
-		       (mapcar
-			(function
-			 (lambda (n)
-			   (setq tmp (w3-normalize-spaces
-				      (apply 'concat (nth 2 n)))
-				 tmp (cons tmp
-					   (or
-					    (cdr-safe (assq 'value (nth 1 n)))
-					    tmp)))
-			   (if (assq 'selected (nth 1 n))
-			       (setq value (car tmp)))
-			   tmp))
-			(nth 2 node)))
-		 (if (not value)
-		     (setq value (caar options)))
-		 (w3-form-add-element 'option name
-				      value size maxlength value action
-				      options w3-current-form-number id nil
+	     (let* (
+		    (name (w3-get-attribute 'name))
+		    (size (string-to-int (or (w3-get-attribute 'size)
+					     "20")))
+		    (maxlength (cdr (assq 'maxlength args)))
+		    (value nil)
+		    (tmp nil)
+		    (action w3-display-form-id)
+		    (options)
+		    (id (w3-get-attribute 'id))
+		    (multiple (assq 'multiple args))
+		    (checked (assq 'checked args)))
+	       (if maxlength (setq maxlength (string-to-int maxlength)))
+	       (if (and name (string-match "[\r\n]" name))
+		   (setq name (mapconcat (function
+					  (lambda (x)
+					    (if (memq x '(?\r ?\n))
+						""
+					      (char-to-string x))))
+					 name "")))
+	       (setq options
+		     (mapcar
+		      (function
+		       (lambda (n)
+			 (setq tmp (w3-normalize-spaces
+				    (apply 'concat (nth 2 n)))
+			       tmp (cons tmp
+					 (or
+					  (cdr-safe (assq 'value (nth 1 n)))
+					  tmp)))
+			 (if (assq 'selected (nth 1 n))
+			     (setq value (car tmp)))
+			 tmp))
+		      (nth 2 node)))
+	       (if (not value)
+		   (setq value (caar options)))
+	       (if multiple
+		   (progn
+		     (setq options
+			   (mapcar
+			    (function
+			     (lambda (opt)
+			       (list 'div nil
+				     (list
+				      (list 'input
+					    (list (cons 'name name)
+						  (cons 'type "checkbox")
+						  (cons 'value (car opt))))
+				      " " (car opt) (list 'br nil nil)))))
+			    options))
+		     (setq node (list 'p nil options))
+		     (w3-handle-content node))
+		 (w3-form-add-element 'option
+				      name value size maxlength value
+				      action options
+				      w3-current-form-number id nil
 				      (car w3-active-faces))
 		 ;; This should really not be necessary, but some versions
 		 ;; of the widget library leave point _BEFORE_ the menu
 		 ;; widget instead of after.
 		 (goto-char (point-max))
-		 )
-	       )
-	     (w3-handle-empty-tag)
-	     )
+		 (w3-handle-empty-tag))))
 	    (textarea
-	     (if (not (assq 'form w3-display-open-element-stack))
-		 (message "Input field outside of a <form>")
-	       (let* (
-		      (name (w3-get-attribute 'name))
-		      (size (string-to-int (or (w3-get-attribute 'size)
-					       "20")))
-		      (maxlength (cdr (assq 'maxlength args)))
-		      (value (w3-normalize-spaces
-			      (apply 'concat (nth 2 node))))
-		      (default value)
-		      (tmp nil)
-		      (action (car w3-display-form-stack))
-		      (options)
-		      (id (w3-get-attribute 'id))
-		      (checked (assq 'checked args)))
-		 (if maxlength (setq maxlength (string-to-int maxlength)))
-		 (if (and name (string-match "[\r\n]" name))
-		     (setq name (mapconcat (function
-					    (lambda (x)
-					      (if (memq x '(?\r ?\n))
-						  ""
-						(char-to-string x))))
-					   name "")))
-		 (w3-form-add-element 'multiline name
-				      value size maxlength value action
-				      options w3-current-form-number id nil
-				      (car w3-active-faces))
-		 )
+	     (let* (
+		    (name (w3-get-attribute 'name))
+		    (size (string-to-int (or (w3-get-attribute 'size)
+					     "22")))
+		    (maxlength (cdr (assq 'maxlength args)))
+		    (value (w3-normalize-spaces
+			    (apply 'concat (nth 2 node))))
+		    (default value)
+		    (tmp nil)
+		    (action w3-display-form-id)
+		    (options)
+		    (id (w3-get-attribute 'id))
+		    (checked (assq 'checked args)))
+	       (if maxlength (setq maxlength (string-to-int maxlength)))
+	       (if (and name (string-match "[\r\n]" name))
+		   (setq name (mapconcat (function
+					  (lambda (x)
+					    (if (memq x '(?\r ?\n))
+						""
+					      (char-to-string x))))
+					 name "")))
+	       (w3-form-add-element 'multiline name
+				    value size maxlength value action
+				    options w3-current-form-number id nil
+				    (car w3-active-faces))
 	       )
 	     (w3-handle-empty-tag)
 	     )
 	    (style
-	     (w3-handle-style (cons (cons 'data (apply 'concat (nth 2 node)))
-				    (nth 1 node)))
+	     (w3-handle-style (alist-to-plist
+			       (cons (cons 'data (apply 'concat (nth 2 node)))
+				     (nth 1 node))))
 	     (w3-handle-empty-tag))
 	    (otherwise
 	     ;; Generic formatting
@@ -1829,6 +1921,48 @@
     (- nd st)))
 
 
+(defsubst w3-finish-drawing ()
+  (if (and (boundp 'w3-image-widgets-waiting) w3-image-widgets-waiting)
+      (let (url glyph widget)
+	(while w3-image-widgets-waiting
+	  (setq widget (car w3-image-widgets-waiting)
+		w3-image-widgets-waiting (cdr w3-image-widgets-waiting)
+		url (widget-get widget 'src)
+		glyph (cdr-safe (assoc url w3-graphics-list)))
+	  (widget-value-set widget glyph)))
+    ;;(w3-handle-annotations)
+    ;;(w3-handle-headers)
+    )
+  )
+
+(defun w3-region (st nd)
+  (if (not w3-setup-done) (w3-do-setup))
+  (let* ((source (buffer-substring st nd))
+	 (w3-display-same-buffer t)
+	 (parse nil))
+    (save-excursion
+      (set-buffer (get-buffer-create " *w3-region*"))
+      (erase-buffer)
+      (insert source)
+      (setq parse (w3-parse-buffer (current-buffer))))
+    (narrow-to-region st nd)
+    (delete-region (point-min) (point-max))
+    (w3-draw-tree parse)
+    (w3-finish-drawing)))
+
+(defun w3-refresh-buffer ()
+  (interactive)
+  (let ((parse w3-current-parse)
+	(inhibit-read-only t)
+	(w3-display-same-buffer t))
+    (if (not parse)
+	(error "Could not find the parse tree for this buffer.  EEEEK!"))
+    (erase-buffer)
+    (w3-draw-tree parse)
+    (w3-finish-drawing)
+    (w3-mode)
+    (set-buffer-modified-p nil)))
+
 (defun w3-prepare-buffer (&rest args)
   ;; The text/html viewer - does all the drawing and displaying of the buffer
   ;; that is necessary to go from raw HTML to a good presentation.
@@ -1841,17 +1975,8 @@
     (set-buffer-modified-p nil)
     (setq w3-current-source source
 	  w3-current-parse parse)
-    (if (and (boundp 'w3-image-widgets-waiting) w3-image-widgets-waiting)
-	(let (url glyph widget)
-	  (while w3-image-widgets-waiting
-	    (setq widget (car w3-image-widgets-waiting)
-		  w3-image-widgets-waiting (cdr w3-image-widgets-waiting)
-		  url (widget-get widget 'src)
-		  glyph (cdr-safe (assoc url w3-graphics-list)))
-	    (widget-value-set widget glyph))))
+    (w3-finish-drawing)
     (w3-mode)
-    ;;(w3-handle-annotations)
-    ;;(w3-handle-headers)
     (set-buffer-modified-p nil)
     (goto-char (point-min))
     (if url-keep-history
--- a/lisp/w3/w3-e19.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-e19.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-e19.el --- Emacs 19.xx specific functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/12/31 15:38:51
-;; Version: 1.12
+;; Created: 1997/01/19 20:04:48
+;; Version: 1.16
 ;; Keywords: faces, help, mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -110,11 +110,11 @@
 	 (widget (and good pt (number-or-marker-p pt) (widget-at pt)))
 	 (link (and widget (or (widget-get widget 'href)
 			       (widget-get widget 'name))))
-	 (form (and widget (widget-get widget 'w3-form-data)))
+	 (form (and widget (widget-get widget :w3-form-data)))
 	 (imag nil) ; (nth 1 (memq 'w3graphic props))))
 	 )
     (cond
-     (link (w3-widget-echo widget))
+     (link (message "%s" (w3-widget-echo widget)))
      (form
       (cond
        ((eq 'submit (w3-form-element-type form))
--- a/lisp/w3/w3-emulate.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-emulate.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-emulate.el --- All variable definitions for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.4
+;; Created: 1997/01/22 16:28:30
+;; Version: 1.6
 ;; Keywords: comm, help, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -207,8 +207,8 @@
 (define-key w3-lynx-emulation-minor-mode-map "\C-w" 'w3-refresh-buffer)
 (define-key w3-lynx-emulation-minor-mode-map "\\"   'w3-source-document)
 (define-key w3-lynx-emulation-minor-mode-map "!"    'shell)
-(define-key w3-lynx-emulation-minor-mode-map [up]   'w3-back-link)
-(define-key w3-lynx-emulation-minor-mode-map [down] 'w3-forward-link)
+(define-key w3-lynx-emulation-minor-mode-map [up]   'w3-widget-backward)
+(define-key w3-lynx-emulation-minor-mode-map [down] 'w3-widget-forward)
 (define-key w3-lynx-emulation-minor-mode-map [right] 'w3-follow-link)
 (define-key w3-lynx-emulation-minor-mode-map [left] 'w3-backward-in-history)
 
--- a/lisp/w3/w3-forms.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-forms.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-forms.el --- Emacs-w3 forms parsing code for new display engine
 ;; Author: wmperry
-;; Created: 1997/01/02 20:20:29
-;; Version: 1.32
+;; Created: 1997/01/21 19:45:55
+;; Version: 1.48
 ;; Keywords: faces, help, comm, data, languages
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -36,6 +36,12 @@
 (require 'w3-vars)
 (require 'mule-sysdp)
 
+(define-widget-keywords :emacspeak-help :w3-form-data)
+
+(defvar w3-form-keymap (copy-keymap global-map))
+(define-key w3-form-keymap "\t"          'w3-widget-forward)
+(define-key w3-form-keymap [(shift tab)] 'w3-widget-backward)
+
 ;; A form entry area is a vector
 ;; [ type name default-value value maxlength options widget]
 ;; Where:
@@ -79,16 +85,22 @@
 		     maxlength
 		     options
 		     action nil))
-	 (size (if size
-		   (+ 2 size)
-		 (case type
-		   ((checkbox radio) 3)
-		   ((reset submit)
-		    (+ 2 (length (or value (symbol-name type)))))
-		   (multiline 21)
-		   (hidden nil)
-		   (otherwise 22))))
-	 )
+	 (size (case type
+		 (checkbox 3)
+		 (radio 4)
+		 ((reset submit)
+		  (+ 2 (length (or value (symbol-name type)))))
+		 (multiline 21)
+		 (hidden nil)
+		 (file (+ 6 (or size 20)))
+		 ((float int) (or size 20))
+		 (otherwise (or size 22))))
+	 (node (assoc action w3-form-elements)))
+    (if (eq type 'hidden)
+	(if node
+	    (setcdr node (cons el (cdr node)))
+	  (setq w3-form-elements (cons (cons action (list el))
+				       w3-form-elements))))
     (if size
 	(set-text-properties (point)
 			     (progn (insert-char ?T size) (point))
@@ -103,7 +115,8 @@
     (while st
       (if (setq info (get-text-property st 'w3-form-info))
 	  (progn
-	    (setq nd (next-single-property-change st 'w3-form-info)
+	    (setq nd (or (next-single-property-change st 'w3-form-info)
+			 (point-max))
 		  action (w3-form-element-action info)
 		  node (assoc action w3-form-elements))
 	    (goto-char st)
@@ -118,6 +131,34 @@
 	    (setq st (next-single-property-change st 'w3-form-info)))
 	(setq st (next-single-property-change st 'w3-form-info))))))
 
+(defsubst w3-form-mark-widget (widget el)
+  (let ((widgets (list widget))
+	(children (widget-get widget :children))
+	(parent (widget-get widget :parent)))
+    (w3-form-element-set-widget el widget)
+    ;; Get _all_ the children associated with this widget
+    (while children
+      (setq widgets (cons (car children) widgets))
+      (if (widget-get (car children) :children)
+	  (setq children (append children
+				 (widget-get (car children) :children))))
+      (setq children (cdr children)))
+    (while (widget-get widget :parent)
+      (setq widget (widget-get widget :parent)
+	    widgets (cons widget widgets)))
+    (setq children (widget-get widget :buttons))
+    ;; Special case for radio buttons
+    (while children
+      (setq widgets (cons (car children) widgets))
+      (if (widget-get (car children) :children)
+	  (setq children (append children
+				 (widget-get (car children) :children))))
+      (setq children (cdr children)))
+    (while widgets
+      (setq widget (pop widgets))
+      (widget-put widget :emacspeak-help 'w3-form-summarize-field)
+      (widget-put widget :w3-form-data el))))
+
 (defun w3-form-add-element-internal (el)
   (let* ((widget nil)
 	 (buffer-read-only nil)
@@ -126,11 +167,11 @@
     (setq widget-creation-function (or (get (w3-form-element-type el)
 					    'w3-widget-creation-function)
 				       'w3-form-default-widget-creator)
-	  widget (funcall widget-creation-function el nil))
+	  widget (and (fboundp widget-creation-function)
+		      (funcall widget-creation-function el nil)))
     (if (not widget)
 	nil
-      (w3-form-element-set-widget el widget)
-      (widget-put widget 'w3-form-data el))))
+      (w3-form-mark-widget widget el))))
 
 ;; These properties tell the add-element function how to actually create
 ;; each type of widget.
@@ -145,14 +186,23 @@
 (put 'keygen    'w3-widget-creation-function 'w3-form-create-keygen-list)
 (put 'button    'w3-widget-creation-function 'w3-form-create-button)
 (put 'image	'w3-widget-creation-function 'w3-form-create-image)
+(put 'int       'w3-widget-creation-function 'w3-form-create-integer)
+(put 'float     'w3-widget-creation-function 'w3-form-create-float)
 
 (defun w3-form-create-checkbox (el face)
-  (widget-create 'checkbox :value-face face
+  (widget-create 'checkbox
+		 :value-face face
 		 (and (w3-form-element-default-value el) t)))
 
+(defun w3-form-radio-button-update (widget child event)
+  (widget-radio-action widget child event)
+  (w3-form-mark-widget widget (widget-get widget :w3-form-data)))
+
 (defun w3-form-create-radio-button (el face)
   (let* ((name (w3-form-element-name el))
-	 (formobj (cdr (assoc name w3-form-radio-elements)))
+	 (action (w3-form-element-action el))
+	 (uniqid (cons name action))
+	 (formobj (cdr (assoc uniqid w3-form-radio-elements)))
 	 (widget nil)
 	 )
     (if formobj
@@ -163,17 +213,24 @@
 				       :format "%t"
 				       :tag ""
 				       :value (w3-form-element-value el)))
+	  (w3-form-mark-widget widget el)
 	  (if (w3-form-element-default-value el)
-	      (widget-value-set widget (w3-form-element-value el)))
+	      (progn
+		(widget-put widget 'w3-form-default-value
+			    (w3-form-element-value el))
+		(widget-value-set widget (w3-form-element-value el))))
 	  nil)
-      (setq widget (widget-create 'radio-button-choice
-				  :value (w3-form-element-value el)
-				  (list 'item
-					:format "%t"
-					:tag ""
-					:value (w3-form-element-value el)))
-	    w3-form-radio-elements (cons (cons name el)
+      (setq widget (widget-create
+		    'radio-button-choice
+		    :value (w3-form-element-value el)
+		    :action 'w3-form-radio-button-update
+		    (list 'item
+			  :format "%t"
+			  :tag ""
+			  :value (w3-form-element-value el)))
+	    w3-form-radio-elements (cons (cons uniqid el)
 					 w3-form-radio-elements))
+      (widget-put widget 'w3-form-default-value (w3-form-element-value el))
       widget)))
 
 (defun w3-form-create-button (el face)
@@ -182,7 +239,10 @@
   (let ((val (w3-form-element-value el)))
     (if (or (not val) (string= val ""))
 	(setq val "Push Me"))
-    (widget-create 'push-button :notify 'ignore :button-face face val)))
+    (widget-create 'push-button
+		   :notify 'ignore
+		   :button-face face
+		   val)))
 
 (defun w3-form-create-image (el face)
   (let ((widget (widget-create 'push-button
@@ -201,7 +261,11 @@
 		   :button-face face val)))
 
 (defun w3-form-create-file-browser (el face)
-  (widget-create 'file :value-face face :value (w3-form-element-value el)))
+  (widget-create 'file
+		 :value-face face
+		 :size (w3-form-element-size el)
+		 :must-match t
+		 :value (w3-form-element-value el)))
 
 (defvar w3-form-valid-key-sizes
   '(
@@ -244,49 +308,184 @@
 			(function
 			 (lambda (x)
 			   (list 'choice-item :format "%[%t%]"
-				 :tag (car x) :value (car x))))
+				 :emacspeak-help 'w3-form-summarize-field
+				 :tag (mule-truncate-string (car x)
+							    (w3-form-element-size el) ? )
+				 :value (car x))))
 			(w3-form-element-options el)))))
     (widget-value-set widget (w3-form-element-value el))
     widget))
 
 ;(defun w3-form-create-multiline (el face)
-;  ;; FIX THIS! - need to padd out with newlines or something...
-;  (widget-create 'field :value-face face (w3-form-element-value el)))
+;  (widget-create 'text :value-face face (w3-form-element-value el)))
 
 (defun w3-form-create-multiline (el face)
-  (widget-create 'push-button :notify 'w3-do-text-entry "Multiline text area"))
+  (widget-create 'push-button
+		 :notify 'w3-do-text-entry
+		 "Multiline text area"))
+
+(defun w3-form-create-integer (el face)
+  (widget-create 'integer
+		 :size (w3-form-element-size el)
+		 :value-face face
+		 :tag ""
+		 :format "%v"
+		 :keymap w3-form-keymap
+		 :w3-form-data el
+		 (w3-form-element-value el)))
+
+(defun w3-form-create-float (el face)
+  (widget-create 'number
+		 :size (w3-form-element-size el)
+		 :value-face face
+		 :format "%v"
+		 :tag ""
+		 :keymap w3-form-keymap
+		 :w3-form-data el
+		 (w3-form-element-value el)))
 
 (defun w3-form-default-widget-creator (el face)
   (widget-create 'link
 		 :notify 'w3-form-default-button-callback
+		 :value-to-internal 'w3-form-default-button-update
 		 :size (w3-form-element-size el)
-		 :tag (mule-truncate-string (w3-form-element-value el)
-					    (w3-form-element-size el) ?_)
 		 :value-face face
+		 :w3-form-data el
 		 (w3-form-element-value el)))
 
+(defun w3-form-default-button-update (w v)
+  (let ((info (widget-get w :w3-form-data)))
+    (widget-put w :tag 
+		(if info
+		    (mule-truncate-string
+		     (if (eq 'password (w3-form-element-type info))
+			 (make-string (length v) ?*)
+		       v)
+		     (w3-form-element-size info) ?_)))
+    v))
+
 (defun w3-form-default-button-callback (widget &rest ignore)
-  (let* ((obj (widget-get widget 'w3-form-data))
+  (let* ((obj (widget-get widget :w3-form-data))
 	 (typ (w3-form-element-type obj))
 	 (def (widget-value widget))
 	 (val nil)
 	 )
     (case typ
       (password
-       (setq val (funcall url-passwd-entry-func "Password: " def))
-       (widget-put widget :tag (mule-truncate-string
-				(make-string (length val) ?*)
-				(w3-form-element-size obj) ?_)))
+       (setq val (funcall url-passwd-entry-func "Password: " def)))
       (otherwise
        (setq val (read-string
-		  (concat (capitalize (symbol-name typ)) ": ") def))
-       (widget-put widget :tag (mule-truncate-string
-				val (w3-form-element-size obj) ?_))))
+		  (concat (capitalize (symbol-name typ)) ": ") def))))
     (widget-value-set widget val))
   (apply 'w3-form-possibly-submit widget ignore))
+
+;; These properties tell the help-echo function how to summarize each
+;; type of widget.
+(put 'checkbox  'w3-summarize-function 'w3-form-summarize-checkbox)
+(put 'multiline 'w3-summarize-function 'w3-form-summarize-multiline)
+(put 'radio     'w3-summarize-function 'w3-form-summarize-radio-button)
+(put 'reset     'w3-summarize-function 'w3-form-summarize-submit-button)
+(put 'submit    'w3-summarize-function 'w3-form-summarize-submit-button)
+(put 'button    'w3-summarize-function 'w3-form-summarize-submit-button)
+(put 'file      'w3-summarize-function 'w3-form-summarize-file-browser)
+(put 'option    'w3-summarize-function 'w3-form-summarize-option-list)
+(put 'keygen    'w3-summarize-function 'w3-form-summarize-keygen-list)
+(put 'image	'w3-summarize-function 'w3-form-summarize-image)
+(put 'hidden    'w3-summariez-function 'ignore)
 
+(defun w3-form-summarize-field (widget &rest ignore)
+  "Sumarize a widget that should be a W3 form entry area.
+This can be used as the :help-echo property of all w3 form entry widgets."
+  (let ((info nil)
+	(func nil)
+	(msg nil)
+	)
+    (setq info (widget-get widget :w3-form-data))
+    (if info
+	nil
+      (while (widget-get widget :parent)
+	(setq widget (widget-get widget :parent)))
+      (setq info (widget-get widget :w3-form-data)))
+    (if (not info)
+	(signal 'wrong-type-argument (list 'w3-form-widget widget)))
+    (setq func (or (get (w3-form-element-type info) 'w3-summarize-function)
+		   'w3-form-summarize-default)
+	  msg (and (fboundp func) (funcall func info widget)))
+    ;; FIXME!  This should be removed once emacspeak is updated to
+    ;; more closely follow the widget-y way of just returning the string
+    ;; instead of having the underlying :help-echo or :emacspeak-help
+    ;; implementation do it.
+    (message "%s" msg)))
+
+(defsubst w3-form-field-label (data)
+  ;;; FIXXX!!! Need to reimplement using the new forms implementation!
+  (declare (special w3-form-labels))
+  nil)
+
+(defun w3-form-summarize-default (data widget)
+  (let ((label (w3-form-field-label data))
+	(name  (w3-form-element-name data))
+	(value (widget-value (w3-form-element-widget data))))
+    (format "Text field %s set to: %s" (or label (concat "called " name))
+	    value)))
+
+(defun w3-form-summarize-multiline (data widget)
+  (let ((name (w3-form-element-name data))
+        (label (w3-form-field-label data))
+        (value (w3-form-element-value data)))
+    (format "Multiline text input %s set to: %s"
+	    (or label (concat "called " name))
+	    value)))
+
+(defun w3-form-summarize-checkbox (data widget)
+  (let ((name (w3-form-element-name data))
+	(label (w3-form-field-label data))
+	(checked (widget-value (w3-form-element-widget data))))
+    (format "Checkbox %s is %s" (or label name) (if checked "on" "off"))))
+
+(defun w3-form-summarize-option-list (data widget)
+  (let ((name (w3-form-element-name data))
+	(label (w3-form-field-label data))
+	(default (w3-form-element-default-value data)))
+    (format "Option list (%s) set to: %s" (or label name)
+	    (widget-value (w3-form-element-widget data)))))
+
+(defun w3-form-summarize-image (data widget)
+  (let ((name (w3-form-element-name data))
+	(label (w3-form-field-label data)))
+    (concat "Image entry " (or label (concat "called " name)))))
+
+(defun w3-form-summarize-submit-button (data widget)
+  (let*  ((type (w3-form-element-type data))
+	  (label (w3-form-field-label data))
+	  (button-text (widget-value (w3-form-element-widget data)))
+	  (type-desc (case type
+		       (submit "Submit Form")
+		       (reset "Reset Form")
+		       (button "A Button"))))
+    (format "%s: %s" type-desc (or label button-text ""))))
+
+(defun w3-form-summarize-radio-button (data widget)
+  (let ((name (w3-form-element-name data))
+	(label (w3-form-field-label data))
+	(cur-value (widget-value (w3-form-element-widget data)))
+	(this-value (widget-value widget)))
+    (format "Radio button %s is %s, could be %s" (or label name) cur-value
+	    this-value)))
+
+(defun w3-form-summarize-file-browser (data widget)
+  (let ((name (w3-form-element-name data))
+	(label (w3-form-field-label data))
+	(file (widget-value (w3-form-element-widget data))))
+    (format "File entry %s pointing to: %s" (or label name) (or file
+								"[nothing]"))))
+
+(defun w3-form-summarize-keygen-list (data widget)
+  )
+
+
 (defun w3-form-possibly-submit (widget &rest ignore)
-  (let* ((formobj (widget-get widget 'w3-form-data))
+  (let* ((formobj (widget-get widget :w3-form-data))
 	 (ident (w3-form-element-action formobj))
 	 (widgets (w3-all-widgets ident))
 	 (text-fields 0)
@@ -313,7 +512,7 @@
 	(w3-submit-form ident))))
 
 (defun w3-form-submit/reset-callback (widget &rest ignore)
-  (let* ((formobj (widget-get widget 'w3-form-data))
+  (let* ((formobj (widget-get widget :w3-form-data))
 	 (w3-submit-button formobj))
     (case (w3-form-element-type formobj)
       (submit (w3-submit-form (w3-form-element-action formobj)))
@@ -326,7 +525,7 @@
 
 (defun w3-do-text-entry (widget &rest ignore)
   (let* ((data (list widget (current-buffer)))
-	 (formobj (widget-get widget 'w3-form-data))
+	 (formobj (widget-get widget :w3-form-data))
 	 (buff (get-buffer-create (format "Form Entry: %s"
 					  (w3-form-element-name formobj)))))
     (switch-to-buffer-other-window buff)
@@ -342,7 +541,7 @@
   (interactive)
   (if w3-current-last-buffer
       (let* ((widget (nth 0 w3-current-last-buffer))
-	     (formobj (widget-get widget 'w3-form-data))
+	     (formobj (widget-get widget :w3-form-data))
 	     (buff (nth 1 w3-current-last-buffer))
 	     (valu (buffer-string))
 	     (inhibit-read-only t)
@@ -375,12 +574,16 @@
 	(case type
 	  ((submit reset image) nil)
 	  (radio
-	   ;; Ack - how!?
-	   )
+	   (setq deft (widget-get widget 'w3-form-default-value))
+	   (if (and widget deft)
+	       (widget-value-set widget deft)))
 	  (checkbox
 	   (if deft
 	       (widget-value-set widget t)
 	     (widget-value-set widget nil)))
+	  (multiline
+	   (w3-form-element-set-value formobj (w3-form-element-default-value
+					       formobj)))
 	  (file
 	   (widget-value-set widget deft))
 	  (otherwise
@@ -418,8 +621,11 @@
 		   (radio
 		    (let* ((radio-name (w3-form-element-name formobj))
 			   (radio-object (cdr-safe
-					  (assoc radio-name
-						 w3-form-radio-elements)))
+					  (assoc
+					   (cons
+					    radio-name
+					    (w3-form-element-action formobj))
+					   w3-form-radio-elements)))
 			   (chosen-widget (and radio-object
 					       (widget-radio-chosen
 						(w3-form-element-widget
@@ -427,6 +633,11 @@
 		      (if (assoc radio-name result)
 			  nil
 			(cons radio-name (widget-value chosen-widget)))))
+		   ((int float)
+		    (cons (w3-form-element-name formobj)
+			  (number-to-string (or (condition-case ()
+						    (widget-value widget)
+						  (error nil)) 0))))
 		   (checkbox
 		    (if (widget-value widget)
 			(cons (w3-form-element-name formobj)
--- a/lisp/w3/w3-hot.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-hot.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-hot.el --- Main functions for emacs-w3 on all platforms/versions
 ;; Author: wmperry
-;; Created: 1996/12/31 15:39:34
-;; Version: 1.10
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.11
 ;; Keywords: faces, help, comm, news, mail, processes, mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-imap.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-imap.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-imap.el --- Imagemap functions
 ;; Author: wmperry
-;; Created: 1996/12/29 01:49:45
-;; Version: 1.6
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.7
 ;; Keywords: hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-keyword.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-keyword.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-keyword.el --- Emacs-W3 binding style sheet mechanism
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.8
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.9
 ;; Keywords: hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-latex.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-latex.el	Mon Aug 13 09:07:36 2007 +0200
@@ -5,7 +5,7 @@
 ;; Keywords: hypermedia, printing, typesetting
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1996 by Stephen Peters <speters@cygnus.com>
+;;; Copyright (c) 1996, 1997 by Stephen Peters <speters@cygnus.com>
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
--- a/lisp/w3/w3-menu.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-menu.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-menu.el --- Menu functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/12/31 15:37:49
-;; Version: 1.19
+;; Created: 1997/01/21 20:54:49
+;; Version: 1.25
 ;; Keywords: menu, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -141,8 +141,22 @@
   (interactive)
   (cond
    (w3-running-xemacs
-    (set-frame-property (selected-frame) 'minibuffer
-                      (not (frame-property (selected-frame) 'minibuffer))))
+    (if (equal (frame-property (selected-frame) 'minibuffer) t)
+ 
+	;; frame has a minibuffer, so remove it
+	;; unfortunately, we must delete and redraw the frame
+	(let ((fp (frame-properties (selected-frame)))
+	      (frame (selected-frame))
+	      (buf (current-buffer)))
+	  (select-frame
+	   (make-frame (plist-put
+			(plist-remprop
+			 (plist-remprop fp 'window-id) 'minibuffer)
+			'minibuffer nil)))
+	  (delete-frame frame)
+	  (switch-to-buffer buf))
+      ;; no minibuffer so add one
+      (set-frame-property (selected-frame) 'minibuffer t)))
    (t nil)))
 
 (defun w3-toggle-location ()
@@ -308,8 +322,9 @@
 	  nil)
 	(if w3-running-xemacs
 	    ["Show Status Bar" w3-toggle-minibuffer
-	     :style toggle :selected nil]
-	  nil)
+	     :style toggle
+	     :selected (eq (frame-property (selected-frame) 'minibuffer) t)
+	     ])
 	["Incremental Display"
 	 (setq w3-do-incremental-display (not w3-do-incremental-display))
 	 :style toggle :selected w3-do-incremental-display]
@@ -337,10 +352,6 @@
    ["Allow Document Stylesheets" (setq w3-honor-stylesheets
 				       (not w3-honor-stylesheets))
     :style toggle :selected w3-honor-stylesheets]
-   ["IE 3.0 Compatible Parsing" (setq css-ie-compatibility
-				      (not css-ie-compatibility))
-    :style toggle :selected (and w3-honor-stylesheets
-				 css-ie-compatibility)]
    ["Honor Color Requests" (setq w3-user-colors-take-precedence
 				 (not w3-user-colors-take-precedence))
     :style toggle :selected (not w3-user-colors-take-precedence)]
@@ -376,14 +387,13 @@
   (list
    "Help"
    ["About Emacs-w3" (w3-fetch "about:") t]
-   ["Manual" (w3-fetch (concat w3-documentation-root "w3_toc.html")) t]
+   ["Manual" (w3-fetch (concat w3-documentation-root "docs/w3_toc.html")) t]
    "---"
    ["Version Information..."
     (w3-fetch
-     (concat w3-documentation-root "help_on_" w3-version-number ".html"))
+     (concat w3-documentation-root "help/version_" w3-version-number ".html"))
     t]
-   ["On Window" (w3-fetch (concat w3-documentation-root "help/window.html")) t]
-   ["On FAQ" (w3-fetch (concat w3-documentation-root"help/FAQ.html")) t]
+   ["On FAQ" (w3-fetch (concat w3-documentation-root "help/FAQ.html")) t]
    "---"
    ["Mail Developer(s)" w3-submit-bug t]
    )
@@ -638,7 +648,6 @@
 		  w3-preferences-ok-hook
 		  w3-preferences-setup-hook
 		  w3-source-file-hook
-		  css-ie-compatibility
 		  w3-toolbar-orientation
 		  w3-toolbar-type
 		  w3-use-menus
--- a/lisp/w3/w3-mouse.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-mouse.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-xemac.el --- XEmacs specific functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.4
+;; Created: 1997/01/18 00:42:22
+;; Version: 1.6
 ;; Keywords: mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -55,21 +55,24 @@
 
 (defvar w3-mouse-button1 (cond
 			  ((and w3-running-xemacs (featurep 'mouse)) 'button1)
-			  (w3-running-xemacs 'return)
+			  (w3-running-xemacs nil)
 			  (t 'mouse-1)))
 (defvar w3-mouse-button2 (cond
 			  ((and w3-running-xemacs (featurep 'mouse)) 'button2)
-			  (w3-running-xemacs 'return)
+			  (w3-running-xemacs nil)
 			  (t 'mouse-2)))
 (defvar w3-mouse-button3 (cond
 			  ((and w3-running-xemacs (featurep 'mouse)) 'button3)
-			  (w3-running-xemacs (list 'meta ?`)) 
+			  (w3-running-xemacs nil) 
 			  (t 'mouse-3)))
 
-(define-key w3-mode-map (vector w3-mouse-button2) 'w3-widget-button-click)
-(define-key w3-mode-map (vector w3-mouse-button3) 'w3-popup-menu)
-(define-key w3-mode-map (vector (list 'shift w3-mouse-button2))
-  'w3-follow-mouse-other-frame)
+(if w3-mouse-button2
+    (define-key w3-mode-map (vector w3-mouse-button2) 'w3-widget-button-click))
+(if w3-mouse-button3
+    (define-key w3-mode-map (vector w3-mouse-button3) 'w3-popup-menu))
+(if w3-mouse-button2
+    (define-key w3-mode-map (vector (list 'shift w3-mouse-button2))
+      'w3-follow-mouse-other-frame))
 
 (define-key w3-netscape-emulation-minor-mode-map (vector w3-mouse-button1)
   'w3-widget-button-click)
--- a/lisp/w3/w3-parse.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-parse.el	Mon Aug 13 09:07:36 2007 +0200
@@ -3,7 +3,7 @@
 ;; Filename: w3-parse.el
 ;; Purpose: Parse HTML and/or SGML for Emacs W3 browser.
 
-;; Copyright © 1995, 1996  Joseph Brian Wells
+;; Copyright © 1995, 1996, 1997  Joseph Brian Wells
 ;; Copyright © 1993, 1994, 1995 by William M. Perry (wmperry@cs.indiana.edu)
 ;; 
 ;; This program is free software; you can redistribute it and/or modify
@@ -1113,6 +1113,7 @@
 
        ;; client-side imagemaps
        (%imagemaps . (area map))
+       (%input.fields . (input select textarea keygen label))
        ;; special action is taken for %text inside %body.content in the
        ;; content model of each element.
        (%body.content . (%heading %block style hr div address %imagemaps))
@@ -1124,7 +1125,7 @@
 
        (%block . (p %list dl form %preformatted 
                     %blockquote isindex fn table fig note
-                    center %block-deprecated %block-obsoleted))
+                    multicol center %block-deprecated %block-obsoleted))
        (%list . (ul ol))
        (%preformatted . (pre))
        (%blockquote . (bq))
@@ -1134,7 +1135,7 @@
        ;; Why is IMG in this list?
        (%pre.exclusion . (*include img *discard tab math big small sub sup))
        
-       (%text . (*data b %notmath sub sup %emacsw3-crud))
+       (%text . (*data b %notmath sub sup %emacsw3-crud %input.fields))
        (%notmath . (%special %font %phrase %misc))
        (%font . (i u s strike tt big small sub sup font
                    roach secret wired)) ;; B left out for MATH
@@ -1251,7 +1252,7 @@
                             ((credit plaintext) *close))
                            nil)])
         (end-tag-omissible . t))
-       ((div banner center)
+       ((div banner center multicol)
         (content-model . [((%body.content)
                            nil
                            ;; Push <P> before data characters.  Non-SGML.
--- a/lisp/w3/w3-prefs.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-prefs.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-prefs.el --- Preferences panels for Emacs-W3
 ;; Author: wmperry
-;; Created: 1996/12/29 01:49:57
-;; Version: 1.12
+;; Created: 1997/01/17 04:34:13
+;; Version: 1.15
 ;; Keywords: hypermedia, preferences
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -274,8 +274,6 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defvar w3-preferences-compatibility-variables
   '(
-    (css-ie-compatibility
-     . "Internet Explorer (tm) 3.0 compatible stylesheet parsing")
     (w3-netscape-compatible-comments
      . "Allow Netscape compatible comments")
     (w3-user-colors-take-precedence
@@ -483,6 +481,7 @@
 	    todo (cdr todo))
       (and (fboundp func) (funcall func)))))
 
+;;###autoload
 (defun w3-preferences-edit ()
   (interactive)
   (if (not w3-preferences-map)
--- a/lisp/w3/w3-print.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-print.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-print.el --- Printing support for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/10/09 19:00:59
-;; Version: 1.5
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.6
 ;; Keywords: faces, help, printing, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-speak.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-speak.el	Mon Aug 13 09:07:36 2007 +0200
@@ -8,7 +8,8 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1996 by T.V. Raman (raman@adobe.com)
-;;; Copyright (c) 1996 by William M. Perry (wmperry@spry.com)
+;;; Copyright (c) 1996, 1997 by William M. Perry (wmperry@spry.com)
+;;; Copyright (c) 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is not part of GNU Emacs, but the same permissions apply.
 ;;;
@@ -56,157 +57,32 @@
   (error (message "Emacspeak not found - speech will not work.")))
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; How to get information summarizing a form field, so it can be spoken in
-;;; a sane manner.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;{{{  putting and getting form field summarizer
-
-(defsubst w3-speak-define-field-summarizer (type &optional function-name)
-  "Associate the name of a function that describes this type of form field."
-  (put type 'w3-speak-summarizer
-       (or function-name (intern
-			  (format "w3-speak-summarize-%s-field" type)))))
-
-(defsubst w3-speak-get-field-summarizer  (type)
-  "Retrieve function-name string for this voice"
-  (get type 'w3-speak-summarizer))
-
-;;}}}
-;;{{{  Associate summarizer functions for form fields 
-
-(w3-speak-define-field-summarizer 'text)
-(w3-speak-define-field-summarizer 'option)
-(w3-speak-define-field-summarizer 'checkbox)
-(w3-speak-define-field-summarizer 'reset)
-(w3-speak-define-field-summarizer 'submit)
-(w3-speak-define-field-summarizer 'button)
-(w3-speak-define-field-summarizer 'radio)
-(w3-speak-define-field-summarizer 'multiline)
-(w3-speak-define-field-summarizer 'image)
-
-;;}}}
-
-
-;;{{{  define the form field summarizer functions
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Now actually define the summarizers
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defsubst w3-speak-extract-form-field-label (data)
-  ;;; FIXXX!!! Need to reimplement using the new forms implementation!
-  (declare (special w3-form-labels))
-  nil)
-
-(defun w3-speak-summarize-text-field (data)
-  "Summarize a text field given the field data."
-  (let (
-	(label (w3-speak-extract-form-field-label data))
-	(name  (w3-form-element-name data))
-	(value (widget-get (w3-form-element-widget data) :value)))
-    (dtk-speak
-     (format "Text  field  %s  %s " (or label (concat "called " name))
-	     (concat "set to " value)))))
-
-(defun w3-speak-summarize-multiline-field (data)
-  "Summarize a text field given the field data."
-  (let (
-        (name (w3-form-element-name data))
-        (label (w3-speak-extract-form-field-label data))
-        (value (w3-form-element-value data)))
-    (dtk-speak
-     (format "Multiline text input  %s  %s" (or label (concat "called " name))
-	     (concat "set to " value)))))
-
-(defun w3-speak-summarize-checkbox-field (data)
-  "Summarize a checkbox  field given the field data."
-  (let (
-	(name (w3-form-element-name data))
-	(label (w3-speak-extract-form-field-label data))
-	(checked (widget-value (w3-form-element-widget data))))
-    (dtk-speak
-     (format "Checkbox %s is %s" (or label name) (if checked "on" "off")))))
-
-(defun w3-speak-summarize-option-field (data)
-  "Summarize a options   field given the field data."
-  (let (
-	(name (w3-form-element-name data))
-	(label (w3-speak-extract-form-field-label data))
-	(default (w3-form-element-default-value data)))
-    (dtk-speak
-     (format "Choose an option %s  %s" (or label name)
-	     (if (string=  "" default)
-                 ""
-               (format "default is %s" default))))))
-
-;;; to handle brain dead nynex forms
-(defun w3-speak-summarize-image-field (data)
-  "Summarize a image   field given the field data.
-Currently, only the NYNEX server uses this."
-  (let (
-	(name (w3-form-element-name data))
-	(label (w3-speak-extract-form-field-label data)))
-    (dtk-speak
-     (substring name 1))))
-
-(defun w3-speak-summarize-submit-field (data)
-  "Summarize a submit field given the field data."
-  (let  (
-	 (type (w3-form-element-type data))
-	 (label (w3-speak-extract-form-field-label data))
-	 (button-text (widget-value (w3-form-element-widget data))))
-    (message "%s" (or label button-text
-		      (case type
-			(submit "Submit Form")
-			(reset "Reset Form")
-			(button "A Button"))))))
-
-(defalias 'w3-speak-summarize-reset-field 'w3-speak-summarize-submit-field)
-(defalias 'w3-speak-summarize-button-field 'w3-speak-summarize-submit-field)
-
-(defun w3-speak-summarize-radio-field (data)
-  "Summarize a radio   field given the field data."
-  (let (
-	(name (w3-form-element-name data))
-	(label (w3-speak-extract-form-field-label data))
-	(checked (widget-value (w3-form-element-widget data))))
-    (dtk-speak
-     (format "Radio button   %s is %s" (or label name) (if checked
-							"pressed"
-						      "not pressed")))))
-
-;;}}}
-
 ;;{{{  speaking form fields 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Now for the guts
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defun w3-speak-extract-form-field-information ()
-  (let* ((widget (widget-at (point)))
-	 (data (and widget (widget-get widget 'w3-form-data))))
-    data))
-
 (defun w3-speak-summarize-form-field ()
   "Summarizes field under point if any."
-  (let* ((data (w3-speak-extract-form-field-information))
-         (type (and data (w3-form-element-type data)))
-         (summarizer (and type (w3-speak-get-field-summarizer type))))
-    (cond
-     ((and data
-           summarizer
-           (fboundp summarizer))
-      (funcall summarizer data))
-     (data
-      (message "Please define a summarizer function for %s"  type))
-     (t nil))))
+  (let ((widget (widget-at (point))))
+    (and widget (w3-form-summarize-field widget))))
 
 ;;}}}
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Movement notification
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defadvice w3-widget-forward (after emacspeak pre act comp)
+  (when (interactive-p)
+    (emacspeak-auditory-icon 'large-movement)
+    (emacspeak-widget-summarize (emacspeak-widget-at  (point )))))
+
+
+(defadvice w3-widget-backward (after emacspeak pre act comp)
+  (when (interactive-p)
+    (emacspeak-auditory-icon 'large-movement)
+    (emacspeak-widget-summarize (emacspeak-widget-at  (point )))))
+
 (defadvice w3-scroll-up (after emacspeak pre act comp)
   "Provide auditory feedback"
   (when (interactive-p)
--- a/lisp/w3/w3-style.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-style.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-style.el --- Emacs-W3 binding style sheet mechanism
 ;; Author: wmperry
-;; Created: 1996/12/13 18:01:46
-;; Version: 1.23
+;; Created: 1997/01/17 14:27:39
+;; Version: 1.25
 ;; Keywords: faces, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -39,33 +39,29 @@
 
 
 
-(defun w3-handle-style (&optional args)
-  (let ((fname (or (cdr-safe (assq 'href args))
-		   (cdr-safe (assq 'src args))
-		   (cdr-safe (assq 'uri args))))
-	(type (downcase (or (cdr-safe (assq 'notation args))
-			    "experimental")))
+(defun w3-handle-style (&optional plist)
+  (let ((url (or (plist-get plist 'href)
+		 (plist-get plist 'src)
+		 (plist-get plist 'uri)))
+	(media (intern (downcase (or (plist-get plist 'media) "all"))))
+	(type (downcase (or (plist-get plist 'notation) "text/css")))
 	(url-working-buffer " *style*")
-	(base (cdr-safe (assq 'base args)))
 	(stylesheet nil)
 	(defines nil)
 	(cur-sheet w3-current-stylesheet)
-	(string (cdr-safe (assq 'data args))))
-    (if fname (setq fname (url-expand-file-name fname
-						(cdr-safe
-						 (assoc base w3-base-alist)))))
-    (save-excursion
-      (set-buffer (get-buffer-create url-working-buffer))
-      (erase-buffer)
-      (setq url-be-asynchronous nil)
-      (cond
-       ((member type '("experimental" "arena" "w3c-style" "css" "text/css"))
-	(setq stylesheet (css-parse fname string cur-sheet)))
-       (t
-	(w3-warn 'html "Unknown stylesheet notation: %s" type))))
-    (setq w3-current-stylesheet stylesheet)
-    )
-  )
+	(string (plist-get plist 'data)))
+    (if (not (memq media (css-active-device-types)))
+	nil				; Not applicable to us!
+      (save-excursion
+	(set-buffer (get-buffer-create url-working-buffer))
+	(erase-buffer)
+	(setq url-be-asynchronous nil)
+	(cond
+	 ((member type '("experimental" "arena" "w3c-style" "css" "text/css"))
+	  (setq stylesheet (css-parse url string cur-sheet)))
+	 (t
+	  (w3-warn 'html "Unknown stylesheet notation: %s" type))))
+      (setq w3-current-stylesheet stylesheet))))
 
 (defun w3-display-stylesheet (&optional sheet)
   (interactive)
--- a/lisp/w3/w3-sysdp.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-sysdp.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,8 +1,8 @@
 ;;; sysdep.el --- consolidate Emacs-version dependencies in one file.
 
-;; Copyright (C) 1995 Ben Wing.
+;; Copyright (c) 1995 - 1997 Ben Wing.
 
-;; Author: Ben Wing <wing@666.com>, William Perry <wmperry@aventail.com>
+;; Author: Ben Wing <wing@666.com>, William Perry <wmperry@cs.indiana.edu>
 ;; Keywords: lisp, tools
 ;; Version: 0.003
 
--- a/lisp/w3/w3-toolbar.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-toolbar.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-toolbar.el --- Toolbar functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/12/30 16:04:40
-;; Version: 1.6
+;; Created: 1997/01/10 00:13:05
+;; Version: 1.7
 ;; Keywords: mouse, toolbar
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
--- a/lisp/w3/w3-vars.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-vars.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-vars.el,v --- All variable definitions for emacs-w3
 ;; Author: wmperry
-;; Created: 1997/01/03 16:47:06
-;; Version: 1.64
+;; Created: 1997/01/23 00:27:58
+;; Version: 1.74
 ;; Keywords: comm, help, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -30,7 +30,7 @@
 ;;; Variable definitions for w3
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defconst w3-version-number
-  (let ((x "p3.0.43"))
+  (let ((x "p3.0.50"))
     (if (string-match "State:[ \t\n]+.\\([^ \t\n]+\\)" x)
 	(setq x (substring x (match-beginning 1) (match-end 1)))
       (setq x (substring x 1)))
@@ -38,7 +38,7 @@
      (function (lambda (x) (if (= x ?-) "." (char-to-string x)))) x ""))
   "Version # of w3-mode.")
 
-(defconst w3-version-date (let ((x "1997/01/03 16:47:06"))
+(defconst w3-version-date (let ((x "1997/01/23 00:27:58"))
 			    (if (string-match "Date: \\([^ \t\n]+\\)" x)
 				(substring x (match-beginning 1) (match-end 1))
 			      x))
@@ -119,21 +119,26 @@
 (defvar w3-dump-to-disk nil
   "*If non-nil, all W3 pages loaded will be dumped to disk.")
 
-(defvar w3-echo-link 'url
-  "Whether to display the URL of a link when tabbing through links.
-Possible values are:
+(defvar w3-echo-link '(title url text name)
+  "*Whether to display the URL of a link when tabbing through links.
+Value is a list of one or more of the following symbols:
 
-  url    == show the url of the target in the minibuffer
-  text   == show the text of the link in the minibuffer
-  title  == show the title attribute of the link in the minibuffer,
-            or the url if there is no title
-  nil    == show nothing")
+  url    == url of the target
+  text   == text of the link
+  title  == title attribute of the link
+  name   == name or id attribute of the link
+
+If none of the information is available, nothing will be shown for the link
+in menus, etc.")
   
 (defvar w3-horizontal-rule-char ?-
   "*The character to use to create a horizontal rule.
 Must be the character's code, not a string.  This character is
 replicated across the screen to create a division.")
 
+(defvar w3-fetch-with-default t
+  "*Whether `w3-fetch' should determine a good starting URL as a default.")
+
 (defvar w3-hotlist-file nil
   "*Hotlist filename.
 This should be the name of a file that is stored in either
@@ -1036,6 +1041,7 @@
 (define-key w3-mode-map "\M-s"	   'w3-search)
 (define-key w3-mode-map "\M-\r"    'w3-follow-inlined-image)
 (define-key w3-mode-map "\r"       'w3-widget-button-press)
+(define-key w3-mode-map "\n"       'w3-widget-button-press)
 (define-key w3-mode-map "b"	   'w3-widget-backward)
 (define-key w3-mode-map "c"        'w3-mail-document-author)
 (define-key w3-mode-map "f"	   'w3-widget-forward)
--- a/lisp/w3/w3-widget.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-widget.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-widget.el --- An image widget
 ;; Author: wmperry
-;; Created: 1996/12/29 01:27:32
-;; Version: 1.12
+;; Created: 1997/01/17 22:09:43
+;; Version: 1.16
 ;; Keywords: faces, images
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -302,6 +302,13 @@
      (t					; Huh?
       "A very confused image widget."))))
 
+(defvar widget-image-auto-retrieve 'ask
+  "*Whether to automatically retrieve the source of an image widget
+if it is not an active hyperlink or imagemap.
+If `nil', don't do anything.
+If `t', automatically retrieve the source.
+Any other value means ask the user each time.")
+
 (defun widget-image-notify (widget widget-changed &optional event)
   ;; Happens when anything changes
   (let* ((glyph (and event (widget-mouse-event-p event) (event-glyph event)))
@@ -310,22 +317,40 @@
 	 (ismap  (widget-get widget 'ismap))
 	 (usemap (widget-image-usemap widget))
 	 (href   (widget-get widget 'href))
+	 (img-src (or (widget-get widget 'src)
+		      (and widget-changed (widget-get widget-changed 'src))))
 	 (value  (widget-value widget))
 	 )
     (cond
      ((and glyph usemap)		; Do the client-side imagemap stuff
       (setq href (w3-point-in-map (vector x y) usemap nil))
-      (if href
+      (if (stringp href)
 	  (w3-fetch href)
 	(message "No destination found for %d,%d" x y)))
      ((and glyph x y ismap)		; Do the server-side imagemap stuff
       (w3-fetch (format "%s?%d,%d" href x y)))
      (usemap				; Dummed-down tty client side imap
-      (w3-fetch value))
+      (let ((choices (mapcar (function
+			      (lambda (entry)
+				(cons
+				 (or (aref entry 3) (aref entry 2))
+				 (aref entry 3)))) usemap))
+	    (choice nil))
+	(setq choice (completing-read "Imagemap: " choices nil t))
+	(and (stringp choice) (w3-fetch choice))))
      (ismap				; Do server-side dummy imagemap for tty
       (w3-fetch (concat href "?0,0")))
      ((stringp href)			; Normal hyperlink
       (w3-fetch href))
+     ((stringp img-src)
+      (cond
+       ((null widget-image-auto-retrieve) nil)
+       ((eq t widget-image-auto-retrieve)
+	(w3-fetch img-src))
+       ((funcall url-confirmation-func
+		 (format "Retrieve image (%s)?"
+			 (url-truncate-url-for-viewing img-src)))
+	(w3-fetch img-src))))
      (t					; Huh?
       nil))))
 
--- a/lisp/w3/w3-xemac.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3-xemac.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3-xemac.el --- XEmacs specific functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1996/11/27 15:11:46
-;; Version: 1.7
+;; Created: 1997/01/19 20:06:02
+;; Version: 1.12
 ;; Keywords: faces, help, mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -30,6 +30,7 @@
 (require 'images)
 (require 'w3-widget)
 (require 'w3-menu)
+(require 'w3-forms)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Enhancements For XEmacs
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -41,11 +42,11 @@
 	 (widget (and good pt (number-or-marker-p pt) (widget-at pt)))
 	 (link (and widget (or (widget-get widget 'href)
 			       (widget-get widget 'name))))
-	 (form (and widget (widget-get widget 'w3-form-data)))
+	 (form (and widget (widget-get widget :w3-form-data)))
 	 (imag nil)
 	 )
     (cond
-     (link (w3-widget-echo widget))
+     (link (message "%s" (w3-widget-echo widget)))
      (form
       (cond
        ((eq 'submit (w3-form-element-type form))
@@ -131,12 +132,13 @@
 
 (defun w3-mode-version-specifics ()
   "XEmacs specific stuff for w3-mode"
-  (cond
-   ((not w3-track-mouse)
-    (setq inhibit-help-echo nil))
-   (inhibit-help-echo
-    (setq mode-motion-hook 'w3-mouse-handler))
-   (t nil))
+  (if (featurep 'mouse)
+      (cond
+       ((not w3-track-mouse)
+	(setq inhibit-help-echo nil))
+       (inhibit-help-echo
+	(setq mode-motion-hook 'w3-mouse-handler))
+       (t nil)))
   (if (eq (device-type) 'tty)
       nil
     (w3-add-toolbar-to-buffer))
--- a/lisp/w3/w3.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/w3.el	Mon Aug 13 09:07:36 2007 +0200
@@ -1,12 +1,12 @@
 ;;; w3.el --- Main functions for emacs-w3 on all platforms/versions
 ;; Author: wmperry
-;; Created: 1996/12/30 20:37:55
-;; Version: 1.48
+;; Created: 1997/01/22 15:30:44
+;; Version: 1.60
 ;; Keywords: faces, help, comm, news, mail, processes, mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
-;;; Copyright (c) 1996 Free Software Foundation, Inc.
+;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
 ;;;
 ;;; This file is part of GNU Emacs.
 ;;;
@@ -426,6 +426,28 @@
   (split-window)
   (w3-fetch url))
 
+;; Ripped off from red gnus
+(defun w3-find-etc-directory (package &optional file)
+  "Go through the path and find the \".../etc/PACKAGE\" directory.
+If FILE, find the \".../etc/PACKAGE\" file instead."
+  (let ((path load-path)
+	dir result)
+    ;; We try to find the dir by looking at the load path,
+    ;; stripping away the last component and adding "etc/".
+    (while path
+      (if (and (car path)
+	       (file-exists-p
+		(setq dir (concat
+			   (file-name-directory
+			    (directory-file-name (car path)))
+			   "etc/" package 
+			   (if file "" "/"))))
+	       (or file (file-directory-p dir)))
+	  (setq result dir
+		path nil)
+	(setq path (cdr path))))
+    result))
+
 (defun w3-url-completion-function (string predicate function)
   (if (not w3-setup-done) (w3-do-setup))
   (cond
@@ -457,14 +479,15 @@
   (url-do-setup)
   (let* ((completion-ignore-case t)
 	 (default
-	   (if (eq major-mode 'w3-mode)
-	       (if (and current-prefix-arg (w3-view-this-url t))
-		   (w3-view-this-url t)
-		 (url-view-url t))
-	     (url-get-url-at-point)))
+	   (cond
+	    ((null w3-fetch-with-default) nil)
+	    ((eq major-mode 'w3-mode)
+	     (or (and current-prefix-arg (w3-view-this-url t))
+		 (url-view-url t)))
+	    ((url-get-url-at-point)
+	     (url-get-url-at-point))
+	    (t "http://www.")))
 	 (url nil))
-    (if (not default)
-	(setq default "http://www."))
     (setq url
 	  (completing-read "URL: "  'w3-url-completion-function
 			   nil nil default))
@@ -479,13 +502,8 @@
 ;;;###autoload
 (defun w3-fetch (&optional url)
   "Retrieve a document over the World Wide Web.
-The World Wide Web is a global hypertext system started by CERN in
-Switzerland in 1991.
-
-The document should be specified by its fully specified
-Uniform Resource Locator.  The document will be parsed, printed, or
-passed to an external viewer as appropriate.  Variable
-`mm-mime-info' specifies viewers for particular file types."
+Defaults to URL of the current document, if any.
+With prefix argument, use the URL of the hyperlink under point instead."
   (interactive (list (w3-read-url-with-default)))
   (if (not w3-setup-done) (w3-do-setup))
   (if (boundp 'w3-working-buffer)
@@ -962,13 +980,10 @@
   (interactive "P")
   (let* ((url (if under (w3-view-this-url) (url-view-url t)))
 	 (fil (if under nil url-current-file))
-	 (tag '$html-source)		; For the stylesheet info
-	 (args nil)			; For the stylesheet info
-	 (face nil)			; For the stylesheet info
 	 (src
 	  (cond
-	   ((or (null url) (string= url "file:nil"))
-	    (error "Not a w3 buffer!"))
+	   ((null url)
+	    (error "No URL found!"))
 	   ((and under (null url)) (error "No link at point!"))
 	   ((and (not under) (equal url-current-mime-type "text/plain"))
 	    (buffer-string))
@@ -995,12 +1010,14 @@
       (insert src)
       (put-text-property (point-min) (point-max) 'w3-base url)
       (goto-char (point-min))
-      (setq buffer-file-truename nil
-	    buffer-file-name nil)
+      (setq buffer-file-truename url
+	    buffer-file-name url)
       ;; Null filename bugs `set-auto-mode' in Mule ...
       (condition-case ()
  	  (set-auto-mode)
 	(error nil))
+      (setq buffer-file-truename nil
+	    buffer-file-name nil)
       (buffer-enable-undo)
       (set-buffer-modified-p nil)
       (w3-notify-when-ready (get-buffer tmp))))
@@ -1288,16 +1305,15 @@
   "Convert current data into the appropriate coding system"
   (and (or (not mmtype)
 	   (member mmtype w3-mime-list-for-code-conversion))
-       (let* ((c (mule-detect-coding-version (point-min) (point-max)))
-	      (code (or (and (listp c) (car c)) c)))
-	 (mule-code-convert-region (point-min) (point-max) code))))
+       (mule-code-convert-region
+	(point-min) (point-max)
+	(mule-detect-coding-version (point-min) (point-max)))))
 
 (defun w3-sentinel (&optional proc string)
   (set-buffer url-working-buffer)
   (if (or (stringp proc)
 	  (bufferp proc)) (setq w3-current-last-buffer proc))
-  (if (boundp 'after-change-functions)
-      (remove-hook 'after-change-functions 'url-after-change-function))
+  (remove-hook 'after-change-functions 'url-after-change-function)
   (if url-be-asynchronous
       (progn
 	(url-clean-text)
@@ -1324,39 +1340,50 @@
 (defun w3-save-as (&optional type)
   "Save a document to the local disk"
   (interactive)
-  (let* ((completion-ignore-case t)
-	 (format (or type (completing-read
-			   "Format: "
-			   '(("HTML Source") ("Formatted Text")
-			     ("LaTeX Source") ("Binary"))
-			   nil t)))
-	(fname (expand-file-name
-		(read-file-name "File name: " default-directory)))
-	(url (url-view-url t)))
-    (cond
-     ((equal "Binary" format)
-      (if (not w3-current-source)
-	  (let ((url-be-asynchronous nil))
-	    (url-retrieve url))))
-     ((equal "HTML Source" format)
-      (if (not w3-current-source)
-	  (let ((url-be-asynchronous nil))
-	    (url-retrieve url))		; Get the document if necessary
-	(let ((txt w3-current-source))
-	  (set-buffer (get-buffer-create url-working-buffer))
-	  (erase-buffer)
-	  (insert txt)))
-      (goto-char (point-min))
-      (if (re-search-forward "<head>" nil t)
-	  (insert "\n"))
-      (insert (format "<BASE HREF=\"%s\">\n" url)))
-     ((or (equal "Formatted Text" format)
-	  (equal "" format))
-      nil)				; Do nothing - we have the text already
-     ((equal "LaTeX Source" format)
-      (w3-parse-tree-to-latex w3-current-parse url)
-      (insert-buffer url-working-buffer)))
-    (write-region (point-min) (point-max) fname)))
+  (save-excursion
+    (let* ((completion-ignore-case t)
+	   (format (or type (completing-read
+			     "Format: "
+			     '(("HTML Source")
+			       ("Formatted Text")
+			       ("LaTeX Source")
+			       ("PostScript")
+			       ("Binary"))
+			     nil t)))
+	   (fname (expand-file-name
+		   (read-file-name "File name: " default-directory)))
+	   (url (url-view-url t)))
+      (cond
+       ((equal "Binary" format)
+	(if (not w3-current-source)
+	    (let ((url-be-asynchronous nil))
+	      (url-retrieve url))))
+       ((equal "HTML Source" format)
+	(if (not w3-current-source)
+	    (let ((url-be-asynchronous nil))
+	      (url-retrieve url))	; Get the document if necessary
+	  (let ((txt w3-current-source))
+	    (set-buffer (get-buffer-create url-working-buffer))
+	    (erase-buffer)
+	    (insert txt)))
+	(goto-char (point-min))
+	(if (re-search-forward "<head>" nil t)
+	    (insert "\n"))
+	(insert (format "<BASE HREF=\"%s\">\n" url)))
+       ((or (equal "Formatted Text" format)
+	    (equal "" format))
+	nil)				; Do nothing - we have the text already
+       ((equal "PostScript" format)
+	(let ((ps-spool-buffer-name " *w3-temp*"))
+	  (if (get-buffer ps-spool-buffer-name)
+	      (kill-buffer ps-spool-buffer-name))
+	  (w3-print-with-ps-print (current-buffer)
+				  'ps-spool-buffer-with-faces)
+	  (set-buffer ps-spool-buffer-name)))
+       ((equal "LaTeX Source" format)
+	(w3-parse-tree-to-latex w3-current-parse url)
+	(insert-buffer url-working-buffer)))
+      (write-region (point-min) (point-max) fname))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2208,7 +2235,7 @@
   (add-minor-mode 'w3-annotation-minor-mode " Annotating"
 		  w3-annotation-minor-mode-map)
   (add-minor-mode 'w3-lynx-emulation-minor-mode " Lynx"
-		  w3-annotation-minor-mode-map)
+		  w3-lynx-emulation-minor-mode-map)
   
   (setq url-package-version w3-version-number
 	url-package-name "Emacs-W3")
@@ -2431,9 +2458,8 @@
 				 (substring link-at-point 0 17) "..."))
 			      "): ")
 		    "Link: ") links-alist nil t))
-    (if (string= choice "")
-	(w3-follow-link)
-      (w3-fetch (cdr (assoc choice links-alist))))))
+    (if (setq choice (try-completion choice links-alist))
+	(w3-fetch (cdr (assoc choice links-alist))))))
 
 (defun w3-mode ()
   "Mode for viewing HTML documents.  If called interactively, will
--- a/lisp/w3/widget-edit.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/widget-edit.el	Mon Aug 13 09:07:36 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.13
+;; Version: 1.18
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;;; Commentary:
@@ -77,7 +77,13 @@
   :prefix "widget-"
   :group 'emacs)
 
-(defface widget-documentation-face '((t ()))
+(defface widget-documentation-faces '((((class color)
+				       (background dark))
+				      (:foreground "lime green"))
+				     (((class color)
+				       (background light))
+				      (:foreground "dark green"))
+				     (t nil))
   "Face used for documentation text."
   :group 'widgets)
 
@@ -90,12 +96,10 @@
   :type 'face
   :group 'widgets)
 
-(defface widget-field-face '((((type x)
-			       (class grayscale color)
+(defface widget-field-face '((((class grayscale color)
 			       (background light))
 			      (:background "light gray"))
-			     (((type x)
-			       (class grayscale color)
+			     (((class grayscale color)
 			       (background dark))
 			      (:background "dark gray"))
 			     (t 
@@ -106,6 +110,7 @@
 (defcustom widget-menu-max-size 40
   "Largest number of items allowed in a popup-menu.
 Larger menus are read through the minibuffer."
+  :group 'widgets
   :type 'integer)
 
 ;;; Utility functions.
@@ -468,10 +473,9 @@
       (call-interactively
        (lookup-key widget-global-map (this-command-keys))))))
 
-(defun widget-forward (arg)
-  "Move point to the next field or button.
-With optional ARG, move across that many fields."
-  (interactive "p")
+(defun widget-move (arg)
+  "Move point to the ARG next field or button.
+ARG may be negative to move backward."
   (while (> arg 0)
     (setq arg (1- arg))
     (let ((next (cond ((get-text-property (point) 'button)
@@ -533,13 +537,22 @@
 	     (goto-char (max button field)))
 	    (button (goto-char button))
 	    (field (goto-char field)))))
-  (widget-echo-help (point)))
+  (widget-echo-help (point))
+  (run-hooks 'widget-move-hook))
+
+(defun widget-forward (arg)
+  "Move point to the next field or button.
+With optional ARG, move across that many fields."
+  (interactive "p")
+  (run-hooks 'widget-forward-hook)
+  (widget-move arg))
 
 (defun widget-backward (arg)
   "Move point to the previous field or button.
 With optional ARG, move across that many fields."
   (interactive "p")
-  (widget-forward (- arg)))
+  (run-hooks 'widget-backward-hook)
+  (widget-move (- arg)))
 
 ;;; Setting up the buffer.
 
@@ -877,6 +890,7 @@
 
 (define-widget 'link 'item
   "An embedded link."
+  :help-echo "Push me to follow the link."
   :format "%[_%t_%]")
 
 ;;; The `info-link' Widget.
@@ -1835,6 +1849,14 @@
 	(concat "\n" pp)
       pp)))
 
+(if (not (fboundp 'error-message-string))
+    (defun error-message-string (obj)
+      "Convert an error value to an error message."
+      (let ((buf (get-buffer-create " *error-message*")))
+	(erase-buffer buf)
+	(display-error obj buf)
+	(buffer-string buf))))
+
 (defun widget-sexp-validate (widget)
   ;; Valid if we can read the string and there is no junk left after it.
   (save-excursion
--- a/lisp/w3/widget.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/w3/widget.el	Mon Aug 13 09:07:36 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.13
+;; Version: 1.18
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;;; Commentary:
--- a/lisp/x11/x-font-menu.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/x11/x-font-menu.el	Mon Aug 13 09:07:36 2007 +0200
@@ -89,12 +89,12 @@
 ;;;
 ;;; - Exactly what behavior you're seeing;
 ;;; - The output of the `xlsfonts' program;
-;;; - The value of the variable `fonts-menu-cache';
+;;; - The value of the variable `device-fonts-cache';
 ;;; - The values of the following expressions, both before and after
 ;;;   making a selection from any of the fonts-related menus:
 ;;;	(face-font 'default)
-;;;	(font-instance-truename (face-font 'default))
-;;;	(font-instance-properties (face-font 'default))
+;;;	(font-truename   (face-font 'default))
+;;;	(font-properties (face-font 'default))
 ;;; - The values of the following variables after making a selection:
 ;;;	font-menu-preferred-resolution
 ;;;	font-menu-preferred-registry
@@ -141,7 +141,7 @@
 				;  "Axcob" -> "Applix Courier Bold", etc.
       )
     "\\|"))
-  "A regexp matching font families which are uninteresting (cursor fonts).")
+  "A regexp matching font families which are uninteresting (e.g. cursor fonts).")
 
 (defun hack-font-truename (fn)
   "Filter the output of `font-instance-truename' to deal with Japanese fontsets."
@@ -196,7 +196,8 @@
 			   (getenv "LANG")))
 	;; #### - this is questionable behavior left over from the I18N4 code.
 	(setq x-font-regexp-ja "jisx[^-]*-[^-]*$"
-	      font-menu-preferred-registry '("*" . "*")))
+	      font-menu-preferred-registry '("*" . "*")
+	      font-menu-preferred-resolution '("*" . "*")))
     (let ((all-fonts nil)
 	  (case-fold-search t)
 	  name family size weight entry monospaced-p
@@ -212,35 +213,34 @@
 		   (or debug
 		       (list-fonts "*-*-*-*-*-*-*-*-*-*-*-*-*-*" device)))))
       (while (setq name (pop all-fonts))
-	(cond ((and (or (not x-font-regexp-ja)
-			(string-match x-font-regexp-ja name))
-		    (string-match x-font-regexp name))
-	       (setq weight (capitalize (match-string 1 name))
-		     size   (string-to-int (match-string 6 name)))
-	       (or (string-match x-font-regexp-foundry-and-family name)
-		   (error "internal error"))
-	       (setq family (capitalize (match-string 1 name)))
-	       (or (string-match x-font-regexp-spacing name)
-		   (error "internal error"))
-	       (setq monospaced-p (string= "m" (match-string 1 name)))
-	       (if (string-match fonts-menu-junk-families family)
-		   nil
-		 (setq entry (or (vassoc family cache)
-				 (car (setq cache
-					    (cons (vector family nil nil t)
-						  cache)))))
-		 (or (member family families)
-		     (setq families (cons family families)))
-		 (or (member weight weights)
-		     (setq weights (cons weight weights)))
-		 (or (member weight (aref entry 1))
-		     (aset entry 1 (cons weight (aref entry 1))))
-		 (or (member size sizes)
-		     (setq sizes (cons size sizes)))
-		 (or (member size (aref entry 2))
-		     (aset entry 2 (cons size (aref entry 2))))
-		 (aset entry 3 (and (aref entry 3) monospaced-p))
-		 ))))
+	(when (and (or (not x-font-regexp-ja)
+		       (string-match x-font-regexp-ja name))
+		   (string-match x-font-regexp name))
+	  (setq weight (capitalize (match-string 1 name))
+		size   (string-to-int (match-string 6 name)))
+	  (or (string-match x-font-regexp-foundry-and-family name)
+	      (error "internal error"))
+	  (setq family (capitalize (match-string 1 name)))
+	  (or (string-match x-font-regexp-spacing name)
+	      (error "internal error"))
+	  (setq monospaced-p (string= "m" (match-string 1 name)))
+	  (unless (string-match fonts-menu-junk-families family)
+	    (setq entry (or (vassoc family cache)
+			    (car (setq cache
+				       (cons (vector family nil nil t)
+					     cache)))))
+	    (or (member family families)
+		(setq families (cons family families)))
+	    (or (member weight weights)
+		(setq weights (cons weight weights)))
+	    (or (member weight (aref entry 1))
+		(aset entry 1 (cons weight (aref entry 1))))
+	    (or (member size sizes)
+		(setq sizes (cons size sizes)))
+	    (or (member size (aref entry 2))
+		(aset entry 2 (cons size (aref entry 2))))
+	    (aset entry 3 (and (aref entry 3) monospaced-p))
+	    )))
       ;;
       ;; Hack scalable fonts.
       ;; Some fonts come only in scalable versions (the only size is 0)
@@ -305,17 +305,39 @@
 		       weights)))
       (cdr dev-cache))))
 
+(defsubst font-menu-truename (face)
+  (hack-font-truename
+   (if (featurep 'mule)
+       (face-font-instance face nil 'ascii)
+     (face-font-instance face))))
+
+;;; Extract a font family from a face.
+;;; Use the user-specified one if possible.
+;;; If the user didn't specify one (with "*", for example)
+;;; get the truename and use the guaranteed family from that.
+(defun font-menu-family (face)
+  (let ((dcache (cdr (assq (selected-device) device-fonts-cache)))
+	(name (font-instance-name (face-font-instance face)))
+	(family nil))
+    (when (string-match x-font-regexp-foundry-and-family name)
+      (setq family (capitalize (match-string 1 name))))
+    (when (not (and family (vassoc family (aref dcache 0))))
+      (setq name (font-menu-truename face))
+      (string-match x-font-regexp-foundry-and-family name)
+      (setq family (capitalize (match-string 1 name))))
+    family))
+
 ;;;###autoload
 (defun font-menu-family-constructor (ignored)
   ;; by Stig@hackvan.com
   (if (not (eq 'x (device-type (selected-device))))
       '(["Cannot parse current font" ding nil])
-    (let ((dcache (cdr (assq (selected-device) device-fonts-cache)))
-	  (name (hack-font-truename (face-font-instance 'default)))
-	  (case-fold-search t)
-	  family weight size		; parsed from current font
-	  entry				; font cache entry
-	  f)
+    (let* ((dcache (cdr (assq (selected-device) device-fonts-cache)))
+	   (name (font-menu-truename 'default))
+	   (case-fold-search t)
+	   family weight size		; parsed from current font
+	   entry			; font cache entry
+	   f)
       (or dcache
 	  (setq dcache (reset-device-font-menus (selected-device))))
       (if (not (string-match x-font-regexp name))
@@ -323,8 +345,7 @@
 	  '(["Cannot parse current font" ding nil])
 	(setq weight (capitalize (match-string 1 name)))
 	(setq size (string-to-number (match-string 6 name)))
-	(and (string-match x-font-regexp-foundry-and-family name)
-	     (setq family (capitalize (match-string 1 name))))
+	(setq family (font-menu-family 'default))
 	(setq entry (vassoc family (aref dcache 0)))
 	(mapcar #'(lambda (item)
 		    ;;
@@ -354,7 +375,7 @@
   (if (not (eq 'x (device-type (selected-device))))
       '(["Cannot parse current font" ding nil])
     (let ((dcache (cdr (assq (selected-device) device-fonts-cache)))
-	  (name (hack-font-truename (face-font-instance 'default)))
+	  (name (font-menu-truename 'default))
 	  (case-fold-search t)
 	  family size			; parsed from current font
 	  entry				; font cache entry
@@ -365,8 +386,7 @@
 	  ;; couldn't parse current font
 	  '(["Cannot parse current font" ding nil])
 	(setq size (string-to-number (match-string 6 name)))
-	(and (string-match x-font-regexp-foundry-and-family name)
-	     (setq family (capitalize (match-string 1 name))))
+	(setq family (font-menu-family 'default))
 	(setq entry (vassoc family (aref dcache 0)))
 	(mapcar
          (lambda (item)
@@ -395,7 +415,7 @@
   (if (not (eq 'x (device-type (selected-device))))
       '(["Cannot parse current font" ding nil])
     (let ((dcache (cdr (assq (selected-device) device-fonts-cache)))
-	  (name (hack-font-truename (face-font-instance 'default)))
+	  (name (font-menu-truename 'default))
 	  (case-fold-search t)
 	  family weight			; parsed from current font
 	  entry				; font cache entry
@@ -406,15 +426,12 @@
 	  ;; couldn't parse current font
 	  '(["Cannot parse current font" ding nil])
 	(setq weight (capitalize (match-string 1 name)))
-	(and (string-match x-font-regexp-foundry-and-family name)
-	     (setq family (capitalize (match-string 1 name))))
+	(setq family (font-menu-family 'default))
 	(setq entry (vassoc family (aref dcache 0)))
 	(mapcar #'(lambda (item)
-		    ;;
 		    ;; Items on the Weight menu are enabled iff current font
 		    ;; has that weight.  Only the weight of the current font
 		    ;; is selected.
-		    ;;
 		    (setq w (aref item 0))
 		    (if (member w (aref entry 1))
 			(enable-menu-item item)
@@ -434,16 +451,14 @@
   ;; fonts menus.  It needs to be rather clever.
   ;; (size is measured in 10ths of points.)
   (let ((faces (delq 'default (face-list)))
-	(default-name (hack-font-truename (face-font-instance 'default)))
+	(default-name (font-menu-truename 'default))
 	(case-fold-search t)
 	new-default-face-font
 	from-family from-weight from-size)
     ;;
     ;; First, parse out the default face's font.
     ;;
-    (or (string-match x-font-regexp-foundry-and-family default-name)
-	(signal 'error (list "couldn't parse font name" default-name)))
-    (setq from-family (capitalize (match-string 1 default-name)))
+    (setq from-family (font-menu-family 'default))
     (or (string-match x-font-regexp default-name)
 	(signal 'error (list "couldn't parse font name" default-name)))
     (setq from-weight (capitalize (match-string 1 default-name)))
@@ -477,8 +492,7 @@
 			      from-family from-weight from-size
 			      to-family   to-weight   to-size)
   (or (symbolp face) (signal 'wrong-type-argument (list 'symbolp face)))
-  (let* ((font (face-font-instance face))
-	 (name (hack-font-truename font))
+  (let* ((name (font-menu-truename face))
 	 (case-fold-search t)
 	 face-family
 	 face-weight
@@ -527,9 +541,9 @@
     (setq slant (capitalize (match-string 2 from-font))
 	  resx  (match-string 7 from-font)
 	  resy  (match-string 8 from-font))
-    (cond ((equal slant "O") (setq other-slant "I")) ; oh, bite me.
-	  ((equal slant "I") (setq other-slant "O"))
-	  (t (setq other-slant nil)))
+    (setq other-slant (cond ((equal slant "O") "I") ; oh, bite me.
+			    ((equal slant "I") "O")
+			    (t nil)))
     ;;
     ;; Remember these values for the first font we switch away from
     ;; (the original default font).
--- a/lisp/x11/x-menubar.el	Mon Aug 13 09:06:45 2007 +0200
+++ b/lisp/x11/x-menubar.el	Mon Aug 13 09:07:36 2007 +0200
@@ -572,10 +572,10 @@
        ["Package Browser"	finder-by-keyword	t]
        ["Splash Screen"		xemacs-splash-buffer	t])
       "-----"
-      ("XEmacs FAQ & Web Page"
-       ["XEmacs WWW Page"	xemacs-www-page		t]
+      ("XEmacs FAQ"
+       ["XEmacs FAQ (local)"	xemacs-local-faq	t]
        ["Newest XEmacs FAQ via WWW" xemacs-www-faq	t]
-       ["XEmacs FAQ (local)"	xemacs-local-faq	t])
+       ["XEmacs WWW Page"	xemacs-www-page		t])
       ("Samples"
        ["Sample"			(find-file
 					 (expand-file-name "sample.emacs"
@@ -606,12 +606,13 @@
        ["Describe Key/Mouse..."	describe-key		t]
        ["List Key Bindings"	describe-bindings	t]
        ["List Mouse Bindings"	describe-pointer	t]
+       ["Recent Keystrokes"	view-lossage		t]
        "-----"
        ["Describe Function..."	describe-function	t]
        ["Describe Variable..."	describe-variable	t]
        ["Where Is Command..."	where-is		t])
       "-----"
-      ["Recent Keystrokes/Messages" view-lossage	t]
+      ["Recent Messages" view-lossage	t]
       ("Misc"
        ["Describe No Warranty"	describe-no-warranty	t]
        ["Describe XEmacs License" describe-copying	t]
--- a/lwlib/lwlib-Xaw.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/lwlib/lwlib-Xaw.c	Mon Aug 13 09:07:36 2007 +0200
@@ -128,6 +128,8 @@
     {
       Dimension bw = 0;
       XtVaGetValues (widget, XtNborderWidth, &bw, 0);
+
+#ifndef LWLIB_DIALOGS_ATHENA3D
       if (bw == 0)
 	/* Don't let buttons end up with 0 borderwidth, that's ugly...
 	   Yeah, all this should really be done through app-defaults files
@@ -136,6 +138,7 @@
 	   not look like shit is just entirely too much work.
 	 */
 	XtVaSetValues (widget, XtNborderWidth, 1, 0);
+#endif
 
       XtVaSetValues (widget,
 		     XtNlabel, val->value,
@@ -518,9 +521,11 @@
   event_data.time = 0;
 
   if ((int) call_data > 0)
-    event_data.action = SCROLLBAR_PAGE_DOWN;
+    /* event_data.action = SCROLLBAR_PAGE_DOWN;*/
+    event_data.action = SCROLLBAR_LINE_DOWN;
   else
-    event_data.action = SCROLLBAR_PAGE_UP;
+    /* event_data.action = SCROLLBAR_PAGE_UP;*/
+    event_data.action = SCROLLBAR_LINE_UP;
 
   if (instance->info->pre_activate_cb)
     instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
--- a/man/ediff.texi	Mon Aug 13 09:06:45 2007 +0200
+++ b/man/ediff.texi	Mon Aug 13 09:07:36 2007 +0200
@@ -795,11 +795,11 @@
 commands, such as going to the next difference or redisplaying.
 @item ediff-toggle-use-toolbar
 @findex ediff-toggle-use-toolbar
-Available in XEmacs only (in a forthcoming version). The Ediff toolbar
-provides quick access to some of the common Ediff functions. This function
-toggles the display of the toolbar. If invoked from the menubar, the function
-may take sometimes effect only after you execute an Ediff command, such as
-going to the next difference.
+Available in XEmacs only. The Ediff toolbar provides quick access to some
+of the common Ediff functions. This function toggles the display of the
+toolbar. If invoked from the menubar, the function may take sometimes
+effect only after you execute an Ediff command, such as going to the next
+difference.
 
 @item ediff-use-toolbar-p
 @vindex ediff-use-toolbar-p
@@ -2163,7 +2163,7 @@
 Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight
 fine differences in Ediff buffers. Alastair Burt <burt@@dfki.uni-kl.de>
 ported Ediff to XEmacs, Eric Freudenthal <freudent@@jan.ultra.nyu.edu>
-made it work with VC, and Marc Paquette <paquette@@crim.ca> wrote the
+made it work with VC, and Marc Paquette <marcpa@@cam.org> wrote the
 toolbar support package for Ediff.
 
 Many people provided help with bug reports, patches, and advice.
--- a/man/viper.texi	Mon Aug 13 09:06:45 2007 +0200
+++ b/man/viper.texi	Mon Aug 13 09:07:36 2007 +0200
@@ -1829,6 +1829,12 @@
 @code{vip-replace-region-start-delimiter} to delimit replacement regions,
 even on color displays (where this is unnecessary). By default, this
 variable is non-nil only on TTYs or monochrome displays.
+@item vip-allow-multiline-replace-regions t
+If non-nil, multi-line text replacement regions, such as those produced by
+commands @kbd{c55w}, @kbd{3C}, etc., will stay around until the user exits
+the replacement mode. In this variable is set to @code{nil}, Viper will
+emulate the standard Vi behavior, which supports only intra-line
+replacement regions (and multi-line replacement regions are deleted).
 @item vip-toggle-key "\C-z"
 Specifies the key used to switch from Emacs to Vi and back.
 Must be set in @file{.vip} or prior to loading Viper. This variable can't be
@@ -1904,6 +1910,7 @@
 @vindex @code{vip-replace-overlay-pixmap}
 @vindex @code{vip-replace-region-end-symbol}
 @vindex @code{vip-replace-region-start-symbol}
+@vindex @code{vip-allow-multiline-replace-regions}
 @vindex @code{vip-toggle-key}
 @vindex @code{vip-ESC-key}
 @vindex @code{vip-buffer-search-char}
--- a/man/w3.texi	Mon Aug 13 09:06:45 2007 +0200
+++ b/man/w3.texi	Mon Aug 13 09:07:36 2007 +0200
@@ -12,6 +12,11 @@
 @end tex
 @synindex cp fn
 @synindex vr fn
+@dircategory World Wide Web
+@dircategory GNU Emacs Lisp
+@direntry
+* W3: (w3).                       Emacs-W3 World Wide Web browser.
+@end direntry
 @ifinfo
 This file documents the Emacs-W3 World Wide Web browser.
 
@@ -221,9 +226,14 @@
 @chapter Stylesheets
 @cindex Stylesheets
 @cindex Cascading Style Sheets
+@cindex Aural Cascading Style Sheets
 @cindex CSS
 @cindex DSSSL
 :: WORK :: Document CSS support
+CSS Information at http://www.w3.org/pub/WWW/TR/REC-CSS1
+Style guide at http://www.htmlhelp.com/reference/css/
+:: WORK :: Document ACSS support
+ACSS Information at http://www.w3.org/pub/WWW/Style/CSS/Speech/NOTE-ACSS
 :: WORK :: Document DSSSL support
 
 @node Supported Protocols, , Stylesheets, Introduction
@@ -261,12 +271,17 @@
 @item Local files
 Local files are of course handled, and MIME content-types are derived
 from the file extensions.
-@item Telnet, tn3270, rlogin
+@item telnet, tn3270, rlogin
 Telnet, tn3270, and rogin are handled by running the appropriate program
 in an emacs buffer, or running an external process.
-@item Mailto
+@item mailto
 Causes a mail message to be started to a specific address.  Supports the
 Netscape @i{extensions} to specify arbitrary headers on the message.
+@item data
+A quick and easy way to `inline' small pieces of information that you do
+not necessarily want to download over the net separately.  Can speed up
+display of small icons, stylesheet information, etc.  See the internet
+draft draft-masinter-url-data-02.txt for more information.
 @item mailserver
 A more powerful version of mailto, which allows the author to specify
 the subject and body text of the mail message.  This type of link is
@@ -274,7 +289,7 @@
 to insert insulting or threatening (and possibly illegal) data into the
 message.  The mail message is displayed, and the user must confirm the
 message before it is sent.
-@item X-exec
+@item x-exec
 A URL can cause a local executable to be run, and its output interpreted
 as if it had come from an HTTP server.  This is very useful, but is
 still an experimental protocol, hence the X- prefix.  This URL protocol
@@ -282,9 +297,8 @@
 @item NFS
 Retrieves information over NFS.  This requires that your operating
 system support auto-mounting of NFS volumes.
-@item Finger
-Retrieves information about a user via the 'finger' protocol, as defined
-in RFC ????? :: WORK ::
+@item finger
+Retrieves information about a user via the 'finger' protocol.
 @item Info
 Creates a link to an GNU-style info file.  @inforef{Info,Top,info}, for more
 information on the Info format.
--- a/man/xemacs-faq.texi	Mon Aug 13 09:06:45 2007 +0200
+++ b/man/xemacs-faq.texi	Mon Aug 13 09:07:36 2007 +0200
@@ -8,352 +8,3695 @@
 @titlepage
 @title XEmacs FAQ
 @subtitle Frequently asked questions about XEmacs
-@subtitle Last Modified:  1995/08/29
+@subtitle Last Modified:  1997/01/16
 @sp 1
 @author Anthony Rossini <arossini@@biostats.hmc.psu.edu>
 @author Ben Wing <wing@@netcom.com>
 @author Chuck Thompson <cthomp@@cs.uiuc.edu>
+@author Steve Baur <steve@@miranova.com>
 @page
 @end titlepage
 
-@c Some of this stuff needs to go in the HTML version which means it
-@c needs to be put outside of the ifinfo statement.
-
-@ifinfo
-@node top, 1. Introductory Questions, (dir), (dir)
-@unnumbered XEmacs FAQ
-
-Version:  1995/08/29
-
-Current-Editor: Chuck Thompson <cthomp@@cs.uiuc.edu>
-
-Copying Status: Freely Redistributable.  I take no liability for the
-                correctness and safety of any procedures or advice given
-                here.  This FAQ 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.
-
-This is a list of frequently asked questions for XEmacs users and
-maintainers. 
-
-You can obtain the latest version of this file by anonymous FTP from
-site @file{ftp.cs.uiuc.edu:/pub/xemacs/faq/xemacs-faq.FORMAT} where FORMAT
-is text, texinfo (the master copy), postscript, dvi, html, info.  Note that
-the html version has 2 files.
-
-Thanks to the many who contributed, especially to JWZ <jwz@@netscape.com> for
-starting this whole wonderful mess...  Special thanks to Tim Geisler
-<tmgeisle@@faui80.informatik.uni-erlangen.de> for the initial texinfo
-version and to Giacomo Boffi <sboff@@hp735.stru.polimi.it> for the initial
-HTML version.  Other contributors (many left out, unfortunately, due to an
-old mail-purge) include:
-@itemize @bullet
-@item
-Juergen Nickelsen <nickel@@prz.tu-berlin.de>
-@item
-Evelyn Ginsparg <ginsparg@@adra.com>
-@item
-d3h554@@foghorn.pnl.gov
-@item
-Marty Hall <hall@@aplcenmp.apl.jhu.edu>
-@item
-Richard Caley <rjc@@cogsci.ed.ac.uk>
-@item
-fcg@@philabs.Philips.COM
-@item
-Stig <stig@@hackvan.com>
-@item
-Arup Mukherjee <arup+@@cmu.edu>
-@item
-Kevin R. Powell <powell@@csl.ncsa.uiuc.edu>
-@item
-Eric Eide <eeide@@cs.utah.edu>
-@item
-William G. Dubuque <wgd@@martigny.ai.mit.edu>
-@item 
-Chris Flatters <cflatter@@nrao.edu>
-@item
-John A. Turner <turner@@lanl.gov>
-@end itemize
-
-@end ifinfo
+@node Top, Introduction, (dir), (dir)
+@top XEmacs FAQ
+
+This is the guide to the XEmacs Frequently Asked Questions list---a
+compendium of questions and answers pertaining to one of the finest
+programs ever written.  It is much more than just a Text Editor.
+
+This FAQ is freely redistributable.  I take no liability for the
+correctness and safety of any procedures or advice given here.  This
+FAQ 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.
+
+If you have a Web browser, the official hypertext version is at
+<URL:http://www.miranova.com/~steve/xemacs-faq.html> and also at
+<URL:http://www.xemacs.org/faq/xemacs-faq.html>.  This version is much
+nicer than the unofficial hypertext versions that are archived at
+Utrecht, Oxford, Smart Pages, and other FAQ archives.
 
 @menu
-* top::                         XEmacs FAQ
-* 1. Introductory Questions::.
-* 2. Compiling XEmacs::.
-* 3. Problems running XEmacs / weird messages::.
-* 4. Customization -- Emacs Lisp and the .emacs file::.
-* 5. Customization -- X resources::.
-* 6. Changing textual fonts and colors::.
-* 7. The modeline::.
-* 8. The keyboard::.
-* 9. The cursor::.
-* 10. The mouse; cutting and pasting::.
-* 11. Highlighting::.
-* 12. The menubar and toolbar::.
-* 13. Scrollbars::.
-* 14. Frame Geometry::.
-* 15. Window/icon title; window manager problems::.
-* 16. Editing source code (C mode; Lisp mode; etc.)::.
-* 17. Text mode::.
-* 18. Shell mode::.
-* 19. Mail; VM; GNUS; BBDB; and related::.
-* 20. Printing::.
-* 21. Gnuserv::.
-* 22. Miscellaneous::.
+* Introduction::        Introduction, Policy, Credits.
+* Installation::        Installation and Trouble Shooting.
+* Customization::       Customization and Options.
+* Subsystems::          Major Subsystems.
+* Miscellaneous::       The Miscellaneous Stuff.
+* Current Events::      What the Future Holds.
 @end menu
 
-
-
-@node 1. Introductory Questions, 2. Compiling XEmacs, top, top
-@chapter 1. Introductory Questions
+@node Introduction, Installation, Top, Top
+@chapter Introduction, Policy, Credits
+
+Learning XEmacs is a lifelong activity.  I've been using Emacs for
+over a decade now, and I'm still discovering new features.  Therefore
+this document cannot be complete.  Instead it is aimed at the person
+who is either considering XEmacs for their own use, or has just
+obtained it and is wondering what to do next.  It is also useful as a
+reference to available resources.
+
+The previous maintainer of the FAQ was Anthony Rossini
+<rossini@@stat.sc.edu>, who started it, after getting tired of hearing
+JWZ complain about repeatedly having to answer questions.  Ben Wing
+<ben@@666.com> and Chuck Thompson <cthomp@@xemacs.org>, the principal
+authors of XEmacs, then took over and Ben did a massive update
+reorganizing the whole thing.  At which point Anthony took back over,
+but then had to give it up again.  Some of the other contributors to
+this FAQ are listed later in this document.
+
+This version was converted to hypertext format, and edited by Steven
+L. Baur <steve@@altair.xemacs.org>.  It was converted back to texinfo by
+Hrvoje Niksic <hniksic@@srce.hr>.
 
 @menu
-* 1.1.::          1.1. Preface
-* 1.2.::          1.2. What is XEmacs?
-* 1.3.::          1.3. What is the current version of XEmacs?
-* 1.4.::          1.4. Where can I find it?
-* 1.5.::          1.5. Why another version of Emacs?
-* 1.6.::          1.6. What do @kbd{M-x}, GNU, etc. mean?
-* 1.7.::          1.7. Where can I get help for using XEmacs?
-* 1.8.::          1.8. Where is the mailing list archived?
-* 1.9.::          1.9. What is InfoDock, how does it relate to XEmacs, and how can I obtain it?
+Introduction:
+* Q1.0.1::      What is XEmacs?
+* Q1.0.2::      What is the current version of XEmacs?
+* Q1.0.3::      Where can I find it?
+* Q1.0.4::      Why Another Version of Emacs?
+* Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
+* Q1.0.6::      Where can I get help?
+* Q1.0.7::      Where is the mailing list archived?
+* Q1.0.8::      How do you pronounce XEmacs?
+* Q1.0.9::      What does XEmacs look like?
+* Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
+* Q1.0.11::     Is there a port of XEmacs to the Macintosh?
+* Q1.0.12::     Is there a port of XEmacs to NextStep?
+* Q1.0.13::     Is there a port of XEmacs to OS/2?
+
+Policies:
+* Q1.1.1::      What is the FAQ editorial policy?
+* Q1.1.2::      How do I become a Beta Tester?
+* Q1.1.3::      How do I contribute to XEmacs itself?
+
+Credits:
+* Q1.2.1::      Who wrote XEmacs?
+* Q1.2.2::      Who contributed to this version of the FAQ?
+* Q1.2.3::      Who contributed to the FAQ in the past?
+
+Internationalization:
+* Q1.3.1::      What is the status of XEmacs v20?
+* Q1.3.2::      What is the status of Asian-language support, aka @var{mule}?
+* Q1.3.3::      How do I type non-ASCII characters?
+* Q1.3.4::      Can XEmacs messages come out in a different language?
+* Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
+* Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
+* Q1.3.7::      How about Cyrillic Modes?
+
+Getting Started:
+* Q1.4.1::      What is a @file{.emacs} and is there a sample one?
+* Q1.4.2::      Can I use the same @file{.emacs} with the other Emacs?
+* Q1.4.3::      Any good XEmacs tutorials around?
+* Q1.4.4::      May I see an example of a useful XEmacs Lisp function?
+* Q1.4.5::      And how do I bind it to a key?
+* Q1.4.6::      What's the difference between a macro and a function?
+* Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or 20.0?
 @end menu
 
-
-@node 1.1.
-@section 1.1. Preface
-
-This is the introduction to a list of frequently asked questions (FAQ's)
-about XEmacs with answers.  This article contains a listing of the
-questions; subsequent articles contain the questions and answers.
-
-This is not a substitute for general Emacs questions, and actually
-includes nothing that might help a novice learn to use Emacs or XEmacs.
-For that, check out the regular Emacs lists, the tutorial inside of
-XEmacs (look on the Help menu), or the O'Reilly book @cite{Learning GNU
-Emacs}.  This FAQ focuses on specific issues regarding XEmacs.  If you
-don't find the answer here, perhaps it really is a more general
-question, and check the GNU Emacs FAQ for more information, as well.
-
-The FAQ list is posted to reduce the noise level in the
-@samp{comp.emacs.xemacs} newsgroup which results from the repetition of
-frequently asked questions, wrong answers to these questions,
-corrections to the wrong answers, corrections to the corrections,
-debate, name calling, etc.  Also, it serves as a repository of the
-canonical ``best'' answers to these questions.  However, if you know a
-better answer or even a slight change that improves an answer, please
-tell me!
-
-If you know the answer of a question is in the FAQ list, please reply to
-the question by e-mail instead of posting.  Help reduce noise!
-
-Please suggest new questions, answers, wording changes, deletions, etc.
-The most helpful form for suggestions is a context diff (i.e. the output
-of @samp{diff -c}).  Include @samp{FAQ} in the subject of messages sent
-to us about the FAQ list.
-
-Please do not send questions to us just because you do not want to
-disturb a lot of people and you think we would know the answer.  We do
-not have time to answer questions individually and keep up with
-everything else we have to get done.
-
-Many thanks need to go to all contributors on the old alt.lucid-emacs.*
-and current comp.emacs.xemacs groups.  This would never have been
-collected without you.
-
-Any directories given are usually in reference to the base directory
-formed by unpacking XEmacs.
-
-
-@node 1.2.
-@section 1.2. What is XEmacs?
+@node Q1.0.1, Q1.0.2, Introduction, Introduction
+@section What is XEmacs?
 
 An alternative to GNU Emacs, originally based on an early alpha version
-of FSF's version 19.  XEmacs was known as Lucid Emacs through version
-19.10.  Almost all features of GNU Emacs are supported in XEmacs (the
-ones that aren't supported are generally implemented in a better way in
-XEmacs).  The maintainers of XEmacs actively track changes to GNU Emacs
-while also working to add new features never before seen in Emacs.
-
-
-@node 1.3.
-@section 1.3. What is the current version of XEmacs?
-
-The current version is 19.13, released on September 1, 1995.
-
-
-@node 1.4.
-@section 1.4. Where can I find it?
-
-The canonical source and binaries is found via anonymous FTP at
-@ifinfo
-@file{ftp.cs.uiuc.edu:/pub/xemacs}.
-@end ifinfo
-@ifhtml
-<A HREF="ftp://ftp.cs.uiuc.edu/pub/xemacs/">ftp.cs.uiuc.edu:/pub/xemacs/</A>
-@end ifhtml
-
-@node 1.5.
-@section 1.5. Why Another Version of Emacs?
-
-@ifinfo
-For a detailed description of the differences between GNU Emacs and
-XEmacs, and a detailed history of XEmacs, see the file @file{etc/NEWS}
-in the source distribution.  However, here is a list of some of the
-reasons why we think you might consider using it:
-@end ifinfo
-@ifhtml
+of FSF's version 19, and has diverged quite a bit since then.  XEmacs
+was known as Lucid Emacs through version 19.10.  Almost all features of
+GNU Emacs are supported in XEmacs The maintainers of XEmacs actively
+track changes to GNU Emacs while also working to add new features.
+
+@node Q1.0.2, Q1.0.3, Q1.0.1, Introduction
+@section What is the current version of XEmacs?
+
+The current version is 19.15, released in January, 1997.
+
+It has been decided that XEmacs 19.15 will be the final release of v19.
+XEmacs 19.15 is scheduled for release in mid January.  After a brief
+period of further testing, XEmacs v20 will be released shortly after
+that.
+
+@node Q1.0.3, Q1.0.4, Q1.0.2, Introduction
+@section Where can I find it?
+
+The canonical source and binaries is found via anonymous FTP at:
+
+@example
+<URL:ftp.xemacs.org:/pub/xemacs/>
+@end example
+
+@node Q1.0.4, Q1.0.5, Q1.0.3, Introduction
+@section Why Another Version of Emacs?
+
 For a detailed description of the differences between GNU Emacs and
 XEmacs and a detailed history of XEmacs, check out the
-<A HREF="http://xemacs.cs.uiuc.edu/NEWS.html/">NEWS</A> file.  However,
-here is a list of some of the reasons why we think you might consider
-using it:
-@end ifhtml
+@example
+<URL:http://www.xemacs.org/NEWS.html>
+@end example
+
+However, here is a list of some of the reasons why we think you might
+consider using it:
 
 @itemize @bullet
 @item
-It looks nicer
+It looks nicer.
+
 @item
 The XEmacs maintainers are generally more receptive to suggestions than
-the GNU Emacs maintainers
+the GNU Emacs maintainers.
+
 @item
-Many more bundled packages than GNU Emacs, all properly integrated with
-XEmacs
+Many more bundled packages than GNU Emacs
+
 @item
-Binaries are available for many common operating systems
+Binaries are available for many common operating systems.
+
 @item
-Face support on TTY's
+Face support on TTY's.
+
 @item
-A built-in toolbar
+A built-in toolbar.
+
 @item
-Better Motif compliance
+Better Motif compliance.
+
 @item
-Some internationalization support for European languages.  Full MULE
-(Multi-Lingual EMacs) support is being actively worked on.
+Some internationalization support (full MULE support starting with 20.0).
+
+@item
+Variable-width fonts.
+
 @item
-Variable-width fonts
-@item
-Variable-height lines
+Variable-height lines.
+
 @item
-Marginal annotations
+Marginal annotations.
+
 @item
-ToolTalk support
+ToolTalk support.
+
 @item
 XEmacs can be used as an Xt widget, and can be embedded within another
-application
+application.
+
 @item
-Horizontal and vertical scrollbars (using real toolkit scrollbars)
+Horizontal and vertical scrollbars (using real toolkit scrollbars).
+
 @item
 Better APIs (and performance) for attaching fonts, colors, and other
-properties to text
+properties to text.
+
 @item
-The ability to embed arbitrary graphics in a buffer
+The ability to embed arbitrary graphics in a buffer.
+
 @item
-Completely compatible (at the C level) with the Xt-based toolkits
+Completely compatible (at the C level) with the Xt-based toolkits.
+
+@item
+First production Web Browser supporting Style Sheets.
 @end itemize
 
-
-@node 1.6.
-@section 1.6. What do @kbd{M-x}, GNU, etc. mean?
-
-This is really a general Emacs question, but a table of some common
-terms/acronyms is provided here for your convenience.
-@ifinfo
-See the @cite{GNU Emacs FAQ} for a more complete list.
-@end ifinfo
-@ifhtml
-See the <A HREF="http://www.eecs.nwu.edu/emacs/faq">GNU Emacs FAQ</A>
-for a more complete list.
-@end ifhtml
-
-@table @samp
-@item BLAT FOOP
-Historical XEmacs error message
-@item C-x
-@dfn{C-x} means that the @key{Control} key and the @key{X} key should be
-pressed together, like when you use the @key{Shift} key.
-@item E-Lisp
-Same as @dfn{Emacs-Lisp}.
-@item Emacs-Lisp
-The dialect of Lisp supported by Emacs and XEmacs.  You use this to
-customize XEmacs.
-@item FAQ
-Frequently asked question(s).
-@item FSF
-The Free Software Foundation.
-@item GNU
-@dfn{GNU} refers to products written by the Free Software Foundation.
-@item JWZ
-Jamie Zawinski <jwz@@netscape.com>, the former maintainer of Lucid Emacs
-(which XEmacs evolved from).
-@item M-x
-@dfn{M-x} means that the @key{Meta} key and the @key{X} key should be
-pressed together, like when you use the @key{Shift} key.  Sometimes
-the @key{Meta} key is labelled @samp{Alt} or with a diamond.  Some
-keyboards don't have a @key{Meta} key at all; then you can get the
-equivalent by typing the @key{Esc} key followed by the @key{X} key.
-@item RMS
-Richard Stallman <rms@@gnu.ai.mit.edu>, the author of GNU Emacs.
-@item VI
-An editor used by those heretics that don't subscribe to the Emacs religion.
-@end table
-
-
-@node 1.7.
-@section 1.7. Where can I get help for using XEmacs?
+@node Q1.0.5, Q1.0.6, Q1.0.4, Introduction
+@section Why Haven't XEmacs and GNU Emacs Merged?
+
+There are currently irreconcilable differences in the views about
+technical, programming, design and organizational matters between RMS
+and the XEmacs development team which provide little hope for a merge to
+take place in the short-term future.
+
+@node Q1.0.6, Q1.0.7, Q1.0.5, Introduction
+@section Where can I get help?
 
 Probably the easiest way, if everything is installed, is to use info, by
-pressing @kbd{C-h i}, or selecting @samp{Emacs Info} from the Help Menu.
+pressing @kbd{C-h i}, or selecting @code{Emacs Info} from the Help Menu.
+
 Also, @kbd{M-x apropos} will look for commands for you.
 
 Try reading this FAQ, examining the regular GNU Emacs FAQ (which can be
 found with the Emacs 19 distribution) as well as at
-@ifinfo
-@file{http://www.eecs.nwu.edu/emacs/faq/} and reading the Usenet group
-@end ifinfo
-@ifhtml
-<A HREF="http://www.eecs.nwu.edu/emacs/faq/">http://www.eecs.nwu.edu/emacs/faq/</A>
-and reading the Usenet group
-@end ifhtml
-@samp{comp.emacs.xemacs}.  If that does not help, try posting your
-question to @samp{comp.emacs.xemacs}.  If you cannot post or read
-Usenet news, there is a corresponding mailing list which is available.
-It can be subscribed to by sending mail to
+@example
+<URL:http://www.eecs.nwu.edu/emacs/faq/>
+@end example
+and reading the Usenet group comp.emacs.xemacs.
+
+If that does not help, try posting your question to comp.emacs.xemacs.
+Please @strong{do not} post XEmacs related questions to gnu.emacs.help.
+
+If you cannot post or read Usenet news, there is a corresponding mailing
+list which is available.  It can be subscribed to by sending a message
+with a subject of @samp{subscribe} to
+@example
+<xemacs-request@@xemacs.org>
+@end example
+for subscription information and
+@example
+<xemacs@@xemacs.org>
+@end example
+to send messages to the list.
+
+To cancel a subscription, you @strong{must} use the xemacs-request
+address.  Send a message with a subject of @samp{unsubscribe} to be
+removed.
+
+@node Q1.0.7, Q1.0.8, Q1.0.6, Introduction
+@section Where is the mailing list archived?
+
+The mailing list is archived in the directory
+@example
+<URL:ftp://ftp.xemacs.org:/pub/mlists/>.
+@end example
+
+@node Q1.0.8, Q1.0.9, Q1.0.7, Introduction
+@section How do you pronounce XEmacs?
+
+I pronounce it @samp{Eks eemax}.
+
+@node Q1.0.9, Q1.0.10, Q1.0.8, Introduction
+@section What does XEmacs look like?
+
+Screen snapshots are available in the WWW version of the FAQ.
+
+@node Q1.0.10, Q1.0.11, Q1.0.9, Introduction
+@section Is there a port of XEmacs to Microsoft ('95 or NT)?
+
+The closest is @dfn{Win-Emacs}, which is based on Lucid Emacs 19.6.
+Available from <URL:http://www.pearlsoft.com/>.  Someone at Microsoft
+expressed some interest in working on a port of 19.14 to NT, but never
+went any farther.
+
+There's a port of GNU Emacs (not XEmacs) at
+@example
+<URL:http://www.cs.washington.edu/homes/voelker/ntemacs.html>.
+@end example
+
+@node Q1.0.11, Q1.0.12, Q1.0.10, Introduction
+@section Is there a port of XEmacs to the Macintosh?
+
+There has been a port to the MachTen environment of XEmacs 19.13, but no
+patches have been submitted to the maintainers to get this in the
+mainstream distribution.
+
+@node Q1.0.12, Q1.0.13, Q1.0.11, Introduction
+@section Is there a port of XEmacs to NextStep?
+
+Carl Edman, apparently no longer at <cedman@@princeton.edu>, did the
+port of GNU Emacs to NeXTstep and expressed interest in doing the XEmacs
+port, but never went any farther.
+
+@node Q1.0.13, Q1.1.1, Q1.0.12, Introduction
+@section Is there a port of XEmacs to OS/2?
+
+No, and there is no news of anyone working on it.
+
+@node Q1.1.1, Q1.1.2, Q1.0.13, Introduction
+@section What is the FAQ editorial policy?
+
+The FAQ is actively maintained and modified regularly.  All links should
+be up to date.
+
+Changes are displayed on a monthly basis.  @dfn{Months}, for this
+purpose are defined as the 5th of the month through the 5th of the
+month.  Preexisting questions that have been changed are marked as such.
+Brand new questions are tagged.
+
+All submissions are welcome.  E-mail submissions to
+<steve@@altair.xemacs.org>.
+
+Please make sure that @samp{XEmacs FAQ} appears on the Subject: line.
+If you think you have a better way of answering a question, or think a
+question should be included, I'd like to hear about it.  Questions and
+answers included into the FAQ will be edited for spelling and grammar,
+and will be attributed.  Answers appearing without attribution are
+either from versions of the FAQ dated before May 1996, or are from one
+of the four people listed at the top of this document.  Answers quoted
+from Usenet news articles will always be attributed, regardless of the
+author.
+
+@node Q1.1.2, Q1.1.3, Q1.1.1, Introduction
+@section How do I become a Beta Tester?
+
+Send an email message to <xemacs-beta-request@@xemacs.org> with a
+subject line of @samp{subscribe}.  Fill out and return the questionaire
+you get back, and you will receive the password to get at the current
+beta.
+
+Be prepared to get your hands dirty, as beta testers are expected to
+identify problems as best they can.
+
+@node Q1.1.3, Q1.2.1, Q1.1.2, Introduction
+@section How do I contribute to XEmacs itself?
+
+Ben Wing <ben@@666.com> writes:
+
+@quotation
+BTW if you have a wish list of things that you want added, you have to
+speak up about it!  More specifically, you can do the following if you
+want a feature added (in increasing order of usefulness):
+
+@itemize @bullet
+@item
+Make a posting about a feature you want added.
+
+@item
+Become a beta tester and make more postings about those same features.
+
+@item
+Convince us that you're going to use the features in some cool and
+useful way.
+
+@item
+Come up with a clear and well-thought-out API concerning the features.
+
+@item
+Write the code to implement a feature and send us a patch.
+@end itemize
+
+(not that we're necessarily requiring you to write the code, but we can
+always hope :)
+@end quotation
+
+@node Q1.2.1, Q1.2.2, Q1.1.3, Introduction
+@section Who wrote XEmacs?
+
+XEmacs is the result of the time and effort of many people.  The
+developers responsible for the 19.15/20.0 release are:
+
+@itemize @bullet
+@item Martin Buchholz <mrb@@eng.sun.com>
+
+@item Steve Baur <steve@@altair.xemacs.org>
+@end itemize
+
+The developers responsible for the 19.14 release are:
+
+@itemize @bullet
+@item Chuck Thompson <cthomp@@xemacs.org>
+
+Chuck was Mr. XEmacs from 19.11 through 19.14, and is responsible
+for XEmacs becoming a widely distributed program over the Internet.
+
+@item Ben Wing <ben@@666.com>
+@end itemize
+
+Jamie Zawinski was Mr. Lucid Emacs from 19.0 through 19.10, the last
+release actually named Lucid Emacs.  Richard Mlynarik was crucial to
+most of those releases.
+
+@itemize @bullet
+@item Jamie Zawinski <jwz@@netscape.com>
+
+@item Richard Mlynarik <mly@@adoc.xerox.com>
+@end itemize
+
+Along with many other contributors, partially enumerated in the
+@samp{About XEmacs} option in the Help menu.
+
+@node Q1.2.2, Q1.2.3, Q1.2.1, Introduction
+@section Who contributed to this version of the FAQ?
+
+The following people contributed valuable suggestions to building this
+version of the FAQ (listed in alphabetical order):
+
+@itemize @bullet
+@item Per Abrahamsen <abraham@@dina.kvl.dk>
+
+@item Vladimir Alexiev <vladimir@@cs.ualberta.ca>
+
+@item Martin Buchholz <Martin.Buchholz@@sun.com>
+
+@item Brian Denheyer <briand@@iccom.com>
+
+@item Markus Gutschke <gutschk@@ESCHER.UNI-MUENSTER.DE>
+
+@item David Kastrup <dak@@fsnif.neuroinformatik.ruhr-uni-bochum.de>
+
+@item Natalie Kershaw <nataliek@@rd.scitec.com.au>
+
+@item John Turner <turner@@lanl.gov>
+
+@item David Vanderschel <DvdS@@eden.com>
+@end itemize
+
+@node Q1.2.3, Q1.3.1, Q1.2.2, Introduction
+@section Who contributed to the FAQ in the past?
+
+This is only a partial list, as many names were lost in a hard disk
+crash some time ago.
+
+@itemize @bullet
+@item Curtis.N.Bingham <binge@@aloft.att.com>
+
+@item Richard Caley <rjc@@cogsci.ed.ac.uk>
+
+@item William G. Dubuque <wgd@@martigny.ai.mit.edu>
+
+@item Eric Eide <eeide@@cs.utah.edu>
+
+@item Chris Flatters <cflatter@@nrao.edu>
+
+@item Evelyn Ginsparg <ginsparg@@adra.com>
+
+@item Marty Hall <hall@@aplcenmp.apl.jhu.edu>
+
+@item Arup Mukherjee <arup+@@cmu.edu>
+
+@item Juergen Nickelsen <nickel@@prz.tu-berlin.de>
+
+@item Kevin R. Powell <powell@@csl.ncsa.uiuc.edu>
+
+@item Stig <stig@@hackvan.com>
+@end itemize
+
+@node Q1.3.1, Q1.3.2, Q1.2.3, Introduction
+@section What is the status of XEmacs v20?
+
+XEmacs v20 is the version of XEmacs that includes MULE (Asian-language)
+support.  It's currently in late beta and the tentative release date for
+20.0 is for mid February.  When compiled without MULE support 20.0 is
+currently very similar to 19.15 (except for some changes to the
+byte-code format, some new primitive types including @code{char},
+@code{char-table}, and @code{range-table}) and equally stable.
+
+@node Q1.3.2, Q1.3.3, Q1.3.1, Introduction
+@section What is the status of Asian-language support, aka MULE?
+
+The MULE support works OK but still needs a fair amount of work before
+it's really solid.  We could definitely use some help here, esp. people
+who speak Japanese and will use XEmacs/MULE to work with Japanese and
+have some experience with E-Lisp.  Martin Buchholz
+<Martin.Buchholz@@sun.com> is working full-time on this currently.  If
+you can help out here, @xref{Q1.1.2}.
+
+@node Q1.3.3, Q1.3.4, Q1.3.2, Introduction
+@section How do I type non-ASCII characters?
+
+See question 3.5.7 (@xref{Q3.5.7}) in part 3 of this FAQ.
+
+@node Q1.3.4, Q1.3.5, Q1.3.3, Introduction
+@section Can XEmacs messages come out in a different language?
+
+The message-catalog support has mostly been written but doesn't
+currently work.  The first release of XEmacs 20 will @emph{not} support
+it.  However, menubar localization @emph{does} work, even in 19.14.  To
+enable it, add to your @file{Emacs} file entries like this:
+
+@example
+Emacs*XlwMenu.resourceLabels:			True
+Emacs*XlwMenu.file.labelString:	        	Fichier
+Emacs*XlwMenu.openInOtherWindow.labelString: 	In anderem Fenster offnen
+@end example
+
+The name of the resource is derived from the non-localized entry by
+removing punctuation and capitalizing as above.  Martin Buchholz
+<Martin.Buchholz@@sun.com> is working on adding support for Asian
+language menubar localization to XEmacs 20.
+
+@node Q1.3.5, Q1.3.6, Q1.3.4, Introduction
+@section Please explain the various input methods in MULE/XEmacs 20.0
+
+MORIOKA Tomohiko <morioka@@jaist.ac.jp> writes:
+
+@quotation
+Original Mule supports following input methods: Wnn4, Wnn6, Canna, SJ3
+and XIM. Interfaces for Wnn and SJ3 uses the @code{egg} user
+interface. Interface for Canna does not use @samp{egg}. I don't know
+about XIM. It is to support ATOK, of course, it may work for another
+servers.
+
+Wnn supports Japanese, Chinese and Korean. It is made by OMRON and Kyôto
+university. It is a powerful and complex system.  Wnn4 is free and Wnn6
+is not free.
+
+Canna supports only Japanese. It is made by NEC. It is a simple and
+powerful system. Canna uses only grammar (Wnn uses grammar and
+probability between words), so I think Wnn is cleverer than Canna,
+however Canna users made a good grammar and dictionary.  So for standard
+modern Japanese, Canna seems cleverer than Wnn4. In addition, the UNIX
+version of Canna is free (now there is a Microsoft Windows version).
+
+SJ3 supports only Japanese. It is made by Sony.  XIM supports was made
+to use ATOK (a major input method in personal computer world).  XIM is
+the standard for accessing input methods bundled in Japanese versions of
+Solaris.  (XEmacs 20 will support XIM input).
+
+Egg consists of following parts:
+
+@enumerate
+@item Input character Translation System (ITS) layer.
+It translates ASCII inputs to Kana/PinYin/Hangul characters.
+
+@item Kana/PinYin/Hangul to Kanji transfer layer.
+It is
+interface layer for network Kana-Kanji server (Wnn and Sj3).
+@end enumerate
+
+These input methods are modal, namely there are mode, alphabet mode and
+Kana-Kanji transfer mode.  However there are mode-less input methods for
+Egg and Canna.  @samp{Boiled-egg} is a mode-less input method running on
+Egg.  For Canna, @samp{canna.el} has a tiny boiled-egg like command,
+@code{(canna-boil)}, and there are some boiled-egg like utilities.  In
+addition, it was planned to make an abstraction for all transfer type
+input methods.  However authors of input methods are busy, so maybe this
+plan is stopped.  Perhaps after Mule merged GNU Emacs will be released,
+it will be continued.
+@end quotation
+
+@node Q1.3.6, Q1.3.7, Q1.3.5, Introduction
+@section How do I portably code for MULE/XEmacs 20.0?
+
+MORIOKA Tomohiko <morioka@@jaist.ac.jp> writes:
+
+@quotation
+MULE and XEmacs are quite different. So the application
+implementor must write separate code for these mule variants.
+
+MULE and the next version of Emacs are similar but the symbols are very
+different---requiring separate code as well.
+
+Namely we must support 3 kinds of mule variants and 4 or 5 or 6 kinds of
+emacs variants... (;_;) I'm shocked, so I wrote a wrapper package called
+@code{emu} to provide a common interface.
+
+I have the following suggestions about dealing with mule variants:
+
+@itemize @bullet
+@item
+@code{(featurep 'mule)} @code{t} on all mule variants
+
+@item
+@code{(boundp 'MULE)} is @code{t} on only MULE.  Maybe the next version
+of Emacs will not have this symbol.
+
+@item
+MULE has a variable @code{mule-version}.  Perhaps the next version of
+Emacs will have this variable as well.
+@end itemize
+
+Following is a sample to distinguish mule variants:
+
+@lisp
+(if (featurep 'mule)
+    (cond ((boundp 'MULE)
+           ;; for original Mule
+           )
+	  ((string-match "XEmacs" emacs-version)
+	   ;; for XEmacs with Mule
+	   )
+	  (t
+	   ;; for next version of Emacs
+	   ))
+  ;; for old emacs variants
+  )
+@end lisp
+@end quotation
+
+@node Q1.3.7, Q1.4.1, Q1.3.6, Introduction
+@section How about Cyrillic Modes?
+
+Ilya Zakharevich <ilya@@math.ohio-state.edu> writes:
+
+@quotation
+There is a cyrillic mode in the file @file{mysetup.zip} in
+<URL:ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs/>.  This is a
+modification to Valery Alexeev's <ava@@math.jhu.ed> @file{russian.el}
+which can be obtained from
+<URL:ftp://tut.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/russian.el.Z>.
+@end quotation
+
+Dima Barsky <d.barsky@@ee.surrey.ac.uk> writes:
+
+@quotation
+There is another cyrillic mode for both GNU Emacs and XEmacs by Dmitrii
+(Mitya) Manin <manin@@camelot.mssm.edu> at
+<URL:http://camelot.mssm.edu/~manin/cyr.el>.
+@end quotation
+
+@node Q1.4.1, Q1.4.2, Q1.3.7, Introduction
+@section What is a @file{.emacs} and is there a sample one?
+
+The @file{.emacs} file is used to customize XEmacs to your tastes.  No
+two are alike, nor are they expected to be alike, but that's the point.
+The XEmacs distribution contains an excellent starter example in the etc
+directory called @file{sample.emacs}.  Copy this file from there to your
+home directory and rename it @file{.emacs}.  Then edit it to suit.
+
+Starting with 19.14, you may bring the @file{sample.emacs} into an
+XEmacs buffer by selecting @samp{Help->Sample .emacs} from the menubar.
+To determine the location of the @file{etc} directory type the command
+@kbd{C-h v data-directory RET}.
+
+@node Q1.4.2, Q1.4.3, Q1.4.1, Introduction
+@section Can I use the same @file{.emacs} with the other Emacs?
+
+Yes.  The sample @file{.emacs} included in the XEmacs distribution will
+show you how to handle different versions and flavors of Emacs.
+
+@node Q1.4.3, Q1.4.4, Q1.4.2, Introduction
+@section Any good tutorials around?
+
+There's the XEmacs tutorial available from the Help Menu, or by typing
+@kbd{C-h t}.
+
+There's an Emacs Lisp tutorial at
+
+@example
+<URL:ftp://prep.ai.mit.edu/pub/gnu/emacs-lisp-intro-1.04.tar.gz>.
+@end example
+
+Erik Sundermann <erik@@petaxp.rug.ac.be> has made a tutorial web page at
+<URL:http://petaxp.rug.ac.be/~erik/xemacs/>.
+
+@node Q1.4.4, Q1.4.5, Q1.4.3, Introduction
+@section May I see an example of a useful XEmacs Lisp function?
+
+The following function does a little bit of everything useful.  It does
+something with the prefix argument, it examines the text around the
+cursor, and it's interactive so it may be bound to a key.  It inserts
+copies of the current word the cursor is sitting on at the cursor.  If
+you give it a prefix argument: @kbd{C-u 3 M-x double-word} then it will
+insert 3 copies.
+
+@lisp
+(defun double-word (count)
+  "Insert a copy of the current word underneath the cursor"
+  (interactive "*p")
+  (let (here there string)
+    (save-excursion
+      (forward-word -1)
+      (setq here (point))
+      (forward-word 1)
+      (setq there (point))
+      (setq string (buffer-substring here there)))
+    (while (>= count 1)
+      (progn
+	(insert string)
+	(setq count (1- count))))))
+@end lisp
+
+The best way to see what is going on here is to let XEmacs tell you.
+Put the code into an XEmacs buffer, and do a @kbd{C-h f} with the cursor
+sitting just to the right of the function you want explained.  Eg.  move
+the cursor to the SPACE between @code{interactive} and @samp{"*p"} and
+hit @kbd{C-h f} to see what the function @code{interactive} does.  Doing
+this will tell you that the @code{*} requires a writable buffer, and
+@code{p} converts the prefix argument to a number, and
+@code{interactive} allows you to execute the command with @kbd{M-x}.
+
+@node Q1.4.5, Q1.4.6, Q1.4.4, Introduction
+@section And how do I bind it to a key?
+
+To bind to a key do:
+
+@lisp
+(global-set-key "\C-cd" 'double-word)
+@end lisp
+
+Or interactively, @kbd{M-x global-set-key} and follow the prompts.
+
+Jari Aalto has written a guide to Emacs keys binding, available at
+<URL:ftp://cs.uta.fi/pub/ssjaaa/ema-keys.gui>.
+
+@node Q1.4.6, Q1.4.7, Q1.4.5, Introduction
+@section What's the difference between a macro and a function?
+
+Quoting from the Lisp Reference (a.k.a @dfn{lispref}) Manual:
+
+@dfn{Macros} enable you to define new control constructs and other
+language features.  A macro is defined much like a function, but instead
+of telling how to compute a value, it tells how to compute another Lisp
+expression which will in turn compute the value.  We call this
+expression the @dfn{expansion} of the macro.
+
+Macros can do this because they operate on the unevaluated expressions
+for the arguments, not on the argument values as functions do.  They can
+therefore construct an expansion containing these argument expressions
+or parts of them.
+
+@node Q1.4.7,  , Q1.4.6, Introduction
+@section How come options saved with 19.13 don't work with 19.14 or 20.0?
+
+There's a problem with options of the form:
+
+@lisp
+(add-spec-list-to-specifier (face-property 'searchm-field 'font)
+                            '((global (nil))))
+@end lisp
+
+saved by a 19.13 XEmacs that causes a 19.14 XEmacs grief.  You must
+delete these options.  19.14 and later no longer write the options
+directly to @file{.emacs} which should allow us to deal with version
+incompatibilities better in the future.
+
+Options saved under XEmacs 19.13 are protected by code that specifically
+requires a version 19 XEmacs.  This won't be a problem unless you're
+testing XEmacs v20.  You should consider changing the code to read:
+
+@lisp
+(cond
+ ((and (string-match "XEmacs" emacs-version)
+       (boundp 'emacs-major-version)
+       (or (and (= emacs-major-version 19)
+                (>= emacs-minor-version 12))
+           (>= emacs-major-version 20)))
+ ...
+@end lisp
+
+@node Installation, Customization, Introduction, Top
+@chapter Installation and Trouble Shooting
+
+This is part 2 of the XEmacs Frequently Asked Questions list.  This
+section is devoted to Installation, Maintenance and Trouble Shooting.
+
+@menu
+Installation:
+* Q2.0.1::      Running XEmacs without installing.
+* Q2.0.2::      XEmacs is too big.
+* Q2.0.3::      Compiling XEmacs with Netaudio.
+* Q2.0.4::      Problems with Linux and ncurses.
+* Q2.0.5::      Do I need X11 to run XEmacs?
+* Q2.0.6::      I'm having strange crashes.  What do I do?
+* Q2.0.7::      Libraries in non-standard locations.
+* Q2.0.8::      can't resolve symbol _h_errno
+* Q2.0.9::      Where do I find external libraries?
+* Q2.0.10::     After I run configure I find a coredump, is something wrong?
+* Q2.0.11::     XEmacs can't resolve host names.
+* Q2.0.12::     Why can't I strip XEmacs?
+* Q2.0.13::     Can't link XEmacs on Solaris with Gcc.
+
+Trouble Shooting:
+* Q2.1.1::      XEmacs just crashed on me!
+* Q2.1.2::      Cryptic Minibuffer messages.
+* Q2.1.3::      Translation Table Syntax messages at Startup.
+* Q2.1.4::      Startup warnings about deducing proper fonts?
+* Q2.1.5::      XEmacs cannot connect to my X Terminal.
+* Q2.1.6::      XEmacs just locked up my Linux X server.
+* Q2.1.7::      HP Alt key as Meta.
+* Q2.1.8::      got (wrong-type-argument color-instance-p nil)!
+* Q2.1.9::      XEmacs causes my OpenWindows 3.0 server to crash.
+* Q2.1.10::     Warnings from incorrect key modifiers.
+* Q2.1.11::     @samp{wrong type argument: bufferp, "......"}.
+* Q2.1.12::     Regular Expression Problems on DEC OSF1.
+* Q2.1.13::     HP/UX 10.10 and @code{create_process} failure
+* Q2.1.14::     @kbd{C-g} doesn't work for me.  Is it broken?
+* Q2.1.15::     How to debug an XEmacs problem with a debugger.
+* Q2.1.16::     XEmacs crashes in @code{strcat} on HP/UX 10.
+* Q2.1.17::     @samp{Marker does not point anywhere}.
+* Q2.1.18::     19.14 hangs on HP/UX 10.10.
+* Q2.1.19::     XEmacs does not follow the local timezone.
+* Q2.1.20::     @samp{Symbol's function definition is void: hkey-help-show.}
+* Q2.1.21::     Every so often the XEmacs frame freezes.
+@end menu
+
+@node Q2.0.1, Q2.0.2, Installation, Installation
+@section Running XEmacs without installing
+
+The @file{INSTALL} file says that up to 108 MB of space is needed
+temporarily during installation!  How can I just try it out?
+
+XEmacs will run in place without requiring installation and copying of
+the Lisp directories, and without having to specify a special build-time
+flag.  It's the copying of the Lisp directories that requires so much
+space.  XEmacs is largely written in Lisp.
+
+A good method is to make a shell alias for xemacs:
+
+@example
+alias xemacs=/i/xemacs-19.14/src/xemacs
+@end example
+
+(You will obviously use whatever directory you downloaded the source
+tree to instead of @file{/i/xemacs-19.14}).
+
+This will let you run XEmacs without massive copying.
+
+@node Q2.0.2, Q2.0.3, Q2.0.1, Installation
+@section XEmacs is too big
+
+Steve Baur <steve@@altair.xemacs.org> writes:
+
+@quotation
+The 45MB of space required by the installation directories can be
+reduced dramatically if desired.  Gzip all the .el files.  Remove all
+the packages you'll never want to use (or even ones you do like the two
+obsolete mailcrypts and Gnus 4 in 19.13).  Remove the TexInfo manuals.
+Remove the Info (and use just hardcopy versions of the manual).  Remove
+most of the stuff in etc.  Remove or gzip all the source code.  Gzip or
+remove the C source code.  Configure it so that copies are not made of
+the support lisp.  I'm not advocating any of these things, just pointing
+out ways to reduce the disk requirements if desired.
+
+Now examine the space used by directory:
+
+@example
+0	/usr/local/bin/xemacs
+2048	/usr/local/bin/xemacs-19.13
+
+1546	/usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2
+1158	/usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13
+@end example
+
+You need to keep these.  XEmacs isn't stripped by default in
+installation, you should consider stripping.  That will save you about
+5MB right there.
+
+@example
+207	/usr/local/lib/xemacs-19.13/etc/w3
+122	/usr/local/lib/xemacs-19.13/etc/sounds
+18	/usr/local/lib/xemacs-19.13/etc/sparcworks
+159	/usr/local/lib/xemacs-19.13/etc/vm
+6	/usr/local/lib/xemacs-19.13/etc/e
+21	/usr/local/lib/xemacs-19.13/etc/eos
+172	/usr/local/lib/xemacs-19.13/etc/toolbar
+61	/usr/local/lib/xemacs-19.13/etc/ns
+43	/usr/local/lib/xemacs-19.13/etc/gnus
+@end example
+
+These are support directories for various packages.  In general they
+match a directory under ./xemacs-19.13/lib/xemacs-19.13/lisp/.  If you
+do not require the package, you may delete or gzip the support too.
+
+@example
+1959	/usr/local/lib/xemacs-19.13/etc
+175	/usr/local/lib/xemacs-19.13/lisp/bytecomp
+340	/usr/local/lib/xemacs-19.13/lisp/calendar
+342	/usr/local/lib/xemacs-19.13/lisp/comint
+517	/usr/local/lib/xemacs-19.13/lisp/dired
+42	/usr/local/lib/xemacs-19.13/lisp/electric
+212	/usr/local/lib/xemacs-19.13/lisp/emulators
+238	/usr/local/lib/xemacs-19.13/lisp/energize
+289	/usr/local/lib/xemacs-19.13/lisp/gnus
+457	/usr/local/lib/xemacs-19.13/lisp/ilisp
+1439	/usr/local/lib/xemacs-19.13/lisp/modes
+2276	/usr/local/lib/xemacs-19.13/lisp/packages
+1040	/usr/local/lib/xemacs-19.13/lisp/prim
+176	/usr/local/lib/xemacs-19.13/lisp/pcl-cvs
+154	/usr/local/lib/xemacs-19.13/lisp/rmail
+3	/usr/local/lib/xemacs-19.13/lisp/epoch
+45	/usr/local/lib/xemacs-19.13/lisp/term
+860	/usr/local/lib/xemacs-19.13/lisp/utils
+851	/usr/local/lib/xemacs-19.13/lisp/vm
+13	/usr/local/lib/xemacs-19.13/lisp/vms
+157	/usr/local/lib/xemacs-19.13/lisp/x11
+19	/usr/local/lib/xemacs-19.13/lisp/tooltalk
+14	/usr/local/lib/xemacs-19.13/lisp/sunpro
+291	/usr/local/lib/xemacs-19.13/lisp/games
+198	/usr/local/lib/xemacs-19.13/lisp/edebug
+619	/usr/local/lib/xemacs-19.13/lisp/w3
+229	/usr/local/lib/xemacs-19.13/lisp/eos
+55	/usr/local/lib/xemacs-19.13/lisp/iso
+59	/usr/local/lib/xemacs-19.13/lisp/mailcrypt
+187	/usr/local/lib/xemacs-19.13/lisp/eterm
+356	/usr/local/lib/xemacs-19.13/lisp/ediff
+408	/usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl
+1262	/usr/local/lib/xemacs-19.13/lisp/hyperbole
+247	/usr/local/lib/xemacs-19.13/lisp/hm--html-menus
+161	/usr/local/lib/xemacs-19.13/lisp/mh-e
+299	/usr/local/lib/xemacs-19.13/lisp/viper
+53	/usr/local/lib/xemacs-19.13/lisp/oobr/tree-x
+4	/usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib
+3	/usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib
+3	/usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib
+11	/usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj
+53	/usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx
+466	/usr/local/lib/xemacs-19.13/lisp/oobr
+14142	/usr/local/lib/xemacs-19.13/lisp
+@end example
+
+These are all Emacs Lisp source code and bytecompiled object code.  You
+may safely gzip everything named *.el here.  You may remove any package
+you don't use.  @emph{Nothing bad will happen if you delete a package
+that you do not use}.  You must be sure you do not use it though, so be
+conservative at first.
+
+Possible candidates for deletion include w3 (newer versions exist, or
+you may just use Lynx or Netscape for web browsing), games, hyperbole,
+mh-e, hm--html-menus (better packages exist), vm, viper, oobr, gnus (new
+versions exist), etc.  Ask yourself, @emph{Do I ever want to use this
+package?}  If the answer is no, then it is a candidate for removal.
+
+First, gzip all the .el files.  Then go about package by package and
+start gzipping the .elc files.  Then run XEmacs and do whatever it is
+you normally do.  If nothing bad happens, then delete the directory.  Be
+conservative about deleting directories, and it would be handy to have a
+backup tape around in case you get too zealous.
+
+@file{prim}, @file{modes}, @file{packages}, and @file{utils} are four
+directories you definitely do @strong{not} want to delete, although
+certain packages can be removed from them if you do not use them.
+
+@example
+1972	/usr/local/lib/xemacs-19.13/info
+@end example
+
+These are online texinfo sources.  You may either gzip them or remove
+them.  In either case, @kbd{C-h i} (info mode) will no longer work.
+
+@example
+20778	/usr/local/lib/xemacs-19.13
+@end example
+
+The 20MB achieved is less than half of what the full distribution takes up,
+@strong{and} can be achieved without deleting a single file.
+@end quotation
+
+giacomo boffi <boffi@@hp735.stru.polimi.it> provides this procedure:
+
+@quotation
+Substitute @file{/usr/local/lib/} with the path where the xemacs tree is
+rooted, then use this script:
+
+@example
+#!/bin/sh
+
+r=/usr/local/lib/xemacs-19.13/lisp
+
+cd $r ; rm -f cmpr ; touch cmpr
+
+du -s .
+
+for d in * ; do
+  if test -d $d ; then
+    cd $d
+    for f in *.el ; do
+#     compress (remove) only (ONLY) the sources that have a
+#     corresponding compiled file --- do not (DO NOT) touch other
+#     sources
+      if test -f $@{f@}c ; then gzip -v9 $f >> $r/cmpr ; fi
+    done
+    cd ..
+  fi
+done
+
+du -s .
+@end example
+
+A step beyond would be substituting @samp{rm -f} for @samp{gzip -v9},
+but you have to be desperate for removing the sources (remember that
+emacs can access compressed files transparently).
+
+Also, a good megabyte could easily be trimmed from the $r/../etc
+directory, e.g., the termcap files, some O+NEWS, others that I don't
+remember as well.
+@end quotation
+
+@node Q2.0.3, Q2.0.4, Q2.0.2, Installation
+@section Compiling XEmacs with Netaudio.
+
+What is the best way to compile XEmacs with the netaudio system, since I
+have got the netaudio system compiled but installed at a weird place, I
+am not root.  Also in the READMEs it does not say anything about
+compiling with the audioserver?
+
+You should only need to add some stuff to the configure command line.
+To tell it to compile in netaudio support: @samp{--with-sound=both}, or
+@samp{--with-sound=nas} if you don't want native sound support for some
+reason.) To tell it where to find the netaudio includes and libraries:
 
 @example
-xemacs-request@@cs.uiuc.edu
+--site-libraries=WHATEVER
+--site-includes=WHATEVER
+@end example
+
+Then (fingers crossed) it should compile and it will use netaudio if you
+have a server running corresponding to the X server. The netaudio server
+has to be there when XEmacs starts. If the netaudio server goes away and
+another is run, XEmacs should cope (fingers crossed, error handling in
+netaudio isn't perfect).
+
+BTW, netaudio has been renamed as it has a name clash with something
+else, so if you see references to NAS or Network Audio System, it's the
+same thing.  It also might be found at
+<URL:ftp.x.org:/contrib/audio/nas/>.
+
+@node Q2.0.4, Q2.0.5, Q2.0.3, Installation
+@section Problems with Linux and ncurses.
+
+On Linux 1.3.98 with termcap 2.0.8 and the ncurses that came with libc
+5.2.18, xemacs 20.0b20 is unable to open a tty device:
+
+@example
+src/xemacs -nw -q
+Initialization error: Terminal type `xterm' undefined (or can't access database?)
+@end example
+
+Ben Wing <ben@@666.com&gt writes:
+
+@quotation
+Your ncurses configuration is messed up.  Your /usr/lib/terminfo is a
+bad pointer, perhaps to a CD-ROM that is not inserted.
+@end quotation
+
+@node Q2.0.5, Q2.0.6, Q2.0.4, Installation
+@section Do I need X11 to run XEmacs?
+
+No.  The name @dfn{XEmacs} is unfortunate in the sense that it is
+@strong{not} an X Window System-only version of Emacs.  Starting with
+19.14 XEmacs has full color support on a color capable character
+terminal.
+
+@node Q2.0.6, Q2.0.7, Q2.0.5, Installation
+@section I'm having strange crashes.  What do I do?
+
+There have been a variety of reports of crashes due to compilers with
+buggy optimizers.  Please see the @file{PROBLEMS} file that comes with
+XEmacs to read what it says about your platform.
+
+@node Q2.0.7, Q2.0.8, Q2.0.6, Installation
+@section Libraries in non-standard locations
+
+I have x-faces, jpeg, xpm etc. all in different places.  I've tried
+space-separated, comma-separated, several --site-libraries, all to no
+avail.
+
+@example
+--site-libraries='/path/one /path/two /path/etc'
+@end example
+
+@node Q2.0.8, Q2.0.9, Q2.0.7, Installation
+@section can't resolve symbol _h_errno
+
+You are using the Linux/ELF distribution of XEmacs 19.14, and your ELF
+libraries are out of date.  You have the following options:
+
+@enumerate
+@item
+Upgrade your libc to at least 5.2.16 (better is 5.2.18, 5.3.12, or
+5.4.10).
+
+@item
+Patch the XEmacs binary by replacing all occurrences of
+@samp{_h_errno^@@} with @samp{h_errno^@@^@@}.  Any version of Emacs will
+suffice.  If you don't understand how to do this, don't do it.
+
+@item
+Rebuild XEmacs yourself -- any working ELF version of libc should be
+O.K.
+@end enumerate
+
+Hrvoje Niksic <hniksic@@srce.hr> writes:
+
+@quotation
+Why not use a Perl one-liner for No. 2?
+
+@example
+perl -pi -e 's/_h_errno\0/h_errno\0\0/g' /usr/local/bin/xemacs-19.14
+@end example
+
+NB: You @emph{must} patch @file{/usr/local/bin/xemacs-19.14}, and not
+@file{xemacs} because @file{xemacs} is a link to @file{xemacs-19.14};
+the Perl @samp{-i} option will cause unwanted side-effects if applied to
+a symbolic link.
+@end quotation
+
+@node Q2.0.9, Q2.0.10, Q2.0.8, Installation
+@section Where do I find external libraries?
+
+All external libraries used by XEmacs can be found at the XEmacs FTP
+site <URL:ftp://ftp.xemacs.org/pub/aux/>.
+
+The canonical locations are as follows:
+
+@table @asis
+@item JPEG
+<URL:ftp://ftp.netcom.com/pub/tg/tgl/uunet/>, mirrored at
+<URL:ftp://ftp.uu.net/graphics/jpeg/>.  Version 6a is current.
+
+@item XPM
+<URL:ftp://ftp.x.org/contrib/libraries/>.  Version 3.4j is current.
+Older versions of this package are known to cause XEmacs crashes.
+
+@item TIFF
+<URL:ftp://ftp.sgi.com/graphics/tiff/>.  v3.4 is current.  The latest
+beta is v3.4b035.  There is a HOWTO here.
+
+@item PNG
+<URL:ftp://ftp.uu.net/graphics/png/>.  0.89c is current.  XEmacs
+requires a fairly recent version to avoid using temporary files.
+
+<URL:ftp://swrinde.nde.swri.edu/pub/png/src/>
+
+@item Compface
+<URL:ftp://ftp.cs.indiana.edu/pub/faces/compface/>.  This library has
+been frozen for about 6 years, and is distributed without version
+numbers.  @emph{It should be compiled with the same options that X11 was
+compiled with on your system}.  The version of this library at
+XEmacs.org includes the @file{xbm2xface.pl} script, written by
+stig@@hackvan.com, which may be useful when generating your own xface.
+
+@item NAS
+<URL:ftp://ftp.x.org/contrib/audio/nas/>.
+Version 1.2p5 is current.  There is a FAQ here.
+@end table
+
+@node Q2.0.10, Q2.0.11, Q2.0.9, Installation
+@section After I run configure I find a coredump, is something wrong?
+
+Not necessarily.  If you have GNU sed 3.0 you should downgrade it to
+2.05.  From the @file{README} at prep.ai.mit.edu:
+
+@quotation
+sed 3.0 has been withdrawn from distribution.  It has major revisions,
+which mostly seem to be improvements; but it turns out to have bugs too
+which cause trouble in some common cases.
+
+Tom Lord won't be able to work fixing the bugs until May.  So in the
+mean time, we've decided to withdraw sed 3.0 from distribution and make
+version 2.05 once again the recommended version.
+@end quotation
+
+It has also been observed that the vfork test on Solaris will leave a
+coredump.
+
+@node Q2.0.11, Q2.0.12, Q2.0.10, Installation
+@section XEmacs doesn't resolve hostnames.
+
+This is the result of a long-standing problem with SunOS and the fact
+that stock SunOS systems do not ship with DNS resolver code in libc.
+
+Christopher Davis <ckd@@loiosh.kei.com> writes:
+
+@quotation
+That's correct [The SunOS 4.1.3 precompiled binaries don't do name
+lookup].  Since Sun figured that everyone used NIS to do name lookups
+(that DNS thing was apparently only a passing fad, right?), the stock
+SunOS 4.x systems don't have DNS-based name lookups in libc.
+
+This is also why Netscape ships two binaries for SunOS 4.1.x.
+
+The best solution is to compile it yourself; the configure script will
+check to see if you've put DNS in the shared libc and will then proceed
+to link against the DNS resolver library code.
+@end quotation
+
+@node Q2.0.12, Q2.0.13, Q2.0.11, Installation
+@section Why can't I strip XEmacs?
+
+Richard Cognot <cognot@@fronsac.ensg.u-nancy.fr> writes:
+
+@quotation
+Because of the way XEmacs (and every other Emacsen, AFAIK) is built. The
+link gives you a bare-boned emacs (called temacs). temacs is then run,
+preloading some of the lisp files. The result is then dumped into a new
+executable, named xemacs, which will contain all of the preloaded lisp
+functions and data.
+
+Now, during the dump itself, the executable (code+data+symbols) is
+written on disk using a special unexec() function. This function is
+obviously heavily system dependent. And on some systems, it leads to an
+executable which, although valid, cannot be stripped without damage. If
+memory serves, this is especially the case for AIX binaries. On other
+architecture it might work OK.
+
+The Right Way to strip the emacs binary is to strip temacs prior to
+dumping xemacs. This will always work, although you can do that only if
+you install from sources (as temacs is @file{not} part of the binary
+kits).
+@end quotation
+
+Nat Makarevitch <nat@@nataa.fr.eu.org> writes:
+
+@quotation
+Here is the trick:
+
+@enumerate
+@item
+[ configure; make ]
+
+@item
+cd src
+
+@item
+rm xemacs
+
+@item
+strip temacs
+
+@item
+cd ..
+
+@item
+make
+
+@item
+cp src/xemacs /usr/local/bin/xemacs
+
+@item
+cp lib-src/DOC-19.14-XEmacs /usr/local/lib/xemacs-19.14/i586-unknown-linuxaout
+@end enumerate
+@end quotation
+
+@node Q2.0.13, Q2.1.1, Q2.0.12, Installation
+@section Problems linking with Gcc on Solaris
+
+There are known difficulties linking with Gnu ld on Solaris.  A typical
+error message might look like:
+
+@example
+unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs: 
+fatal: relocation error: 
+symbol not found: main: referenced in ../dynodump/dynodump.so
+@end example
+
+Martin Buchholz <mrb@@eng.sun.com> writes:
+
+@quotation
+You need to specify @samp{-fno-gnu-linker} as part of your flags to pass
+to ld.  Future releases of XEmacs will try to do this automatically.
+@end quotation
+
+@node Q2.1.1, Q2.1.2, Q2.0.13, Installation
+@section Help!  XEmacs just crashed on me!
+
+First of all, don't panic.  Whenever XEmacs crashes, it tries extremely
+hard to auto-save all of your files before dying. (The main time that
+this will not happen is if the machine physically lost power or if you
+killed the XEmacs process using @code{kill -9}). The next time you try
+to edit those files, you will be informed that a more recent auto-save
+file exists.  You can use @kbd{M-x recover-file} to retrieve the
+auto-saved version of the file.
+
+Starting with 19.14, you may use the command @kbd{M-x recover-session}
+after a crash to pick up where you left off.
+
+Now, XEmacs is not perfect, and there may occasionally be times, or
+particular sequences of actions, that cause it to crash.  If you can
+come up with a reproducible way of doing this (or even if you have a
+pretty good memory of exactly what you were doing at the time), the
+maintainers would be very interested in knowing about it.  Post a
+message to comp.emacs.xemacs or send mail to <crashes@@xemacs.org>.
+Please note that the @samp{crashes} address is exclusively for crash
+reports.
+
+If at all possible, include a stack backtrace of the core dump that was
+produced.  This shows where exactly things went wrong, and makes it much
+easier to diagnose problems.  To do this, you need to locate the core
+file (it's called @file{core}, and is usually sitting in the directory
+that you started XEmacs from, or your home directory if that other
+directory was not writable).  Then, go to that directory and execute a
+command like:
+
+@example
+gdb `which xemacs` core
+@end example
+
+and then issue the command @samp{where} to get the stack backtrace.  You
+might have to use @code{dbx} or some similar debugger in place of
+@code{gdb}.  If you don't have any such debugger available, complain to
+your system administrator.
+
+It's possible that a core file didn't get produced, in which case you're
+out of luck.  Go complain to your system administrator and tell him not
+to disable core files by default.  Also @xref{Q2.1.15} for tips and
+techniques for dealing with a debugger.
+
+When making a problem report make sure that:
+
+@enumerate
+@item
+Report @strong{all} of the information output by XEmacs during the
+crash.
+
+@item
+You mention what O/S & Hardware you are running XEmacs on.
+
+@item
+What version of XEmacs you are running.
+
+@item
+What build options you are using.
+
+@item
+If the problem is related to graphics, we will also need to know what
+version of the X Window System you are running, and what window manager
+you are using.
+
+@item
+If the problem happened on a tty, please include the terminal type.
+@end enumerate
+
+@node Q2.1.2, Q2.1.3, Q2.1.1, Installation
+@section Cryptic Minibuffer messages.
+
+When I try to use some particular option of some particular package, I
+get a cryptic error in the minibuffer.
+
+If you can't figure out what's going on, select Options/General
+Options/Debug on Error from the Menubar and then try and make the error
+happen again.  This will give you a backtrace that may be enlightening.
+If not, try reading through this FAQ; if that fails, you could try
+posting to comp.emacs.xemacs (making sure to include the backtrace) and
+someone may be able to help.  If you can identify which Emacs lisp
+source file the error is coming from you can get a more detailed stack
+backtrace by doing the following:
+
+@enumerate
+@item
+Visit the .el file in an XEmacs buffer.
+
+@item
+Issue the command @kbd{M-x eval-current-buffer}.
+
+@item
+Reproduce the error.
+@end enumerate
+
+Depending on the version of XEmacs, you may either select Edit->Show
+Messages (19.13 and earlier) or Help->Recent Keystrokes/Messages (19.14
+and later) from the menubar to see the most recent messages.  This
+command is bound to @kbd{C-h l} by default.
+
+@node Q2.1.3, Q2.1.4, Q2.1.2, Installation
+@section Translation Table Syntax messages at Startup
+
+I get tons of translation table syntax error messages during startup.
+How do I get rid of them?
+
+There are two causes of this problem.  The first usually only strikes
+people using the prebuilt binaries.  The culprit in both cases is the
+file @file{XKeysymDB}.
+
+@itemize @bullet
+@item
+The binary cannot find the @file{XKeysymDB} file.  The location is
+hardcoded at compile time so if the system the binary was built on puts
+it a different place than your system does, you have problems.  To fix,
+set the environment variable @var{XKEYSYMDB} to the location of the
+@file{XKeysymDB} file on your system or to the location of the one
+included with XEmacs which should be at
+@file{<xemacs_root_directory>/lib/xemacs-19.14/etc/XKeysymDB}.
+
+@item
+The binary is finding the XKeysymDB but it is out-of-date on your system
+and does not contain the necessary lines.  Either ask your system
+administrator to replace it with the one which comes with XEmacs (which
+is the stock R6 version and is backwards compatible) or set your
+@var{XKEYSYMDB} variable to the location of XEmacs's described above.
+@end itemize
+
+@node Q2.1.4, Q2.1.5, Q2.1.3, Installation
+@section Startup warnings about deducing proper fonts?
+
+How can I avoid the startup warnings about deducing proper fonts?
+
+This is highly dependent on your installation, but try with the
+following font as your base font for XEmacs and see what it does:
+
+@example
+-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
+@end example
+
+More precisely, do the following in your resource file:
+
+@example
+Emacs.default.attributeFont: -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
 @end example
 
-for subscription information and 
+If you just don't want to see the @samp{*Warnings*} buffer at startup
+time, you can set this:
+
+@lisp
+(setq display-warning-minimum-level 'error)
+@end lisp
+
+The buffer still exists; it just isn't in your face.
+
+@node Q2.1.5, Q2.1.6, Q2.1.4, Installation
+@section XEmacs cannot connect to my X Terminal!
+
+Help!  I can not get XEmacs to display on my Envizex X-terminal!
+
+Try setting the @var{DISPLAY} variable using the numeric IP address of
+the host you are running XEmacs from.
+
+@node Q2.1.6, Q2.1.7, Q2.1.5, Installation
+@section XEmacs just locked up my Linux X server!
+
+Help! XEmacs just locked up my X server on my Linux box!
+
+There have been several reports of the X server locking up under Linux.
+In all reported cases removing speedo and scaled fonts from the font
+path corrected the problem.  This can be done with the command
+'@code{xset}.
+
+It is possible that using a font server may also solve the problem.
+
+@node Q2.1.7, Q2.1.8, Q2.1.6, Installation
+@section HP Alt key as Meta.
+
+How can I make XEmacs recognize the Alt key of my HP workstation as a
+Meta key?
+
+Put the following line into a file and load it with xmodmap(1) before
+starting XEmacs:
+
+@example
+remove Mod1 = Mode_switch
+@end example
+
+@node Q2.1.8, Q2.1.9, Q2.1.7, Installation
+@section got (wrong-type-argument color-instance-p nil)
+
+Natalie Kershaw <nataliek@@rd.scitec.com.au> writes:
+
+@quotation
+I am trying to run xemacs 19.13 under X11R4. Whenever I move the mouse I
+get the following error. Has anyone seen anything like this? This
+doesn't occur on X11R5.
+
+@lisp
+Signalling: (error "got (wrong-type-argument color-instance-p nil) and I don't know why!")
+@end lisp
+@end quotation
+
+dinos <map01kd@@gold.ac.uk> writes:
+
+@quotation
+I think this is due to undefined resources; You need to define color
+backgrounds and foregrounds into your @file{.../app-defaults/Emacs}
+like:
+
+@example
+*Foreground:	Black	;everything will be of black on grey95,
+*Background:	Grey95	;unless otherwise specified.
+*cursorColor:	Red3	;red3 cursor with grey95 border.
+*pointerColor:	Red3	;red3 pointer with grey95 border.
+@end example
+@end quotation
+
+Natalie Kershaw adds:
+
+@quotation
+What fixed the problem was adding some more colors to the X color
+database (copying the X11R5 colors over), and also defining the
+following resources:
+
+@example
+xemacs*cursorColor:    black
+xemacs*pointerColor:   black
+@end example
+
+With the new colours installed the problem still occurs if the above 
+resources are not defined.
+
+If the new colours are not present then an additional error occurs on 
+XEmacs startup, which says @samp{Color Red3} not defined.
+@end quotation
+
+@node Q2.1.9, Q2.1.10, Q2.1.8, Installation
+@section XEmacs causes my OpenWindows 3.0 server to crash.
+
+The OpenWindows 3.0 server is incredibly buggy.  Your best bet is to
+replace it with one from the generic MIT X11 release.  You might also
+try disabling parts of your @file{.emacs}, like enabling background
+pixmaps.
+
+@node Q2.1.10, Q2.1.11, Q2.1.9, Installation
+@section Warnings from incorrect key modifiers.
+
+The following information comes from the @file{PROBLEMS} file that comes
+with XEmacs.
+
+If you're having troubles with HP/UX it is because HP/UX defines the
+modifiers wrong in X.  Here is a shell script to fix the problem; be
+sure that it is run after VUE configures the X server.
+
+@example
+#! /bin/sh
+xmodmap 2> /dev/null - << EOF
+keysym Alt_L = Meta_L
+keysym Alt_R = Meta_R
+EOF
+
+xmodmap - << EOF
+clear mod1
+keysym Mode_switch = NoSymbol
+add mod1 = Meta_L
+keysym Meta_R = Mode_switch
+add mod2 = Mode_switch
+EOF
+@end example
+
+@node Q2.1.11, Q2.1.12, Q2.1.10, Installation
+@section @samp{wrong type argument: bufferp, "......"}.
+
+I'm using XEmacs 19.13 on Solaris 2.5. I'm having problem using the
+bookmark. When I try to set a bookmark, I always get the following error
+message:
+
+@lisp
+wrong type argument: bufferp, "......"
+@end lisp
+
+You are using the wrong version of @code{set-text-properties}.  Please
+use the one given with Q5.1.3 (@xref{Q5.1.3}).
+
+@node Q2.1.12, Q2.1.13, Q2.1.11, Installation
+@section Problems with Regular Expressions on DEC OSF1.
+
+I have xemacs 19.13 running on an alpha running OSF1 V3.2 148 and ispell
+would not run because it claimed the version number was incorrect
+although it was indeed OK. I traced the problem to the regular
+expression handler.
+
+Douglas Kosovic <douglask@@dstc.edu.au> writes:
+
+@quotation
+Actually it's a DEC cc optimisation bug that screws up the regexp
+handling in XEmacs.
+
+Rebuilding using the @samp{-migrate} switch for DEC cc (which uses a
+different sort of optimisation) works fine.
+@end quotation
+
+See @file{xemacs-19_13-dunix-3_2c.patch} at the following URL on how to
+build with the @samp{-migrate} flag:
+
+@example
+<URL:http://www-digital.cern.ch/carney/emacs/emacs.html>
+@end example
+
+NOTE: There have been a variety of other problems reported that are
+fixed in this fashion.
+
+@node Q2.1.13, Q2.1.14, Q2.1.12, Installation
+@section HP/UX 10.10 and @code{create_process} failure.
+
+Dave Carrigan <Dave.Carrigan@@ipl.ca> writes:
+
+@quotation
+With XEmacs 19.13 and HP/UX 10.10, anything that relies on the
+@code{create_process} function fails. This breaks a lot of things
+(shell-mode, compile, ange-ftp, to name a few).
+@end quotation
+
+Phil Johnson <johnson@@dtc.hp.com> writes:
+
+@quotation
+This is a problem specific to HP-UX 10.10.  It only occurs when XEmacs
+is compiled for shared libraries (the default), so you can work around
+it by compiling a statically-linked binary (run configure with
+@samp{--dynamic=no}).
+
+I'm not sure whether the problem is with a particular shared library or
+if it's a kernel problem which crept into 10.10.
+@end quotation
+
+Richard Cognot <cognot@@ensg.u-nancy.fr> writes:
+
+@quotation
+I had a few problems with 10.10. Apparently, some of them were solved by
+forcing a static link of libc (manually).
+@end quotation
+
+@node Q2.1.14, Q2.1.15, Q2.1.13, Installation
+@section @kbd{C-g} doesn't work for me.  Is it broken?
+
+Ben Wing <ben@@666.com> writes:
+
+@quotation
+@kbd{C-g} does work for most people in most circumstances.  If it
+doesn't, there are only two explanations:
+
+@enumerate
+@item
+The code is wrapped with a binding of @code{inhibit-quit} to
+@code{t}.  @kbd{Ctrl-Shift-G} should still work, I think.
+
+@item
+SIGIO is broken on your system, but BROKEN_SIGIO isn't defined.
+@end enumerate
+
+To test #2, try executing @code{(while t)} from the @samp{*scratch*}
+buffer.  If @kbd{C-g} doesn't interrupt, then you're seeing #2.
+@end quotation
+
+Morten Welinder <terra@@diku.dk> writes:
+
+@quotation
+On some (but @emph{not} all) machines a hung XEmacs can be revived by
+@code{kill -FPE <pid>}.  This is a hack, of course, not a solution.
+This technique works on a Sun4 running 4.1.3_U1.  To see if it works for
+you, start another XEmacs and test with that first.  If you get a core
+dump the method doesn't work and if you get @samp{Arithmetic error} then
+it does.
+@end quotation
+
+@node Q2.1.15, Q2.1.16, Q2.1.14, Installation
+@section How to Debug an XEmacs problem with a debugger
+
+Ben Wing <ben@@666.com> writes:
+
+@quotation
+If XEmacs does crash on you, one of the most productive things you can
+do to help get the bug fixed is to poke around a bit with the debugger.
+Here are some hints:
+
+@itemize @bullet
+@item
+First of all, if the crash is at all reproducible, consider very
+strongly recompiling your XEmacs with debugging symbols, with no
+optimization, and with the configure options @samp{--debug=yes},
+@samp{--error-checking=all}, and @samp{--dynamic=no}.  This will make
+your XEmacs run somewhat slower but make it a lot more likely to catch
+the problem earlier (closer to its source), and a lot easier to
+determine what's going on with a debugger.
+
+@item
+If you're able to run XEmacs under a debugger and reproduce the crash
+(if it's inconvenient to do this because XEmacs is already running or is
+running in batch mode as part of a bunch of scripts, consider attaching
+to the existing process with your debugger; most debuggers let you do
+this by substituting the process ID for the core file when you invoke
+the debugger from the command line, or by using the @code{attach}
+command or something similar), here are some things you can do:
+
+@item
+If XEmacs is hitting an assertion failure, put a breakpoint on
+@code{assert_failed()}.
+
+@item
+If XEmacs is hitting some weird Lisp error that's causing it to crash
+(e.g. during startup), put a breakpoint on @code{signal_1()}---this is
+declared static in eval.c.
+
+@item
+Internally, you will probably see lots of variables that hold objects of
+type @code{Lisp_Object}.  These are exactly what they appear to be,
+i.e. references to Lisp objects.  Printing them out with the debugger
+probably won't be too useful---you'll just see a number.  To decode
+them, do this:
+
+@example
+call debug_print (OBJECT)
+@end example
+
+where @var{OBJECT} is whatever you want to decode (it can be a variable,
+a function call, etc.).  This will print out a readable representation
+on the TTY from which the xemacs process was invoked.
+
+@item
+If you want to get a Lisp backtrace showing the Lisp call
+stack, do this:
+
+@example
+call debug_backtrace ()
+@end example
+
+@item
+If all you've got is a core dump, all is not lost.  You can still poke
+around somewhat, and if you're using GDB, there are some macros in the
+file @file{gdbinit} in the @file{src} directory of the XEmacs
+distribution that should make it easier for you to decode Lisp objects.
+
+If you're using DBX, you may be able to get further help from Martin
+Buchholz, the engineer at Sun who works on XEmacs.  Write to him at
+<Martin.Buchholz@@sun.com>.
+
+@item
+If you're using a debugger to get a C stack backtrace and you're seeing
+stack traces with some of the innermost frames mangled, it may be due to
+dynamic linking. (This happens especially under Linux.) Consider
+reconfiguring with @samp{--dynamic=no}.  Also, sometimes (again under
+Linux), stack backtraces of core dumps will have the frame where the
+fatal signal occurred mangled; if you can obtain a stack trace while
+running the XEmacs process under a debugger, the stack trace should be
+clean.
+
+Curtiss <1CMC3466@@ibm.mtsac.edu> suggests upgrading to ld.so version 1.8
+if dynamic linking and debugging is a problem on Linux.
+
+@item
+If you're using a debugger to get a C stack backtrace and you're
+getting a completely mangled and bogus stack trace, it's probably due to
+one of the following:
+
+@enumerate a
+@item
+Your executable has been stripped.  Bad news.  Tell your sysadmin not to
+do this---it doesn't accomplish anything except to save a bit of disk
+space, and makes debugging much much harder.
+
+@item
+Your stack is getting trashed.  Debugging this is hard; you have to do a
+binary-search-type of narrowing down where the crash occurs, until you
+figure out exactly which line is causing the problem.  Of course, this
+only works if the bug is highly reproducible.
+
+@item
+If your stack trace has exactly one frame in it, with address 0x0, this
+could simply mean that XEmacs attempted to execute code at that address,
+e.g. through jumping to a null function pointer.  Unfortunately, under
+those circumstances, GDB under Linux doesn't know how to get a stack
+trace. (Yes, this is the third Linux-related problem I've mentioned.  I
+have no idea why GDB under Linux is so bogus.  Complain to the GDB
+authors, or to comp.os.linux.development.system).  Again, you'll have to
+use the narrowing-down process described above.
+
+@item
+If you compiled 19.14 with @samp{--debug} (or by default in 19.15), you
+will get a Lisp backtrace output when XEmacs crashes, so you'll have
+something useful.  If you're in 19.13, you could try doing @code{call
+debug_backtrace()}---sometimes this works even after a fatal signal has
+been received.
+@end enumerate
+@end itemize
+@end quotation
+
+Here's some more info about using gdbinit:
+
+Different version of @code{gdbinit} are provided for different
+platforms.  One of these should be installed as @file{.gdbinit} in your
+home directory.  If you're using XEmacs 19.14 or better, you should
+install the default @code{gdbinit} in the @file{src/} directory if you
+have GDB 4.14 or better.  With GDB 4.13 or earlier, install
+@file{gdbinit.pre-4.14}; however, this is noticeably harder to use.  If
+you're on a machine that uses a union type for Lisp_Objects (only the
+DEC Alpha, I think), you'll have to use @code{gdbinit.union}, which is
+of the pre-4.14 variety but should be easily upgradable.
+
+With XEmacs 19.13 and earlier, only one @code{gdbinit} is provided (I
+think); it's of the pre-4.14 variety and of the union-type
+variety. (Many more machines used the union type under 19.13).
+
+With the GDB 4.14+ gdbinit, you can print out a Lisp_Object using
+@code{p1 OBJECT} (which calls @code{debug_print()}, and hence only works
+if you have a running process) or @code{frob OBJECT} (which works even
+on core dumps, and does its own decoding of the object, but its output
+isn't always so convenient).
+
+With the pre-GDB 4.14 gdbinit, you have to do these steps:
+
+@example
+print OBJECT
+xtype
+<then type "xcons" or "xstring" or whatever, depending on the type>
+@end example
+
+If the object is a record type, you'll probably have to the following
+steps:
+
+@example
+print OBJECT
+xtype
+xrecord
+<remember what type is printed>
+print OBJECT
+<then type "xbuffer" or "xsymbol" or whatever>
+@end example
+
+Of course, if you know in advance what type the object is of, you can
+omit all but the last two steps.
+
+@node Q2.1.16, Q2.1.17, Q2.1.15, Installation
+@section XEmacs crashes in @code{strcat} on HP/UX 10
+
+>From the problems database (through
+<URL:http://support.mayfield.hp.com/>):
 
 @example
-xemacs@@cs.uiuc.edu
+Problem Report: 5003302299
+Status:         Open
+
+System/Model:   9000/700
+Product Name:   HPUX S800 10.0X
+Product Vers:   9245XB.10.00
+
+Description: strcat(3C) may read beyond end of source string, can cause
+SIGSEGV
+
+
+*** PROBLEM TEXT ***
+strcat(3C) may read beyond the source string onto an unmapped page,
+causing a segmentation violation.
+@end example
+
+@node Q2.1.17, Q2.1.18, Q2.1.16, Installation
+@section @samp{Marker does not point anywhere}
+
+This is a problem with line-number-mode in XEmacs 19.14, and affects a
+large number of other packages.  If you see this error message, turn off
+line-number-mode.
+
+@node Q2.1.18, Q2.1.19, Q2.1.17, Installation
+@section 19.14 hangs on HP/UX 10.10.
+
+Richard Cognot <cognot@@ensg.u-nancy.fr> writes:
+
+@quotation
+For the record, compiling on hpux 10.10 leads to a hang in Gnus when
+compiled with optimization on.
+
+I've just discovered that my hpux 10.01 binary was working less well
+than expected. In fact, on a 10.10 system, @code{(while t)} was not
+interupted by @kbd{C-g}. I defined @code{BROKEN_SIGIO} and recompiled on
+10.10, and... the hang is now gone.
+
+As far as configure goes, this will be a bit tricky: @code{BROKEN_SIGIO}
+is needed on 10.10, but @strong{not} on 10.01: if I run my 10.01 binary
+on a 10.01 machine, without @code{BROKEN_SIGIO} being defined, @kbd{C-g}
+works as expected.
+@end quotation
+
+Richard Cognot <cognot@@ensg.u-nancy.fr> adds:
+
+@quotation
+Apparently somebody has found the reason why there is this @samp{poll:
+interrupted...} message for each event.  For some reason, libcurses
+reimplements a @code{select()} system call, in a highly broken fashion.
+The fix is to add a -lc to the link line @emph{before} the
+-lxcurses. XEmacs will then use the right version of @code{select()}.
+@end quotation
+
+
+Alain Fauconnet <af@@biomath.jussieu.fr> writes:
+
+@quotation
+The @emph{real} solution is to @emph{not} link -lcurses in!  I just
+changed -lcurses to -ltermcap in the Makefile and it fixed:
+
+@enumerate
+@item
+The @samp{poll: interrupted system call} message.
+
+@item
+A more serious problem I had discovered in the meantime, that is the
+fact that subprocess handling was seriously broken: subprocesses
+e.g. started by AUCTeX for TeX compilation of a buffer would
+@emph{hang}.  Actually they would wait forever for emacs to read the
+socket which connects stdout...
+@end enumerate
+@end quotation
+
+@node Q2.1.19, Q2.1.20, Q2.1.18, Installation
+@section XEmacs does not follow the local timezone.
+
+When using one of the prebuilt binaries many users have observed that
+XEmacs uses the timezone under which it was built, but not the timezone
+under which it is running.  The solution is to add:
+
+@lisp
+(set-time-zone-rule "MET")
+@end lisp
+
+to your @file{.emacs} or the @file{site-start.el} file if you can.
+Replace @code{MET} with your local timezone.
+
+@node Q2.1.20, Q2.1.21, Q2.1.19, Installation
+@section @samp{Symbol's function definition is void: hkey-help-show.}
+
+This is a problem with a partially loaded hyperbole.  Try adding:
+
+@lisp
+(require 'hmouse-drv)
+@end lisp
+
+where you load hyperbole and the problem should go away.
+
+@node Q2.1.21,  , Q2.1.20, Installation
+@section Every so often the XEmacs frame freezes
+
+This problem has been fixed in 19.15, and was due to a not easily
+reproducible race condition.
+
+@node Customization, Subsystems, Installation, Top
+@chapter Customization and Options
+
+This is part 3 of the XEmacs Frequently Asked Questions list.  This
+section is devoted to Customization and screen settings.
+
+@menu
+Customization---Emacs Lisp and @file{.emacs}:
+* Q3.0.1::      What version of Emacs am I running?
+* Q3.0.2::      How do I evaluate Elisp expressions?
+* Q3.0.3::      @code{(setq tab-width 6)} behaves oddly.
+* Q3.0.4::      How can I add directories to the @code{load-path}?
+* Q3.0.5::      How to check if a lisp function is defined?
+* Q3.0.6::      Can I force the output of @code{(face-list)} to a buffer?
+* Q3.0.7::      Font selections don't get saved after @code{Save Options}.
+* Q3.0.8::      How do I make a single minibuffer frame?
+
+X Window System & Resources:
+* Q3.1.1::      Where is a list of X resources?
+* Q3.1.2::      How can I detect a color display?
+* Q3.1.3::      @code{(set-screen-width)} worked in 19.6, but not in 19.13?
+* Q3.1.4::      Specifiying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.13?
+* Q3.1.5::      How can I get the icon to just say @samp{XEmacs}?
+* Q3.1.6::      How can I have the window title area display the full path?
+* Q3.1.7::      @samp{xemacs -name junk} doesn't work?
+* Q3.1.8::      @samp{-iconic} it doesn't work.
+
+Textual Fonts & Colors:
+* Q3.2.1::      How can I set color options from @file{.emacs}?
+* Q3.2.2::      How do I set the text, menu and modeline fonts?
+* Q3.2.3::      How can I set the colors when highlighting a region?
+* Q3.2.4::      How can I limit color map usage?
+* Q3.2.5::      My tty supports color, but XEmacs doesn't use them.
+
+The Modeline:
+* Q3.3.1::      How can I make the modeline go away?
+* Q3.3.2::      How do you have XEmacs display the line number in the modeline?
+* Q3.3.3::      How do I get XEmacs to put the time of day on the modeline?
+* Q3.3.4::      How do I turn off current chapter from AUC-TeX modeline?
+* Q3.3.5::      How can one change the modeline color based on the mode used?
+
+3.4 Multiple Device Support:
+* Q3.4.1::      How do I open a frame on another screen of my multi-headed display?
+* Q3.4.2::      Can I really connect to a running XEmacs after calling up over a modem?  How?
+
+3.5 The Keyboard:
+* Q3.5.1::      How can I bind complex functions (or macros) to keys?
+* Q3.5.2::      How can I stop down-arrow from adding empty lines to the bottom of my buffers?
+* Q3.5.3::      How do I bind C-. and C-; to scroll one line up and down?
+* Q3.5.4::      Globally binding @kbd{Delete}?
+* Q3.5.5::      Scrolling one line at a time.
+* Q3.5.6::      How to map @kbd{Help} key alone on Sun type4 keyboard?
+* Q3.5.7::      How can you type in special characters in XEmacs?
+* Q3.5.8::      Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
+* Q3.5.9::      How do I make the Delete key delete forward?
+* Q3.5.10::     Can I turn on @dfn{sticky} modifier keys?
+
+The Cursor:
+* Q3.6.1::      Is there a way to make the bar cursor thicker?
+* Q3.6.2::      Is there a way to get back the old block cursor where the cursor covers the character in front of the point?
+* Q3.6.3::      Can I make the cursor blink?
+
+The Mouse and Highlighting:
+* Q3.7.1::      How can I turn off Mouse pasting?
+* Q3.7.2::      How do I set control/meta/etc modifiers on mouse buttons?
+* Q3.7.3::      Clicking the left button does not do anything in buffer list.
+* Q3.7.4::      How can I get a list of buffers when I hit mouse button 3?
+* Q3.7.5::      Why does cut-and-paste not work between XEmacs and a cmdtool?
+* Q3.7.6::      How I can set XEmacs up so that it pastes where the text cursor is?
+* Q3.7.7::      How do I select a rectangular region?
+* Q3.7.8::      Why does @kbd{M-w} take so long?
+
+The Menubar and Toolbar:
+* Q3.8.1::      How do I get rid of the menu (or menubar)?
+* Q3.8.2::      Can I customize the basic menubar?
+* Q3.8.3::      How do I control how many buffers are listed in the menu @code{Buffers} list?
+* Q3.8.4::      Resources like @code{Emacs*menubar*font} are not working?
+* Q3.8.5::      How can I bind a key to a function to toggle the toolbar?
+
+Scrollbars:
+* Q3.9.1::      How can I disable the scrollbar?
+* Q3.9.2::      How can one use resources to change scrollbar colors?
+* Q3.9.3::      Moving the scrollbar can move the point; can I disable this?
+* Q3.9.4::      How can I get automatic horizontal scrolling?
+
+Text Selections:
+* Q3.10.1::     How can I turn off or change highlighted selections?
+* Q3.10.2::     How do I get that typing on an active region removes it?
+* Q3.10.3::     Can I turn off the highlight during isearch?
+* Q3.10.4::     How do I turn off highlighting after @kbd{C-x C-p} (mark-page)?
+* Q3.10.5::     The region disappears when I hit the end of buffer while scrolling.
+@end menu
+
+@node Q3.0.1, Q3.0.2, Customization, Customization
+@section What version of Emacs am I running?
+
+How can @file{.emacs} determine which of the family of Emacsen I am
+using?
+
+To determine if you are currently running GNU Emacs 18, GNU Emacs 19,
+XEmacs 19, or Epoch, and use appropriate code, check out the example
+given in @file{etc/sample.emacs}.  There are other nifty things in there
+as well!
+
+For all new code, all you really need to do is:
+
+@lisp
+(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
+@end lisp
+
+@node Q3.0.2, Q3.0.3, Q3.0.1, Customization
+@section How can I evaluate Emacs-Lisp expressions?
+
+I know I can evaluate Elisp expressions from @code{*scratch*} buffer
+with @kbd{C-j} after the expression.  How do I do it from another
+buffer?
+
+Use the following code:
+
+@lisp
+(put 'eval-expression 'disabled nil)
+@end lisp
+
+This sets it so that hitting @kbd{M-:} lets you type a single expression
+to be evaluated.  This line can also be put into your @file{.emacs}.
+
+@node Q3.0.3, Q3.0.4, Q3.0.2, Customization
+@section @code{(setq tab-width 6)} behaves oddly.
+
+If you put @code{(setq tab-width 6)} in your @file{.emacs} file it does
+not work!  Is there a reason for this?  If you do it at the EVAL prompt
+it works fine!! How strange.
+
+Use @code{setq-default} instead, since @code{tab-width} is
+all-buffer-local.
+
+@node Q3.0.4, Q3.0.5, Q3.0.3, Customization
+@section How can I add directories to the @code{load-path}?
+
+Here are two ways to do that, one that puts your directories at the
+front of the load-path, the other at the end:
+
+@lisp
+;;; Add things at the beginning of the load-path, do not add
+;;; duplicate directories:
+(if (null (member "bar" load-path))
+    (setq load-path (cons "bar" load-path)))
+
+(if (null (member "foo" load-path))
+    (setq load-path (cons "foo" load-path)))
+
+;;; Add things at the end, unconditionally
+(setq load-path (append load-path '("foo" "bar")))
+@end lisp
+
+keith (k.p.) hanlan <keithh@@nortel.ca> writes:
+
+@quotation
+To add directories using Unix shell metacharacters use
+@file{expand-file-name} like this:
+
+@lisp
+(setq load-path (cons (expand-file-name "~keithh/.emacsdir") load-path))
+@end lisp
+@end quotation
+
+@node Q3.0.5, Q3.0.6, Q3.0.4, Customization
+@section How to check if a lisp function is defined?
+
+Use the following elisp:
+
+@lisp
+(fboundp 'foo)
+@end lisp
+
+It's almost always a mistake to test @code{emacs-version} or any similar
+variables.
+
+Instead, use feature-tests, such as @code{featurep}, @code{boundp},
+@code{fboundp}, or even simple behavioural tests, eg.:
+
+@lisp
+(defvar foo-old-losing-code-p 
+  (condition-case nil (progn (losing-code t) nil)
+   (wrong-number-of-arguments t)))
+@end lisp
+
+There is an incredible amount of broken code out there which could work
+much better more often in more places if it did the above instead of
+trying to divine its environment from the value of one variable.
+
+@node Q3.0.6, Q3.0.7, Q3.0.5, Customization
+@section Can I force the output of @code{(face-list)} to a buffer?
+
+It would be good having it in a buffer, as the output of
+@code{(face-list)} is too wide to fit to a minibuffer.
+
+Evaluate the expression in the @samp{*scratch*} buffer with point after
+the rightmost paren and typing @kbd{C-j}.
+
+@node Q3.0.7, Q3.0.8, Q3.0.6, Customization
+@section Font selections don't get saved after @code{Save Options}.
+
+John Mann <mannj@@ll.mit.edu> writes:
+
+@quotation
+You have to go to Options->Menubar Appearance and unselect
+@samp{Frame-Local Font Menu}.  If this option is selected, font changes
+are only applied to the @emph{current} frame and do @emph{not} get saved
+when you save options.
+@end quotation
+
+@node Q3.0.8, Q3.1.1, Q3.0.7, Customization
+@section How do I get a single minibuffer frame?
+
+Vin Shelton <acs@@acm.org> writes:
+
+@lisp
+(setq initial-frame-plist '(minibuffer nil))
+(setq default-frame-plist '(minibuffer nil))
+(setq default-minibuffer-frame
+      (make-frame
+	'(minibuffer only
+                     width 86
+                     height 1
+                     menubar-visible-p nil
+                     default-toolbar-visible-p nil
+                     name "minibuffer"
+                     top -2
+                     left -2
+                     has-modeline-p nil)))
+(frame-notice-user-settings)
+@end lisp
+
+@strong{NOTE:} The single minibuffer frame may not be to everyone's
+taste, and there any number of other XEmacs options settings that may
+make it difficult or inconvenient to use.
+
+@node Q3.1.1, Q3.1.2, Q3.0.8, Customization
+@section Where is a list of X resources?
+
+Search through the @file{NEWS} file for @samp{X Resources}.  A fairly
+comprehensive list is given after it.
+
+In addition, an @file{app-defaults} file is supplied,
+@file{etc/Emacs.ad} listing the defaults.  The file
+@file{etc/sample.Xdefaults} gives a set of defaults that you might
+consider.  It is essentially the same as @file{etc/Emacs.ad} but some
+entries are slightly altered.  Be careful about installing the contents
+of this file into your @file{.Xdefaults} or @file{.Xresources} file if
+you use GNU Emacs under X11 as well.
+
+@node Q3.1.2, Q3.1.3, Q3.1.1, Customization
+@section How can I detect a color display?
+
+You can test the return value of the function @code{(device-class)}, as
+in:
+
+@lisp
+(when (eq (device-class) 'color)
+  (set-face-foreground  'font-lock-comment-face "Grey")
+  (set-face-foreground  'font-lock-string-face  "Red")
+  ....
+  )
+@end lisp
+
+@node Q3.1.3, Q3.1.4, Q3.1.2, Customization
+@section @code{(set-screen-width)} worked in 19.6, but not in 19.13?
+
+In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and
+@code{(set-screen-height @var{lines})} in my @file{.emacs} instead of
+specifying @code{Emacs*EmacsScreen.geometry} in my @file{.Xdefaults} but
+this does not work in XEmacs 19.13.
+
+These two functions now take frame arguments:
+
+@lisp
+(set-frame-width (selected-frame) @var{characters})
+(set-frame-height (selected-frame) @var{lines})
+@end lisp
+
+@node Q3.1.4, Q3.1.5, Q3.1.3, Customization
+@section Specifiying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.13?
+
+In XEmacs 19.11 I specified @code{Emacs*EmacsScreen.geometry} in
+my @file{.emacs} but this does not work in XEmacs 19.13.
+
+We have switched from using the term @dfn{screen} to using the term
+@dfn{frame}.
+
+The correct entry for your @file{.Xdefaults} is now:
+
+@example
+Emacs*EmacsFrame.geometry
+@end example
+
+@node Q3.1.5, Q3.1.6, Q3.1.4, Customization
+@section How can I get the icon to just say @samp{XEmacs}?
+
+I'd like the icon to just say @samp{XEmacs}, and not include the name of
+the current file in it.
+
+Add the following line to your @file{.emacs}:
+
+@lisp
+(setq frame-icon-title-format "XEmacs")
+@end lisp
+
+@node Q3.1.6, Q3.1.7, Q3.1.5, Customization
+@section How can I have the window title area display the full path?
+
+I'd like to have the window title area display the full directory/name
+of the current buffer file and not just the name.
+
+Add the following line to your @file{.emacs}:
+
+@lisp
+(setq frame-title-format "%S: %f")
+@end lisp
+
+A more sophisticated title might be:
+
+@lisp
+(setq frame-title-format
+  '("%S: " (buffer-file-name "%f" (dired-directory dired-directory "%b"))))
+@end lisp
+
+That is, use the file name, or the dired-directory, or the buffer name.
+
+@node Q3.1.7, Q3.1.8, Q3.1.6, Customization
+@section @samp{xemacs -name junk} doesn't work?
+
+When I run @samp{xterm -name junk}, I get an xterm whose class name
+according to xprop, is @samp{junk}.  This is the way it's supposed to
+work, I think.  When I run @samp{xemacs -name junk} the class name is
+not set to @samp{junk}.  It's still @samp{emacs}.  What does
+@samp{xemacs -name} really do?  The reason I ask is that my window
+manager (fvwm) will make a window sticky and I use XEmacs to read my
+mail.  I want that XEmacs window to be sticky, without having to use the
+window manager's function to set the window sticky.  What gives?
+
+@samp{xemacs -name} sets the application name for the program (that is,
+the thing which normally comes from @samp{argv[0]}).  Using @samp{-name}
+is the same as making a copy of the executable with that new name.  The
+@code{WM_CLASS} property on each frame is set to the frame-name, and the
+application-class.  So, if you did @samp{xemacs -name FOO} and then
+created a frame named @var{BAR}, you'd get an X window with WM_CLASS =
+@code{( "BAR", "Emacs")}.  However, the resource hierarchy for this
+widget would be:
+
+@example
+Name:    FOO   .shell             .container   .BAR
+Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
+@end example
+
+instead of the default
+
+@example
+Name:    xemacs.shell             .container   .emacs
+Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
+@end example
+
+
+It is arguable that the first element of WM_CLASS should be set to the
+application-name instead of the frame-name, but I think that's less
+flexible, since it does not give you the ability to have multiple frames
+with different WM_CLASS properties.  Another possibility would be for
+the default frame name to come from the application name instead of
+simply being @samp{emacs}.  However, at this point, making that change
+would be troublesome: it would mean that many users would have to make
+yet another change to their resource files (since the default frame name
+would suddenly change from @samp{emacs} to @samp{xemacs}, or whatever
+the executable happened to be named), so we'd rather avoid it.
+
+To make a frame with a particular name use:
+
+@lisp
+(make-frame '((name . "the-name")))
+@end lisp
+
+@node Q3.1.8, Q3.2.1, Q3.1.7, Customization
+@section @samp{-iconic} doesn't work.
+
+When I start up XEmacs using @samp{-iconic} it doesn't work right.
+Using @samp{-unmapped} on the command line, and setting the
+@code{initiallyUnmapped} X Resource don't seem to help much either...
+
+Ben Wing <ben@@666.com> writes:
+
+@quotation
+Ugh, this stuff is such an incredible mess that I've about given up
+getting it to work.  The principal problem is numerous window-manager
+bugs...
+@end quotation
+
+@node Q3.2.1, Q3.2.2, Q3.1.8, Customization
+@section How can I set color options from @file{.emacs}?
+
+How can I set the most commonly used color options from my @file{.emacs}
+instead of from my @file{.Xdefaults}?
+
+Like this:
+
+@lisp
+(set-face-background 'default      "bisque")     ; frame background
+(set-face-foreground 'default      "black")      ; normal text
+(set-face-background 'zmacs-region "red")        ; When selecting w/
+                                                 ; mouse 
+(set-face-foreground 'zmacs-region "yellow")
+(set-face-font       'default      "*courier-bold-r*120-100-100*")
+(set-face-background 'highlight    "blue")       ; Ie when selecting buffers 
+(set-face-foreground 'highlight    "yellow")
+(set-face-background 'modeline     "blue")       ; Line at bottom of buffer
+(set-face-foreground 'modeline     "white")
+(set-face-font       'modeline     "*bold-r-normal*140-100-100*")
+(set-face-background 'isearch      "yellow")     ; When highlighting while
+                                                 ; searching		 
+(set-face-foreground 'isearch      "red")
+(setq x-pointer-foreground-color   "black")      ; Adds to bg color,
+                                                 ; so keep black
+(setq x-pointer-background-color   "blue")       ; This is color you really
+                                                 ; want ptr/crsr
+@end lisp
+
+@node Q3.2.2, Q3.2.3, Q3.2.1, Customization
+@section How do I set the text, menu and modeline fonts?
+
+Note that you should use @samp{Emacs.} and not @samp{Emacs*} when
+setting face values.
+
+In @file{.Xdefaults}:
+
+@example
+Emacs.default.attributeFont:  -*-*-medium-r-*-*-*-120-*-*-m-*-*-* 
+Emacs*menubar*font:           fixed
+Emacs.modeline.attributeFont: fixed
+@end example
+
+This is confusing because modeline is a face, and can be found listed
+with all faces in the current mode by using @kbd{M-x set-face-font
+(enter) ?}.  It uses the face specification of @code{attributeFont},
+while menubar is a normal X thing that uses the specification
+@code{font}.  With Motif it may be necessary to use @code{fontList}
+instead of @code{font}.
+
+Suggestions on improving the answer to this question would be
+appreciated.
+
+@node Q3.2.3, Q3.2.4, Q3.2.2, Customization
+@section How can I set the colors when highlighting a region?
+
+How can I set the background/foreground colors when highlighting a
+region?
+
+You can change the face @code{zmacs-region} either in your
+@file{.Xdefaults}:
+
+@example
+Emacs.zmacs-region.attributeForeground: firebrick
+Emacs.zmacs-region.attributeBackground: lightseagreen
 @end example
 
-to send messages to the list.
-
-To cancel a subscription, YOU MUST use the xemacs-request address. 
-
-Bug reports should be sent to the same locations.
-
-
-@node 1.8.
-@section 1.8. Where is the mailing list archived?
-
-The mailing list is archived in the directory
-@ifinfo
-@file{ftp.cs.uiuc.edu:/pub/xemacs/mlists/}.
-@end ifinfo
-@ifhtml
-<A HREF="ftp://ftp.cs.uiuc.edu/pub/xemacs/mlists/">ftp.cs.uiuc.edu:/pub/xemacs/mlists/</A>
-@end ifhtml
-
-
-@node 1.9.
-@section 1.9. What is InfoDock, how does it relate to XEmacs, and how can I obtain it?
+or in your @file{.emacs}:
+
+@lisp
+(set-face-background 'zmacs-region "red")   
+(set-face-foreground 'zmacs-region "yellow")
+@end lisp
+
+@node Q3.2.4, Q3.2.5, Q3.2.3, Customization
+@section How can I limit color map usage?
+
+I'm using Netscape (or another color grabber like XEmacs);
+is there anyway to limit the number of available colors in the color map?
+
+XEmacs 19.13 doesn't have such a mechanism (unlike netscape, or other
+color-hogs).  One solution is to start XEmacs prior to netscape, since
+this will prevent Netscape from grabbing all colors (but Netscape will
+complain).  You can use the flags for Netscape, like -mono, -ncols <#>
+or -install (for mono, limiting to <#> colors, or for using a private
+color map).  Since Netscape will take the entire colormap and never
+release it, the only reasonable way to run it is with @samp{-install}.
+
+If you have the money, another solution would be to use a truecolor or
+direct color video.
+
+Starting with XEmacs 19.14, XEmacs uses the closest available color if
+the colormap is full, so it's O.K. now to start Netscape first.
+
+@node Q3.2.5, Q3.3.1, Q3.2.4, Customization
+@section My tty supports color, but XEmacs doesn't use them.
+
+XEmacs tries to automatically determine whether your tty supports color,
+but sometimes guesses wrong.  In that case, you can make XEmacs Do The
+Right Thing using this Lisp code:
+
+@lisp
+(if (eq 'tty (device-type))
+    (set-device-class nil 'color))
+@end lisp
+
+@node Q3.3.1, Q3.3.2, Q3.2.5, Customization
+@section How can I make the modeline go away?
+
+@lisp
+(set-specifier has-modeline-p nil)
+@end lisp
+
+Starting with XEmacs 19.14 the modeline responds to mouse clicks, so if
+you haven't liked or used the modeline in the past, you might want to
+try the new version out.
+
+@node Q3.3.2, Q3.3.3, Q3.3.1, Customization
+@section How do you have XEmacs display the line number in the modeline?
+
+Add the following line to your @file{.emacs} file to display the
+line number:
+
+@lisp
+(setq line-number-mode t)
+@end lisp
+
+Use the following to display the column number:
+
+@lisp
+(display-column-mode)
+@end lisp
+
+@node Q3.3.3, Q3.3.4, Q3.3.2, Customization
+@section How do I get XEmacs to put the time of day on the modeline?
+
+@lisp
+(display-time)
+@end lisp
+
+@node Q3.3.4, Q3.3.5, Q3.3.3, Customization
+@section How do I turn off current chapter from AUC-TeX modeline?
+
+With AUC-TeX, fast typing is hard because the current chapter, section
+etc. are given in the modeline.  How can I turn this off?
+
+It's not auc-tex, it comes from @code{func-menu} in @file{func-menu.el}.
+Add this code to your @file{.emacs} to turn it off:
+
+@lisp
+(setq fume-display-in-modeline-p nil)
+@end lisp
+
+Or just add a hook to @code{TeX-mode-hook} to turn it off only for TeX
+mode:
+
+@lisp
+(add-hook 'TeX-mode-hook '(lambda () (setq fume-display-in-modeline-p nil)))
+@end lisp
+
+David Hughes <dhughes@@origin-at.co.uk> writes:
+
+@quotation
+If you have 19.14 or later, try this instead; you'll still get the
+function name displayed in the modeline, but it won't attempt to keep
+track when you modify the file. To refresh when it gets out of synch,
+you simply need click on the @samp{Rescan Buffer} option in the
+function-menu.
+
+@lisp
+(setq-default fume-auto-rescan-buffer-p nil)
+@end lisp
+@end quotation
+
+@node Q3.3.5, Q3.4.1, Q3.3.4, Customization
+@section How can one change the modeline color based on the mode used?
+
+You can use something like the following:
+
+@lisp
+(add-hook 'lisp-mode-hook 
+        '(lambda () (set-face-background 'modeline "red" (current-buffer))
+                    (set-face-foreground 'modeline "yellow" (current-buffer))))
+@end lisp
+
+Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline
+colors change from the default set in your @file{.emacs}.  The change
+will only be made in the buffer you just entered (which contains the
+Lisp file you are editing) and will not affect the modeline colors
+anywhere else.
+
+Notes:
+
+@itemize @bullet
+
+@item
+The hook is the mode name plus @code{-hook}.  eg. c-mode-hook,
+c++-mode-hook, emacs-lisp-mode-hook (used for your @file{.emacs} or a
+@file{xx.el} file), lisp-interaction-mode-hook (the @samp{*scratch*}
+buffer), text-mode-hook, etc.
+
+@item
+Be sure to use @code{add-hook}, not @code{(setq c-mode-hook xxxx)},
+otherwise you will erase anything that anybody has already put on the
+hook.
+
+@item
+You can also do @code{(set-face-font 'modeline @var{font})},
+eg. @code{(set-face-font 'modeline "*bold-r-normal*140-100-100*"
+(current-buffer))} if you wish the modeline font to vary based on the
+current mode.
+@end itemize
+
+This works in 19.14 as well, but there are additional modeline faces,
+@code{modeline-buffer-id}, @code{modeline-mousable}, and
+@code{modeline-mousable-minor-mode}, which you may want to customize.
+
+@node Q3.4.1, Q3.4.2, Q3.3.5, Customization
+@section How do I open a frame on another screen of my multi-headed display?
+
+The support for this has been revamped for 19.14.  Use the command
+@kbd{M-x make-frame-on-display}.  This command is also on the File menu
+in the menubar.
+
+XEmacs 19.14 also has the command @code{make-frame-on-tty} which will
+establish a connection to any tty-like device.
+
+@node Q3.4.2, Q3.5.1, Q3.4.1, Customization
+@section Can I really connect to a running XEmacs after calling up over a modem?  How?
+
+If you're not running at least XEmacs 19.14, you can't.  Otherwise check
+out the @code{gnuattach} program supplied with XEmacs.
+
+@node Q3.5.1, Q3.5.2, Q3.4.2, Customization
+@section How can I bind complex functions (or macros) to keys?
+
+As an example, say you want the @kbd{paste} key on a Sun keyboard to
+insert the current Primary X selection at point. You can accomplish this
+with:
+
+@lisp
+(define-key global-map [f18] 'x-insert-selection)
+@end lisp
+
+However, this only works if there is a current X selection (the
+selection will be highlighted).  The functionality I like is for the
+@kbd{paste} key to insert the current X selection if there is one,
+otherwise insert the contents of the clipboard.  To do this you need to
+pass arguments to @code{x-insert-selection}.  This is done by wrapping
+the call in a 'lambda form:
+
+@lisp
+(define-key global-map [f18]
+  (function (lambda () (interactive) (x-insert-selection t nil))))
+@end lisp
+
+This binds the f18 key to a @dfn{generic} functional object.  The
+interactive spec is required because only interactive functions can be
+bound to keys.  Also take a look at the doc for @code{function}.
+
+For the FAQ example you could use:
+
+@lisp
+(global-set-key [(control ?.)]
+		(function (lambda () (interactive) (scroll-up 1))))
+(global-set-key [(control ?;)]
+	        (function (lambda () (interactive) (scroll-up -1))))
+@end lisp
+
+This is fine if you only need a few functions within the lambda body.
+If you're doing more it's cleaner to define a separate function as in
+question 3.5.3 (@xref{Q3.5.3}).
+
+@node Q3.5.2, Q3.5.3, Q3.5.1, Customization
+@section How can I stop down-arrow from adding empty lines to the bottom of my buffers?
+
+Add the following line to your @file{.emacs} file:
+
+@lisp
+(setq next-line-add-newlines nil)
+@end lisp
+
+@node Q3.5.3, Q3.5.4, Q3.5.2, Customization
+@section How do I bind C-. and C-; to scroll one line up and down?
+
+Add the following (Thanks to Richard Mlynarik <mly@@adoc.xerox.com> and
+Wayne Newberry <wayne@@zen.cac.stratus.com>) to @file{.emacs}:
+
+@lisp
+(defun scroll-up-one-line ()
+  (interactive)
+  (scroll-up 1))
+
+(defun scroll-down-one-line ()
+  (interactive)
+  (scroll-down 1))
+
+(global-set-key [(control ?.)]   'scroll-up-one-line)        ; C-.
+(global-set-key [(control ?;)]   'scroll-down-one-line)      ; C-;
+@end lisp
+
+The key point is that you can only bind simple functions to keys; you
+can not bind a key to a function that you're also passing arguments to.
+(@xref{Q3.5.1} for a better answer).
+
+@node Q3.5.4, Q3.5.5, Q3.5.3, Customization
+@section Globally binding @kbd{Delete}?
+
+I cannot manage to globally bind my @kbd{Delete} key to something other
+than the default.  How does one do this?
+
+@lisp
+(defun Foo ()
+  (interactive)
+    (message "You hit DELETE"))
+
+(global-set-key 'delete 'Foo)
+@end lisp
+
+However, some modes explicitly bind @kbd{Delete}, so you would need to
+add a hook that does @code{local-set-key} for them.  If what you want to
+do is make the Backspace and Delete keys work more PC/Motif-like, then
+take a look at the @file{delbackspace.el} package.
+
+New in XEmacs 19.14 is a variable called @code{key-translation-map}
+which makes it easier to bind @kbd{Delete}.  @file{delbackspace.el} is a
+good example of how to do this correctly.
+
+@node Q3.5.5, Q3.5.6, Q3.5.4, Customization
+@section Scrolling one line at a time.
+
+Can the cursor keys scroll the screen a line at a time, rather than the
+default half page jump?  I tend it to find it disorienting.
+
+Try this:
+
+@lisp
+(defun scroll-one-line-up (&optional arg)
+  "Scroll the selected window up (forward in the text) one line (or N lines)."
+  (interactive "p")
+  (scroll-up (or arg 1)))
+
+(defun scroll-one-line-down (&optional arg)
+  "Scroll the selected window down (backward in the text) one line (or N)."
+  (interactive "p")
+  (scroll-down (or arg 1)))
+
+(global-set-key 'up 'scroll-one-line-up)
+(global-set-key 'down  'scroll-one-line-down)
+@end lisp
+
+
+The following will also work but will affect more than just the cursor
+keys (i.e. @kbd{C-n} and @kbd{C-p}):
+
+@lisp
+(setq scroll-step 1)
+@end lisp
+
+@node Q3.5.6, Q3.5.7, Q3.5.5, Customization
+@section How to map @kbd{Help} key alone on Sun type4 keyboard?
+
+The following works in GNU Emacs 19:
+
+@lisp
+(global-set-key [help] 'help-command)  		;; Help
+@end lisp
+
+The following works in XEmacs 19.13 with the addition of shift:
+
+@lisp
+(global-set-key [(shift help)] 'help-command)  		;; Help
+@end lisp
+
+But it doesn't work alone.  This is in the file @file{PROBLEMS} which
+should have come with your XEmacs installation: @emph{Emacs ignores the
+@kbd{help} key when running OLWM}.
+
+OLWM grabs the @kbd{help} key, and retransmits it to the appropriate
+client using @code{XSendEvent}.  Allowing Emacs to react to synthetic
+events is a security hole, so this is turned off by default.  You can
+enable it by setting the variable @code{x-allow-sendevents} to t.  You
+can also cause fix this by telling OLWM to not grab the help key, with
+the null binding @code{OpenWindows.KeyboardCommand.Help:}.
+
+@node Q3.5.7, Q3.5.8, Q3.5.6, Customization
+@section How can you type in special characters in XEmacs?
+
+One way is to use the package @samp{x-compose}.  Then you can use
+sequences like @kbd{Compose " a} to get ä, etc.
+
+Another way is to use the iso8859-1 package.
+
+@node Q3.5.8, Q3.5.9, Q3.5.7, Customization
+@section Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
+
+Why does @code{(define-key global-map [ delete-forward ] 'delete-char)}
+complain of not being able to bind an unknown key?
+
+Try this instead:
+
+@lisp
+(define-key global-map [delete_forward] 'delete-char)
+@end lisp
+
+and it will work.
+
+What you are seeing above is a bug due to code that is trying to check
+for GNU Emacs syntax like:
+
+(define-key global-map [C-M-a] 'delete-char)
+
+which otherwise would cause no errors but would not result in the
+expected behavior.
+
+This bug has been fixed in 19.14.
+
+@node Q3.5.9, Q3.5.10, Q3.5.8, Customization
+@section How do I make the Delete key delete forward?
+
+Use the @file{delbackspace} package:
+
+@lisp
+(load-library "delbackspace")
+@end lisp
+
+Also @xref{Q3.5.4}.
+
+@node Q3.5.10, Q3.6.1, Q3.5.9, Customization
+@section Can I turn on @dfn{sticky} modifier keys?
+
+Yes, with @code{(setq modifier-keys-are-sticky t)}.  This will give the
+effect of being able to press and release Shift and have the next
+character typed come out in upper case.  This will affect all the other
+modifier keys like Control and Meta as well.
+
+Ben Wing <ben@@666.com> writes:
+
+@quotation
+One thing about the sticky modifiers is that if you move the mouse out
+of the frame and back in, it cancels all currently "stuck" modifiers.
+@end quotation
+
+@node Q3.6.1, Q3.6.2, Q3.5.10, Customization
+@section Is there a way to make the bar cursor thicker?
+
+I'd like to have the bar cursor a little thicker, as I tend to "lose" it
+often.
+
+For a 1 pixel bar cursor, use:
+
+@lisp
+(setq bar-cursor t)
+@end lisp
+
+For a 2 pixel bar cursor, use:
+
+@lisp
+(setq bar-cursor 'anything-else)
+@end lisp
+
+You can use a color to make it stand out better:
+
+@example
+Emacs*cursorColor:	Red
+@end example
+
+@node Q3.6.2, Q3.6.3, Q3.6.1, Customization
+@section Is there a way to get back the block cursor?
+
+@lisp
+(setq bar-cursor nil)
+@end lisp
+
+@node Q3.6.3, Q3.7.1, Q3.6.2, Customization
+@section Can I make the cursor blink?
+
+If you are running a version of XEmacs older than 19.14, no.  Otherwise
+you can do the following:
+
+@lisp
+(blink-cursor-mode)
+@end lisp
+
+This function toggles between a steady cursor and a blinking cursor.
+You may also set this mode from the menu bar by selecting @samp{Options
+=> Frame Appearance => Blinking Cursor}.
+
+@node Q3.7.1, Q3.7.2, Q3.6.3, Customization
+@section How can I turn off Mouse pasting?
+
+I keep hitting the middle mouse button by accident and getting stuff
+pasted into my buffer so how can I turn this off?
+
+Here is an alternative binding, whereby the middle mouse button selects
+(but does not cut) the expression under the mouse. Clicking middle on a
+left or right paren will select to the matching one.  Note that you can
+use @code{define-key} or @code{global-set-key}.
+
+@lisp
+(defun Mouse-Set-Point-and-Select (event)
+  "Sets the point at the mouse location, then marks following form"
+  (interactive "@@e")
+  (mouse-set-point event)
+  (mark-sexp 1)
+  )
+(define-key global-map 'button2 'Mouse-Set-Point-and-Select)
+@end lisp
+
+@node Q3.7.2, Q3.7.3, Q3.7.1, Customization
+@section How do I set control/meta/etc modifiers on mouse buttons?
+
+Use, for instance, @code{[(meta button1)]}. For example, here is a
+common setting for Common Lisp programmers who use the bundled ilisp
+package, whereby meta-button1 on a function name will find the file
+where the function name was defined, and put you at that location in the
+source file.
+
+[Inside a function that gets called by the lisp-mode-hook and
+ilisp-mode-hook]
+
+@lisp
+(local-set-key [(meta button1)] 'edit-definitions-lisp)
+@end lisp
+
+@node Q3.7.3, Q3.7.4, Q3.7.2, Customization
+@section Clicking the left button does not do anything in buffer list.
+
+I do @kbd{C-x C-b} to get a list of buffers and the entries get
+highlighted when I move the mouse over them but clicking the left mouse
+does not do anything.
+
+Use the middle mouse button.
+
+@node Q3.7.4, Q3.7.5, Q3.7.3, Customization
+@section How can I get a list of buffers when I hit mouse button 3?
+
+The following code will actually replace the default popup on button3:
+
+@lisp
+(defun cw-build-buffers ()
+  "Popup buffer menu."
+  (interactive "@@")
+  (run-hooks 'activate-menubar-hook)
+  (popup-menu (car (find-menu-item current-menubar '("Buffers")))))
+
+(define-key global-map [(button3)] 'cw-build-buffers)
+@end lisp
+
+@node Q3.7.5, Q3.7.6, Q3.7.4, Customization
+@section Why does cut-and-paste not work between XEmacs and a cmdtool?
+
+We don't know.  It's a bug.  There does seem to be a work-around,
+however.  Try running xclipboard first.  It appears to fix the problem
+even if you exit it.  (This should be mostly fixed in 19.13, but we
+haven't yet verified that).
+
+@node Q3.7.6, Q3.7.7, Q3.7.5, Customization
+@section How I can set XEmacs up so that it pastes where the text cursor is?
+
+By default XEmacs pastes X selections where the mouse pointer is.  How
+do I disable this?
+
+Examine the function @code{mouse-yank}, by typing @kbd{C-h f mouse-yank
+RET}.
+
+To get XEmacs to paste at the text cursor, add this your @file{.emacs}:
+
+@lisp
+(setq mouse-yank-at-point t)
+@end lisp
+
+@node Q3.7.7, Q3.7.8, Q3.7.6, Customization
+@section How do I select a rectangular region?
+
+Just select the region normally, then use the rectangle commands (e.g.
+@code{kill-rectangle} on it.  The region does not highlight as a
+rectangle, but the commands work just fine.
+
+To actually sweep out rectangular regions with the mouse do the
+following:
+
+@lisp
+(setq mouse-track-rectangle-p t)
+@end lisp
+
+Aki Vehtari <Aki.Vehtari@@hut.fi> writes:
+
+@quotation
+To actually sweep out rectangular regions with the mouse you can also
+use @code{mouse-track-do-rectangle} which is assigned to
+@kbd{M-button1}. Then use rectangle commands.
+
+@example
+ mouse-track-do-rectangle: (event)
+   -- an interactive compiled Lisp function.
+ Like `mouse-track' but selects rectangles instead of regions.
+@end example
+@end quotation
+
+@node Q3.7.8, Q3.8.1, Q3.7.7, Customization
+@section Why does @kbd{M-w} take so long?
+
+It actually doesn't.  It leaves the region visible for a second so that
+you can see what area is being yanked.  If you start working, though, it
+will immediately complete its operation.  In other words, it will only
+delay for a second if you let it.
+
+@node Q3.8.1, Q3.8.2, Q3.7.8, Customization
+@section How do I get rid of the menu (or menubar)?
+
+If you are running XEmacs 19.13 and earlier, add this command to your
+@file{.emacs}.
+
+@lisp
+(set-menubar nil)
+@end lisp
+
+Starting with XEmacs 19.14 the preferred method is:
+
+@lisp
+(set-specifier menubar-visible-p nil)
+@end lisp
+
+@node Q3.8.2, Q3.8.3, Q3.8.1, Customization
+@section Can I customize the basic menubar?
+
+For an extensive menubar, add this line to your @file{.emacs}:
+
+@lisp
+(load "big-menubar")
+@end lisp
+
+If you'd like to write your own, this file provides as good a set of
+examples as any to start from.  The file is located in
+@file{lisp/packages/big-menubar.el} in the XEmacs installation
+directory.
+
+@node Q3.8.3, Q3.8.4, Q3.8.2, Customization
+@section How do I control how many buffers are listed in the menu @code{Buffers List}?
+
+Add the following to your @file{.emacs} (suit to fit):
+
+@lisp
+(setq buffers-menu-max-size 20)
+@end lisp
+
+For no limit, use an argument of @samp{nil}.
+
+@node Q3.8.4, Q3.8.5, Q3.8.3, Customization
+@section Resources like @code{Emacs*menubar*font} are not working?
+
+I am trying to use a resource like @code{Emacs*menubar*font} to set the
+font of the menubar but it's not working.
+
+If you are using the real Motif menubar, this resource is not
+recognized; you have to say:
+
+@example
+Emacs*menubar*fontList: FONT
+@end example
+
+If you are using the Lucid menubar, the former resource will be
+recognized only if the latter resource is unset.  This means that the
+resource
+
+@example
+*fontList: FONT
+@end example
+
+will override
+
+@example
+Emacs*menubar*font: FONT
+@end example
+
+even though the latter is more specific.
+
+@node Q3.8.5, Q3.9.1, Q3.8.4, Customization
+@section How can I bind a key to a function to toggle the toolbar?
+
+Try something like:
+
+@lisp
+(global-set-key [(control x) T]
+		'(lambda () (interactive)
+		   (set-specifier default-toolbar-visible-p 
+				  (not (specifier-instance
+					default-toolbar-visible-p)))))
+@end lisp
+
+There are redisplay bugs in 19.14 that may make the preceding result in
+a messed-up display, especially for frames with multiple windows.  You
+may need to resize the frame before XEmacs completely realizes the
+toolbar is really gone.
+
+Thanks to Martin Buchholz <Martin.Buchholz@@sun.com> for the correct
+code.
+
+@node Q3.9.1, Q3.9.2, Q3.8.5, Customization
+@section How can I disable the scrollbar?
+
+To disable them for all frames, add the following line to
+your @file{.Xdefaults}:
+
+@example
+Emacs.scrollBarWidth:  0
+@end example
+
+To turn the scrollbar off on a per-frame basis, use the following
+function:
+
+@lisp
+(set-specifier scrollbar-width (cons (selected-frame) 0))
+@end lisp
+
+You can actually turn the scrollbars on at any level you want by
+substituting for (selected-frame) in the above command.  For example, to
+turn the scrollbars off only in a single buffer:
+
+@lisp
+(set-specifier scrollbar-width (cons (current-buffer) 0))
+@end lisp
+
+Starting with 19.14 you can use the more logical form:
+
+@lisp
+(set-specifier scrollbar-width 0 (selected-frame))
+@end lisp
+
+@node Q3.9.2, Q3.9.3, Q3.9.1, Customization
+@section How can one use resources to change scrollbar colors?
+
+Here's a recap of how to use resources to change your scrollbar colors:
+
+@example
+! Motif scrollbars
+
+Emacs*XmScrollBar.Background: skyblue
+Emacs*XmScrollBar.troughColor: lightgray
+
+! Athena scrollbars
+
+Emacs*Scrollbar.Foreground: skyblue
+Emacs*Scrollbar.Background: lightgray
+@end example
+
+Note the capitalization of @code{Scrollbar} for the Athena widget.
+
+@node Q3.9.3, Q3.9.4, Q3.9.2, Customization
+@section Moving the scrollbar can move the point; can I disable this?
+
+When I move the scrollbar in an XEmacs window, it moves the point as
+well, which should not be the default behavior.  Is this a bug or a
+feature?  Can I disable it?
+
+The current behavior is a feature, not a bug.  Point remains at the same
+buffer position as long as that position does not scroll off the screen.
+In that event, point will end up in either the upper-left or lower-left
+hand corner.
+
+This cannot be changed.
+
+@node Q3.9.4, Q3.10.1, Q3.9.3, Customization
+@section How can I get automatic horizontal scrolling?
+
+By the same token, how can I turn it off in specific modes?
+
+To do this, add to your @file{.emacs} file:
+
+@lisp
+(require 'auto-show)
+@end lisp
+
+Then do @code{(setq truncate-lines t)} in the mode-hooks for any modes
+in which you want lines truncated.
+
+More precisely: If @code{truncate-lines} is nil, horizontal scrollbars
+will never appear.  Otherwise, they will appear only if the value of
+@code{scrollbar-height} for that buffer/window/etc. is non-zero.  If you
+do
+
+@lisp
+(set-specifier scrollbar-height 0)
+@end lisp
+
+then horizontal scrollbars will not appear in truncated buffers unless
+the package specifically asked for them.
+
+Automatic horizontal scrolling is now standard, starting with 19.14.
+
+@node Q3.10.1, Q3.10.2, Q3.9.4, Customization
+@section How can I turn off or change highlighted selections?
+
+The @code{zmacs} mode allows for what some might call gratuitous
+highlighting for selected regions (either by setting mark or by using
+the mouse).  This is the default behavior.  To turn off, add the
+following line to your @file{.emacs} file:
+
+@lisp
+(setq zmacs-regions nil)
+@end lisp
+
+To change the face for selection, look at @code{Options->Edit Faces} on
+the menubar.
+
+@node Q3.10.2, Q3.10.3, Q3.10.1, Customization
+@section How do I get that typing on an active region removes it?
+
+I want to change things so that if I select some text and start typing,
+the typed text replaces the selected text, similar to Motif.
+
+You want to use something called @dfn{pending delete}.  Pending delete
+is what happens when you select a region (with the mouse or keyboard)
+and you press a key to replace the selected region by the key you typed.
+Usually backspace kills the selected region.
+
+To get this behavior, add the following line to your @file{.emacs}:
+
+@lisp
+(require 'pending-del)
+@end lisp
+
+Note that this will work with both Backspace and Delete.
+
+@node Q3.10.3, Q3.10.4, Q3.10.2, Customization
+@section Can I turn off the highlight during isearch?
+
+I do not like my text highlighted while I am doing isearch as I am not
+able to see what's underneath.  How do I turn it off?
+
+Put the following in your @file{.emacs}:
+
+@lisp
+(setq isearch-highlight nil)
+@end lisp
+
+Note also that isearch-highlight affects query-replace and ispell.
+Instead of disabling isearch-highlight you may find that a better
+solution consists of customizing the @code{isearch} face.
+
+@node Q3.10.4, Q3.10.5, Q3.10.3, Customization
+@section How do I turn off highlighting after @kbd{C-x C-p} (mark-page)?
+
+Put this in your @code{.emacs}:
+
+@lisp
+(setq zmacs-regions nil)
+@end lisp
+
+@strong{Warning: This command turns off all region highlighting.}
+
+@node Q3.10.5,  , Q3.10.4, Customization
+@section The region disappears when I hit the end of buffer while scrolling.
+
+How do I turn this feature (if it indeed is a feature) off?
+
+Like this:
+
+@lisp
+(defadvice scroll-up (around scroll-up freeze)
+  (interactive "_P")
+  (let ((zmacs-region-stays t))
+    (if (interactive-p)
+	(condition-case nil
+	    ad-do-it
+	  (end-of-buffer (goto-char (point-max))))
+      ad-do-it)))
+
+(defadvice scroll-down (around scroll-down freeze)
+  (interactive "_P")
+  (let ((zmacs-region-stays t))
+    (if (interactive-p)
+	(condition-case nil
+	    ad-do-it
+	  (beginning-of-buffer (goto-char (point-min))))
+      ad-do-it)))
+@end lisp
+
+Thanks to T. V. Raman <raman@@adobe.com> for assistance in deriving this
+answer.
+
+@node Subsystems, Miscellaneous, Customization, Top
+@chapter Major Subsystems
+
+This is part 4 of the XEmacs Frequently Asked Questions list.  This
+section is devoted to major XEmacs subsystems.
+
+@menu
+Reading Mail with VM:
+* Q4.0.1::      How do I set up VM to retrieve remote mail using POP?
+* Q4.0.2::      How do I get VM to filter mail for me?
+* Q4.0.3::      How can I get VM to automatically check for new mail?
+* Q4.0.4::      [This question intentionally left blank]
+* Q4.0.5::      How do I get my outgoing mail archived?
+* Q4.0.6::      I have various addresses at which I receive mail.  How can I tell VM to ignore them when doing a "reply-all"?
+* Q4.0.7::      Is there a mailing list or FAQ for VM?
+* Q4.0.8::      Remote Mailreading with VM.
+* Q4.0.9::      rmail or VM gets an error incorporating new mail.
+* Q4.0.10::     How do I make VM stay in a single frame?
+* Q4.0.11::     How do I make VM or mh-e display graphical smilies?
+* Q4.0.12::     Customization of VM not covered in the manual or here.
+
+Web browsing with W3:
+* Q4.1.1::      What is W3?
+* Q4.1.2::      How do I run W3 from behind a firewall?
+
+Reading Netnews and Mail with Gnus:
+* Q4.2.1::      GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, argh!
+* Q4.2.2::      [This question intentionally left blank]
+* Q4.2.3::      How do I make Gnus stay within a single frame?
+* Q4.2.4::      How do I customize the From: line?
+
+Other Mail & News:
+* Q4.3.1::      How can I read and/or compose MIME messages?
+* Q4.3.2::      What is TM and where do I get it?
+* Q4.3.3::      Why isn't this @code{movemail} program working?
+* Q4.3.4::      Movemail is also distributed by Netscape?  Can that cause problems?
+* Q4.3.5::      Where do I find pstogif (required by tm)?
+
+Sparcworks, EOS, and WorkShop:
+* Q4.4.1::      What is SPARCworks, EOS, and WorkShop
+
+Energize:
+* Q4.5.1::      What is/was Energize?
+
+Infodock:
+* Q4.6.1::      What is Infodock?
+
+Other Unbundled Packages:
+* Q4.7.1::      What is AucTeX?  Where do you get it?
+* Q4.7.2::      Are there any Emacs Lisp Spreadsheets?
+* Q4.7.3::      Byte compiling AucTeX on XEmacs 19.14
+* Q4.7.4::      Problems installing AucTeX
+@end menu
+
+@node Q4.0.1, Q4.0.2, Subsystems, Subsystems
+@section How do I set up VM to retrieve mail from a remote site using POP?
+
+Use @code{vm-spool-files}, like this for example:
+
+@lisp
+(setq vm-spool-files '("/var/spool/mail/wing"
+                       "netcom23.netcom.com:110:pass:wing:MYPASS"))
+@end lisp
+
+Of course substitute your actual password for MYPASS.
+
+@node Q4.0.2, Q4.0.3, Q4.0.1, Subsystems
+@section How do I get VM to filter mail for me?
+
+One possibility is to use procmail to split your mail before it gets to
+VM.  I prefer this personally, since there are many strange and
+wonderful things one can do with procmail.  Procmail may be found at
+<URL:ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/>.
+
+Also see the Mail Filtering FAQ at:
+<URL:http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html>.
+
+Another possibility is to check out Gnus 5.  Gnus 5 has mail splitting
+capability, and can use VM as a mail reading backend.
+
+@node Q4.0.3, Q4.0.4, Q4.0.2, Subsystems
+@section How can I get VM to automatically check for new mail?
+
+John Turner <turner@@lanl.gov> writes:
+
+@quotation
+Use the following:
+
+@lisp
+(setq vm-auto-get-new-mail 60)
+@end lisp
+@end quotation
+
+@node Q4.0.4, Q4.0.5, Q4.0.3, Subsystems
+@section [This question intentionally left blank]
+
+Obsolete question, left blank to avoid renumbering.
+
+@node Q4.0.5, Q4.0.6, Q4.0.4, Subsystems
+@section How do I get my outgoing mail archived?
+
+@lisp
+(setq mail-archive-file-name "~/outbox")
+@end lisp
+
+@node Q4.0.6, Q4.0.7, Q4.0.5, Subsystems
+@section I have various addresses at which I receive mail.  How can I tell VM to ignore them when doing a "reply-all"?
+
+Set @code{vm-reply-ignored-addresses} to a list, like
+
+@lisp
+(setq vm-reply-ignored-addresses '("wing@@netcom[0-9]*.netcom.com"
+				   "wing@@netcom.com" "wing@@666.com"))
+@end lisp
+
+Note that each string is a regular expression.
+
+@node Q4.0.7, Q4.0.8, Q4.0.6, Subsystems
+@section Is there a mailing list or FAQ for VM?
+
+There is no archived FAQ for VM.
+
+Kyle Jones <kyle_jones@@wonderworks.com> writes:
+
+@quotation
+No, I'm too atavistic to write one.  For some reason I'd rather just
+answer the questions myself.  I guess it serves a purpose in that the VM
+user community knows that I'm still alive, despite the 9 months since
+the last release.
+@end quotation
+
+VM has its own newsgroup gnu.emacs.vm.info.
+
+@node Q4.0.8, Q4.0.9, Q4.0.7, Subsystems
+@section Remote Mailreading with VM.
+
+My mailbox lives at the office on a big honkin server.  My regular INBOX
+lives on my honkin desktop machine.  I now can PPP to the office from
+home which is far from honking...  I'd like to be able to read mail at
+home without storing it here and I'd like to use xemacs and VM at
+home...  Is there a recommended setup?
+
+Joseph J. Nuspl Jr. <nuspl@@nvwls.cc.purdue.edu> writes:
+
+@quotation
+There are several ways to do this.
+
+@enumerate
+@item
+Set your display to your home machine and run dxpc or one of the other X
+compressors.
+
+@item
+NFS mount your desktop machine on your home machine and modify your pop
+command on your home machine to rsh to your desktop machine and actually
+do the pop get's.
+
+@item
+Run a POP server on your desktop machine as well and do a sort of two
+tiered POP get.
+@end enumerate
+@end quotation
+
+William Perry <wmperry@@monolith.spry.com> adds:
+
+@quotation
+Or you could run a pop script periodically on your desktop machine, and
+just use ange-ftp or NFS to get to your mailbox.  I used to do this all
+the time back at IU.
+@end quotation
+
+@node Q4.0.9, Q4.0.10, Q4.0.8, Subsystems
+@section rmail or VM gets an error incorporating new mail.
+
+>From the XEmacs PROBLEMS file:
+
+@quotation
+rmail and VM get new mail from @file{/usr/spool/mail/$USER} using a
+program called @code{movemail}.  This program interlocks with
+@code{/bin/mail} using the protocol defined by @code{/bin/mail}.
+ 
+There are two different protocols in general use.  One of them uses the
+@code{flock} system call.  The other involves creating a lock file;
+@code{movemail} must be able to write in @file{/usr/spool/mail} in order
+to do this.  You control which one is used by defining, or not defining,
+the macro @code{MAIL_USE_FLOCK} in @file{config.h} or the m- or s- file
+it includes.
+
+@strong{IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR
+SYSTEM, YOU CAN LOSE MAIL!}
+
+If your system uses the lock file protocol, and fascist restrictions
+prevent ordinary users from writing the lock files in
+@file{/usr/spool/mail}, you may need to make @code{movemail} setgid to a
+suitable group such as @samp{mail}.  You can use these commands (as
+root):
+
+@example
+chgrp mail movemail
+chmod 2755 movemail
+@end example
+
+If your system uses the lock file protocol, and fascist restrictions
+prevent ordinary users from writing the lock files in
+@file{/usr/spool/mail}, you may need to make @code{movemail} setgid to a
+suitable group such as @code{mail}.  To do this, use the following
+commands (as root) after doing the make install.
+
+@example
+chgrp mail movemail
+chmod 2755 movemail
+@end example
+
+Installation normally copies movemail from the build directory to an
+installation directory which is usually under @file{/usr/local/lib}.
+The installed copy of @code{movemail} is usually in the directory
+@file{/usr/local/lib/emacs/VERSION/TARGET}.  You must change the group
+and mode of the installed copy; changing the group and mode of the build
+directory copy is ineffective.
+@end quotation
+
+@node Q4.0.10, Q4.0.11, Q4.0.9, Subsystems
+@section How do I make VM stay in a single frame?
+
+John S Cooper <John.Cooper@@Eng.Sun.COM> writes:
+
+@quotation
+@lisp
+; Don't use multiple frames
+(setq vm-frame-per-composition nil)
+(setq vm-frame-per-folder nil)
+(setq vm-frame-per-edit nil)
+(setq vm-frame-per-summary nil)
+@end lisp
+@end quotation
+
+@node Q4.0.11, Q4.0.12, Q4.0.10, Subsystems
+@section How do I make VM or mh-e display graphical smilies?
+
+For mh-e use the following:
+
+@lisp
+(add-hook 'mh-show-mode-hook '(lambda () (smiley-region (point-min)
+                                                        (point-max))))
+@end lisp
+
+For vm use the following:
+@lisp
+(require 'messagexmas)
+(require 'smiley)
+(add-hook 'vm-select-message-hook '(lambda () (smiley-region (point-min)
+                                                             (point-max))))
+@end lisp
+
+For tm use the following:
+@lisp
+(autoload 'smiley-buffer "smiley" nil t)
+(add-hook 'mime-viewer/plain-text-preview-hook 'smiley-buffer)
+@end lisp
+
+@node Q4.0.12, Q4.1.1, Q4.0.11, Subsystems
+@section Customization of VM not covered in the manual, or here.
+
+giacomo boffi <boffi@@hp735.stru.polimi.it> writes:
+
+@quotation
+The meta-answer is to look into the file @file{vm-vars.el}, in the vm
+directory of the lisp library.
+
+@file{vm-vars.el} contains, initializes and carefully describes, with
+examples of usage, the plethora of user options that @emph{fully}
+control VM's behavior.
+
+Enter vm-vars, @code{forward-search} for toolbar, find the variables
+that control the toolbar placement, appearance, existence, copy to your
+@file{.emacs} or @file{.vm} and modify according to the detailed
+instructions.
+
+The above also applies to all the various features of VM: search for
+some keywords, maybe the first you conjure isn't appropriate, find the
+appropriate variables, copy and experiment.
+@end quotation
+
+@node Q4.1.1, Q4.1.2, Q4.0.12, Subsystems
+@section What is W3?
+
+W3 is an advanced graphical browser written in Emacs lisp that runs on
+XEmacs.  It has full support for cascaded style sheets, and more...
+
+It has a home web page at
+<URL:http://www.cs.indiana.edu/elisp/w3/docs.html>.
+
+@node Q4.1.2, Q4.2.1, Q4.1.1, Subsystems
+@section How do I run W3 from behind a firewall?
+
+There is a long, well-written, detailed section in the W3 manual that
+describes how to do this.  Look in the section entitled "Firewalls".
+
+@node Q4.2.1, Q4.2.2, Q4.1.2, Subsystems
+@section GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Mamey Sapote Gnus, argh!
+
+Please see <URL:http://www.ccs.neu.edu/software/gnus/> for details.
+
+@node Q4.2.2, Q4.2.3, Q4.2.1, Subsystems
+@section This question intentionally left blank.
+
+Obsolete question, left blank to avoid renumbering.
+
+@node Q4.2.3, Q4.2.4, Q4.2.2, Subsystems
+@section How do I make Gnus stay within a single frame?
+
+When starting Gnus from the toolbar it is automatically put into a new
+frame.  Gnus not being frame-aware code, has no provision to disable
+this feature.  If you feel this is a problem here are some workarounds:
+
+@enumerate
+@item
+Don't start Gnus from the toolbar, use @kbd{M-x gnus}.  This is what I
+do.
+
+@item
+Redefine the function called by the toolbar:
+
+@lisp
+(defun toolbar-news ()
+  "Run Gnus in the frame it was started from."
+  (interactive)
+  (gnus))
+@end lisp
+@end enumerate
+
+@node Q4.2.4, Q4.3.1, Q4.2.3, Subsystems
+@section How do I customize the From: line?
+
+How do I change the @code{From:} line?  I have set gnus-user-from-line
+to Gail Gurman <gail.gurman@@sybase.com>, but XEmacs Gnus doesn't use
+it. Instead it uses Gail Mara Gurman <gailg@@deall> and then complains
+that it's incorrect. Also, as you perhaps can see, my Message-ID is
+screwy. How can I change that?
+
+Lars Magne Ingebrigtsen <larsi@@aegir.ifi.uio.no> writes:
+
+@quotation
+Set @code{user-mail-address} to @samp{gail.gurman@@sybase.com} or
+@code{mail-host-address} to @samp{sybase.com}.
+@end quotation
+
+@node Q4.3.1, Q4.3.2, Q4.2.4, Subsystems
+@section How can I read and/or compose MIME messages?
+
+One answer is @code{tra-vm-mime}.  You may find it at
+<URL:http://lenkkari.cs.tut.fi/~tra/software/tra-vm-mime.el>.
+
+Another possibility is RMIME.  You may find RMIME at
+<URL:http://www.cinti.net/~rmoody/rmime/index.html>.
+
+You probably want to use the Tools for MIME (tm).  @xref{Q4.3.2} for
+details.
+
+Trey Jackson <trey@@cs.berkeley.edu> has an Emacs & MIME web page at
+<URL:http://bmrc.berkeley.edu/~trey/emacs/mime.html>.
+
+@node Q4.3.2, Q4.3.3, Q4.3.1, Subsystems
+@section What is TM and where do I get it?
+
+TM stands for @dfn{Tools for MIME} and not Tiny MIME.  TM integrates
+with all major XEmacs packages like Gnus (all flavors), VM, MH-E, and
+mailcrypt.  It provides totally transparent and trouble-free MIME
+support.  When appropriate a message will be decoded in place in an
+XEmacs buffer.
+
+TM was written by MORIOKA Tomohiko <morioka@@jaist.ac.jp> and KOBAYASHI
+Shuhei <shuhei-k@@jaist.ac.jp>.  It is based on the work of UMEDA
+Masanobu <umerin@@mse.kyutech.ac.jp>, the original writer of GNUS.
+
+The following information is from the @file{README}:
+
+@dfn{tm} is a MIME package for GNU Emacs.
+tm has following functions:
+
+@itemize @bullet
+@item MIME style multilingual header.
+@item MIME message viewer (mime/viewer-mode).
+@item MIME message composer (mime/editor-mode).
+@item MIME extenders for mh-e, GNUS, RMAIL and VM.
+@end itemize
+
+tm is available from following anonymous ftp sites:
+@itemize @bullet
+@item <URL:ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime/> (Japan).
+@item <URL:ftp://ftp.nis.co.jp/pub/gnu/emacs-lisp/tm/> (Japan).
+@item <URL:ftp://ftp.nisiq.net/pub/gnu/emacs-lisp/tm/> (US).
+@item <URL:ftp://ftp.miranova.com/pub/gnus/jaist.ac.jp/> (US).
+@item <URL:ftp://ftp.unicamp.br/pub/mail/mime/tm/> (Brasil).
+@item <URL:ftp://ftp.th-darmstadt.de/pub/editors/GNU-Emacs/lisp/mime/> (Germany).
+@item <URL:ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib/> (Germany).
+@end itemize
+
+Don't let the installation procedure & instructions stop you from trying
+this package out---it's much simpler than it looks, and once installed,
+trivial to use.
+
+@node Q4.3.3, Q4.3.4, Q4.3.2, Subsystems
+@section Why isn't this @code{movemail} program working?
+
+Ben Wing <ben@@666.com> writes:
+
+@quotation
+It wasn't chown'ed/chmod'd correctly.
+@end quotation
+
+@node Q4.3.4, Q4.3.5, Q4.3.3, Subsystems
+@section Movemail is also distributed by Netscape?  Can that cause problems?
+
+Steve Baur <steve@@altair.xemacs.org> writes:
+
+@quotation
+Yes.  Always use the movemail installed with your XEmacs.  Failure to do
+so can result in lost mail.
+@end quotation
+
+Please refer to Jamie Zawinski's <jwz@@netscape.com> notes at
+<URL:http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html>.
+In particular, this document will show you how to make Netscape use the
+version of movemail configured for your system by the person who built
+XEmacs.
+
+@node Q4.3.5, Q4.4.1, Q4.3.4, Subsystems
+@section Where do I find pstogif (required by tm)?
+
+pstogif is part of the latex2html package.
+
+Jan Vroonhof <vroonhof@@math.ethz.ch> writes:
+
+latex2html is best found at the CTAN hosts and their mirrors
+in @file{tex-archive/support/latex2html}.
+
+CTAN hosts are:
+
+@itemize @bullet
+@item <URL:ftp://ftp.tex.ac.uk/tex-archive/support/latex2html/>.
+@item <URL:ftp://ftp.dante.de/tex-archive/support/latex2html/>.
+@end itemize
+
+There is a good mirror at ftp.cdrom.com;
+<URL:ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/>.
+
+@node Q4.4.1, Q4.5.1, Q4.3.5, Subsystems
+@section What is SPARCworks, EOS, and WorkShop?
+
+John Turner <turner@@lanl.gov> writes:
+
+@quotation
+SPARCworks is SunSoft's development environment, comprising compilers
+(C, C++, FORTRAN 77, Fortran 90, Ada, and Pascal), a debugger, and other
+tools such as TeamWare (for configuration management), MakeTool, etc.
+@end quotation
+
+See <URL:http://www.sun.com/sunsoft/Developer-products/products.html>
+for more info.
+
+EOS stands for "Era on SPARCworks", but I don't know what Era stands
+for.
+
+EOS is the integration of XEmacs with the SPARCworks debugger.  It
+allows one to use an XEmacs frame to view code (complete with
+fontification, etc.), set breakpoints, print variables, etc., while
+using the SPARCworks debugger.  It works very well and I use it all the
+time.
+
+Chuck Thompson <cthomp@@xemacs.org> writes:
+
+@quotation
+Era stood for "Emacs Rewritten Again".  It was what we were calling the
+modified version of Lucid Emacs for Sun when I was dragged, er, allowed
+to work on this wonderful editor.
+@end quotation
+
+Martin Buchholz <Martin.Buchholz@@sun.com> writes:
+
+@quotation
+EOS is being replaced with a new graphical development environment
+called Sun WorkShop, which is currently (07/96) in Alpha Test.  For more
+details, check out
+<URL:http://www.sun.com/sunsoft/Products/Developer-products/programs.html>.
+@end quotation
+
+@node Q4.5.1, Q4.6.1, Q4.4.1, Subsystems
+@section What is/was Energize?
+
+David N Gray <gray@@meteor.harlequin.com> writes:
+@quotation
+The files in @file{lisp/energize} are to enable Emacs to interface with
+the "Energize Programming System", a C and C++ development environment,
+which was a product of Lucid, Inc.  Tragically, Lucid went out of
+business in 1994, so although Energize is still a great system, if you
+don't already have it, there isn't any way to get it now.  (Unless you
+happen to be in Japan; INS Engineering may still be selling it there.
+Tartan bought the rights to sell it in the rest of the world, but never
+did so.)
+@end quotation
+
+@node Q4.6.1, Q4.7.1, Q4.5.1, Subsystems
+@section What is Infodock?
+
+NB:  the information in this section is quite dated.
 
 InfoDock is an integrated productivity toolset, mainly aimed at
 technical people.  It is built atop the XEmacs variant of GNU Emacs and
@@ -387,33 +3730,40 @@
 Emacs Manual.
 
 InfoDock menus are much more extensive and more mature than standard
-Emacs menus.  Each menu offers a @samp{Manual} item which displays
+Emacs menus.  Each menu offers a @code{Manual} item which displays
 documentation associated with the menu's functions.
-    
+
 Three types of menubars are provided:
+
 @enumerate
 @item
 An extensive menubar providing access to global InfoDock commands.
+
 @item
 Mode-specific menubars tailored to the current major mode.
+
 @item
-A simple menubar for basic editing to help novices get started with InfoDock.
+A simple menubar for basic editing to help novices get started
+with InfoDock.
 @end enumerate
 
-Most modes also include mode-specific popup menus.  Additionally, region and
-rectangle popup menus are included.
+Most modes also include mode-specific popup menus.  Additionally, region
+and rectangle popup menus are included.
+
 @itemize @bullet
 @item
-@samp{Hyperbole}, the everyday information manager, is a core part of
+@dfn{Hyperbole}, the everyday information manager, is a core part of
 InfoDock.  This provides context-sensitive mouse keys, a rolodex-type
 contact manager, programmable hypertext buttons, and an autonumbered
 outliner with embedded hyperlink anchors.
+
 @item
-@samp{PIEmail}, the prototype Personalized Information Environment Mail
+@dfn{PIEmail}, the prototype Personalized Information Environment Mail
 Tool, is included.
+
 @item
-The @samp{OO-Browser}, a multi-language object-oriented code browser, is a
-standard part of InfoDock.
+The @dfn{OO-Browser}, a multi-language object-oriented code browser, is
+a standard part of InfoDock.
 @end itemize
 
 InfoDock saves a more extensive set of user options than other Emacs
@@ -427,666 +3777,588 @@
 Your working set of buffers is automatically saved and restored (if you
 answer yes to a prompt) between InfoDock sessions.
 
-Refined color choices for code highlighting are provided for both dark and
-light background display frames.
-
-The @kbd{C-z} key prefix performs frame-based commands which parallel the
-@kbd{C-x} key prefix for window-based commands.
+Refined color choices for code highlighting are provided for both dark
+and light background display frames.
+
+The @kbd{C-z} key prefix performs frame-based commands which parallel
+the @kbd{C-x} key prefix for window-based commands.
 
 The Smart Menu system is included for producing command menus on dumb
-terminals. (InfoDock does not yet run on dumb terminals but will in 1995.)
+terminals. (InfoDock does not yet run on dumb terminals but will in
+1995.)
 
 Lisp libraries are better categorized according to function.
 
-Extensions and improvements to many areas of Emacs are included, such as:
-paragraph filling, mail reading with Rmail, shell handling, outlining, code
-highlighting and browsing, and man page browsing.
+Extensions and improvements to many areas of Emacs are included, such
+as: paragraph filling, mail reading with Rmail, shell handling,
+outlining, code highlighting and browsing, and man page browsing.
+
 
 InfoDock questions, answers and discussion should go to the mail list
-@samp{infodock@@hub.ucsb.edu}.  Use
-@samp{infodock-request@@hub.ucsb.edu} to be added or removed from the
-list.  Always include your InfoDock version number when sending help
-requests.
-
-InfoDock is available across the Internet via anonymous FTP.  To get
-it, first move to a directory into which you want the InfoDock archive
-files placed.  We will call this <DIST-DIR>.
- 
+<URL:mailto:infodock@@hub.ucsb.edu>.
+
+Use <URL:mailto:infodock-request@@hub.ucsb.edu> to be added or removed
+from the list.  Always include your InfoDock version number when sending
+help requests.
+
+InfoDock is available across the Internet via anonymous FTP.  To get it,
+first move to a directory into which you want the InfoDock archive files
+placed.  We will call this <DIST-DIR>.
+
 @example
-   cd <DIST-DIR>
+cd <DIST-DIR>
 @end example
 
 FTP to ftp.cs.uiuc.edu  (Internet Host ID = 128.174.252.1):
 
 @example
-   prompt> ftp ftp.cs.uiuc.edu
+prompt> ftp ftp.cs.uiuc.edu
 @end example
 
-Login as @samp{anonymous} with your own <user-id>@@<site-name> as a password.
-
-@example   
-   Name (ftp.cs.uiuc.edu): anonymous
-   331 Guest login ok, send your complete e-mail address as password.
-   Password: -<your-user-id@@your-domain>
-   230 Guest login ok, access restrictions apply.
+Login as anonymous with your own <user-id>@@<site-name> as a password.
+
+@example
+Name (ftp.cs.uiuc.edu): anonymous
+331 Guest login ok, send your complete e-mail address as password.
+Password: -<your-user-id@@your-domain>
+230 Guest login ok, access restrictions apply.
 @end example
 
 Move to the location of the InfoDock archives:
 
 @example
-   ftp> cd pub/xemacs/infodock
+ftp> cd pub/xemacs/infodock
 @end example
 
 Set your transfer mode to binary:
 
 @example
-   ftp> bin
-   200 Type set to I.
+ftp> bin
+200 Type set to I.
 @end example
 
 Turn off prompting:
 
 @example
-   ftp> prompt
-   Interactive mode off.
+ftp> prompt
+Interactive mode off.
 @end example
 
 Retrieve the InfoDock archives that you want, either by using a
-@samp{get <file>} for each file you want or by using the following to
+@code{get <file>} for each file you want or by using the following to
 get a complete distribution, including all binaries:
 
 @example
-   ftp> mget ID-INSTALL
-   ftp> mget id-*
+ftp> mget ID-INSTALL
+ftp> mget id-*
 @end example
 
 Close the FTP connection:
 
 @example
-   ftp> quit
-   221 Goodbye.
+ftp> quit
+221 Goodbye.
 @end example
 
 Read the @file{ID-INSTALL} file which you just retrieved for
 step-by-step installation instructions.
 
-
-
-@node 2. Compiling XEmacs, 3. Problems running XEmacs / weird messages, 1. Introductory Questions, top
-@chapter 2. Compiling XEmacs
-
-@menu
-* 2.1.::          2.1. What is the best way to compile XEmacs with the netaudio system, since I have got the netaudio system compiled but installed at a weird place, I am not root.  Also in the READMEs it does not say anything about compiling with the audioserver?
-@end menu
-
-
-@node 2.1.
-@section 2.1. What is the best way to compile XEmacs with the netaudio system, since I have got the netaudio system compiled but installed at a weird place, I am not root.  Also in the READMEs it does not say anything about compiling with the audioserver?
-
-You should only need to add some stuff to the configure command line.  To tell
-it to compile in netaudio support:
-
-@example
---with-sound=both
-@end example
-
-(Or @samp{--with-sound=nas} if you don't want native sound support for
-some reason.) To tell it where to find the netaudio includes and
-libraries:
-
-@example
---site-libraries=WHATEVER
---site-includes=WHATEVER
-@end example
-
-Then (fingers crossed) it should compile and it will use netaudio if you
-have a server running corresponding to the X server. The netaudio server
-has to be there when XEmacs starts. If the netaudio server goes away and
-another is run, XEmacs should cope (fingers crossed, error handling in
-netaudio isn't perfect).
-
-BTW, netaudio has been renamed as it has a name clash with something
-else, so if you see references to NAS or Network Audio System, it's the
-@ifinfo
-same thing.  It also might be found at
-
-@example
-ftp.x.org:/contrib/audio/nas/
-ftp.ncd.com:/pub/ncd/technology/src/nas/
-@end example
-@end ifinfo
-@ifhtml
-same thing.  It also might be found at
-<A HREF="ftp://ftp.x.org/contrib/audio/nas/">ftp.x.org:/contrib/audio/nas/</A>
-<A HREF="ftp://ftp.ncd.com:/pub/ncd/technology/src/nas/">ftp.ncd.com:/pub/ncd/technology/src/nas/</A>
-@end ifhtml
-
-@node 3. Problems running XEmacs / weird messages, 4. Customization -- Emacs Lisp and the .emacs file, 2. Compiling XEmacs, top
-@chapter 3. Problems running XEmacs / weird messages
-
-@menu
-* 3.1.::          3.1. Help! XEmacs just crashed on me!
-* 3.2.::          3.2. When I try to use some particular option of some particular package, I get a cryptic error in the minibuffer.
-* 3.3.::          3.3. I get tons of translation table syntax error messages during startup.  How do I get rid of them?
-* 3.4.::          3.4. How can I avoid the startup warnings about deducing proper fonts?
-* 3.5.::          3.5. Help! I can not get XEmacs to display on my Envizex X-terminal!
-* 3.6.::          3.6. Why do I get weird messages about giftoppm and ppmdither not being found?
-* 3.7.::          3.7. How can I avoid those messages about deleting excess backup files?
-* 3.8.::          3.8. Help! XEmacs just locked up my X server on my Linux box!
-@end menu
-
-
-@node 3.1.
-@section 3.1. Help! XEmacs just crashed on me!
-
-First of all, don't panic.  Whenever XEmacs crashes, it tries extremely
-hard to auto-save all of your files before dying. (The main time that
-this will not happen is if the machine physically lost power or if you
-killed the XEmacs process using @samp{kill -9}.) The next time you
-try to edit those files, you will be informed that a more recent
-auto-save file exists.  You can use @kbd{M-x recover-file} to retrieve
-the auto-saved version of the file.
-
-Now, XEmacs is not perfect, and there may occasionally be times, or
-particular sequences of actions, that cause it to crash.  If you can
-come up with a reproducible way of doing this (or even if you have a
-pretty good memory of exactly what you were doing at the time), the
-maintainers would be very interested in knowing about it.  Post a
-message to @samp{comp.emacs.xemacs} or send mail to
-@samp{xemacs@@cs.uiuc.edu}.
-
-If at all possible, include a stack backtrace of the core dump that was
-produced.  This shows where exactly things went wrong, and makes it much
-easier to diagnose problems.  To do this, you need to locate the core
-file (it's called @samp{core}, and is usually sitting in the directory
-that you started XEmacs from, or your home directory if that other
-directory was not writable).  Then, go to that directory and execute a
-command like
-
-@example
-gdb `which xemacs` core
-@end example
-
-and then issue the command @samp{where} to get the stack backtrace.
-(You might have to use @samp{dbx} or some similar debugger in place
-of @samp{gdb}.  If you don't have any such debugger available,
-complain to your system administrator.)
-
-It's possible that a core file didn't get produced, in which case
-you're out of luck.  Go complain to your system administrator and
-tell him not to disable core files by default. (If you explicitly
-disabled core files, then double shame on you!)
-
-
-@node 3.2.
-@section 3.2. When I try to use some particular option of some particular package, I get a cryptic error in the minibuffer.
-
-If you can't figure out what's going on, try typing @kbd{ESC ESC} and
-issuing the command
-
-@example
-(setq debug-on-error t)
-@end example
-
-and then try and make the error happen again.  This will give you a
-backtrace that may be enlightening.  If not, try reading farther down in
-this FAQ; if that fails, you could try posting to
-@samp{comp.emacs.xemacs} (making sure to include the backtrace) and
-someone may be able to help.
-
-
-@node 3.3.
-@section 3.3. I get tons of translation table syntax error messages during startup.  How do I get rid of them?
-
-There are two causes of this problem.  The first usually only strikes
-people using the prebuilt binaries.  The culprit in both cases is the
-file @file{XKeysymDB}.
-@itemize @bullet
-@item
-The binary cannot find the XKeysymDB file.  The location is hardcoded at
-compile time so if the system the binary was built on puts it a
-different place than your system does, you have problems.  To fix, set
-the environment variable @samp{XKEYSYMDB} to the location of the
-XKeysymDB file on your system or to the location of the one included
-with XEmacs which should be at:
-
-@example
-<xemacs_root_directory>/lib/xemacs-19.13/etc/XKeysymDB
-@end example
-
-@item
-The binary is finding the XKeysymDB but it is out-of-date on your system
-and does not contain the necessary lines.  Either ask your system
-administrator to replace it with the one which comes with XEmacs (which
-is the stock R6 version and is backwards compatible) or set your
-@samp{XKEYSYMDB} variable to the location of XEmacs's described above.
-@end itemize
-
-
-@node 3.4.
-@section 3.4. How can I avoid the startup warnings about deducing proper fonts?
-
-This is highly dependent on your installation, but try with the
-following font as your base font for XEmacs and see what it does: 
-
-@example
--adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
-@end example
-
-More precisely, do the following in your resource file:
-
-@example
-Emacs.default.attributeFont: -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
-@end example
-
-
-@node 3.5.
-@section 3.5. Help!  I can not get XEmacs to display on my Envizex X-terminal!
-
-Try setting the DISPLAY variable using the numeric IP address of the
-host you are running XEmacs from.
-
-
-@node 3.6.
-@section 3.6.  Why do I get weird messages about giftoppm and ppmdither not being found?
-
-Because they are not.  You are probably trying to read some HTML files,
-or using W3-mode as your Web client.  To display inline pictures, this
-requires the above programs (which can be found in the netpbm package or
-its older version, pbmplus).  The netpbm package can be found at
-@ifinfo
-@samp{ftp.x.org}, or any of its mirror sites.  It can also be found at
-@samp{ftp.cs.uiuc.edu:/pub/xemacs/aux}.
-@end ifinfo
-@ifhtml
-<A HREF="ftp://ftp.x.org/contrib/utilities/">ftp.x.org:/contrib/utilities/</A>
-.  It can also be found at
-<A HREF="ftp://ftp.cs.uiuc.edu/pub/xemacs/aux/">ftp.cs.uiuc.edu:/pub/xemacs/aux/</A>
-@end ifhtml
-
-
-@node 3.7.
-@section 3.7.  How can I avoid those messages about deleting excess backup files?
-
-
-Try the following Emacs-Lisp:
+@emph{Note}: Hyperbole, the KOutliner, and OO-Browser are included in
+XEmacs 19.14.
+
+@node Q4.7.1, Q4.7.2, Q4.6.1, Subsystems
+@section What is AucTeX?  Where do you get it?
+
+AucTeX is a package written by Per Abrahamsen <abraham@@dina.kvl.dk>.
+The following information is from the @file{README} and website.
+
+AUC TeX is an extensible package that supports writing and formatting
+TeX files for most variants of GNU Emacs. Many different macro packages
+are supported, including AMS TeX, LaTeX, and TeXinfo.
+
+The most recent version is always available by ftp at
+<URL:ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz>.
+
+In case you don't have access to anonymous ftp, you can get it by an
+email request to <URL:mailto:ftpmail@@decwrl.dec.com>.
+
+WWW users may want to check out the AUC TeX page at
+<URL:http://sunsite.auc.dk/auctex/>.
+
+@node Q4.7.2, Q4.7.3, Q4.7.1, Subsystems
+@section Are there any Emacs Lisp Spreadsheets?
+
+Yes.  Check out @dfn{dismal} (which stands for Dis' Mode Ain't Lotus) at
+<URL:ftp://cs.nyu.edu/pub/local/fox/dismal/>.
+
+@node Q4.7.3, Q4.7.4, Q4.7.2, Subsystems
+@section Byte compiling AucTeX on XEmacs 19.14.
+
+Georges Brun-Cottan <bruncott@@dormeur.inria.fr> writes:
+
+@quotation
+When byte compiling auxtex-9.4g, you must use the command:
 
 @example
-(setq version-control t)
-(setq kept-old-versions 0)
-(setq kept-new-versions 8)
-(if (string-match "XEmacs\\|Lucid" emacs-version)
-   (setq trim-versions-without-asking t)
-   (setq delete-old-versions t))
-@end example
-
-@node 3.8.
-@section 3.8.  Help! XEmacs just locked up my X server on my Linux box!
-
-There have been several reports of the X server locking up under Linux.
-In all reported cases removing speedo and scaled fonts from the font
-path corrected the problem.  This can be done with the command 'xset'.
-
-It is possible that using a font server may also solve the problem.
-
-
-
-@node 4. Customization -- Emacs Lisp and the .emacs file, 5. Customization -- X resources, 3. Problems running XEmacs / weird messages, top
-@chapter 4. Customization -- Emacs Lisp and the .emacs file
-
-@menu
-* 4.1.::          4.1. How can @file{.emacs} determine which of the family of emacsen I am using?
-* 4.2.::          4.2. How can I detect a color display?
-* 4.3.::          4.3. How can I evaluate emacs-lisp expressions without switching to the *scratch* buffer?
-* 4.4.::          4.4. If you put (setq tab-width 6) in your @file{.emacs} file it does not work!  Is there a reason for this.  If you do it at the EVAL prompt it works fine!! How strange.
-* 4.5.::          4.5. How can I add directories to the load-path?
-* 4.6.::          4.6. How to check if a lisp function is defined or not?
-* 4.7.::          4.7.  Can I force the output of (list-faces) to a buffer other than the minibuffer since it is too wide to fit?
-@end menu
-
-
-@node 4.1.
-@section 4.1. How can @file{.emacs} determine which of the family of Emacsen I am using?
-
-To determine if you are currently running GNU Emacs 18, GNU Emacs 19,
-XEmacs 19, or Epoch, and use appropriate code, check out the example
-given in @file{etc/sample.emacs}.  There are other nifty things in there
-as well!  Alternatively, there is a package, @file{emacs-vers.el},
-available at an Emacs-Lisp archive near you; try searching
-
-@example
-archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive/misc/
-@end example
-
-
-@node 4.2.
-@section 4.2. How can I detect a color display?
-
-You can test the return value of the function
-@code{(device-class)}, as in:
-
-@example
-(if (eq (device-class) 'color)
-    (progn 
-      (set-face-foreground  'font-lock-comment-face "Grey")
-      (set-face-foreground  'font-lock-string-face "Red")
-      ....
-      ))
-@end example
-
-
-@node 4.3.
-@section 4.3. How can I evaluate Emacs-Lisp expressions without switching to the *scratch* buffer?
-
-@example
-(put 'eval-expression 'disabled nil)
-@end example
-
-This sets it so that hitting @kbd{ESC ESC} lets you type a single
-expression to be evaluated.  This line can also be put into your
-@file{.emacs}.
-
-
-@node 4.4.
-@section 4.4. If you put (setq tab-width 6) in your @file{.emacs} file it does not work!  Is there a reason for this.  If you do it at the EVAL prompt it works fine!! How strange.
-
-Use setq-default, since tab-width is all-buffer-local.
-
-
-@node 4.5.
-@section 4.5. How can I add directories to the load-path?
-
-Here are two ways to do that, one that puts your directories at the front of
-the load-path, the other at the end:
-
-@example
-;;; Add things at the beginning of the load-path
-(setq load-path (cons "bar" load-path))
-(setq load-path (cons "foo" load-path))
-
-;;; Add things at the end
-(setq load-path (append load-path '("foo" "bar")))
-@end example
-
-
-@node 4.6.
-@section 4.6. How to check if a lisp function is defined or not?
-
-Use the following elisp:
-
-@example
-(fboundp 'foo)
+xemacs -batch -l lpath.el
 @end example
-
-It's always a mistake, under all circumstances, to test `emacs-version' or
-any similar variables, in case they are not bound, unless you do the above.
-
-Instead, use feature-tests, such as featurep or boundp or fboundp, or
-even simple behavioural tests, eg
- (defvar foo-old-losing-code? (condition-case nil (progn (losing-code t) nil)
-                                 (wrong-number-of-arguments t)))
-
-There is an incredible amount of broken code out there which could
-work much better more often in more places if it did the above instead
-of trying to divine its environment from the value of one variable.
-
-
-@node 4.7.
-@section 4.7.  Can I force the output of (face-list) to a buffer other than the minibuffer since it is too wide to fit?
-
-Evaluate the expression in the "*scratch*" buffer with point on the rightmost
-paren and typing @kbd{C-j}.
-
-
-
-@node 5. Customization -- X resources, 6. Changing textual fonts and colors, 4. Customization -- Emacs Lisp and the .emacs file, top
-@chapter 5. Customization -- X resources
-
-@menu
-* 5.1.::          5.1. Where is a list of X resources?
-@end menu
-
-
-@node 5.1.
-@section 5.1. Where is a list of X resources?
-
-Search through the NEWS file for ``X Resources''.  A fairly comprehensive list
-is given after it.
-
-In addition, an app-defaults file is supplied, @file{etc/Emacs.ad},
-listing the defaults.  The file @file{etc/sample.Xdefaults} gives a set
-of defaults that you might consider.  It is essentially the same as
-@file{etc/Emacs.ad} but some entries are slightly altered.  Be careful
-about installing the contents of this file into your @file{.Xdefaults}
-(.Xresources) file if you use FSF GNU Emacs under X11 as well.
-
-
-
-@node 6. Changing textual fonts and colors, 7. The modeline, 5. Customization -- X resources, top
-@chapter 6. Changing textual fonts and colors
-
-@menu
-* 6.1.::          6.1. How do I set the text, menu and modeline fonts?
-* 6.2.::          6.2. How can I set the background/foreground colors when highlighting a region? 
-* 6.3.::          6.3. How can I set the most commonly used color options from my @file{.emacs} instead of from my @file{.Xdefaults}? 
-@end menu
-
-
-@node 6.1.
-@section 6.1. How do I set the text, menu and modeline fonts?
-
-Note that you should use @samp{Emacs.} and not @samp{Emacs*} when
-setting face values.
-
-In @file{.Xdefaults}:
-
-@example
-Emacs.default.attributeFont:  -*-*-medium-r-*-*-*-120-*-*-m-*-*-* 
-Emacs*menubar*font:           fixed
-Emacs.modeline.attributeFont: fixed
-@end example
-
-This is confusing because modeline is a face, and can be found listed
-with all faces in the current mode by using M-x set-face-font (enter) ?.
-It uses the face specification of "attributeFont", while menubar is a
-normal X thing that uses the specification "font".  With Motif it may be
-necessary to use "fontList" instead of "font".  (Please rewrite this if
-you understand this better than me ...  A general description of faces
-would be very useful.  I am just saying that menubar is a FAQ because
-it's not a face and not listed.)
-
-
-@node 6.2.
-@section 6.2. How can I set the background/foreground colors when highlighting a region? 
-
-You can change the face `zmacs-region' either in your @file{.Xdefaults}:
-
-@example
-Emacs.zmacs-region.attributeForeground: firebrick
-Emacs.zmacs-region.attributeBackground: lightseagreen
-@end example
-
-or in your @file{.emacs}:
-
-@example
-(set-face-background 'zmacs-region "red")   
-(set-face-foreground 'zmacs-region "yellow")
-@end example
-
-
-@node 6.3.
-@section 6.3. How can I set the most commonly used color options from my @file{.emacs} instead of from my @file{.Xdefaults}? 
-
-@example
-(set-face-background 'default "bisque")          ; frame background
-(set-face-foreground 'default "black")           ; normal text
-(set-face-background 'zmacs-region "red")   ; When selecting w/
-                                                 ; mouse 
-(set-face-foreground 'zmacs-region "yellow")
-(set-face-font  'default "*courier-bold-r*120-100-100*")
-(set-face-background 'highlight "blue")          ; Ie when selecting buffers 
-(set-face-foreground 'highlight "yellow")
-(set-face-background 'modeline "blue")           ; Line at bottom of buffer
-(set-face-foreground 'modeline "white")
-(set-face-font  'modeline "*bold-r-normal*140-100-100*")
-(set-face-background 'isearch "yellow")          ; When highlighting while
-                                                 ; searching		 
-(set-face-foreground 'isearch "red")
-(setq x-pointer-foreground-color "black")        ; Adds to bg color,
-                                                 ; so keep black
-(setq x-pointer-background-color "blue")         ; This is color you really
-@end example
-                                                 ; want ptr/crsr
-
-
-@node 7. The modeline, 8. The keyboard, 6. Changing textual fonts and colors, top
-@chapter 7. The modeline
-
-@menu
-* 7.1.::          7.1. How can I make the modeline go away?
-* 7.2.::          7.2. How do you have XEmacs display the line number in the modeline?
-* 7.3.::          7.3. How do I get XEmacs to put the time of day on the modeline?
-* 7.4.::          7.4. How can one change the color of the modeline based on the mode used? i.e. red for C mode, green for TeX mode etc.?
-@end menu
-
-
-@node 7.1.
-@section 7.1. How can I make the modeline go away?
-
-(set-specifier has-modeline-p nil)
-
-
-@node 7.2.
-@section 7.2. How do you have XEmacs display the line number in the modeline?
-
-Add the following line to your @file{.emacs} file:
-
-@example
-(setq line-number-mode t)
-@end example
-
-
-@node 7.3.
-@section 7.3. How do I get XEmacs to put the time of day on the modeline?
-
-@example
-(display-time)
-@end example
-
-
-@node 7.4.
-@section 7.4. How can one change the color of the modeline based on the mode used? i.e. red for C mode, green for TeX mode etc.?
-
-You can use something like the following:
-
-@example
-(add-hook 'lisp-mode-hook 
-        '(lambda () (set-face-background 'modeline "red" (current-buffer))
-                    (set-face-foreground 'modeline "yellow" (current-buffer))))
-@end example
-
-Then, when editing a Lisp file (ie went into Lisp mode), the modeline
-colors change from the default set in your @file{.emacs}.  The change
-will only be made in the buffer you just entered (which contains the
-Lisp file you are editing) and will not affect the modeline colors
-anywhere else.
-
-Notes:
+@end quotation
+
+@node Q4.7.4,  , Q4.7.3, Subsystems
+@section Problems installing AucTeX.
+
+Jan Vroonhof <vroonhof@@math.ethz.ch> writes:
+
+@quotation
+AucTeX works fine on both stock Emacs and XEmacs has been doing so for a
+very very long time. This is mostly due to the work of Per Abrahamsen
+<abraham@@dina.kvl.dk> (clap clap) in particular his @file{easymenu}
+package.  Which leads to what is probably the problem...
+@end quotation
+
+Most problems with AucTeX are one of two things:
 
 @itemize @bullet
 @item
-The hook is the mode name plus "-hook". Ie c-mode-hook, c++-mode-hook,
-emacs-lisp-mode-hook (ie your @file{.emacs} or a xx.el file),
-lisp-interaction-mode-hook (the *scratch* buffer), text-mode-hook, etc.
-@item
-Be sure to use add-hook, not (setq c-mode-hook xxxx), otherwise you will
-erase anything that anybody has already put on the hook.
+The TeX-lisp-directory in @file{tex-site.el} and the makefile don't
+match.
+
+Fix: make sure you configure AucTeX properly @strong{before} installing.
+
 @item
-You can also do (set-face-font 'modeline @code{font}), eg (set-face-font
-'modeline "*bold-r-normal*140-100-100*" (current-buffer)) if you wish
-the modeline font to vary based on the current mode.
+You have an old version of easymenu.el in your path.
+
+Fix: use @code{locate-library} and remove old versions to make sure it
+@strong{only} finds the one that came with XEmacs.
 @end itemize
 
-
-@node 8. The keyboard, 9. The cursor, 7. The modeline, top
-@chapter 8. The keyboard
+@node Miscellaneous, Current Events, Subsystems, Top
+@chapter The Miscellaneous Stuff
+
+This is part 5 of the XEmacs Frequently Asked Questions list.  This
+section is devoted to anything that doesn't fit neatly into the other
+sections.
 
 @menu
-* 8.1.::          8.1. What is the difference in key sequences between XEmacs and GNU Emacs? 
-* 8.2.::          8.2. How can I make XEmacs recognize the Alt key of my HP workstation as a Meta key?
-* 8.3.::          8.3. How can I stop the down-arrow-key from adding empty lines at the bottom of my buffers?
-* 8.4.::          8.4. I wonder if there is an interactive function that can generate "fake" keyboard events. This way, I could simply map them inside XEmacs.
-* 8.5.::          8.5. I am trying to bind C-. to scroll up by one line and C-; to scroll down by one line...
-* 8.6.::          8.6. I cannot manage to globally bind my @key{Delete} key to something other than the default.  How does one do this?
-* 8.7.::          8.7. How can I bind complex functions (or macros) to keys?
-* 8.8.::          8.8. Can the cursor keys scroll the screen a line at a time, rather than the default half page jump?  I tend it to find it disorienting.
-* 8.9.::          8.9. How to map "Help" key alone on Sun type4 keyboard?
-* 8.10.::          8.10. How can you type in special characters in XEmacs?
+Major & Minor Modes:
+* Q5.0.1::      How can I do source code highlighting using font-lock?
+* Q5.0.2::      I do not like cc-mode.  How do I use the old c-mode?
+* Q5.0.3::      How do I get @samp{More} Syntax Highlighting on by default?
+* Q5.0.4::      How can I enable auto-indent?
+* Q5.0.5::      How can I get XEmacs to come up in text/auto-fill mode by default?
+* Q5.0.6::      How do I start up a second shell buffer?
+* Q5.0.7::      Telnet from shell filters too much.
+* Q5.0.8::      Why does edt emulation not work?
+* Q5.0.9::      How can I emulate VI and use it as my default mode?
+* Q5.0.10::     What is @samp{Omit} minor mode?
+* Q5.0.11::     Filladapt doesn't work in 19.13?
+* Q5.0.12::     How do I disable gnuserv from opening a new frame?
+* Q5.0.13::     How do I start gnuserv so that each subsequent XEmacs is a client?
+* Q5.0.14::     Strange things are happening in Shell Mode.
+* Q5.0.15::     Where do I get the latest CC Mode?
+* Q5.0.16::     I find auto-show-mode disconcerting.  How do I turn it off?
+* Q5.0.17::     How can I get two instances of info?
+* Q5.0.18::     I upgraded to XEmacs 19.14 and gnuserv stopped working
+* Q5.0.19::     Is there something better than LaTeX mode?
+
+Emacs Lisp Programming Techniques:
+* Q5.1.1::      The difference in key sequences between XEmacs and GNU Emacs?
+* Q5.1.2::      Can I generate "fake" keyboard events?
+* Q5.1.3::      How can I visit several marked files at once in dired?
+* Q5.1.4::      In 19.13, why do I get @samp{set-text-something} lisp errors with Gnus and AUC-TeX?
+* Q5.1.5::      How do I put a glyph as annotation in a buffer?
+
+Sound:
+* Q5.2.1::      How do I turn off the sound?
+* Q5.2.2::      How do I get funky sounds instead of a boring beep?
+* Q5.2.3::      What's NAS, how do I get it?
+* Q5.2.4::      Sunsite sounds don't play.
+
+Miscellaneous:
+* Q5.3.1::      How do you make XEmacs indent CL if-clauses correctly?
+* Q5.3.2::      Fontifying hangs when editing a postscript file.
+* Q5.3.3::      How can I print WYSIWYG a font-locked buffer?
+* Q5.3.4::      Getting @kbd{M-x lpr} to work with postscript printer.
+* Q5.3.5::      How do I specify the paths that XEmacs uses for finding files?
+* Q5.3.6::      [This question intentionally left blank]
+* Q5.3.7::      Can I have the end of the buffer delimited in some way?
+* Q5.3.8::      How do I insert today's date into a buffer?
+* Q5.3.9::      Are only certain syntactic character classes available for abbrevs?
+* Q5.3.10::     How can I get those oh-so-neat X-Face lines?
+* Q5.3.11::     How do I add new Info directories?
+* Q5.3.12::     What do I need to change to make printing work?
 @end menu
 
-
-@node 8.1.
-@section 8.1. What is the difference in in key sequences between XEmacs and GNU Emacs? 
-
-The real question might be rephrased as "When should one use the quoted list,
-vector, or escaped string representations of key sequences?"  Is there any
-particular advantage to one representation over another?
-
-From Richard Mlynarik <mly@@adoc.xerox.com>:
-
-@table @asis
-@item (meta a)
-is a convenience shorthand for the sequence @code{[(meta a)]}.
-@code{(global-set-key 'a 'foo)} means the same thing as
-@code{(global-set-key '[a] 'foo)}.  It could be argued that allowing
-such a shorthand just leads to sloppiness and bugs, but it's there, and
-it isn't likely to go away.
-
-@item [(meta a)]
-is The Right Thing.  It corresponds in a one-to-one way with the
-internal representation of key-sequences in keymaps.
-
-@item [Meta-a]
-is typical FSF Emacs 19 brain damage.  As is usual, an existing,
-functional design is ignored (XEmacs) and an incompatible and
-technically worse kludge is used.
-
-@item "\ea"
-is compatible with Emacs 18, but suffers from ASCII Seven-Bit Brain
-Damage.  I also find it harder to read.  Use this if you're trying to
-write code which works in every Emacs, but be aware that you can not
-express all Possible key-sequences (@kbd{control-9}, @kbd{f1}, etc.)
-using this.
-
-@end table
-
-
-@node 8.2.
-@section 8.2. How can I make XEmacs recognize the Alt key of my HP workstation as a Meta key?
-
-Put the following line into a file and load it with xmodmap(1) before
-starting XEmacs:
+@node Q5.0.1, Q5.0.2, Miscellaneous, Miscellaneous
+@section How can I do source code highlighting using font-lock?
+
+For most modes, font-lock is already set up and just needs to be turned
+on.  This can be done by @kbd{M-x font-lock-mode}, or by having XEmacs
+automatically start it by adding lines like:
+
+@lisp
+(add-hook 'emacs-lisp-mode-hook	'turn-on-font-lock)
+(add-hook 'dired-mode-hook	'turn-on-font-lock)
+@end lisp
+
+to your @file{.emacs}.  See the file @file{etc/sample.emacs} for more
+examples.
+
+@node Q5.0.2, Q5.0.3, Q5.0.1, Miscellaneous
+@section I do not like cc-mode.  How do I use the old c-mode?
+
+Well, first off, consider if you really want to do this.  cc-mode is
+much more powerful than the old c-mode.  If you're having trouble
+getting your old offsets to work, try using @code{c-set-offset} instead.
+You might also consider using the package @code{cc-compat}.
+
+But, if you still insist, add the following lines to your @file{.emacs}:
+
+@lisp
+(fmakunbound 'c-mode)
+(makunbound 'c-mode-map)
+(fmakunbound 'c++-mode)
+(makunbound 'c++-mode-map)
+(makunbound 'c-style-alist)
+(load-library "old-c-mode")
+(load-library "old-c++-mode")	
+@end lisp
+
+This must be done before any other reference is made to either c-mode or
+c++-mode.
+
+@node Q5.0.3, Q5.0.4, Q5.0.2, Miscellaneous
+@section How do I get @samp{More} Syntax Highlighting on by default?
+
+For C, C++, and Lisp, you can add the following to your @file{.emacs}:
+
+@lisp
+(setq c-font-lock-keywords c-font-lock-keywords-2)
+(setq c++-font-lock-keywords c++-font-lock-keywords-2)
+(setq lisp-font-lock-keywords lisp-font-lock-keywords-2)
+@end lisp
+
+@node Q5.0.4, Q5.0.5, Q5.0.3, Miscellaneous
+@section How can I enable auto-indent?
+
+Put the following line in your @file{.emacs}:
+
+@lisp
+(setq indent-line-function 'indent-relative-maybe)
+@end lisp
+
+If you want to get fancy, try the @code{filladapt} package available
+standard with XEmacs.  Put this into your @file{.emacs}:
+
+@lisp
+(require 'filladapt)
+(add-hook 'text-mode-hook    'turn-on-filladapt-mode)
+(add-hook 'message-mode-hook 'turn-on-filladapt-mode)
+;;; and so forth ...
+@end lisp
+
+Please note that the @code{fa-extras} package is no longer useful.
+
+@node Q5.0.5, Q5.0.6, Q5.0.4, Miscellaneous
+@section How can I get XEmacs to come up in text/auto-fill mode by default?
+
+Try the following lisp in your @file{.emacs}:
+
+@lisp
+(setq default-major-mode 'text-mode)
+(setq text-mode-hook 'turn-on-auto-fill)
+@end lisp
+
+@strong{WARNING}: note that changing the value of
+@code{default-major-mode} from @code{fundamental-mode} can break a large
+amount of built-in code that expects newly created buffers to be in
+@code{fundamental-mode}.  (Changing from @code{fundamental-mode} to
+@code{text-mode} might not wreak too much havoc, but changing to
+something more exotic like a lisp-mode would break many Emacs packages).
+
+Note that Emacs by default starts up in buffer @code{*scratch*} in
+@code{initial-major-mode}, which defaults to
+@code{lisp-interaction-mode}. Thus adding the following form to your
+Emacs init file will cause the initial @code{*scratch*} buffer to be put
+into auto-fill'ed @code{text-mode}:
+
+@lisp
+(setq initial-major-mode
+      (function (lambda ()
+        (text-mode)
+        (turn-on-auto-fill))))
+@end lisp
+
+Note that after your init file is loaded, if
+@code{inhibit-startup-message} is null (the default) and the startup
+buffer is @code{*scratch*} then the startup message will be inserted
+into @code{*scratch*}; it will be removed after a timeout by erasing the
+entire @code{*scratch*} buffer. Keep in mind this default usage of
+@code{*scratch*} if you desire any prior manipulation of
+@code{*scratch*} from within your Emacs init file. In particular,
+anything you insert into @code{*scratch*} from your init file will be
+later erased. Also, if you change the mode of the @code{*scratch*}
+buffer, be sure that this will not interfere with possible later
+insertion of the startup message (e.g. if you put @code{*scratch*} into
+a nonstandard mode that has automatic font lock rules, then the startup
+message might get fontified in a strange foreign manner, e.g. as code in
+some programming language).
+
+@node Q5.0.6, Q5.0.7, Q5.0.5, Miscellaneous
+@section How do I start up a second shell buffer?
+
+In the @code{*shell*} buffer:
+
+@lisp
+M-x rename-buffer RET *shell-1* RET
+M-x shell RET
+@end lisp
+
+This will then start a second shell.  The key is that no buffer named
+@samp{*shell*} can exist.  It might be preferable to use @kbd{M-x
+rename-uniquely} to rename the @code{*shell*} buffer instead of @kbd{M-x
+rename-buffer}.
+
+@node Q5.0.7, Q5.0.8, Q5.0.6, Miscellaneous
+@section Telnet from shell filters too much
+
+I'm using the Emacs @kbd{M-x shell} function, and I would like to invoke
+and use a telnet session within it.  Everything works fine except that
+now all @samp{^M}'s are filtered out by Emacs.  Fixes?
+
+Use @kbd{M-x rsh} or @kbd{M-x telnet} to open remote sessions rather
+than doing rsh or telnet within the local shell buffer.
+
+@node Q5.0.8, Q5.0.9, Q5.0.7, Miscellaneous
+@section Why does edt emulation not work?
+
+We don't know, but you can use tpu-edt emulation instead, which works
+fine and is a little fancier than the standard edt emulation.  To do
+this, add the following line to your @file{.emacs}:
+
+@lisp
+(load "tpu-edt")
+@end lisp
+
+If you don't want it to replace @kbd{C-h} with an edt-style help menu
+add this as well:
+
+@lisp
+(global-set-key '(control h) 'help-for-help)
+@end lisp
+
+@node Q5.0.9, Q5.0.10, Q5.0.8, Miscellaneous
+@section How can I emulate VI and use it as my default mode?
+
+Our recommended VI emulator is viper. To make viper-mode the default,
+add this to your @file{.emacs}:
+
+@lisp
+(viper-mode)
+@end lisp
+
+Michael Kifer <kifer@@CS.SunySB.EDU> writes:
+
+@quotation
+This should be added as close to the top of @file{.emacs} as you can get
+it, otherwise some minor modes may not get viper-ized.
+@end quotation
+
+@node Q5.0.10, Q5.0.11, Q5.0.9, Miscellaneous
+@section What is @code{Omit} minor mode?
+
+I have no idea where this is coming from, but ever since I moved from
+19.9 to 19.13 I have started seeing that all of my buffers will get a
+minor mode called @code{Omit}.  I have no idea how it got there nor do I
+know what it does.  What is it?
+
+It's part of dired.  In dired, you can type M-o to get Omit mode and
+that will ignore uninteresting files (checkpoint files and backups, for
+example).  You get Omit in the modeline everywhere because the variable
+@code{dired-omit-files-p} is globally set to some non-nil value.  If you
+want this functionality, it's probably best to use a hook:
+
+@lisp
+(add-hook 'dired-after-readin-hook '(lambda () (dired-omit-toggle)))
+@end lisp
+
+Alternatively, since it seems odd to toggle the omit state with every
+readin, since readin can happen many times in a Dired buffer, you can
+try this hook to correct the @code{Omit} problem:
+
+@lisp
+(add-hook 'dired-mode-hook
+  (function (lambda ()
+      ;; `dired-omit-files-p' is made buffer-local by "dired-x.el", but
+      ;; maybe not soon enough.
+            (make-local-variable 'dired-omit-files-p)
+            (setq dired-omit-files-p t))))
+@end lisp
+
+This is only run once, when the Dired buffer is created.
+
+@node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous
+@section Filladapt doesn't work in 19.13?
+
+Filladapt 2.x is included in 19.13+.  In it filladapt is now a minor
+mode and minor modes are traditionally off by default.  The following
+added to your @file{.emacs} will turn it on for all buffers:
+
+@lisp
+(setq-default filladapt-mode t)
+@end lisp
+
+Use @code{turn-on-filladapt-mode} to turn Filladapt on in particular
+major modes, like this:
+
+@lisp
+(add-hook 'text-mode-hook 'turn-on-filladapt-mode) 
+@end lisp
+
+@node Q5.0.12, Q5.0.13, Q5.0.11, Miscellaneous
+@section How do I disable gnuserv from opening a new frame?
+
+If you set the @code{gnuserv-frame} variable to the frame that should be
+used to display buffers that are pulled up, a new frame will not be
+created. For example, you could put
+
+@lisp
+(setq gnuserv-frame (selected-frame))
+@end lisp
+
+early on in your @file{.emacs}, to ensure that the first frame created
+is the one used for your gnuserv buffers.
+
+Starting in 19.15, there is an option to set the gnuserv target to
+the current frame.  See
+@code{Options->"Other Window" Location->Make current frame gnuserv target}
+
+@node Q5.0.13, Q5.0.14, Q5.0.12, Miscellaneous
+@section How do I start gnuserv so that each subsequent XEmacs is a client?
+
+Put the following in your @file{.emacs} file to start the server:
+
+@lisp
+(gnuserv-start)
+@end lisp
+
+Start your first XEmacs as usual.  After that, you can do:
 
 @example
-remove Mod1 = Mode_switch
+gnuclient randomfilename
 @end example
 
-
-@node 8.3.
-@section 8.3. How can I stop the down-arrow-key from adding empty lines at the bottom of my buffers?
-
-Add the following line to your @file{.emacs} file:
+from the command line to get your existing XEmacs process to open a new
+frame and visit randomfilename in that window. When you're done editing
+randomfilename, hit @kbd{C-x #} to kill the buffer and get rid of the
+frame.
+
+@node Q5.0.14, Q5.0.15, Q5.0.13, Miscellaneous
+@section Strange things are happening in Shell Mode.
+
+Sometimes (i.e. it's not repeatable, and I can't work out why it
+happens) when I'm typing into shell mode, I hit return and only a
+portion of the command is given to the shell, and a blank prompt is
+returned.  If I hit return again, the rest of the previous command is
+given to the shell.
+
+Martin Buchholz <Martin.Buchholz@@sun.com> writes:
+
+@quotation
+There is a known problem with interaction between @code{csh} and the
+@code{filec} option and XEmacs.  You should add the following to your
+@file{.cshrc}:
 
 @example
-(setq next-line-add-newlines nil)
+if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec
 @end example
-
-
-@node 8.4.
-@section 8.4. I wonder if there is an interactive function that can generate "fake" keyboard events. This way, I could simply map them inside XEmacs.
+@end quotation
+
+@node Q5.0.15, Q5.0.16, Q5.0.14, Miscellaneous
+@section Where do I get the latest CC Mode?
+
+Barry A. Warsaw <bwarsaw@@cnri.reston.va.us> writes:
+
+@quotation
+This can be had from <URL:http://www.python.org/ftp/emacs/>.
+@end quotation
+
+@node Q5.0.16, Q5.0.17, Q5.0.15, Miscellaneous
+@section I find auto-show-mode disconcerting.  How do I turn it off?
+
+@code{auto-show-mode} controls whether or not a horizontal scrollbar
+magically appears when a line is too long to be displayed.  This is
+enabled by default.  To turn it off, put the following in your
+@file{.emacs}:
+
+@lisp
+(setq auto-show-mode nil)
+(setq-default auto-show-mode nil)
+@end lisp
+
+@node Q5.0.17, Q5.0.18, Q5.0.16, Miscellaneous
+@section How can I get two instances of info?
+
+You can't.  The info package does not provide for multiple info buffers.
+
+@node Q5.0.18, Q5.0.19, Q5.0.17, Miscellaneous
+@section I upgraded to XEmacs 19.14 and gnuserv stopped working.
+
+Mark Daku <daku@@nortel.ca> writes:
+
+@quotation
+It turns out I was using an older version of gnuserv.  The installation
+didn't put the binary into the public bin directory.  It put it in
+@file{lib/xemacs-19.14/hppa1.1-hp-hpux9.05/gnuserv}.  Shouldn't it have
+been put in @file{bin/hppa1.1-hp-hpux9.0}?
+@end quotation
+
+@node Q5.0.19, Q5.1.1, Q5.0.18, Miscellaneous
+@section Is there something better than LaTeX mode?
+
+David Kastrup <dak@@fsnif.neuroinformatik.ruhr-uni-bochum.de> writes:
+
+@quotation
+The standard TeX modes leave much to be desired, and are somewhat
+leniently maintained.  Serious TeX users use AucTeX (@xref{Q4.7.1}).
+@end quotation
+
+@node Q5.1.1, Q5.1.2, Q5.0.19, Miscellaneous
+@section What is the difference in key sequences between XEmacs and GNU Emacs?
+
+Erik Naggum <erik@@naggum.no> writes;
+
+@quotation
+Emacs has a legacy of keyboards that produced characters with modifier
+bits, and therefore map a variety of input systems into this scheme even
+today.  XEmacs is instead optimized for X events.  This causes an
+incompatibility in the way key sequences are specified, but both Emacs
+and XEmacs will accept a key sequence as a vector of lists of modifiers
+that ends with a key, e.g., to bind M-C-a, you would say [(meta control
+a)] in both Emacsen.  XEmacs has an abbreviated form for a single key,
+just (meta control a).  Emacs has an abbreviated form for the Control
+and the Meta modifiers to string-characters (the ASCII characters), as
+in "\M-\C-a".  XEmacs users need to be aware that the abbreviated form
+works only for one-character key sequences, while Emacs users need to be
+aware that the string-character is rather limited.  Specifically, the
+string-character can accomodate only 256 different values, 128 of which
+have the Meta modifier and 128 of which have not.  In each of these
+blocks, only 32 characters have the Control modifier.  Whereas [(meta
+control A)] differs from [(meta control a)] because the case differs,
+"\M-\C-a" and "\M-\C-A" do not.  Programmers are advised to use the full
+common form, both because it is more readable and less error-prone, and
+because it is supported by both Emacsen.
+@end quotation
+
+@node Q5.1.2, Q5.1.3, Q5.1.1, Miscellaneous
+@section Can I generate "fake" keyboard events?
+
+I wonder if there is an interactive function that can generate "fake"
+keyboard events.  This way, I could simply map them inside XEmacs.
 
 This seems to work:
-@example
+
+@lisp
 (defun cg--generate-char-event (ch)
   "Generate an event, as if ch has been typed"
   (dispatch-event (character-to-event ch)))
@@ -1096,1261 +4368,529 @@
                 '(lambda () (interactive) (cg--generate-char-event 127)))
 (global-set-key '(unknown_keysym_0x4)
                 '(lambda () (interactive) (cg--generate-char-event 4)))
-@end example
-
-
-@node 8.5.
-@section 8.5. I am trying to bind C-. to scroll up by one line and C-; to scroll down by one line...
-
-Add the following (Thanks to Richard Mlynarik <mly@@adoc.xerox.com> and
-Wayne Newberry <wayne@@zen.cac.stratus.com>) to @file{.emacs}:
-
-@example
-(defun scroll-up-one-line ()
-  (interactive)
-  (scroll-up 1))
-
-(defun scroll-down-one-line ()
-  (interactive)
-  (scroll-down 1))
-
-(global-set-key [(control ?.)]   'scroll-up-one-line)        ; C-.
-(global-set-key [(control ?;)]   'scroll-down-one-line)      ; C-;
-@end example
-
-The key point is that you can only bind simple functions to keys; you can not
-bind a key to a function that you're also passing arguments to.  (See <A
-HREF="#ss8.7">8.7 How can I bind complex functions</A> for a better answer.)
-
-@c Fix the above HTML specifier reference
-
-@node 8.6.
-@section 8.6. I cannot manage to globally bind my @key{Delete} key to something other than the default.  How does one do this?
-
-@example
-(defun Foo ()
-  (interactive)
-    (message "You hit DELETE"))
-
-(global-set-key "\C-?" 'Foo)
-@end example
-
-However, some modes explicitly bind @key{Delete}, so you would need to
-add a hook that does @code{local-set-key} for them.
-
-
-@node 8.7.
-@section 8.7. How can I bind complex functions (or macros) to keys?
-
-As an example, say you want the PASTE key on a Sun keyboard to insert the
-current Primary X selection at point. You can accomplish this with:
-
-@example
-(define-key global-map 'f18 'x-insert-selection)
-@end example
-
-However, this only works if there is a current X selection (the
-selection will be highlighted).  The functionality I like is for the
-PASTE key to insert the current X selection if there is one, otherwise
-insert the contents of the clipboard.  To do this you need to pass
-arguments to x-insert-selection.  This is done by wrapping the call in a
-'lambda form:
-
-@example
-(define-key global-map 'f18
-  (function (lambda () (interactive) (x-insert-selection t nil))))
-@end example
-
-This binds the 'f18 key to a "generic" functional object.  The interactive
-spec is required because only interactive functions can be bound to keys.
-Also take a look at the doc for "function".
-
-For the FAQ example you could use:
-
-@example
-(global-set-key [(control ?.)]
-		(function (lambda () (interactive) (scroll-up 1))))
-(global-set-key [(control ?;)]
-	        (function (lambda () (interactive) (scroll-up -1))))
-@end example
-
-This is fine if you only need a few functions within the lambda body.  If
-you're doing more it's cleaner to define a separate function as in the
-original FAQ example (<A HREF="#ss11.3">question 11.3</A>).
-
-@c Fix the above HTML specifier reference
-
-@node 8.8.
-@section 8.8. Can the cursor keys scroll the screen a line at a time, rather than the default half page jump?  I tend it to find it disorienting.
-
-Try this:
-
-@example
-(defun scroll-one-line-up (&optional arg)
-  "Scroll the selected window up (forward in the text) one line (or N lines)."
-  (interactive "p")
-  (scroll-up (or arg 1)))
-
-(defun scroll-one-line-down (&optional arg)
-  "Scroll the selected window down (backward in the text) one line (or N)."
-  (interactive "p")
-  (scroll-down (or arg 1)))
-
-(global-set-key 'up 'scroll-one-line-up)
-(global-set-key 'down  'scroll-one-line-down)
-@end example
-
-The following will also work but will affect more than just the cursor
-keys (i.e. C-n and C-p):
-
-@example
-(setq scroll-step 1)
-@end example
-
-@node 8.9.
-@section 8.9. How to map "Help" key alone on Sun type4 keyboard?
-
-The following works in GNU Emacs 19:
-
-@example
-(global-set-key [help] 'help-command)  		;; Help
-@end example
-
-The following works in XEmacs 19.13 with the addition of shift:
-
-@example 
-(global-set-key [(shift help)] 'help-command)  		;; Help
-@end example
-
-But it doesn't work alone.  This is in the file @file{PROBLEMS} which
-should have come with your XEmacs installation:
-
-@emph{Emacs ignores the @key{help} key when running OLWM}.
-
-OLWM grabs the @key{help} key, and retransmits it to the appropriate
-client using XSendEvent.  Allowing Emacs to react to synthetic events is
-a security hole, so this is turned off by default.  You can enable it by
-setting the variable x-allow-sendevents to t.  You can also cause fix
-this by telling OLWM to not grab the help key, with the null binding
-@samp{OpenWindows.KeyboardCommand.Help:}.
-
-
-@node 8.10.
-@section 8.10. How can you type in special characters in XEmacs?
-
-One way is to use the package @file{x-compose}.  Then you can use sequences
-like @kbd{Compose " a} to get d (a-umlaut), etc.
-
-
-
-@node 9. The cursor, 10. The mouse; cutting and pasting, 8. The keyboard, top
-@chapter 9. The cursor
-
-@menu
-* 9.1.::          9.1. Is there a way to make the bar cursor a little thicker than one-pixel thick since I lose it?
-* 9.2.::          9.2. On the same subject -- is there a way to get back the old "block" cursor where the cursor covers the character in front of the point?
-@end menu
-
-
-@node 9.1.
-@section 9.1. Is there a way to make the bar cursor a little thicker than one-pixel thick since I lose it?
-
-For a 1 pixel bar cursor, use:
-
-@example
-(setq bar-cursor t)
-@end example
-
-For a 2 pixel bar cursor, use:
-
-@example
-(setq bar-cursor 'anything-else)
-@end example
-
-You can use a color to make it stand out better:
-
-@example
-Emacs*cursorColor:	Red
-@end example
-
-
-@node 9.2.
-@section 9.2. On the same subject -- is there a way to get back the old "block" cursor where the cursor covers the character in front of the point?
-
-@example
-(setq bar-cursor nil)
-@end example
-
-
-
-@node 10. The mouse; cutting and pasting, 11. Highlighting, 9. The cursor, top
-@chapter 10. The mouse; cutting and pasting
-
-@menu
-* 10.1.::          10.1. I keep hitting the middle mouse button by accident and getting stuff pasted into my buffer so how can I turn this off?
-* 10.2.::          10.2. How do I set control/meta/etc modifiers on mouse buttons?
-* 10.3.::          10.3. I do "^x ^b" to get a list of buffers and the entries get highlighted when I move the mouse over them but clicking the left mouse does not do anything.
-* 10.4.::          10.4. How can I get a list of buffers to popup when I hit button 3 on the mouse?
-* 10.5.::          10.5. Why does cut-and-paste not work between XEmacs and a cmdtool?
-* 10.6.::          10.6. How I can set XEmacs up so that it pastes where the cursor is _not_ where the pointer lies?
-* 10.7.::          10.7. How do I select a rectangular region?
-* 10.8.::          10.8. Why does M-w take so long?
-@end menu
-
-
-@node 10.1.
-@section 10.1. I keep hitting the middle mouse button by accident and getting stuff pasted into my buffer so how can I turn this off?
-
-Here is an alternative binding, whereby the middle mouse button selects (but
-does not cut) the expression under the mouse. Clicking middle on a left or
-right paren will select to the matching one.  Note that you can use
-@code{define-key} or @code{global-set-key}.
-
-@example
-(defun Mouse-Set-Point-and-Select (event)
-  "Sets the point at the mouse location, then marks following form"
-  (interactive "@@e")
-  (mouse-set-point event)
-  (mark-sexp 1)
-  )
-(define-key global-map 'button2 'Mouse-Set-Point-and-Select)
-@end example
-
-@c Get this fixed
-(Editor's Note -- there is a problem with texinfo/text/html conversion, so
-the double at-sign should only be a single, above.  I'll fix it one of these
-days -- AJR)
-
-
-@node 10.2.
-@section 10.2. How do I set control/meta/etc modifiers on mouse buttons?
-
-Use, for instance, @code{[(meta button1)]}. For example, here is a
-common setting for Common Lisp programmers who use the bundled ilisp
-package, whereby meta-button1 on a function name will find the file
-where the function name was defined, and put you at that location in
-the source file.
-
-[Inside a function that gets called by the lisp-mode-hook and ilisp-mode-hook] 
-@example
-(local-set-key [(meta button1)] 'edit-definitions-lisp)
-@end example
-
-
-@node 10.3.
-@section 10.3. I do "^x ^b" to get a list of buffers and the entries get highlighted when I move the mouse over them but clicking the left mouse does not do anything.
-
-Use the middle mouse button.
-
-
-@node 10.4.
-@section 10.4. How can I get a list of buffers to popup when I hit button 3 on the mouse?
-
-The following code will actually replace the default popup on button3:
-
-@example
-(defun cw-build-buffers ()
-  "Popup buffer menu."
-  (interactive "@@")
-  (run-hooks 'activate-menubar-hook)
-  (popup-menu (car (find-menu-item current-menubar '("Buffers")))))
-
-(define-key global-map [(button3)] 'cw-build-buffers)
-@end example
-
-@c Get this fixed
-
-(Editor's Note -- there is a problem with texinfo/text/html conversion, so
-the double at-sign should only be a single, above.  I'll fix it one of these
-days -- AJR)
-
-
-@node 10.5.
-@section 10.5. Why does cut-and-paste not work between XEmacs and a cmdtool?
-
-We don't know.  It's a bug.  There does seem to be a work-around,
-however.  Try running xclipboard first.  It appears to fix the problem
-even if you exit it.  (This should be mostly fixed in 19.13, but we
-haven't yet verified that).
-
-
-@node 10.6.
-@section 10.6.  How I can set XEmacs up so that it pastes where the cursor is _not_ where the pointer lies?
-
-
-Try adding the following to your @file{.emacs}:
-
-@example
-(define-key global-map 'button2 'x-insert-selection)
-@end example
-
-This comes from the @file{sample.emacs} file in @file{etc/}, which has
-lots of goodies.
-
-
-@node 10.7.
-@section 10.7. How do I select a rectangular region?
-
-
-Just select the region normally, then use the rectangle commands (e.g.
-@code{kill-rectangle}) on it.  The region does not highlight as a
-rectangle, but the commands work just fine.
-
-To actually sweep out rectangular regions with the mouse do the
-following:
-
-@example
-(setq mouse-track-rectangle-p t)
-@end example
-
-
-@node 10.8.
-@section 10.8. Why does M-w take so long?
-
-It actually doesn't.  It leaves the region visible for a second so that
-you can see what area is being yanked.  If you start working, though, it
-will immediately complete its operation.  In other words, it will only
-delay for a second if you let it.
-
-
-@node 11. Highlighting, 12. The menubar and toolbar, 10. The mouse; cutting and pasting, top
-@chapter 11. Highlighting
-
-@menu
-* 11.1.::          11.1. How can I highlight selections?
-* 11.2.::          11.2. How do I get a pending-delete type of behavior?
-* 11.3.::          11.3. I do not like my text highlighted while I am doing isearch as I am not able to see whats underneath.  How do I turn it off?
-* 11.4.::          11.4. The text gets highlighted when I do C-x C-p (mark-page).  Is there a way to turn this feature off?
-@end menu
-
-
-@node 11.1.
-@section 11.1. How can I highlight selections?
-
-Use zmacs mode.  This mode allows for what some might call gratuitous
-highlighting for selected regions (either by setting mark or by using the
-mouse).  To use, add the following line to your @file{.emacs} file:
-
-@example
-(setq zmacs-regions t)
-@end example
-
-This is the default behavior.
-
-
-@node 11.2.
-@section 11.2. How do I get a pending-delete type of behavior?
-
-@dfn{Pending delete} is what happens when you select a region (with the
-mouse or keyboard) and you press a key to replace the selected region by
-the key you typed.  Usually backspace kills the selected region.
-
-To get this behavior, add the following line to your @file{.emacs} file:
-
-@example
-(require 'pending-del)
-@end example
-
-
-@node 11.3.
-@section 11.3. I do not like my text highlighted while I am doing isearch as I am not able to see whats underneath.  How do I turn it off?
-
-@example
-(setq isearch-highlight nil)
-@end example
-
-Note also that isearch-highlight affects query-replace and ispell.  Instead
-of disabling isearch-highlight you may find that a better solution consists
-of customizing the 'isearch' face.
-
-
-@node 11.4.
-@section 11.4. The text gets highlighted when I do C-x C-p (mark-page).  Is there a way to turn this feature off?
-
-@example
-(setq zmacs-regions nil)
-@end example
-
-
-
-@node 12. The menubar and toolbar, 13. Scrollbars, 11. Highlighting, top
-@chapter 12. The menubar and toolbar
-
-@menu
-* 12.1.::          12.1. How do I get rid of the menu (or menubar) ?
-* 12.2.::          12.2. Can I customize the basic menubar?
-* 12.3.::          12.3. What controls how many buffers are listed in the menu "Buffers" list?
-* 12.4.::          12.4. I am trying to use a resource like @code{Emacs*menubar*font} to set the font of the menubar but it's not working.
-
-@end menu
-
-
-@node 12.1.
-@section 12.1. How do I get rid of the menu (or menubar) ?
-
-Answer: To get rid of the menubar, add to @file{.emacs}:
-
-@example
-(set-menubar nil)
-@end example
-
-
-@node 12.2.
-@section 12.2. Can I customize the basic menubar?
-
-For an extensive menubar, add the line
-
-@example
-(load "big-menubar")
-@end example
-
-to your @file{.emacs} file.  If you'd like to write your own, this file
-provides a good set of examples to start from:
-
-@example
-lisp/packages/big-menubar.el
-@end example
-
-(starting from your system XEmacs installation directory).
-
-
-@node 12.3.
-@section 12.3. What controls how many buffers are listed in the menu "Buffers" list?
-
-Add the following to your @file{.emacs}, modified as needed:
-
-@example
-(setq buffers-menu-max-size 20)
-@end example
-
-If you do not want a limit, try
-
-@example
-(setq buffers-menu-max-size nil)
-@end example
-
-
-@node 12.4.
-@section 12.4. I am trying to use a resource like @code{Emacs*menubar*font} to set the font of the menubar but it's not working.
-
-If you are using the real Motif menubar, this resource is not recognized;
-you have to say
-
-@example
-Emacs*menubar*fontList: FONT
-@end example
-
-If you are using the Lucid menubar, the former resource will be recognized
-only if the latter resource is unset.  This means that the resource
-
-@example
-*fontList: FONT
-@end example
-
-will override
-
-@example
-Emacs*menubar*font: FONT
-@end example
-
-even though the latter is more specific.
-
-
-@node 13. Scrollbars, 14. Frame Geometry, 12. The menubar and toolbar, top
-@chapter 13. Scrollbars
-
-@menu
-* 13.1.::          13.1. How can I disable the scrollbar?
-* 13.2.::          13.2. How can one use resources to change scrollbar colors?
-* 13.3.::          13.3. When I move the scrollbar in an XEmacs window, it moves the point as well, which should not be the default behavior.  Is this a bug or a feature?  Can I disable it?
-@end menu
-
-
-@node 13.1.
-@section 13.1. How can I disable the scrollbar?
-
-To turn disable them for all frames, add the following line to
-your @file{.Xdefaults}:
-
-@example
-Emacs.scrollBarWidth:  0
-@end example
-
-To turn the scrollbar off on a per-frame basis, use the following function:
-
-@example
-(set-specifier scrollbar-width (cons (selected-frame) 0))
-@end example
-
-You can actually turn the scrollbars on at any level you want by
-substituting for (selected-frame) in the above command.  For example, to
-turn the scrollbars off only in a single buffer:
-
-@example
-(set-specifier scrollbar-width (cons (current-buffer) 0))
-@end example
-
-
-@node 13.2.
-@section 13.2. How can one use resources to change scrollbar colors?
-
-Here's a recap of how to use resources to change your scrollbar colors:
-
-@example
-! Motif scrollbars
-
-Emacs*XmScrollBar.Background: skyblue
-Emacs*XmScrollBar.troughColor: lightgray
-
-! Athena scrollbars
-
-Emacs*Scrollbar.Foreground: skyblue
-Emacs*Scrollbar.Background: lightgray
-@end example
-
-Note the capitalization of @samp{Scrollbar} for the Athena widget.
-
-
-@node 13.3.
-@section 13.3. When I move the scrollbar in an XEmacs window, it moves the point as well, which should not be the default behavior.  Is this a bug or a feature?  Can I disable it?
-
-The current behavior is a feature, not a bug.  Point remains at the same
-buffer position as long as that position does not scroll off the screen.  In
-that event, point will end up in either the upper-left or lower-left hand
-corner.
-
-
-
-@node 14. Frame Geometry, 15. Window/icon title; window manager problems, 13. Scrollbars, top
-@chapter 14. Frame Geometry
-
-@menu
-* 14.1.::          14.1. In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and @code{(set-screen-height @var{lines})} in my @file{.emacs} instead of specifying @samp{Emacs*EmacsScreen.geometry} in my @file{.Xdefaults} but this does not work in XEmacs 19.13.
-* 14.2.::          14.2. In XEmacs 19.11 I specified @samp{Emacs*EmacsScreen.geometry} in my @file{.emacs} but this does not work in XEmacs 19.13.
-@end menu
-
-
-@node 14.1.
-@section 14.1. In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and @code{(set-screen-height @var{lines})} in my @file{.emacs} instead of specifying @samp{Emacs*EmacsScreen.geometry} in my @file{.Xdefaults} but this does not work in XEmacs 19.13.
-
-These two functions now take frame arguments:
-
-@example
-(set-frame-width (selected-frame) @var{characters})   
-(set-frame-height (selected-frame) @var{lines})
-@end example
-
-@node 14.2.
-@section 14.2. In XEmacs 19.11 I specified @samp{Emacs*EmacsScreen.geometry} in my @file{.emacs} but this does not work in XEmacs 19.13.
-
-We have switched from using the term 'screen' to using the term 'frame'.
-The correct entry for your @file{.Xdefaults} is now:
-
-@example
-Emacs*EmacsFrame.geometry
-@end example
-
-
-@node 15. Window/icon title; window manager problems, 16. Editing source code (C mode; Lisp mode; etc.), 14. Frame Geometry, top
-@chapter 15. Window/icon title; window manager problems
-
-@menu
-* 15.1.::          15.1. How can I get the icon to just say @samp{XEmacs} and not include the name of the current file in it?
-* 15.2.::          15.2. How can I have the window title area display the full directory/name of the current buffer file and not just the name?
-* 15.3.::          15.3. When I run @samp{xterm -name junk} I get an xterm whose class name according to xprop, is @samp{junk}.  This is the way it's supposed to work, I think.  When I run @samp{xemacs -name junk} the class name is not set to @samp{junk}.  It's still @samp{emacs}.  What does @samp{xemacs -name} really do?  The reason I ask is that my window manager (fvwm) will make a window sticky and I use XEmacs to read my mail.  I want that XEmacs window to be sticky, without having to use the window manager's function to set the window sticky.  What gives?
-@end menu
-
-
-@node 15.1.
-@section 15.1. How can I get the icon to just say @samp{XEmacs} and not include the name of the current file in it?
-
-Add the following line to your @file{.emacs} file:
-
-@example
-(setq frame-icon-title-format "XEmacs")
-@end example
-
-
-@node 15.2.
-@section 15.2. How can I have the window title area display the full directory/name of the current buffer file and not just the name?
-
-Add the following line to your @file{.emacs} file:
-
-@example
-(setq frame-title-format "%S: %f")
-@end example
-A more sophisticated title might be:
-
-@example
-(setq frame-title-format
-  '("%S: " (buffer-file-name "%f" (dired-directory dired-directory "%b"))))
-@end example
-
-That is, use the file name, or the dired-directory, or the buffer name.
-
-
-@node 15.3.
-@section 15.3. When I run @samp{xterm -name junk} I get an xterm whose class name according to xprop, is @samp{junk}.  This is the way it's supposed to work, I think.  When I run @samp{xemacs -name junk} the class name is not set to @samp{junk}.  It's still @samp{emacs}.  What does @samp{xemacs -name} really do?  The reason I ask is that my window manager (fvwm) will make a window sticky and I use XEmacs to read my mail.  I want that XEmacs window to be sticky, without having to use the window manager's function to set the window sticky.  What gives?
-
-@samp{xemacs -name} sets the application-name for the program (that is,
-the thing which normally comes from @code{argv[0]}.)  Using @samp{-name}
-is the same as making a copy of the executable with that new name.  The
-WM_CLASS property on each frame is set to the frame-name, and the
-application-class.  So, if you did @samp{xemacs -name FOO} and then
-created a frame named @samp{BAR}, you'd get an X window with WM_CLASS =
-@samp{( "BAR", "Emacs")}.  However, the resource hierarchy for this
-widget would be
-
-@example
-Name:    FOO  .shell.       .pane        .BAR
-Class:   Emacs.TopLevelShell.XmMainWindow.EmacsFrame
-@end example
-
-instead of the default
-
-@example
-Name:    xemacs.shell.       .pane        .emacs
-Class:   Emacs .TopLevelShell.XmMainWindow.EmacsFrame
-@end example
-
-It is arguable that the first element of WM_CLASS should be set to the
-application-name instead of the frame-name, but I think that's less
-flexible, since it does not give you the ability to have multiple
-frames with different WM_CLASS properties.  Another possibility would
-be for the default frame name to come from the application name instead
-of simply being @samp{emacs}.  However, at this point, making that
-change would be troublesome: it would mean that many users would have to
-make yet another change to their resource files (since the default
-frame name would suddenly change from @samp{emacs} to @samp{xemacs}, or
-whatever the executable happened to be named), so we'd rather avoid it.
-
-To make a frame with a particular name use:
-
-@example
-(make-frame '((name . "the-name")))
-@end example
-
-
-
-@node 16. Editing source code (C mode; Lisp mode; etc.), 17. Text mode, 15. Window/icon title; window manager problems, top
-@chapter 16. Editing source code (C mode; Lisp mode; etc.)
-
-@menu
-* 16.1.::          16.1. How can I do source code highlighting using font-lock?
-* 16.2.::          16.2. How do you arrange it so that XEmacs indents all the clauses of a Common Lisp @code{if} the same amount instead of indenting the 3rd clause differently from the first two?
-* 16.3.::          16.3. I do not like cc-mode.  How do I use the old c-mode?
-* 16.4.::          16.4. When I try to edit a postscript file it gets stuck saying:  fontifying 'filename' (regexps....) and it just sits there. If I press ctrl-c in the window where XEmacs was started, it suddenly becomes alive again. 
-* 16.5.::          16.5.  Does anyone know how to get the "More" Syntax Highlighting on by default? 
-@end menu
-
-
-@node 16.1.
-@section 16.1. How can I do source code highlighting using font-lock?
-
-For most modes, font-lock is already set up and just needs to be turned
-on.  This can be done by 
-
-@example
-M-x font-lock-mode 
-@end example
-
-or by having XEmacs automatically start it by adding lines like
-
-@example
-(add-hook 'emacs-lisp-mode-hook	'turn-on-font-lock)
-(add-hook 'dired-mode-hook	'turn-on-font-lock)
-@end example
-
-to your @file{.emacs}.  See the file @code{etc/sample.emacs} for more
-examples.
-
-
-@node 16.2.
-@section 16.2. How do you arrange it so that XEmacs indents all the clauses of a Common Lisp @code{if} the same amount instead of indenting the 3rd clause differently from the first two?
+@end lisp
+
+@node Q5.1.3, Q5.1.4, Q5.1.2, Miscellaneous
+@section How can I visit several marked files at once in dired?
+
+You can put this in your @file{.emacs} and then @kbd{F} will find marked
+files:
+
+@lisp
+(add-hook
+ 'dired-load-hook
+ (function (lambda ()
+	     (define-key dired-mode-map "F"
+	       (function
+		(lambda () (interactive)
+		  (mapcar 'find-file
+			  (dired-mark-get-files))))))))
+@end lisp
+
+Aki Vehtari <Aki.Vehtari@@hut.fi> writes:
+
+@quotation
+You can also use @file{dired-x.el} (Sebastian Kremer's Extra DIRED). It
+defines F and makes other improvements too.  See @file{dired/dired-x.el}
+in the XEmacs distribution.
+
+In your @file{~/.emacs}, add:
+
+@lisp
+(setq dired-load-hook '(lambda () (load "dired-x")))
+@end lisp
+@end quotation
+
+@node Q5.1.4, Q5.1.5, Q5.1.3, Miscellaneous
+@section In 19.13, why do I get @samp{set-text-something} lisp errors with Gnus and AUC-TeX?
+
+The real problem is out of date software.  Upgrade to later versions of
+Gnus and AUC-TeX where this problem doesn't exist.
+
+The problem lies with the needs for an Emacs function,
+@code{set-text-properties}, which generally isn't required by XEmacs.
+The solutions include adding the following code to your @file{.emacs}:
+
+@lisp
+(fset 'set-text-properties (symbol-function 'ignore))
+@end lisp
+
+or 
+
+@lisp
+(defadvice set-text-properties (around ignore-strings activate)
+  "Ignore strings."
+  (or (stringp (ad-get-arg 3))
+      ad-do-it))
+@end lisp
+
+The best is probably the canonical solution (posted by C.Thompson, on
+10/17/95):
+
+@lisp
+(defun set-text-properties (start end props &optional buffer)
+  "You should NEVER use this function.  It is ideologically blasphemous.
+It is provided only to ease porting of broken FSF Emacs programs."
+  (if (stringp buffer) nil
+    (map-extents 
+     #'(lambda (extent ignored)
+	 (remove-text-properties
+	  start end (list (extent-property extent 'text-prop) nil)
+	  buffer))
+     buffer start end nil nil 'text-prop)
+    (add-text-properties start end props buffer)))
+@end lisp
+
+@node Q5.1.5, Q5.2.1, Q5.1.4, Miscellaneous
+@section How do I put a glyph as annotation in a buffer?
+
+Thomas Feuster <feuster@@tp4.physik.uni-giessen.de> writes:
+
+@quotation
+@lisp
+(let ((image-glyph (make-glyph-internal)))
+(seems to be unavoidable to do 'make-glyph-internal')
+@end lisp
+
+Now for viewing files:
+
+@lisp
+(set-glyph-image image-glyph view-graph-file-buf))
+@end lisp
+
+For viewing already loaded buffers:
+
+@lisp
+(setq image-glyph (make-glyph 
+                   (vector view-graph-file-format :data 
+		           (buffer-substring 
+			   (point-min) 
+		       	   (point-max)))))
+@end lisp
+
+The thing I couldn't figure out is how to make XEmacs guess the format
+from the contents - like it does for files. So it's a real pain to
+extract the format from the extensions of the file-name...
+@end quotation
+
+@node Q5.2.1, Q5.2.2, Q5.1.5, Miscellaneous
+@section How do I turn off the sound?
+
+Add the following line to your @file{.emacs}:
+
+@lisp
+(setq bell-volume 0)
+(setq sound-alist nil)
+@end lisp
+
+@node Q5.2.2, Q5.2.3, Q5.2.1, Miscellaneous
+@section How do I get funky sounds instead of a boring beep?
+
+Make sure your XEmacs was compiled with sound support, and then put this
+in your @file{.emacs}:
+
+@lisp
+(load-default-sounds)
+@end lisp
+
+The sound support in XEmacs 19.14 is greatly improved over previous
+versions.
+
+@node Q5.2.3, Q5.2.4, Q5.2.2, Miscellaneous
+@section What's NAS, how do I get it?
+
+@xref{Q2.0.3} for an explanation of the @dfn{Network Audio System}.
+
+@node Q5.2.4, Q5.3.1, Q5.2.3, Miscellaneous
+@section Sunsite sounds don't play.
+
+I'm having some trouble with sounds I've downloaded from sunsite.  They
+play when I run them through @code{showaudio} or cat them directly to
+@file{/dev/audio}, but XEmacs refuses to play them.
+
+Markus Gutschke <gutschk@@uni-muenster.de> writes:
+
+@quotation
+[Many of] These files have an (erroneous) 24byte header that tells about
+the format that they have been recorded in. If you cat them to
+@file{/dev/audio}, the header will be ignored and the default behavior
+for /dev/audio will be used. This happens to be 8kHz uLaw. It is
+probably possible to fix the header by piping through @code{sox} and
+passing explicit parameters for specifying the sampling format; you then
+need to perform a 'null' conversion from SunAudio to SunAudio.
+@end quotation
+
+@node Q5.3.1, Q5.3.2, Q5.2.4, Miscellaneous
+@section How do you make XEmacs indent CL if-clauses correctly?
+
+I'd like XEmacs to indent all the clauses of a Common Lisp @code{if} the
+same amount instead of indenting the 3rd clause differently from the
+first two.
 
 One way is to add, to @file{.emacs}:
 
-@example
+@lisp
 (put 'if 'lisp-indent-function nil)
-@end example
+@end lisp
 
 However, note that the package @file{cl-indent.el} that comes with
-XEmacs sets up this kind of indentation by default.  @file{cl-indent} also
-knows about many other CL-specific forms.  To use @file{cl-indent}, one can
-do this:
-
-@example
+XEmacs sets up this kind of indentation by default.  @code{cl-indent}
+also knows about many other CL-specific forms.  To use @code{cl-indent},
+one can do this:
+
+@lisp
 (load "cl-indent")
 (setq lisp-indent-function (function common-lisp-indent-function))
-@end example
-
-One can also customize @file{cl-indent.el} so it mimics the default @samp{if}
-indentation (@samp{then} indented more than the @samp{else}). Here's
-how:
-
-@example
+@end lisp
+
+One can also customize @file{cl-indent.el} so it mimics the default
+@code{if} indentation @code{then} indented more than the @code{else}.
+Here's how:
+
+@lisp
 (put 'if 'common-lisp-indent-function '(nil nil &body))
-@end example
+@end lisp
 
 Also, a new version (1.2) of @file{cl-indent.el} was posted to
-@samp{comp.emacs.xemacs} on 12/9/94. This version includes more
-documentation than previous versions.  This may prove useful if you
-need to customize any indent-functions.  The post can be retrieved by
-searching the XEmacs mail archives.
-
-
-@node 16.3.
-@section 16.3. I do not like cc-mode.  How do I use the old c-mode?
-
-Well, first off, consider if you really want to do this.  cc-mode is
-much more powerful than the old c-mode.  But if you still insist, add
-the following lines to your @file{.emacs}:
-
-@example
-(fmakunbound 'c-mode)
-(makunbound 'c-mode-map)
-(fmakunbound 'c++-mode)
-(makunbound 'c++-mode-map)
-(makunbound 'c-style-alist)
-(load-library "old-c-mode")
-(load-library "old-c++-mode")	
-@end example
-
-This must be done before any other reference is made to either c-mode
-or c++-mode.
-
-
-@node 16.4.
-@section 16.4. When I try to edit a postscript file it gets stuck saying:  fontifying 'filename' (regexps....) and it just sits there. If I press ctrl-c in the window where XEmacs was started, it suddenly becomes alive again. 
+comp.emacs.xemacs on 12/9/94.  This version includes more documentation
+than previous versions.  This may prove useful if you need to customize
+any indent-functions.
+
+NB: I would have thought with the passage of time this would be the
+standard version by now, but that appears not to be the case.  The
+version of filladapt included with 19.14 is last dated 1993, and does
+not have a version number.
+
+@node Q5.3.2, Q5.3.3, Q5.3.1, Miscellaneous
+@section Fontifying hang when editing a postscript file.
+
+When I try to edit a postscript file it gets stuck saying:
+@samp{fontifying 'filename' (regexps....)} and it just sits there.  If I
+press @kbd{C-c} in the window where XEmacs was started, it suddenly
+becomes alive again.
 
 This was caused by a bug in the Postscript font-lock regular
-expressions.  It should be fixed in 19.13.  For earlier versions of
-XEmacs, have a look at your @file{.emacs} file.  You will probably have
-a line like:
-
-@example
+expressions.  It was fixed in 19.13.  For earlier versions of XEmacs,
+have a look at your @file{.emacs} file.  You will probably have a line
+like:
+
+@lisp
 (add-hook 'postscript-mode-hook	'turn-on-font-lock)
-@end example
-
-Take it out, restart XEmacs, and it won't try to fontify your
-postscript files anymore.
-
-
-@node 16.5.
-@section 16.5.  Does anyone know how to get the "More" Syntax Highlighting on by default? 
-
-For C, C++, and Lisp, you can try adding the following to your @file{.emacs} file:
-
-@example
-(setq c-font-lock-keywords c-font-lock-keywords-2)
-(setq c++-font-lock-keywords c++-font-lock-keywords-2)
-(setq lisp-font-lock-keywords lisp-font-lock-keywords-2)
-@end example
-
-
-
-@node 17. Text mode, 18. Shell mode, 16. Editing source code (C mode; Lisp mode; etc.), top
-@chapter 17. Text mode
-
-@menu
-* 17.1.::          17.1. How can I enable auto-indent?
-* 17.2.::          17.2. How can I get XEmacs to come up in text mode (auto-fill) by default? 
-@end menu
-
-
-@node 17.1.
-@section 17.1. How can I enable auto-indent?
-
-Put the following line in your @file{.emacs}.
-
-@example
-(setq indent-line-function 'indent-relative-maybe)
-@end example
-
-If you want to get fancy, try @file{filladapt} and @file{fa-extras},
-available from the Emacs Lisp Archive at Ohio State University.
-@ifinfo
-Get them at URL:
-
-@example
-ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages
-@end example
-@end ifinfo
-@ifhtml
-Get them at 
-<A HREF="ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/">ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/</A>
-@end ifhtml
-
-
-@node 17.2.
-@section 17.2. How can I get XEmacs to come up in text mode (auto-fill) by default? 
-
-Try the following lisp in your @file{.emacs} file
-
-@example
-(setq default-major-mode 'text-mode)
-(setq text-mode-hook 'turn-on-auto-fill)
-@end example
-
-WARNING: note that changing default-major-mode from fundamental-mode can
-break a large amount of built-in code that expects newly created buffers to
-be in fundamental-mode.  (Changing from fundamental-mode to auto-fill
-text-mode might not wreak too much havoc, but changing to something more
-exotic like a lisp-mode would break many Emacs packages.
-
-Note that Emacs defaultly starts up in buffer *scratch* in
-initial-major-mode, which defaults to lisp-interaction-mode. Thus
-adding the following form to your Emacs init file will cause the
-initial *scratch* buffer to be put into auto-fill'ed text-mode.
-
-@example
-(setq initial-major-mode
-      (function (lambda ()
-        (text-mode)
-        (turn-on-auto-fill))))
-@end example
-
-Note that after your init file is loaded, if inhibit-startup-message
-is null (the default) and the startup buffer is *scratch* then the
-startup message will be inserted into *scratch*; it will be removed
-after a timeout by erasing the entire *scratch* buffer. Keep in mind
-this default usage of *scratch* if you desire any prior manipulation
-of *scratch* from within your Emacs init file. In particular, anything
-you insert into *scratch* from your init file will be later erased.
-Also, if you change the mode of *scratch* be sure that this will
-not interfere with possible later insertion of the startup message
-(e.g. if you put *scratch* into a nonstandard mode that has automatic
-font lock rules, then the startup message might get fontified in
-a strange foreign manner, e.g. as code in some programming language).
-
-
-
-@node 18. Shell mode, 19. Mail; VM; GNUS; BBDB; and related, 17. Text mode, top
-@chapter 18. Shell mode
-
-@menu
-* 18.1.::          18.1. How do I start up a second shell buffer?
-* 18.2.::          18.2. I'm using the Emacs @kbd{M-x shell} function, and I would like to invoke and use a telnet session within it.  Everything works fine except that now all ^M's are filtered out by Emacs.  Fixes? 
-* 18.3.::          18.3. If I type a very long command line (like a compile command) into a shell buffer, the output seems to be messed up.
-@end menu
-
-
-@node 18.1.
-@section 18.1. How do I start up a second shell buffer?
-
-In the *shell* buffer:
-
-@example
-M-x rename-buffer RET *shell-1* RET
-M-x shell RET
-@end example
-
-This will then start a second shell.  The key is that no buffer named
-*shell* can exist.  It might be preferable to use @kbd{M-x
-rename-uniquely} to rename the *shell* buffer instead of @kbd{M-x
-rename-buffer}.
-
-
-@node 18.2.
-@section 18.2. I'm using the Emacs @kbd{M-x shell} function, and I would like to invoke and use a telnet session within it.  Everything works fine except that now all ^M's are filtered out by Emacs.  Fixes? 
-
-Use @kbd{M-x rsh} or @kbd{M-x telnet} to open remote sessions rather
-than doing rsh or telnet within the local shell buffer.
-
-
-@node 18.3.
-@section 18.3. If I type a very long command line (like a compile command) into a shell buffer, the output seems to be messed up.
-
-If you see lots of ^G's in the buffer, you're using an old version of
-XEmacs.  If the command line seems to be delayed or split into pieces,
-you are probably using csh with the @samp{filec} variable set.  To fix
-this, add the following line to your @file{.cshrc}, after @samp{filec} is set:
-
-@example
-if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec
-@end example
-
-@node 19. Mail; VM; GNUS; BBDB; and related, 20. Printing, 18. Shell mode, top
-@chapter 19. Mail; VM; GNUS; BBDB; and related
-
-@menu
-* 19.1.::          19.1. How and where I am suppose to set the face attributes for customizing the appearance of messages (i.e. for VM)?
-* 19.2.::          19.2. I seem to have heard that there's a package distributed with XEmacs which will use the echo area to notify you of incoming mail in a rather configurable way (multiple spool files, different actions for different files).  What and where is it?
-* 19.3.::          19.3. Is there any way to add more faces and regexps to GNUS without hacking gnus.el?
-* 19.4.::          19.4. What is BBDB?
-* 19.5.::          19.5. I noticed that BBDB evokes an XEmacs bug; is there a fix?
-* 19.6.::          19.6. I'm getting the error 'Wrong type argument: listp :-pos' when I try to start BBDB.  What do I do?
-* 19.7.::          19.7. I'm getting the error 'movemail: Permission denied' when I try and start VM.  What do I do?
-@end menu
-
-
-@node 19.1.
-@section 19.1. How and where I am suppose to set the face attributes for customizing the appearance of messages (i.e. for VM)?
-
-Suppose you want to use:
-
-@example
-(set-face-font 'message-highlighted-header-contents
-               "-adobe-courier-bold-r-normal--12*")
-(set-face-foreground 'message-headers "darkslateblue")
-(set-face-foreground 'message-header-contents "brown")
-(set-face-foreground 'message-highlighted-header-contents "black")
-(set-face-foreground 'message-cited-text "darkgreen")
-@end example
-
-Well, this should work, provided that @code{(require
-'highlight-headers)} is executed first.  Also, highlight-headers is
-self-contained and you don't need to turn on font-lock mode.
-
-
-@node 19.2.
-@section 19.2.  I seem to have heard that there's a package distributed with XEmacs which will use the echo area to notify you of incoming mail in a rather configurable way (multiple spool files, different actions for different files).  What and where is it?
-
-It's called reportmail.  Add the following to your @file{.emacs}:
-
-@example
-(load-library "reportmail")
-@end example
-
-
-@node 19.3.
-@section 19.3.  Is there any way to add more faces and regexps to GNUS without hacking gnus.el?
-
-You can try the folowing elisp:
-
-@example
-(add-hook 'gnus-startup-hook
-          '(lambda ()
-              (font-lock-mode)
-              (set-face-foreground 'message-headers "red")
-              (set-face-foreground 'message-header-contents "orange")
-              (set-face-foreground 'message-cited-text "blue")))
-@end example
-
-
-@node 19.4.
-@section 19.4.  What is BBDB?
-
-BBDB is the Big Brother Database, written by Jamie Zawinski
-<jwz@@netscape.com>.  It interfaces to VM, mh-e, and GNUS and
-conveniently snarfs information about people and other things from
-articles and messages that go by.
-
-BBDB is available from the elisp archive
-
-@ifinfo
-@example
-archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive
-@end example
-@end ifinfo
-@ifhtml
-<A HREF="ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/">ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/</A>
-@end ifhtml
-
-BBDB has a mailing list devoted to it:
-
-@example
-info-bbdb@@cs.uiuc.edu
-@end example
-
-This mailing list is archived at
-
-@ifinfo
-@example
-ftp.cs.uiuc.edu:/pub/bbdb
-@end example
-@end ifinfo
-@ifhtml
-<A
-HREF="ftp://ftp.cs.uiuc.edu:/pub/bbdb/">ftp.cs.uiuc.edu:/pub/bbdb/</A>
-@end ifhtml
-
-
-@node 19.5.
-@section 19.5. I noticed that BBDB evokes an XEmacs bug; is there a fix?
-
-This worked for me:
-
-@example
-(setq bbdb-electric-p nil)
-@end example
-
-@node 19.6.
-@section 19.6. I'm getting the error 'Wrong type argument: listp :-pos' when I try to start BBDB.  What do I do?
-
-Discard the copy of mail-extr.el that came with bbdb.
-
-XEmacs 19.12 made the change that you cannot change the value of
-interned symbols whose names begin with a colon.  The mail-extr.el
-that's distributed with 19.12+ is fixed to live with this restriction,
-but old copies of mail-extr.el will bomb.
-
-
-@node 19.7.
-@section 19.7. I'm getting the error 'movemail: Permission denied' when I try and start VM.  What do I do?
-
-Execute the following two commands.  movemail is normally located in the
-XEmacs install tree at @file{.../lib/xemacs-19.13/$@{arch@}/movemail}.
-
-@example
-        chgrp mail movemail
-        chmod 2555 movemail
-@end example
-
-
-@node 20. Printing, 21. Gnuserv, 19. Mail; VM; GNUS; BBDB; and related, top
-@chapter 20. Printing
-
-@menu
-* 20.1.::          20.1. Font-lock looks nice.  How can I print (WYSIWYG) the highlighted document?
-* 20.2.::          20.2. My printer is a Postscript printer and @code{lpr} only works for Postscript files, so how do I get @kbd{M-x lpr-region} and @kbd{M-x lpr-buffer} to work?
-@end menu
-
-
-@node 20.1.
-@section 20.1. Font-lock looks nice.  How can I print (WYSIWYG) the highlighted document?
-
-The package ps-print.el, which is now included with XEmacs, provides the
-ability to do this.  It contains complete instructions on its use:
-
-@example
-<xemacs_src_root>/lisp/packages/ps-print.el
-@end example
-
-
-@node 20.2.
-@section 20.2. My printer is a Postscript printer and @code{lpr} only works for Postscript files, so how do I get @kbd{M-x lpr-region} and @kbd{M-x lpr-buffer} to work?
-
-@example
-(setq lpr-command "@var{Command to print text files}")
-@end example
-
-Please don't forget to replace @var{Command to print text files} with the
-actual command (@samp{enscript}, @samp{nenscript}, etc.)!
-
-
-
-@node 21. Gnuserv, 22. Miscellaneous, 20. Printing, top
-@chapter 21. Gnuserv
-
-@menu
-* 21.1.::          21.1. How do I disable gnuserv from opening a new frame?
-* 21.2.::          21.2. What do I do to start the gnuserv server so that each subseqeuent XEmacs is a client?
-@end menu
-
-
-@node 21.1.
-@section 21.1. How do I disable gnuserv from opening a new frame?
-
-If you set the gnuserv-screen variable to the frame that should be
-used to display buffers that are pulled up, a new frame will not be
-created. For example, you could put
-
-@example
-(setq gnuserv-screen (selected-frame))
-@end example
-
-early on in your @file{.emacs}, to ensure that the first frame created is
-the one used for your gnuserv buffers. 
-
-
-@node 21.2.
-@section 21.2.  What do I do to start the gnuserv server so that each subseqeuent XEmacs is a client?
-
-Put the following in your @file{.emacs} file to start the server:
-
-@example
-(gnuserv-start)
-@end example
-
-Start your first XEmacs as usual.  After that, you can do
-
-@example
-gnuclient randomfilename
-@end example
-
-from the command line to get your existing XEmacs process to open a new
-frame and visit randomfilename in that window. When you're done editing
-randomfilename, hit @kbd{C-x #} to kill the buffer and get rid of the
-frame.
-
-
-
-@node 22. Miscellaneous,, 21. Gnuserv, top
-@chapter 22. Miscellaneous
-
-@menu
-* 22.1.::          22.1. How do I specify the paths that XEmacs uses for finding files?
-* 22.2.::          22.2. Why does edt emulation not work?
-* 22.3.::          22.3. How can I emulate VI and use it as my default mode?
-* 22.4.::          22.4. Is there some way to get the behavior so that if the current buffer has a file associated with it, the current buffer will use that files name else use the buffer name?
-* 22.5.::          22.5. I have no idea where this is coming from, but ever since I moved from 19.9 to 19.13 I have started seeing that all of my buffers will get a minor mode called @samp{Omit}.  I have no idea how it got there nor do I know what it does.  What is it?
-* 22.6.::          22.6. How do I turn off the sound?
-* 22.7.::          22.7. Can I have the end of the buffer delimited in some way? Say, with:   [END] ?
-* 22.8.::          22.8. Can I insert today's date into buffer?
-* 22.9.::          22.9. Are only certain syntactic character classes available for abbrevs?  I didn't see any restrictions in the info.
-* 22.10.::         22.10. Filladapt used to work after I loaded it.  Now in 19.13 it doesn't.  What gives?
-@end menu
-
-
-@node 22.1.
-@section 22.1. How do I specify the paths that XEmacs uses for finding files?
+@end lisp
+
+Take it out, restart XEmacs, and it won't try to fontify your postscript
+files anymore.
+
+@node Q5.3.3, Q5.3.4, Q5.3.2, Miscellaneous
+@section How can I print WYSIWYG a font-locked buffer?
+
+Font-lock looks nice.  How can I print (WYSIWYG) the highlighted
+document?
+
+The package @file{ps-print.el}, which is now included with XEmacs,
+provides the ability to do this.  The source code contains complete
+instructions on its use, in
+@file{<xemacs_src_root>/lisp/packages/ps-print.el}.
+
+@node Q5.3.4, Q5.3.5, Q5.3.3, Miscellaneous
+@section Getting @kbd{M-x lpr} to work with postscript printer.
+
+My printer is a Postscript printer and @code{lpr} only works for
+Postscript files, so how do I get @kbd{M-x lpr-region} and @kbd{M-x
+lpr-buffer} to work?
+
+Put something like this in your @file{.emacs}:
+
+@lisp
+(setq lpr-command "a2ps")
+(setq lpr-switches '("-p" "-1"))
+@end lisp
+
+If you don't use a2ps to convert ASCII to postscript (why not, it's
+free?), replace with the command you do use.  Note also that some
+versions of a2ps require a @samp{-Pprinter} to ensure spooling.
+
+@node Q5.3.5, Q5.3.6, Q5.3.4, Miscellaneous
+@section How do I specify the paths that XEmacs uses for finding files?
 
 You can specify what paths to use by using a number of different flags
 when running configure.  See the section MAKE VARIABLES in the top-level
 file INSTALL in the XEmacs distribution for a listing of those flags.
 
-Most of the time, however, the simplest fix is: DO NOT specify paths as
-you might for FSF GNU Emacs.  XEmacs can generally determine the
+Most of the time, however, the simplest fix is: @strong{do not} specify
+paths as you might for GNU Emacs.  XEmacs can generally determine the
 necessary paths dynamically at run time.  The only path that generally
 needs to be specified is the root directory to install into.  That can
 be specified by passing the @code{--prefix} flag to configure.  For a
-description of the XEmacs install tree, please consult the NEWS file.
-
-
-@node 22.2.
-@section 22.2. Why does edt emulation not work?
-
-We don't know, but you can use tpu-edt emulation instead, which works fine
-and is a little fancier than the standard edt emulation.  To do this, add
-the following line to your @file{.emacs}:
-
+description of the XEmacs install tree, please consult the @file{NEWS}
+file.
+
+@node Q5.3.6, Q5.3.7, Q5.3.5, Miscellaneous
+@section [This question intentionally left blank]
+
+Obsolete question, left blank to avoid renumbering.
+
+@node Q5.3.7, Q5.3.8, Q5.3.6, Miscellaneous
+@section Can I have the end of the buffer delimited in some way?
+
+Say, with: [END]?
+
+Use this:
+
+@lisp
+(make-annotation "[END]" (point-max) 'text (current-buffer))
+@end lisp
+
+Note that you might want to put this in a hook.  Since
+@code{make-annotation} is not defined by default, you might also need:
+
+@lisp
+(require 'annotations)
+@end lisp
+
+@node Q5.3.8, Q5.3.9, Q5.3.7, Miscellaneous
+@section How do I insert today's date into a buffer?
+
+Like this:
+
+@lisp
+(insert (current-time-string))
+@end lisp
+
+@node Q5.3.9, Q5.3.10, Q5.3.8, Miscellaneous
+@section Are only certain syntactic character classes available for abbrevs?
+
+Markus Gutschke <gutschk@@uni-muenster.de> writes:
+
+@quotation
+Yes, abbrevs only expands word-syntax strings. While XEmacs does not
+prevent you from defining (e.g. with @kbd{C-x a g} or @kbd{C-x a l})
+abbrevs that contain special characters, it will refuse to expand
+them. So you need to ensure, that the abbreviation contains letters and
+digits only. This means that @samp{xd}, @samp{d5}, and @samp{5d} are
+valid abbrevs, but @samp{&d}, and @samp{x d} are not.
+
+If this sounds confusing to you, (re-)read the online documentation for
+abbrevs (@kbd{C-h i m XEmacs RET m Abbrevs RET}), and then come back and
+read this question/answer again.
+@end quotation
+
+@node Q5.3.10, Q5.3.11, Q5.3.9, Miscellaneous
+@section How can I get those oh-so-neat X-Face lines?
+
+Firstly there is an ftp site which describes X-faces and has the
+associated tools mentioned below, at
+<URL:ftp://ftp.cs.indiana.edu:/pub/faces/>.
+
+Then the steps are
+
+@enumerate
+@item
+Create 48x48x1 bitmap with your favorite tool
+
+@item
+Convert to "icon" format using one of xbm2ikon, pbmtoicon, etc.,
+and then compile the face.
+
+@item
 @example
-(load "tpu-edt")
+cat file.xbm | xbm2ikon |compface > file.face
 @end example
 
-If you don't want it to replace Ctrl-h with edt-style help menu add this as
-well:
-
-@example
-(global-set-key '(control h) 'help-for-help)
-@end example
-
-
-@node 22.3.
-@section 22.3. How can I emulate VI and use it as my default mode?
-
-Our recommended VI emulator is viper.  To put the current buffer into
-viper-mode, use the command:
+@item
+Then be sure to quote things that are necessary for emacs strings:
 
 @example
-M-x viper
-@end example
-
-To make viper-mode the default, add the following lines to your @file{.emacs}:
-
-@example
-(load-library "viper")
-(setq term-setup-hook 'viper)
-(setq find-file-hooks 'viper)
-(setq find-file-not-found-hooks 'viper)
+cat ./file.face | sed 's/\\/\\\\/g'  | sed 's/\"/\\\"/g' > ./file.face.quoted
 @end example
 
-
-@node 22.4.
-@section 22.4. Is there some way to get the behavior so that if the current buffer has a file associated with it, the current buffer will use that files name else use the buffer name?
-
-Just set frame-title-format from find-file-hooks.  Alternatively, look at
-the answer to question 15.2.  
-
-In addition, one could set modeline-format.
-
-
-@node 22.5.
-@section 22.5. I have no idea where this is coming from, but ever since I moved from 19.9 to 19.13 I have started seeing that all of my buffers will get a minor mode called @samp{Omit}.  I have no idea how it got there nor do I know what it does.  What is it?
-
-It's part of dired.  In dired, you can type M-o to get Omit mode and that will
-ignore uninteresting files (checkpoint files and backups, for example).  You
-get Omit in the modeline everywhere because the variable `dired-omit-files-p'
-is globally set to some non-nil value.  If you want this functionality, it's
-probably best to use a hook:
-
-@example
-(add-hook 'dired-after-readin-hook '(lambda () (dired-omit-toggle)))
-@end example
-
-Alternatively, since  it seems odd to toggle the omit
-state with every readin, since readin can happen many times in a Dired
-buffer, you can try this hook to correct the "Omit" problem:
+@item
+Then set up emacs to include the file as a mail header - there were a
+couple of suggestions here---either something like:
+
+@lisp
+(setq  mail-default-headers 
+  "X-Face:  <Ugly looking text string here>")
+@end lisp
+
+Or, alternatively, as:
+
+@lisp
+(defun mail-insert-x-face ()
+  (save-excursion 
+    (goto-char (point-min))
+    (search-forward mail-header-separator)
+    (beginning-of-line nil)
+    (insert "X-Face:")
+    (insert-file "~/.face")))
+
+(add-hook 'mail-setup-hook 'mail-insert-x-face)
+@end lisp
+@end enumerate
+
+However, 2 things might be wrong:
+
+Some versions of pbmtoicon produces some header lines that is not
+expected by the version of compface that I grabbed. So I found I had to
+include a @code{tail +3} in the pipeline like this:
 
 @example
-(add-hook 'dired-mode-hook
-  (function (lambda ()
-      ;; `dired-omit-files-p' is made buffer-local by "dired-x.el", but
-      ;; maybe not soon enough.
-            (make-local-variable 'dired-omit-files-p)
-            (setq dired-omit-files-p t))))
-@end example
-
-This is only run once, when the Dired buffer is created.
-
-
-@node 22.6.
-@section 22.6. How do I turn off the sound?
-
-Add the following line to your @file{.emacs} file:
-
-@example
-(setq bell-volume 0)
-(setq sound-alist nil)
-@end example
-
-
-@node 22.7.
-@section 22.7. Can I have the end of the buffer delimited in some way? Say, with:   [END] ?
-
-@example
-(make-annotation "[END]" (point-max) 'text (current-buffer))
-@end example
-
-Note that you might want to put this in a hook.
-
-You might also need:
-
-@example
-(require 'annotations)
+cat file.xbm | xbm2ikon | tail +3 |compface > file.face
 @end example
 
-since @code{make-annotation} is not defined by default.
-
-
-@node 22.8.
-@section 22.8. Can I insert today's date into buffer?
-
-Use this lisp in a function:
-
-@example
-(insert (current-time-string))
-@end example
-
-
-@node 22.9.
-@section 22.9. Are only certain syntactic character classes available for abbrevs?  I didn't see any restrictions in the info.
-
-Yes, abbrevs only expand word-syntax strings.  So, in c-mode if you
-wanted to expand something to @samp{define }, you would be able to
-expand @samp{xd} but not @samp{#d}.
-
-
-@node 22.10.
-@section 22.10.  Filladapt used to work after I loaded it.  Now in 19.13 it doesn't.  What gives?
-
-Filladapt 2.x is included in 19.13+.  In it filladapt is now a minor
-mode and minor modes are traditionally off by default.  The following
-added to your .emacs will turn it on for all buffers:
-
-@example
-(setq-default filladapt-mode t)
-@end example
-
-Use @code{turn-on-filladapt-mode} to turn Filladapt on in particular
-major modes, like this:
-
-@example
-(add-hook 'text-mode-hook 'turn-on-filladapt-mode) 
-@end example
-
-
-@page
-@contents
+Some people have also found that if one uses the @code{(insert-file)}
+method, one should NOT quote the face string using the sed script .
+
+It might also be helpful to use Stig's <stig@@hackvan.com> script
+(included in the compface distribution at XEmacs.org) to do the
+conversion.  For convenience xbm2xface is available for anonymous FTP at
+<URL:ftp://ftp.miranova.com/pub/xemacs/xbm2xface.pl>.
+
+Contributors for this item:
+
+Paul Emsley, 
+Ricardo Marek,
+Amir J. Katz,
+Glen McCort,
+Heinz Uphoff, 
+Peter Arius,
+Paul Harrison, and
+Vegard Vesterheim
+
+@node Q5.3.11, Q5.3.12, Q5.3.10, Miscellaneous
+@section How do I add new Info directories?
+
+You use something like:
+
+@lisp
+(setq Info-directory-list (cons 
+			    (expand-file-name "~/info")
+ 			    Info-default-directory-list))
+@end lisp
+
+David Masterson <davidm@@prism.kla.com> writes:
+
+@quotation
+Emacs Info and XEmacs Info do many things differently.  If you're trying to
+support a number of versions of Emacs, here are some notes to remember:
+
+@enumerate
+@item
+Emacs Info scans @code{Info-directory-list} from right-to-left while
+XEmacs Info reads it from left-to-right, so append to the @emph{correct}
+end of the list.
+
+@item
+Use @code{Info-default-directory-list} to initialize
+@code{Info-directory-list} @emph{if} it is available at startup, but not
+all Emacsen define it.
+
+@item
+Emacs Info looks for a standard @file{dir} file in each of the
+directories scanned from #1 and magically concatenates them together.
+
+@item
+XEmacs Info looks for a @file{localdir} file (which consists of just the
+menu entries from a @file{dir} file) in each of the directories scanned
+from #1 (except the first), does a simple concatentation of them, and
+magically attaches the resulting list to the end of the menu in the
+@file{dir} file in the first directory.
+@end enumerate
+
+Another alternative is to convert the documentation to HTML with
+texi2html and read it from a web browser like Lynx or W3.
+@end quotation
+
+@node Q5.3.12,  , Q5.3.11, Miscellaneous
+@section What do I need to change to make printing work?
+
+For regular printing there are two variables that can be customized.
+
+@table @code
+@item lpr-command
+This should be set to a command that takes standard input and sends
+it to a printer.  Something like:
+
+@lisp
+(setq lpr-command "lp")
+@end lisp
+
+@item lpr-switches
+This should be set to a list that contains whatever the print command
+requires to do its job.  Something like:
+
+@lisp
+(setq lpr-switches '("-depson"))
+@end lisp
+@end table
+
+For postscript printing there are three analogous variables to
+customize.
+
+@table @code
+@item ps-lpr-command
+This should be set to a command that takes postscript on standard input
+and directs it to a postscript printer.
+
+@item ps-lpr-switches
+This should be set to a list of switches required for
+@code{ps-lpr-command} to do its job.
+
+@item ps-print-color-p
+This boolean variable should be set @code{t} if printing will be done in
+color, otherwise it should be set to @code{nil}.
+@end table
+
+NOTE: It is an undocumented limitation in XEmacs that postscript
+printing (the @code{Pretty Print Buffer} menu item) @strong{requires} a
+window system environment.  It cannot be used outside of X11.
+
+@node Current Events,  , Miscellaneous, Top
+@chapter What the Future Holds
+
+This is part 6 of the XEmacs Frequently Asked Questions list.  This
+section will change monthly, and contains any interesting items that have
+transpired over the previous month.  If you are reading this from the
+XEmacs distribution, please see the version on the Web or archived at the
+various FAQ FTP sites, as this file is surely out of date.
+
+@menu
+* Q6.0.1::      What is new in 19.15?
+* Q6.0.3::      Procedural changes in XEmacs development.
+@end menu
+
+@node Q6.0.1, Q6.0.3, Current Events, Current Events
+@section What is new in 19.15?
+
+The biggest changes in 19.15 include integration of TM (a MIME package
+for VM and Gnus), beautifying the outlook, and bugfixing.
+
+XEmacs 20.0 is now very close (currently a separate branch of XEmacs
+that includes full Asian-language aka MULE support).  This work is being
+supported by Sun Microsystems.
+
+@node Q6.0.3,  , Q6.0.1, Current Events
+@section Procedural changes in XEmacs development.
+
+@enumerate
+@item
+Discussion about the development of XEmacs occurs on the xemacs-beta
+mailing list.  Subscriptions to this list will now be fully automated
+instead of being handled by hand.  Send a mail message to
+<xemacs-beta-request@@xemacs.org> with a subject of subscribe to join
+the list.  Please note this is a developers mailing list for people who
+have an active interest in the development process.
+
+@item
+Due to the long development cycle in between releases, it has been
+decided that intermediate versions will be made available in source only
+form for the truly interested.
+
+XEmacs 19.15 is the end of the road for version 19 XEmacs.  The next
+release after 19.15 will be XEmacs 20.0.
+
+@item
+As of December 1996, Steve Baur <steve@@altair.xemacs.org> has become
+the lead maintainer of XEmacs.
+
 @bye
--- a/src/ChangeLog	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 09:07:36 2007 +0200
@@ -1,3 +1,87 @@
+Wed Jan 22 21:09:52 1997  Steven L Baur  <steve@altair.xemacs.org>
+	* puresize.h (BASE_PURESIZE): Tighten up.
+
+	* scrollbar.c (scrollbar-page-up): Add Athena3d to Lucid/Motif
+	code.
+	(scrollbar-page-down): Ditto.
+
+	* scrollbar-x.c (x_create_scrollbar_instance): Add Athena3d to
+	Lucid/Motif code.
+	(x_update_vertical_scrollbar_callback): Ditto.
+	(x_update_horizontal_scrollbar_callback): Add Athena3d to Lucid
+	special case code.
+
+	* scrollbar-x.h (struct x_scrollbar_data): Add start drag position
+	for Athena3d.
+
+	* redisplay-output.c (redisplay_update_line): A vain attempt to
+	get the Athena vertical thumb adjusted after drag.
+
+	* EmacsFrame.c: Default to lower/right with Athena3d libraries.
+
+Wed Jan 22 18:38:52 1997  Ian Wells  <I.Wells@tarragon-et.co.uk>
+
+	* m/aviion.h: Remove definition of m88k.
+
+	* s/dgux5-4r4.h: New file.
+
+Wed Jan 22 18:32:49 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* buffer.h: Put proper typecasts on calls to alloca().
+
+Tue Jan 21 22:25:23 1997  Steven L. Baur  <steve@altair.xemacs.org>
+
+	* config.h.in: Add LWLIB_USES_ATHENA symbol
+
+	* Makefile.in.in (TOOLKIT_LIBS): It is possible to have both
+	Athena and Motif in the same link.
+
+Tue Jan 21 20:43:41 1997  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* redisplay-tty.c (tty_ring_bell): Don't ring tty bell if the
+	volume is set to 0.
+
+Tue Jan 21 20:38:58 1997  Axel Seibert  <aseibert@cybernet-ag.net>
+
+	* s/nextstep.h (signal_handler_t): define as int.
+
+Mon Jan 20 21:12:57 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* src/event-Xt.c (emacs_Xt_handle_magic_event):
+	(frame-totally-visible-p) sometimes incorrectly returned nil.
+
+Thu Jan 16 17:24:29 1997  Joel Peterson  <tarzan@aosi.com>
+
+	* menubar-x.c (pre_activate_callback): Correctly handle buffer
+	local variables in :included clauses.
+	(compute_menubar_data): Ditto.
+
+Wed Jan 15 21:44:53 1997  Joel Peterson  <tarzan@aosi.com>
+
+	* redisplay.c (add_emchar_rune): Enable last_charset display
+	optimization.
+
+Wed Jan 15 19:06:27 1997  David Moore  <dmoore@UCSD.EDU>
+
+	* event-stream.c (Faccept_process_output): Avoid checking an
+	uninitialized variable.
+
+Wed Jan 15 14:14:24 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* regex.c: Modify values of re_max_failures and MAX_FAILURE_ITEMS
+	to match Emacs 19.34.
+
+Mon Jan 13 00:36:01 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* sysdep.c (sys_execvp): Fix when compiled with
+	--const-is-losing=no.  Old code could crash if argv contained
+	non-ascii characters and the execvp failed and then caller
+	examined argv (for error message, for example).
+
+Sun Jan 12 17:22:24 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in.in: TM .elcs moved to SUNPRO_LISP only.
+
 Fri Jan 10 20:21:47 1997  Ben Wing  <ben@666.com>
 
 	* minibuf.c (Ftry_completion): Don't crash if not given a proper
--- a/src/EmacsFrame.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/EmacsFrame.c	Mon Aug 13 09:07:36 2007 +0200
@@ -85,7 +85,8 @@
      offset (scrollbar_height), XtRImmediate, (XtPointer)-1},
   {XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement,
       sizeof(unsigned char), offset(scrollbar_placement), XtRImmediate,
-#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
+    defined (LWLIB_SCROLLBARS_ATHENA3D)
       (XtPointer) XtBOTTOM_RIGHT
 #else
       (XtPointer) XtBOTTOM_LEFT
--- a/src/Makefile.in.in	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/Makefile.in.in	Mon Aug 13 09:07:36 2007 +0200
@@ -617,6 +617,9 @@
 
 #ifdef LWLIB_USES_MOTIF
 TOOLKIT_LIBS = -lXm
+#ifdef LWLIB_USES_ATHENA
+TOOLKIT_LIBS = -lXm -lXaw
+#endif /* LWLIB_USES_ATHENA */
 #else /* ! LWLIB_USES_MOTIF */
 TOOLKIT_LIBS = -lXaw
 #endif /* ! LWLIB_USES_MOTIF */
@@ -1092,26 +1095,12 @@
 #else
 # define MULE_X11_LISP
 #endif
-#define MULE_TM_LISP \
-	${lispdir}tm/mime-setup.elc \
-	${lispdir}tl/tl-misc.elc \
-	${lispdir}tl/tl-str.elc \
-	${lispdir}tl/tl-list.elc \
-	${lispdir}tl/tl-seq.elc \
-	${lispdir}tl/tl-atype.elc \
-	${lispdir}tl/file-detect.elc \
-	${lispdir}tl/emu.elc \
-	${lispdir}tl/emu-x20.elc \
-	${lispdir}tl/emu-xemacs.elc \
-	${lispdir}tm/tm-setup.elc \
-	${lispdir}mule/cyrillic.elc
 #define MULE_LISP \
 	${lispdir}mule/mule-load.elc ${lispdir}mule/mule-coding.elc \
 	${lispdir}mule/mule-charset.elc ${lispdir}mule/mule-files.elc \
 	${lispdir}mule/mule-category.elc ${lispdir}mule/mule-misc.elc \
 	${lispdir}mule/mule-ccl.elc ${lispdir}mule/mule-init.elc \
 	MULE_X11_LISP \
-	MULE_TM_LISP \
 	${lispdir}mule/arabic-hooks.elc \
 	${lispdir}mule/chinese-hooks.elc \
 	${lispdir}mule/cyrillic-hooks.elc \
@@ -1163,6 +1152,19 @@
 
 #ifdef SUNPRO
 /* Lisp files preloaded if compiled with support for SunPro products */
+#define MULE_TM_LISP \
+	${lispdir}tm/mime-setup.elc \
+	${lispdir}tl/tl-misc.elc \
+	${lispdir}tl/tl-str.elc \
+	${lispdir}tl/tl-list.elc \
+	${lispdir}tl/tl-seq.elc \
+	${lispdir}tl/tl-atype.elc \
+	${lispdir}tl/file-detect.elc \
+	${lispdir}tl/emu.elc \
+	${lispdir}tl/emu-x20.elc \
+	${lispdir}tl/emu-xemacs.elc \
+	${lispdir}tm/tm-setup.elc \
+	${lispdir}mule/cyrillic.elc
 #define SUNPRO_LISP \
 	${lispdir}packages/sccs.elc \
 	${lispdir}sunpro/sunpro-init.elc \
@@ -1182,7 +1184,8 @@
 	${lispdir}utils/annotations.elc \
 	${lispdir}modes/cc-mode.elc \
 	${lispdir}modes/imenu.elc \
-	${lispdir}utils/reporter.elc
+	${lispdir}utils/reporter.elc \
+	MULE_TM_LISP
 #else
 #define SUNPRO_LISP
 #endif
--- a/src/buffer.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/buffer.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1548,7 +1548,9 @@
 	{
 	  /* Just reference the variable
 	     to cause it to become set for this buffer.  */
-	  (void) find_symbol_value (sym);
+	  /* Use find_symbol_value_quickly to avoid an unnecessary O(n)
+	     lookup. */
+	  (void) find_symbol_value_quickly (XCAR (tail), 1);
 	}
     }
 
@@ -1556,9 +1558,7 @@
 
   if (old_buf)
     {
-      for (tail = old_buf->local_var_alist; 
-           !NILP (tail);
-           tail = XCDR (tail))
+      LIST_LOOP (tail, old_buf->local_var_alist)
 	{
 	  Lisp_Object sym = XCAR (XCAR (tail));
 	  Lisp_Object valcontents = XSYMBOL (sym)->value;
@@ -1567,7 +1567,11 @@
 	    {
 	      /* Just reference the variable
 		 to cause it to become set for this buffer.  */
-	      (void) find_symbol_value (sym);
+	      /* Use find_symbol_value_quickly with find_it_p as 0 to avoid an
+		 unnecessary O(n) lookup which is guaranteed to be worst case.
+		 Any symbols which are local are guaranteed to have been
+		 handled in the previous loop, above. */
+	      (void) find_symbol_value_quickly (sym, 0);
 	    }
 	}
     }
--- a/src/buffer.h	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/buffer.h	Mon Aug 13 09:07:36 2007 +0200
@@ -1313,7 +1313,7 @@
     }									\
   else									\
     {									\
-      (stick_value_here) = alloca (1 + __gcida_len_out__);		\
+      (stick_value_here) = (CONST Extbyte *) alloca (1 + __gcida_len_out__);		\
       memcpy ((Bufbyte *) stick_value_here, __gcida_ptr_out__,		\
 	      1 + __gcida_len_out__); 					\
       (stick_len_here) = __gcida_len_out__;				\
@@ -1387,7 +1387,7 @@
   __gseda_ptr__ = convert_to_external_format (string_data (__gseda_s__),   \
 					      string_length (__gseda_s__), \
 					      &__gseda_len__, fmt);	   \
-  (stick_value_here) = alloca (1 + __gseda_len__);			   \
+  (stick_value_here) = (CONST Extbyte *) alloca (1 + __gseda_len__);			   \
   memcpy ((Extbyte *) stick_value_here, __gseda_ptr__, 1 + __gseda_len__); \
   (stick_len_here) = __gseda_len__;					   \
 } while (0)
--- a/src/config.h.in	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/config.h.in	Mon Aug 13 09:07:36 2007 +0200
@@ -555,13 +555,16 @@
 #undef TOOLTALK
 
 #undef LWLIB_USES_MOTIF
+#undef LWLIB_USES_ATHENA
 #undef LWLIB_MENUBARS_LUCID
 #undef LWLIB_MENUBARS_MOTIF
 #undef LWLIB_SCROLLBARS_LUCID
 #undef LWLIB_SCROLLBARS_MOTIF
 #undef LWLIB_SCROLLBARS_ATHENA
+#undef LWLIB_SCROLLBARS_ATHENA3D
 #undef LWLIB_DIALOGS_MOTIF
 #undef LWLIB_DIALOGS_ATHENA
+#undef LWLIB_DIALOGS_ATHENA3D
 
 /* Other things that can be disabled by configure. */
 #undef HAVE_MENUBARS
--- a/src/emacsfns.h	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/emacsfns.h	Mon Aug 13 09:07:36 2007 +0200
@@ -1715,6 +1715,7 @@
 Lisp_Object Fmake_local_variable (Lisp_Object object);
 int symbol_value_buffer_local_info (Lisp_Object symbol, struct buffer *);
 Lisp_Object find_symbol_value (Lisp_Object symbol);
+Lisp_Object find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p);
 Lisp_Object top_level_value (Lisp_Object symbol);
 Lisp_Object Fkill_local_variable (Lisp_Object symbol);
 Lisp_Object Fmake_variable_buffer_local (Lisp_Object variable);
--- a/src/energize.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/energize.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1666,7 +1666,7 @@
     {
       if (modifying_p
 	  && strcmp ((char*) XSTRING_DATA (buffer_name),
-		     (char*) xSTRING_DATA (XBUFFER (binfo->emacs_buffer)->name))))
+		     (char*) XSTRING_DATA (XBUFFER (binfo->emacs_buffer)->name)))
 	rename_the_buffer (buffer_name);
     }
 
@@ -2553,7 +2553,7 @@
   CHECK_STRING (command);
 
   execute_energize_menu (buffer, extent_to_data (extent_obj),
-			 (char*)XSTRING_DATA (command), 0, 0, selection,
+			 (char*) XSTRING_DATA (command), 0, 0, selection,
 			 no_confirm);
 
   return Qt;
--- a/src/event-Xt.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/event-Xt.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1318,10 +1318,9 @@
       break;
       
     case VisibilityNotify: /* window visiblity has changed */
-      if (event->xvisibility.state == VisibilityUnobscured)
-	FRAME_X_TOTALLY_VISIBLE_P (f) = 1;
-      else
-	FRAME_X_TOTALLY_VISIBLE_P (f) = 0;
+      if (event->xvisibility.window == XtWindow (FRAME_X_SHELL_WIDGET (f)))
+ 	FRAME_X_TOTALLY_VISIBLE_P (f) =
+ 	  (event->xvisibility.state == VisibilityUnobscured);
       break;
       
     case ConfigureNotify:
--- a/src/event-stream.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/event-stream.c	Mon Aug 13 09:07:36 2007 +0200
@@ -2429,7 +2429,7 @@
 	 || (!EQ (result, Qt) && event_stream_event_pending_p (0)))
     {
       /* If our timeout has arrived, we move along. */
-      if (!event_stream_wakeup_pending_p (timeout_id, 0))
+      if (timeout_enabled && !event_stream_wakeup_pending_p (timeout_id, 0))
 	{
 	  timeout_enabled = 0;
 	  process = Qnil;	/* We're  done. */
--- a/src/fileio.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/fileio.c	Mon Aug 13 09:07:36 2007 +0200
@@ -929,8 +929,8 @@
   if (! NILP (defalt) && !EQ (defalt, name)
       /* This saves time in a common case.  */
       && ! (XSTRING_LENGTH (defalt) >= 3
-	    && IS_DIRECTORY_SEP (string_byte (XSTRING (defalt), 0))
-	    && IS_DEVICE_SEP (string_byte (XSTRING (defalt), 1))))
+	    && IS_DIRECTORY_SEP (XSTRING_BYTE (defalt, 0))
+	    && IS_DEVICE_SEP (XSTRING_BYTE (defalt, 1))))
     {
       struct gcpro gcpro1;
 
@@ -1477,7 +1477,7 @@
 
     {
       int rlen = strlen (resolved_path);
-      if (elen > 0 && string_byte (XSTRING (expanded_name), elen - 1) == '/'
+      if (elen > 0 && XSTRING_BYTE (expanded_name, elen - 1) == '/'
           && !(rlen > 0 && resolved_path[rlen - 1] == '/'))
 	{
 	  if (rlen + 1 > countof (resolved_path))
@@ -1738,7 +1738,7 @@
 #ifdef VMS
   {
     Bufbyte c =
-      string_byte (XSTRING (abspath), XSTRING_LENGTH (abspath) - 1);
+      XSTRING_BYTE (abspath, XSTRING_LENGTH (abspath) - 1);
     if (c == ':' || c == ']' || c == '>')
       abspath = Fdirectory_file_name (abspath);
   }
@@ -1746,10 +1746,8 @@
   /* Remove final slash, if any (unless path is root).
      stat behaves differently depending!  */
   if (XSTRING_LENGTH (abspath) > 1
-      && IS_DIRECTORY_SEP (string_byte (XSTRING (abspath),
-					XSTRING_LENGTH (abspath) - 1))
-      && !IS_DEVICE_SEP (string_byte (XSTRING (abspath),
-				      XSTRING_LENGTH (abspath) - 2)))
+      && IS_DIRECTORY_SEP (XSTRING_BYTE (abspath, XSTRING_LENGTH (abspath) - 1))
+      && !IS_DEVICE_SEP (XSTRING_BYTE (abspath, XSTRING_LENGTH (abspath) - 2)))
     /* We cannot take shortcuts; they might be wrong for magic file names.  */
     abspath = Fdirectory_file_name (abspath);
 #endif
@@ -1859,8 +1857,7 @@
       args[1] = Qnil; args[2] = Qnil;
       NGCPRO1 (*args); 
       ngcpro1.nvars = 3;
-      if (string_byte (XSTRING (newname),
-		       XSTRING_LENGTH (newname) - 1) != '/')
+      if (XSTRING_BYTE (newname, XSTRING_LENGTH (newname) - 1) != '/')
 	args[i++] = build_string ("/");
       args[i++] = Ffile_name_nondirectory (filename);
       newname = Fconcat (i, args);
@@ -2260,7 +2257,7 @@
   /* If the link target has a ~, we must expand it to get
      a truly valid file name.  Otherwise, do not expand;
      we want to permit links to relative file names.  */
-  if (string_byte (XSTRING (filename), 0) == '~') /* #### Un*x-specific */
+  if (XSTRING_BYTE (filename, 0) == '~') /* #### Un*x-specific */
     filename = Fexpand_file_name (filename, Qnil);
   linkname = Fexpand_file_name (linkname, Qnil);
 
@@ -3469,7 +3466,8 @@
 	desc = open (fn_data, O_RDWR, 0);
 	if (desc < 0)
 	  desc = creat_copy_attrs ((STRINGP (current_buffer->filename)
-				    ? (char *) XSTRING_DATA (current_buffer->filename)
+				    ? (char *)
+				    XSTRING_DATA (current_buffer->filename)
 				    : 0),
 				   fn_data);
       }
@@ -4163,14 +4161,11 @@
     return Qnil;
   clear_echo_area (selected_frame (), Qauto_saving, 1);
   Fding (Qt, Qauto_save_error, Qnil);
-  message ("Auto-saving...error for %s",
-	   XSTRING_DATA (current_buffer->name));
+  message ("Auto-saving...error for %s", XSTRING_DATA (current_buffer->name));
   Fsleep_for (make_int (1));
-  message ("Auto-saving...error!for %s",
-	   XSTRING_DATA (current_buffer->name));
+  message ("Auto-saving...error!for %s", XSTRING_DATA (current_buffer->name));
   Fsleep_for (make_int (1));
-  message ("Auto-saving...error for %s",
-	   XSTRING_DATA (current_buffer->name));
+  message ("Auto-saving...error for %s", XSTRING_DATA (current_buffer->name));
   Fsleep_for (make_int (1));
   return Qnil;
 }
--- a/src/getloadavg.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/getloadavg.c	Mon Aug 13 09:07:36 2007 +0200
@@ -567,6 +567,26 @@
   free(buf);
   
 #endif /* HAVE_KSTAT_H && HAVE_LIBKSTAT */
+
+#if !defined (LDAV_DONE) && defined (HAVE_SYS_PSTAT_H)
+#define LDAV_DONE
+  /* This is totally undocumented, and is not guaranteed to work, but
+     mayhap it might ....  If it does work, it will work only on HP-UX
+     8.0 or later.  -- Darryl Okahata <darrylo@sr.hp.com> */
+#undef LOAD_AVE_TYPE		/* Make sure these don't exist. */
+#undef LOAD_AVE_CVT
+#undef LDAV_SYMBOL
+  struct pst_dynamic	procinfo;
+  union pstun		statbuf;
+
+  statbuf.pst_dynamic = &procinfo;
+  if (pstat (PSTAT_DYNAMIC, statbuf, sizeof (struct pst_dynamic), 0, 0) == -1)
+    return (-1);
+  loadavg[elem++] = procinfo.psd_avg_1_min;
+  loadavg[elem++] = procinfo.psd_avg_5_min;
+  loadavg[elem++] = procinfo.psd_avg_15_min;
+#endif	/* HPUX */
+
 #endif /* XEMACS */
 
 #if !defined (LDAV_DONE) && defined (__linux__)
--- a/src/glyphs-x.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/glyphs-x.c	Mon Aug 13 09:07:36 2007 +0200
@@ -2249,7 +2249,7 @@
 }
 
 static int
-tiff_possible_dest_types ()
+tiff_possible_dest_types (void)
 {
   return IMAGE_COLOR_PIXMAP_MASK;
 }
--- a/src/glyphs.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/glyphs.c	Mon Aug 13 09:07:36 2007 +0200
@@ -2379,7 +2379,7 @@
 	struct face_cachel *cachel;
 
 	find_charsets_in_bufbyte_string (charsets,
-					 XSTRING_DATA (string),
+					 XSTRING_DATA   (string),
 					 XSTRING_LENGTH (string));
 
 	if (!NILP (frame_face))
--- a/src/hpplay.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/hpplay.c	Mon Aug 13 09:07:36 2007 +0200
@@ -178,7 +178,7 @@
     char            *server;
 
     if (STRINGP(Vhp_play_server))
-      server = (char *) (XSTRING_DATA (Vhp_play_server));
+      server = (char *) XSTRING_DATA (Vhp_play_server);
     server = "";
 
     /*
@@ -222,7 +222,7 @@
     char            *server;
 
     if (STRINGP (Vhp_play_server))
-      server = (char *) (XSTRING_DATA (Vhp_play_server));
+      server = (char *) XSTRING_DATA (Vhp_play_server);
     server = "";
 
     /* open audio connection */
--- a/src/lread.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/lread.c	Mon Aug 13 09:07:36 2007 +0200
@@ -577,7 +577,7 @@
   handler = Ffind_file_name_handler (file, Qload);
   if (!NILP (handler))
     RETURN_UNGCPRO (call5 (handler, Qload, file, no_error,
-			   nomessage, nosuffix));
+			  nomessage, nosuffix));
 
   /* Do this after the handler to avoid
      the need to gcpro noerror, nomessage and nosuffix.
@@ -672,22 +672,22 @@
     fd = open (foundstr, O_RDONLY | O_TEXT);
 #endif /* DOS_NT */
 
-#define PRINT_LOADING_MESSAGE(done) do {			\
-  if (load_ignore_elc_files)					\
-    {								\
-      if (message_p)						\
-	message ("Loading %s..." done, XSTRING_DATA (newer));	\
-    }								\
-  else if (!NILP (newer))					\
-    message ("Loading %s..." done " (file %s is newer)",	\
-	     XSTRING_DATA (file),				\
-	     XSTRING_DATA (newer));				\
-  else if (source_only)						\
+#define PRINT_LOADING_MESSAGE(done) do {				\
+  if (load_ignore_elc_files)						\
+    {									\
+      if (message_p)							\
+	message ("Loading %s..." done, XSTRING_DATA (newer));		\
+    }									\
+  else if (!NILP (newer))						\
+    message ("Loading %s..." done " (file %s is newer)",		\
+	     XSTRING_DATA (file),					\
+	     XSTRING_DATA (newer));					\
+  else if (source_only)							\
     message ("Loading %s..." done " (file %s.elc does not exist)",	\
-	     XSTRING_DATA (file),				\
-	     XSTRING_DATA (Ffile_name_nondirectory (file)));	\
-  else if (message_p)						\
-    message ("Loading %s..." done, XSTRING_DATA (file));	\
+	     XSTRING_DATA (file),					\
+	     XSTRING_DATA (Ffile_name_nondirectory (file)));		\
+  else if (message_p)							\
+    message ("Loading %s..." done, XSTRING_DATA (file));		\
   } while (0)
 
   PRINT_LOADING_MESSAGE ("");
--- a/src/lstream.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/lstream.c	Mon Aug 13 09:07:36 2007 +0200
@@ -709,7 +709,7 @@
 int
 Lstream_close (Lstream *lstr)
 {
-  int rc =0;
+  int rc = 0;
 
   if (lstr->flags & LSTREAM_FL_IS_OPEN)
     {
--- a/src/m/aviion.h	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/m/aviion.h	Mon Aug 13 09:07:36 2007 +0200
@@ -37,9 +37,9 @@
    Ones defined so far include vax, m68000, ns16000, pyramid,
    orion, tahoe, APOLLO and many others */
 
-#ifndef m88k
-#define m88k
-#endif
+/*#ifndef m88k*/
+/*#define m88k*/
+/*#endif*/
 
 /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
    the bit field into an int.  In other words, if bit fields
--- a/src/menubar-x.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/menubar-x.c	Mon Aug 13 09:07:36 2007 +0200
@@ -336,6 +336,7 @@
   struct device *d = get_device_from_display (XtDisplay (widget));
   struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
   Lisp_Object rest = Qnil;
+  Lisp_Object frame;
   int any_changes = 0;
 
   if (!f)
@@ -343,6 +344,10 @@
   if (!f)
     return;
 
+  /* make sure f is the selected frame */
+  XSETFRAME (frame, f);
+  Fselect_frame (frame);
+
   if (client_data)
     {
       /* this is an incremental menu construction callback */
@@ -433,12 +438,20 @@
     data = 0;
   else
     {
+      Lisp_Object old_buffer;
+      int count = specpdl_depth ();
+
+      old_buffer = Fcurrent_buffer ();
+      record_unwind_protect (Fset_buffer, old_buffer);
+      Fset_buffer ( XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer);
       data = menu_item_descriptor_to_widget_value (menubar, MENUBAR_TYPE,
 						   deep_p, 0);
 #ifdef ENERGIZE
       if (data)
 	set_panel_button_sensitivity (f, data);
 #endif
+      Fset_buffer (old_buffer);
+      unbind_to (count, Qnil);
     }
   return data;
 }
--- a/src/nas.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/nas.c	Mon Aug 13 09:07:36 2007 +0200
@@ -51,17 +51,16 @@
  *			be sure all play has finished.
  */
 
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
+#if __STDC__ || defined (STDC_HEADERS)
+#    include <stdlib.h>
+#    include <stdarg.h>
+#    include <string.h>
 #endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-
 #include <stdio.h>
 #include <config.h> /* for CONST in syssignal.h (neal@ctd.comsat.com) */
 #include "syssignal.h"
--- a/src/process.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/process.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1187,9 +1187,9 @@
   new_argv[0] = (char *) XSTRING_DATA (program);
 
   /* If program file name is not absolute, search our path for it */
-  if (!IS_DIRECTORY_SEP (string_byte (XSTRING (program), 0))
+  if (!IS_DIRECTORY_SEP (XSTRING_BYTE (program, 0))
       && !(XSTRING_LENGTH (program) > 1
-	   && IS_DEVICE_SEP (string_byte (XSTRING (program), 1))))
+	   && IS_DEVICE_SEP (XSTRING_BYTE (program, 1))))
     {
       struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; /* Caller protects args[] */
       GCPRO4 (buffer, current_dir, name, program);
--- a/src/puresize.h	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/puresize.h	Mon Aug 13 09:07:36 2007 +0200
@@ -32,9 +32,9 @@
    things configured in. */
 
 #if (LONGBITS == 64)
-# define BASE_PURESIZE 922000
+# define BASE_PURESIZE 847000
 #else
-# define BASE_PURESIZE 562000
+# define BASE_PURESIZE 467000
 #endif
 
 /* If any particular systems need to change the base puresize, they
--- a/src/redisplay-output.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/redisplay-output.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1140,7 +1140,12 @@
   /* #### See if we can get away with only calling this if
      max_line_len is greater than the window_char_width. */
 #ifdef HAVE_SCROLLBARS
-  update_window_scrollbars (w, NULL, 1, 1);
+  {
+    extern int stupid_vertical_scrollbar_drag_hack;
+
+    update_window_scrollbars (w, NULL, 1, stupid_vertical_scrollbar_drag_hack);
+    stupid_vertical_scrollbar_drag_hack = 1;
+  }
 #endif
 
   /* This has to be done after we've updated the values.  We don't
--- a/src/redisplay-tty.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/redisplay-tty.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1073,8 +1073,11 @@
 {
   struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
 
-  OUTPUT1 (c, TTY_SD (c).audio_bell);
-  Lstream_flush (XLSTREAM (CONSOLE_TTY_DATA (c)->outstream));
+  if (volume)
+    {
+      OUTPUT1 (c, TTY_SD (c).audio_bell);
+      Lstream_flush (XLSTREAM (CONSOLE_TTY_DATA (c)->outstream));
+    }
 }
 
 
--- a/src/redisplay.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/redisplay.c	Mon Aug 13 09:07:36 2007 +0200
@@ -876,6 +876,7 @@
 	    data->last_char_width = -1;
 	  data->new_ascent  = max (data->new_ascent,  (int) fi->ascent);
 	  data->new_descent = max (data->new_descent, (int) fi->descent);
+	  data->last_charset = charset;
 	}
 
       width = data->last_char_width;
--- a/src/regex.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/regex.c	Mon Aug 13 09:07:36 2007 +0200
@@ -1125,7 +1125,7 @@
 #if defined (MATCH_MAY_ALLOCATE)
 /* 4400 was enough to cause a crash on Alpha OSF/1,
    whose default stack limit is 2mb.  */
-int re_max_failures = 4000;
+int re_max_failures = 20000;
 #else
 int re_max_failures = 2000;
 #endif
@@ -1348,7 +1348,10 @@
 #endif
 
 /* We push at most this many items on the stack.  */
-#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+/* We used to use (num_regs - 1), which is the number of registers
+   this regexp will save; but that was changed to 5
+   to avoid stack overflow for a regexp with lots of parens.  */
+#define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
 
 /* We actually push this many items.  */
 #define NUM_FAILURE_ITEMS						\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/dgux5-4r4.h	Mon Aug 13 09:07:36 2007 +0200
@@ -0,0 +1,37 @@
+/* Definitions file for GNU Emacs running on Data General's DG/UX
+   version 5.4 Release 4.00 and above.
+   Copyright (C) 1994 Free Software Foundation, Inc.
+
+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 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.31. */
+
+#include "dgux5-4r3.h"
+
+/* wait() is better off not operating as a struct.  Things go a bit pear. */
+#undef _BSD_WAIT_FLAVOR
+
+/* Some things won't compile for me with these (in dgux.h): */
+#undef setpgrp
+/*#undef getpgrp*/
+
+/* Symbols missing - I suspect this is the culprit... */
+#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen
+
+/* Prevent use of a (non-existent) debugging library. */
+#define LIBS_DEBUG
--- a/src/s/nextstep.h	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/s/nextstep.h	Mon Aug 13 09:07:36 2007 +0200
@@ -116,6 +116,7 @@
 
 #undef SYSV_SYSTEM_DIR
 #undef NONSYSTEM_DIR_LIBRARY
+#define signal_handler_t int
 #define pid_t int
 #undef BSD_TERMIOS
 #undef HAVE_TERMIOS
--- a/src/scrollbar-x.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/scrollbar-x.c	Mon Aug 13 09:07:36 2007 +0200
@@ -46,7 +46,9 @@
    scrollbar is incredibly stupid about updating the thumb and causes
    lots of flicker if it is done too often.  */
 static int inhibit_thumb_size_change;
+int stupid_vertical_scrollbar_drag_hack = 1;
 
+/* Doesn't work with athena */
 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
 static int vertical_drag_in_progress;
 #endif
@@ -56,6 +58,7 @@
 static int
 x_inhibit_scrollbar_thumb_size_change (void)
 {
+  /* Doeesn't work with Athena */
 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
   return inhibit_thumb_size_change;
 #else
@@ -103,7 +106,8 @@
   SCROLLBAR_X_ID (instance) = new_lwlib_id ();
   sprintf (buffer, "scrollbar_%d", SCROLLBAR_X_ID (instance));
   SCROLLBAR_X_NAME (instance) = xstrdup (buffer);
-#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
+    defined (LWLIB_SCROLLBARS_ATHENA3D)
   SCROLLBAR_X_VDRAG_ORIG_VALUE (instance) = -1;
 #endif
 
@@ -157,6 +161,7 @@
   UPDATE_DATA_FIELD (scrollbar_x);
   UPDATE_DATA_FIELD (scrollbar_y);
 
+  /* This doesn't work with Athena, why? */
 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
   if (w && !vertical_drag_in_progress)
     {
@@ -532,7 +537,8 @@
          Depending on where you click the size of the page varies.
          Motif always does a standard Emacs page. */
     case SCROLLBAR_PAGE_UP:
-#if !defined (LWLIB_SCROLLBARS_MOTIF) && !defined (LWLIB_SCROLLBARS_LUCID)
+#if !defined (LWLIB_SCROLLBARS_MOTIF) && !defined (LWLIB_SCROLLBARS_LUCID) && \
+    !defined (LWLIB_SCROLLBARS_ATHENA3D)
       {
 	double tmp = ((double) data->slider_value /
 		      (double) SCROLLBAR_X_POS_DATA(instance).scrollbar_height);
@@ -551,7 +557,8 @@
       break;
 
     case SCROLLBAR_PAGE_DOWN:
-#if !defined (LWLIB_SCROLLBARS_MOTIF) && !defined (LWLIB_SCROLLBARS_LUCID)
+#if !defined (LWLIB_SCROLLBARS_MOTIF) && !defined (LWLIB_SCROLLBARS_LUCID) && \
+    !defined (LWLIB_SCROLLBARS_ATHENA3D)
       {
 	double tmp = ((double) data->slider_value /
 		      (double) SCROLLBAR_X_POS_DATA(instance).scrollbar_height);
@@ -591,6 +598,7 @@
       SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance) =
 	XINT (Fwindow_start (win));
 #endif
+      stupid_vertical_scrollbar_drag_hack = 0;
       break;
 
     case SCROLLBAR_DRAG:
@@ -667,6 +675,7 @@
 	      }
 	  }
 #else
+	stupid_vertical_scrollbar_drag_hack = 0;
 	value = data->slider_value;
 #endif
 
@@ -738,7 +747,7 @@
       inhibit_thumb_size_change = 1;
       /* #### Fix the damn toolkit code so they all work the same way.
          Lucid is the one mostly wrong.*/
-#if defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_LUCID) || defined (LWLIB_SCROLLBARS_ATHENA3D)
       signal_special_Xt_user_event (win, Qscrollbar_horizontal_drag,
 				    (Fcons
 				     (win, make_int (data->slider_value))));
--- a/src/scrollbar-x.h	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/scrollbar-x.h	Mon Aug 13 09:07:36 2007 +0200
@@ -42,7 +42,8 @@
   /* Pointer to the scrollbar widget this structure describes. */
   Widget widget;
 
-#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
+    defined (LWLIB_SCROLLBARS_ATHENA3D)
   /* Recorded starting position for Motif-like scrollbar drags. */
   int vdrag_orig_value;
   Bufpos vdrag_orig_window_start;
@@ -58,7 +59,8 @@
 #define SCROLLBAR_X_POS_DATA(i) (SCROLLBAR_X_DATA (i)->pos_data)
 #define SCROLLBAR_X_WIDGET(i) (SCROLLBAR_X_DATA (i)->widget)
 
-#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
+    defined (LWLIB_SCROLLBARS_ATHENA3D)
 #define SCROLLBAR_X_VDRAG_ORIG_VALUE(i) \
   (SCROLLBAR_X_DATA (i)->vdrag_orig_value)
 #define SCROLLBAR_X_VDRAG_ORIG_WINDOW_START(i) \
--- a/src/scrollbar.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/scrollbar.c	Mon Aug 13 09:07:36 2007 +0200
@@ -720,7 +720,8 @@
      with their standard behaviors.  It is not possible to hide the
      differences down in lwlib because knowledge of XEmacs buffer and
      cursor motion routines is necessary. */
-#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
+    defined (LWLIB_SCROLLBARS_ATHENA3D)
   window_scroll (window, Qnil, -1, ERROR_ME_NOT);
 #else /* Athena */
   {
@@ -760,7 +761,8 @@
      with their standard behaviors.  It is not possible to hide the
      differences down in lwlib because knowledge of XEmacs buffer and
      cursor motion routines is necessary. */
-#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID)
+#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
+    defined (LWLIB_SCROLLBARS_ATHENA3D)
   window_scroll (window, Qnil, 1, ERROR_ME_NOT);
 #else /* Athena */
   {
@@ -828,6 +830,7 @@
   start_pos = scrollbar_point (XWINDOW (window), 1);
   Fset_window_start (window, make_int (start_pos), Qnil);
   scrollbar_reset_cursor (window, orig_pt);
+  Fsit_for(Qzero, Qnil);
   zmacs_region_stays = 1;
   return Qnil;
 }
--- a/src/specifier.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/specifier.c	Mon Aug 13 09:07:36 2007 +0200
@@ -2152,8 +2152,8 @@
 
 	  GCPRO1 (opaque);
 	  retval = call_with_suspended_errors
-	    ( (lisp_fn_t) call_validate_matchspec_method,
-	      Qnil, Qspecifier, errb, 2, opaque, matchspec);
+	    ((lisp_fn_t) call_validate_matchspec_method,
+	     Qnil, Qspecifier, errb, 2, opaque, matchspec);
 	  
 	  free_opaque_ptr (opaque);
 	  UNGCPRO;
@@ -2276,9 +2276,9 @@
 
 	  if (HAS_SPECMETH_P (sp, instantiate))
 	    val = call_with_suspended_errors
-	      ( (lisp_fn_t) RAW_SPECMETH (sp, instantiate),
-		Qunbound, Qspecifier, errb, 5, specifier,
-		matchspec, domain, XCDR (tagged_inst), depth);
+	      ((lisp_fn_t) RAW_SPECMETH (sp, instantiate),
+	       Qunbound, Qspecifier, errb, 5, specifier,
+	       matchspec, domain, XCDR (tagged_inst), depth);
 
 	  if (!UNBOUNDP (val))
 	    {
--- a/src/symbols.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/symbols.c	Mon Aug 13 09:07:36 2007 +0200
@@ -436,7 +436,9 @@
 
 static void set_up_buffer_local_cache (Lisp_Object sym, 
 				       struct symbol_value_buffer_local *bfwd,
-				       struct buffer *buf);
+				       struct buffer *buf,
+				       Lisp_Object new_alist_el,
+				       int set_it_p);
 
 DEFUN ("boundp", Fboundp, 1, 1, 0, /*
 T if SYMBOL's value is not void.
@@ -1275,9 +1277,11 @@
 static void
 set_up_buffer_local_cache (Lisp_Object sym, 
 			   struct symbol_value_buffer_local *bfwd,
-			   struct buffer *buf)
+			   struct buffer *buf,
+			   Lisp_Object new_alist_el,
+			   int set_it_p)
 {
-  Lisp_Object new_alist_el, new_val;
+  Lisp_Object new_val;
 
   if (!NILP (bfwd->current_buffer)
       && buf == XBUFFER (bfwd->current_buffer))
@@ -1288,7 +1292,10 @@
   write_out_buffer_local_cache (sym, bfwd);
 
   /* Retrieve the new alist element and new value. */
+  if (NILP (new_alist_el)
+      && set_it_p)
   new_alist_el = buffer_local_alist_element (buf, sym, bfwd);
+
   if (NILP (new_alist_el))
     new_val = bfwd->default_value;
   else
@@ -1360,14 +1367,15 @@
 	     will do this.  It doesn't hurt to do it whenever
 	     BUF == current_buffer, so just go ahead and do that. */
 	  if (buf == current_buffer)
-	    set_up_buffer_local_cache (sym, bfwd, buf);
+	    set_up_buffer_local_cache (sym, bfwd, buf, Qnil, 0);
 	}
     }
 }
 
 static Lisp_Object
 find_symbol_value_1 (Lisp_Object sym, struct buffer *buf,
-		     struct console *con, int swap_it_in)
+		     struct console *con, int swap_it_in,
+		     Lisp_Object symcons, int set_it_p)
 {
   Lisp_Object valcontents;
 
@@ -1388,6 +1396,7 @@
 
     case SYMVAL_VARALIAS:
       sym = follow_varalias_pointers (sym, Qt /* #### kludge */);
+      symcons = Qnil;
       /* presto change-o! */
       goto retry;
 
@@ -1399,7 +1408,7 @@
 
 	if (swap_it_in)
 	  {
-	    set_up_buffer_local_cache (sym, bfwd, buf);
+	    set_up_buffer_local_cache (sym, bfwd, buf, symcons, set_it_p);
 	    valcontents = bfwd->current_value;
 	  }
 	else
@@ -1407,14 +1416,17 @@
 	    if (!NILP (bfwd->current_buffer) &&
 		buf == XBUFFER (bfwd->current_buffer))
 	      valcontents = bfwd->current_value;
-	    else
+	    else if (NILP (symcons))
 	      {
+		if (set_it_p)
 		valcontents = assq_no_quit (sym, buf->local_var_alist);
 		if (NILP (valcontents))
 		  valcontents = bfwd->default_value;
 		else
-		  valcontents = Fcdr (valcontents);
+		  valcontents = XCDR (valcontents);
 	      }
+	    else
+	      valcontents = XCDR (symcons);
 	  }
 	break;
       }
@@ -1449,7 +1461,7 @@
 			      /* If it bombs out at startup due to a
 				 Lisp error, this may be nil. */
 			      CONSOLEP (Vselected_console)
-			      ?	XCONSOLE (Vselected_console) : 0, 0);
+			      ?	XCONSOLE (Vselected_console) : 0, 0, Qnil, 1);
 }
 
 static Lisp_Object
@@ -1462,7 +1474,8 @@
   else
     console = Vselected_console;
 
-  return find_symbol_value_1 (sym, current_buffer, XCONSOLE (console), 0);
+  return find_symbol_value_1 (sym, current_buffer, XCONSOLE (console), 0,
+			      Qnil, 1);
 }
 
 /* Return the current value of SYM.  The difference between this function
@@ -1489,7 +1502,45 @@
       dev = 0;
     }
 
-  return find_symbol_value_1 (sym, current_buffer, dev, 1);
+  return find_symbol_value_1 (sym, current_buffer, dev, 1, Qnil, 1);
+}
+
+/* This is an optimized function for quick lookup of buffer local symbols
+   by avoiding O(n) search.  This will work when either:
+     a) We have already found the symbol e.g. by traversing local_var_alist.
+   or
+     b) We know that the symbol will not be found in the current buffer's
+        list of local variables.
+   In the former case, find_it_p is 1 and symbol_cons is the element from
+   local_var_alist.  In the latter case, find_it_p is 0 and symbol_cons
+   is the symbol.
+
+   This function is called from set_buffer_internal which does both of these
+   things. */
+
+Lisp_Object
+find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p)
+{
+  /* WARNING: This function can be called when current_buffer is 0
+     and Vselected_console is Qnil, early in initialization. */
+  struct console *dev;
+  Lisp_Object sym = find_it_p ? XCAR (symbol_cons) : symbol_cons;
+  
+  CHECK_SYMBOL (sym);
+  if (CONSOLEP (Vselected_console))
+    dev = XCONSOLE (Vselected_console);
+  else
+    {
+      /* This can also get called while we're preparing to shutdown.
+         #### What should really happen in that case?  Should we
+         actually fix things so we can't get here in that case? */
+      assert (!initialized || preparing_for_armageddon);
+      dev = 0;
+    }
+
+  return find_symbol_value_1 (sym, current_buffer, dev, 1,
+			      find_it_p ? symbol_cons : Qnil,
+			      find_it_p);
 }
 
 DEFUN ("symbol-value", Fsymbol_value, 1, 1, 0, /*
@@ -2119,7 +2170,7 @@
 	case SYMVAL_BOOLEAN_FORWARD:
 	case SYMVAL_OBJECT_FORWARD:
 	case SYMVAL_DEFAULT_BUFFER_FORWARD:
-	  set_up_buffer_local_cache (variable, bfwd, current_buffer);
+	  set_up_buffer_local_cache (variable, bfwd, current_buffer, Qnil, 1);
 	  break;
 
 	case SYMVAL_UNBOUND_MARKER:
@@ -2215,7 +2266,7 @@
 	   value of the C variable.  set_up_buffer_local_cache()
 	   will do this.  It doesn't hurt to do it always,
 	   so just go ahead and do that. */
-	set_up_buffer_local_cache (variable, bfwd, current_buffer);
+	set_up_buffer_local_cache (variable, bfwd, current_buffer, Qnil, 1);
       }
       return (variable);
 
--- a/src/sysdep.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/sysdep.c	Mon Aug 13 09:07:36 2007 +0200
@@ -3240,13 +3240,19 @@
 
 #ifdef ENCAPSULATE_EXECVP
 int
-sys_execvp (CONST char *path, char * CONST argv[])
+sys_execvp (CONST char *path, char * CONST * argv)
 {
-  int i;
+  int i, argc;
+  CONST char ** new_argv;
+  
   PATHNAME_CONVERT_OUT (path);
-  for (i = 0; argv[i]; i++)
-    PATHNAME_CONVERT_OUT (argv[i]);
-  return execvp (path, argv);
+  for (argc = 0; argv[argc]; argc++)
+    ;
+  new_argv = (CONST char **) alloca ( (argc + 1) * sizeof (* new_argv));
+  for (i = 0; i < argc; i++)
+    GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (argv[i], new_argv[i]);
+  new_argv[argc] = NULL;
+  return execvp (path, (char **) new_argv);
 }
 #endif /* ENCAPSULATE_EXECVP */
 
--- a/src/vmsfns.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/vmsfns.c	Mon Aug 13 09:07:36 2007 +0200
@@ -368,8 +368,7 @@
   for (ptr = process_list; ptr; ptr = ptr->next)
     if (XINT (name) == ptr->name)
       {
-	write_to_mbx (ptr, string_data (XSTRING (command)),
-		      string_length (XSTRING (command)));
+	write_to_mbx (ptr, XSTRING_DATA (command), XSTRING_LENGTH (command));
 	return Qt;
       }
   return Qnil;
@@ -583,8 +582,8 @@
 
   CHECK_STRING (priv);
   priv = Fupcase (priv, Fcurrent_buffer ());
-  prvname = string_data (XSTRING (priv));
-  prvlen = string_length (XSTRING (priv));
+  prvname = XSTRING_DATA   (priv);
+  prvlen  = XSTRING_LENGTH (priv);
   found = 0;
   prvmask[0] = 0;
   prvmask[1] = 0;
@@ -603,7 +602,7 @@
 	}
     }
   if (! found)
-    error ("Unknown privilege name %s", string_data (XSTRING (priv)));
+    error ("Unknown privilege name %s", XSTRING_DATA (priv));
   if (NILP (getprv))
     {
       if (sys$setprv (NILP (value) ? 0 : 1, prvmask, 0, 0) == SS$_NORMAL)
@@ -654,8 +653,8 @@
 
   CHECK_STRING (type);
   type = Fupcase (type, Fcurrent_buffer ());
-  typename = string_data (XSTRING (type));
-  typelen = string_length (XSTRING (type));
+  typename = XSTRING_DATA   (type);
+  typelen  = XSTRING_LENGTH (type);
   for (i = 0; i < sizeof (vms_object) / sizeof (vms_object[0]); i++)
     {
       ptr = &vms_object[i];
@@ -678,7 +677,7 @@
   int prcnam[2];
 
   if (NILP (pid)
-      || STRINGP (pid) && string_length (XSTRING (pid)) == 0
+      || STRINGP (pid) && XSTRING_LENGTH (pid) == 0
       || ZEROP (pid))
     {
       code = owner ? JPI$_OWNER : JPI$_PID;
@@ -693,8 +692,8 @@
     return (XINT (pid));
   CHECK_STRING (pid);
   pid = Fupcase (pid, Fcurrent_buffer ());
-  size = string_length (XSTRING (pid));
-  p = string_data (XSTRING (pid));
+  size = XSTRING_LENGTH (pid);
+  p = XSTRING_DATA (pid);
   numeric = 1;
   id = 0;
   for (i = 0; i < size; i++, p++)
@@ -713,8 +712,8 @@
       }
   if (numeric)
     return (id);
-  prcnam[0] = string_length (XSTRING (pid));
-  prcnam[1] = string_data (XSTRING (pid));
+  prcnam[0] = XSTRING_LENGTH (pid);
+  prcnam[1] = XSTRING_DATA   (pid);
   status = lib$getjpi (&JPI$_PID, 0, prcnam, &id);
   if (! (status & 1))
     error ("Cannot find process id: %s",
@@ -854,8 +853,8 @@
   short length, level;
 
   CHECK_STRING (arg1);
-  symdsc[0] = string_length (XSTRING (arg1));
-  symdsc[1] = string_data (XSTRING (arg1));
+  symdsc[0] = XSTRING_LENGTH (arg1);
+  symdsc[1] = XSTRING_DATA   (arg1);
   status = lib$sys_trnlog (symdsc, &length, strdsc);
   if (! (status & 1))
     error ("Unable to translate logical name: %s", vmserrstr (status));
@@ -874,8 +873,8 @@
   short length, level;
 
   CHECK_STRING (arg1);
-  symdsc[0] = string_length (XSTRING (arg1));
-  symdsc[1] = string_data (XSTRING (arg1));
+  symdsc[0] = XSTRING_LENGTH (arg1);
+  symdsc[1] = XSTRING_DATA   (arg1);
   status = lib$get_symbol (symdsc, strdsc, &length, &level);
   if (! (status & 1)) {
     if (status == LIB$_NOSUCHSYM)
--- a/src/vmsproc.c	Mon Aug 13 09:06:45 2007 +0200
+++ b/src/vmsproc.c	Mon Aug 13 09:07:36 2007 +0200
@@ -395,7 +395,7 @@
   close_process_descs ();
 
   if (STRINGP (current_buffer->directory))
-    chdir (string_data (XSTRING (current_buffer->directory)));
+    chdir (XSTRING_DATA (current_buffer->directory));
 }
 
 DEFUN ("call-process-internal", Fcall_process_internal, 1, MANY, 0 /*
@@ -469,7 +469,7 @@
     int arg0;
     int firstArg;
 
-    if (strcmp (string_data (XSTRING (args[0])), "*dcl*") == 0)
+    if (strcmp (XSTRING_DATA (args[0]), "*dcl*") == 0)
       {
 	arg0 = 5;
 	firstArg = 6;
@@ -479,18 +479,18 @@
 	arg0 = 0;
 	firstArg = 4;
       }
-    len = string_length (XSTRING (args[arg0])) + 1;
+    len = XSTRING_LENGTH (args[arg0]) + 1;
     for (i = firstArg; i < nargs; i++)
       {
 	CHECK_STRING (args[i]);
-	len += string_length (XSTRING (args[i])) + 1;
+	len += XSTRING_LENGTH (args[i]) + 1;
       }
     new_argv = alloca (len);
-    strcpy (new_argv, string_data (XSTRING (args[arg0])));
+    strcpy (new_argv, XSTRING_DATA (args[arg0]));
     for (i = firstArg; i < nargs; i++)
       {
 	strcat (new_argv, " ");
-	strcat (new_argv, string_data (XSTRING (args[i])));
+	strcat (new_argv, XSTRING_DATA (args[i]));
       }
     dcmd.l = len-1;
     dcmd.a = new_argv;
@@ -520,7 +520,7 @@
     vs->outputChan = outchannel;
   }
 
-  filefd = open (string_data (XSTRING (args[1])), O_RDONLY, 0);
+  filefd = open (XSTRING_DATA (args[1]), O_RDONLY, 0);
   if (filefd < 0)
     {
       sys$dassgn (inchannel);
@@ -531,8 +531,8 @@
   else
     close (filefd);
 
-  din.l = string_length (XSTRING (args[1]));
-  din.a = string_data (XSTRING (args[1]));
+  din.l = XSTRING_LENGTH (args[1]);
+  din.a = XSTRING_DATA   (args[1]);
 
   /*
       Start a read on the process channel