changeset 83397:693e794b57bf

Merged from miles@gnu.org--gnu-2005 (patch 149-151, 629-641) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-629 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-631 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-632 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-633 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-634 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-635 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-636 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-637 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-638 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-639 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-640 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-641 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-149 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-150 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-151 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-437
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 07 Nov 2005 14:56:19 +0000
parents 201f610eb492 (current diff) 7edb08362291 (diff)
children c090869028e6
files ChangeLog admin/FOR-RELEASE configure configure.in etc/TODO lisp/ChangeLog lisp/bindings.el lisp/faces.el lisp/files.el lisp/font-lock.el lisp/help-fns.el lisp/ldefs-boot.el lisp/loadup.el lisp/net/newsticker.el lisp/net/rcirc.el lisp/progmodes/gdb-ui.el lisp/simple.el lisp/startup.el lisp/subr.el lisp/term/x-win.el lisp/vc-cvs.el lisp/vc-sccs.el lisp/vc.el lispref/ChangeLog man/ChangeLog man/newsticker.texi src/Makefile.in src/alloc.c src/data.c src/fringe.c src/keyboard.c src/lisp.h src/lread.c src/puresize.h src/window.c src/xdisp.c src/xfns.c
diffstat 153 files changed, 6308 insertions(+), 2809 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,7 +1,26 @@
+2005-11-03  Andreas Schwab  <schwab@suse.de>
+
+	* configure.in: Use GZIP_PROG instead of GZIP.
+
+	* Makefile.in (GZIP_PROG): Renamed from GZIP.
+	(install-arch-indep): Adjust.
+
+2005-11-01  Andreas Schwab  <schwab@suse.de>
+
+	* Makefile.in (bootstrap): Fix dependencies for parallel build.
+	(bootfast): Likewise.
+
+2005-11-01  Romain Francoise  <romain@orebokech.com>
+
+	* configure.in: Check for gzip.
+	* configure: Regenerate.
+
+	* Makefile.in (install): Compress source files.
+
 2005-10-24  Steven Tamm  <steventamm@mac.com>
 
-	* configure.in: Fix darwin386 configuration issue
-	* configure: Regenerate
+	* configure.in: Fix darwin386 configuration issue.
+	* configure: Regenerate.
 
 2005-10-22  Eli Zaretskii  <eliz@gnu.org>
 
--- a/Makefile.in	Mon Nov 07 14:17:18 2005 +0000
+++ b/Makefile.in	Mon Nov 07 14:56:19 2005 +0000
@@ -223,6 +223,9 @@
 # By default, we uphold the dignity of our programs.
 INSTALL_STRIP =
 
+# We use gzip to compress installed .el files.
+GZIP_PROG = @GZIP_PROG@
+
 # ============================= Targets ==============================
 
 # Program name transformation.
@@ -475,6 +478,14 @@
 	   (cd ${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
 	else true; fi
 	-unset CDPATH; \
+	if [ -n "${GZIP_PROG}" ]; \
+	then \
+	   echo "Compressing *.el ..." ; \
+	   (cd ${lispdir}; for f in `find . -name "*.elc" -print`; do \
+		${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
+	    done) \
+	else true; fi
+	-unset CDPATH; \
 	thisdir=`/bin/pwd`; \
 	if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
 	then \
@@ -750,9 +761,11 @@
 	  exit 1;\
 	fi
 
-bootstrap: bootstrap-clean-before info bootstrap-build FRC
+bootstrap: bootstrap-clean-before FRC
+	$(MAKE) $(MFLAGS) info bootstrap-build
 
-bootfast: bootstrap-clean-before-fast info bootstrap-build FRC
+bootfast: bootstrap-clean-before-fast FRC
+	$(MAKE) $(MFLAGS) info bootstrap-build
 
 bootstrap-build: FRC
 	(cd lisp; $(MAKE) $(MFLAGS) bootstrap-prepare)
--- a/admin/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/admin/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,7 @@
+2005-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* FOR-RELEASE: Init file change implemented.
+
 2005-10-27  Chong Yidong  <cyd@stupidchicken.com>
 
 	* FOR-RELEASE: Fringe angle bitmap at eob fixed.
--- a/admin/FOR-RELEASE	Mon Nov 07 14:17:18 2005 +0000
+++ b/admin/FOR-RELEASE	Mon Nov 07 14:56:19 2005 +0000
@@ -27,8 +27,6 @@
 
 * NEW FEATURES
 
-** Change .emacs.d/.emacs to .emacs.d/emacs.
-
 ** Rework how fringe bitmaps are defined and used.
 Currently, bitmap usage and bitmap appearence are "mixed-up" in a
 one-level representation.  It would be cleaner to split the
@@ -46,7 +44,11 @@
 
 * BUGS
 
-** VC bug report from Peter Milliken on Sep 21 (emacs-pretest-bug).
+** Make where-is-internal detect when a key is shadowed by a shorter
+prefix key that prevents you from entering it.
+
+** Clean up the confusion about what `unspecified' means
+in the face defaults for new frames.
 
 ** TCP server processes do not work on Windows.
 
@@ -57,7 +59,7 @@
 
 * DOCUMENTATION
 
-** Update man/info.texi.
+** Check man/info.texi.
 
 ** Add missing years in copyright notices of all files.
 
--- a/configure	Mon Nov 07 14:17:18 2005 +0000
+++ b/configure	Mon Nov 07 14:56:19 2005 +0000
@@ -310,7 +310,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO EGREP LIBSOUND SET_MAKE PKG_CONFIG GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GETOPTOBJS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO GZIP_PROG EGREP LIBSOUND SET_MAKE PKG_CONFIG GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GETOPTOBJS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -988,7 +988,7 @@
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -2629,6 +2629,12 @@
     machine=powermac opsys=darwin
     # Define CPP as follows to make autoconf work correctly.
     CPP="${CC-cc} -E -no-cpp-precomp"
+    # Use fink packages if available.
+    if test -d /sw/include && test -d /sw/lib; then
+	GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
+        CPP="${CPP} ${GCC_TEST_OPTIONS}"
+	NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
+    fi
   ;;
 
   ## AMD x86-64 Linux-based GNU system
@@ -3272,8 +3278,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3331,8 +3336,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3448,8 +3452,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3503,8 +3506,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3549,8 +3551,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3594,8 +3595,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4193,6 +4193,45 @@
 echo "${ECHO_T}no" >&6
 fi
 
+# Extract the first word of "gzip", so it can be a program name with args.
+set dummy gzip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GZIP_PROG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $GZIP_PROG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GZIP_PROG="$GZIP_PROG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GZIP_PROG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+GZIP_PROG=$ac_cv_path_GZIP_PROG
+
+if test -n "$GZIP_PROG"; then
+  echo "$as_me:$LINENO: result: $GZIP_PROG" >&5
+echo "${ECHO_T}$GZIP_PROG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
 
 
 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
@@ -4228,8 +4267,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4505,8 +4543,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4535,8 +4572,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4606,8 +4642,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4659,8 +4694,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4731,8 +4765,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4784,8 +4817,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4855,8 +4887,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5026,8 +5057,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5096,8 +5126,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5251,8 +5280,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5348,8 +5376,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5491,8 +5518,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5611,8 +5637,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5777,8 +5802,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5841,8 +5865,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5915,8 +5938,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6002,8 +6024,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6076,8 +6097,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6147,8 +6167,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6207,8 +6226,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6277,8 +6295,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6339,8 +6356,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6406,8 +6422,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6553,8 +6568,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6618,8 +6632,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6684,8 +6697,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6731,8 +6743,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6806,8 +6817,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6872,8 +6882,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6917,8 +6926,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6989,8 +6997,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7040,8 +7047,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7112,8 +7118,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7163,8 +7168,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7235,8 +7239,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7286,8 +7289,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7358,8 +7360,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7409,8 +7410,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7481,8 +7481,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7532,8 +7531,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7620,8 +7618,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7727,8 +7724,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7788,8 +7784,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7913,6 +7908,7 @@
 echo "$as_me:$LINENO: checking for X" >&5
 echo $ECHO_N "checking for X... $ECHO_C" >&6
 
+ac_path_x_has_been_run=yes
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -8005,7 +8001,7 @@
 /usr/openwin/share/include'
 
 if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Intrinsic.h.
+  # Guess where to find include files, by looking for a specified header file.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8013,7 +8009,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+#include <X11/Xlib.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -8040,7 +8036,7 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
   for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Intrinsic.h"; then
+  if test -r "$ac_dir/X11/Xlib.h"; then
     ac_x_includes=$ac_dir
     break
   fi
@@ -8054,33 +8050,32 @@
   # See if we find them without any special options.
   # Don't add to $LIBS permanently.
   ac_save_LIBS=$LIBS
-  LIBS="-lXt $LIBS"
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Intrinsic.h>
-int
-main ()
-{
-XtMalloc (0)
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8104,7 +8099,7 @@
 do
   # Don't even attempt the hair of trying to link an X program!
   for ac_extension in a so sl; do
-    if test -r $ac_dir/libXt.$ac_extension; then
+    if test -r $ac_dir/libX11.$ac_extension; then
       ac_x_libraries=$ac_dir
       break 2
     fi
@@ -8140,8 +8135,12 @@
   # Update the cache value to reflect the command line values.
   ac_cv_have_x="have_x=yes \
 		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
+  # It might be that x_includes is empty (headers are found in the
+  # standard search path. Then output the corresponding message
+  ac_out_x_includes=$x_includes
+  test "x$x_includes" = x && ac_out_x_includes="in standard search path"
+  echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6
 fi
 
 if test "$no_x" = yes; then
@@ -8223,8 +8222,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8460,8 +8458,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8556,8 +8553,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8616,8 +8612,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8701,8 +8696,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8886,8 +8880,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9139,8 +9132,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9207,8 +9199,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9277,8 +9268,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9363,8 +9353,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9441,8 +9430,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9496,8 +9484,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9566,8 +9553,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9671,8 +9657,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9739,8 +9724,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9810,8 +9794,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10051,8 +10034,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10161,8 +10143,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10265,8 +10246,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10344,8 +10324,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10499,8 +10478,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10574,8 +10552,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10647,8 +10624,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10730,8 +10706,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10810,8 +10785,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10882,8 +10856,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10952,8 +10925,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11026,8 +10998,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11150,8 +11121,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11253,8 +11223,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11334,8 +11303,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11403,8 +11371,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11549,8 +11516,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11659,8 +11625,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11805,8 +11770,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11913,8 +11877,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12068,8 +12031,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12144,8 +12106,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12293,8 +12254,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12371,8 +12331,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12519,8 +12478,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12593,8 +12551,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12795,8 +12752,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12869,8 +12825,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13015,8 +12970,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13092,8 +13046,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13156,8 +13109,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13238,8 +13190,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13380,8 +13331,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13526,8 +13476,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13603,8 +13552,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13677,8 +13625,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13833,8 +13780,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13900,8 +13846,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14161,8 +14106,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14229,8 +14173,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14382,8 +14325,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14567,8 +14509,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14895,8 +14836,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14997,8 +14937,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15071,8 +15010,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15151,8 +15089,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15221,8 +15158,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15290,8 +15226,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15365,8 +15300,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15470,8 +15404,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15546,8 +15479,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15699,8 +15631,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15768,8 +15699,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15946,8 +15876,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16023,8 +15952,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16178,8 +16106,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16330,8 +16257,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16482,8 +16408,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16625,8 +16550,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16670,8 +16594,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16817,8 +16740,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16862,8 +16784,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16928,8 +16849,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17019,8 +16939,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17207,8 +17126,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17278,8 +17196,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17348,8 +17265,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17481,8 +17397,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17584,8 +17499,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17654,8 +17568,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17762,8 +17675,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17866,8 +17778,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17943,8 +17854,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18048,8 +17958,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18141,8 +18050,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18207,8 +18115,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18274,8 +18181,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18385,8 +18291,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18451,8 +18356,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18532,8 +18436,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18606,8 +18509,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18680,8 +18582,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18754,8 +18655,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18829,8 +18729,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18902,8 +18801,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18978,8 +18876,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19051,8 +18948,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19125,8 +19021,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19276,8 +19171,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19423,8 +19317,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19570,8 +19463,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19728,8 +19620,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19875,8 +19766,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20022,8 +19912,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20181,8 +20070,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20340,8 +20228,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20530,8 +20417,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20604,8 +20490,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20673,8 +20558,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20720,8 +20604,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20795,8 +20678,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20860,8 +20742,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20999,8 +20880,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21061,8 +20941,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21207,8 +21086,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21364,8 +21242,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21536,8 +21413,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21605,8 +21481,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21791,8 +21666,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21834,18 +21708,24 @@
   ac_cv_func_fork_works=cross
 else
   cat >conftest.$ac_ext <<_ACEOF
-/* By Ruediger Kuhlmann. */
-      #include <sys/types.h>
-      #if HAVE_UNISTD_H
-      # include <unistd.h>
-      #endif
-      /* Some systems only have a dummy stub for fork() */
-      int main ()
-      {
-	if (fork() < 0)
-	  exit (1);
-	exit (0);
-      }
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+	  /* By Ruediger Kuhlmann. */
+	  if (fork() < 0)
+	    exit (1);
+	  exit (0);
+
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@@ -22085,8 +21965,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22151,8 +22030,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22215,8 +22093,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22282,8 +22159,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22324,8 +22200,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22392,8 +22267,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -23305,6 +23179,7 @@
 s,@RANLIB@,$RANLIB,;t t
 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
 s,@INSTALL_INFO@,$INSTALL_INFO,;t t
+s,@GZIP_PROG@,$GZIP_PROG,;t t
 s,@EGREP@,$EGREP,;t t
 s,@LIBSOUND@,$LIBSOUND,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
@@ -23509,11 +23384,6 @@
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -23552,6 +23422,12 @@
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
--- a/configure.in	Mon Nov 07 14:17:18 2005 +0000
+++ b/configure.in	Mon Nov 07 14:56:19 2005 +0000
@@ -1272,6 +1272,8 @@
 AC_PATH_PROG(INSTALL_INFO, install-info)
 AC_PATH_PROG(INSTALL_INFO, install-info,, /usr/sbin)
 AC_PATH_PROG(INSTALL_INFO, install-info,:, /sbin)
+dnl Don't use GZIP, which is used by gzip for additional parameters.
+AC_PATH_PROG(GZIP_PROG, gzip)
 
 dnl Add our options to ac_link now, after it is set up.
 
--- a/etc/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,7 +1,51 @@
+2005-11-06  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* images/copy.xpm, images/copy.pbm, images/low-color/copy.xpm
+	* images/save.xpm, images/save.pbm, images/low-color/save.xpm:
+	Adjust baseline.
+	
+2005-11-06  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* images/up-node.xpm, images/prev-node.xpm, images/next-node.xpm
+	* images/up-node.pbm, images/prev-node.pbm, images/next-node.pbm
+	* images/low-color/up-node.xpm, images/low-color/prev-node.xpm
+	* images/low-color/next-node.xpm: Adjust paper size and layout.
+
+2005-11-05  Nick Roberts  <nickrob@snap.net.nz>
+
+	* DEBUG: Describe how to provide preprocessor macro information.
+
+2005-11-04  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* images/up-node.xpm, images/prev-node.xpm, images/next-node.xpm
+	* images/up-node.pbm, images/prev-node.pbm, images/next-node.pbm
+	* images/low-color/up-node.xpm, images/low-color/prev-node.xpm
+	* images/low-color/next-node.xpm: New images.
+
+2005-11-04  Carsten Dominik  <dominik@science.uva.nl>
+
+	* orgcard.tex (section{Notes}): Version number change.
+
+2005-11-03  Romain Francoise  <romain@orebokech.com>
+
+	* orgcard.tex: Update FSF's address.
+
+2005-11-03  Nick Roberts  <nickrob@snap.net.nz>
+
+	* DEBUG: GDB can sometimes expand macros.
+
+2005-11-01  Romain Francoise  <romain@orebokech.com>
+
+	* NEWS: Source files are compressed by default.
+
+2005-10-28  Bill Wohler  <wohler@newt.com>
+
+	* NEWS: Help mode now creates hyperlinks for URLs.
+
 2005-10-27  Dan Nicolaescu  <dann@ics.uci.edu>
 
-	* e/eterm-color.ti (el1): Undo 2005-10-23 change. 
-	Add some comments on how to update this file. Add ri 
+	* e/eterm-color.ti (el1): Undo 2005-10-23 change.
+	Add some comments on how to update this file. Add ri
 	capability that has long been supported by term.el.
 
 2005-10-25  Nick Roberts  <nickrob@snap.net.nz>
--- a/etc/DEBUG	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/DEBUG	Mon Nov 07 14:56:19 2005 +0000
@@ -158,11 +158,13 @@
 
   XVECTOR (this_command_keys)->contents[this_command_key_count++] = key;
 
-XVECTOR is a macro, and therefore GDB does not know about it.
-GDB cannot evaluate "p XVECTOR (this_command_keys)".
+XVECTOR is a macro, so GDB only knows about it if Emacs has been compiled with
+preprocessor macro information.  GCC provides this if you specify the options
+`-gdwarf-2' and `-g3'.  In this case, GDB can evaluate expressions like
+"p XVECTOR (this_command_keys)".
 
-However, you can use the xvector command in GDB to get the same
-result.  Here is how:
+When this information isn't available, you can use the xvector command in GDB
+to get the same result.  Here is how:
 
     (gdb) p this_command_keys
     $1 = 1078005760
--- a/etc/MH-E-NEWS	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/MH-E-NEWS	Mon Nov 07 14:56:19 2005 +0000
@@ -32,6 +32,11 @@
 
 The -face suffix has been dropped from all face names. 
 
+*** Default Identity Prevents Insertion of Auto Fields
+
+Auto insertion of an identity now occurs even when the default
+identity is used (closes SF #1204506).
+
 *** mh-compose-forward and Default Message Number
 
 mh-compose-forward will now default to the sent message in the sent
--- a/etc/NEWS	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/NEWS	Mon Nov 07 14:56:19 2005 +0000
@@ -118,6 +118,9 @@
 The Emacs terminal emulation in term.el now uses "eterm-color" as its
 terminfo name, since term.el now supports color.
 
+---
+** Emacs Lisp source files are compressed by default if `gzip' is available.
+
 
 * Startup Changes in Emacs 22.1
 
@@ -192,8 +195,9 @@
 
 +++
 ** Init file changes
-You can now put the init files .emacs and .emacs_SHELL under
-~/.emacs.d or directly under ~.  Emacs will find them in either place.
+If the init file ~/.emacs does not exist, Emacs will try
+~/.emacs.d/init.el or ~/.emacs.d/init.elc.  You can also put the shell
+init file .emacs_SHELL under ~/.emacs.d.
 
 +++
 ** Emacs now reads the standard abbrevs file ~/.abbrev_defs
@@ -236,8 +240,9 @@
 
 +++
 ** A prefix argument is no longer required to repeat a jump to a
-previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the
-mark ring.  Use C-u C-u C-SPC to set the mark immediately after a jump.
+previous mark if you set `set-mark-command-repeat-pop' to t.  I.e. C-u
+C-SPC C-SPC C-SPC ... cycles through the mark ring.  Use C-u C-u C-SPC
+to set the mark immediately after a jump.
 
 +++
 ** The info-search bindings on C-h C-f, C-h C-k and C-h C-i
@@ -280,6 +285,14 @@
 * Editing Changes in Emacs 22.1
 
 +++
+** !MEM FULL! at the start of the mode line indicates that Emacs
+cannot get any more memory for Lisp data.  This often means it could
+crash soon if you do things that use more memory.  On most systems,
+killing buffers will get out of this state.  If killing buffers does
+not make !MEM FULL! disappear, you should save your work and start
+a new Emacs.
+
++++
 ** The max size of buffers and integers has been doubled.
 On 32bit machines, it is now 256M (i.e. 268435455).
 
@@ -468,7 +481,9 @@
 preceded by one of the words `variable' or `option'.  It now makes
 hyperlinks to Info anchors (or nodes) if the anchor (or node) name is
 enclosed in single quotes and preceded by `info anchor' or `Info
-anchor' (in addition to earlier `info node' and `Info node').
+anchor' (in addition to earlier `info node' and `Info node'). In
+addition, it now makes hyperlinks to URLs as well if the URL is
+enclosed in single quotes and preceded by `URL'.
 
 +++
 *** The new command `describe-char' (C-u C-x =) pops up a buffer with
@@ -1522,7 +1537,7 @@
 
 +++
 ** savehist saves minibuffer histories between sessions.
-To use this feature, put (savehist-load) in your `.emacs' file.
+To use this feature, turn on savehist-mode in your `.emacs' file.
 
 +++
 ** Filesets are collections of files.  You can define a fileset in
@@ -3348,6 +3363,10 @@
 
 ---
 ** Support for Mocklisp has been removed.
+
++++
+** The variable `memory-full' now remains t until
+there is no longer a shortage of memory.
 
 * Lisp Changes in Emacs 22.1
 
--- a/etc/TODO	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/TODO	Mon Nov 07 14:56:19 2005 +0000
@@ -288,6 +288,9 @@
 
 ** Face remapping.
 
+** Optionally make the cursor a little thinner at the end of a line
+  or the end of the buffer.
+
 ** Add support for rendering antialiased text, probably using
   XRender/Freetype.
 
Binary file etc/images/copy.pbm has changed
--- a/etc/images/copy.xpm	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/images/copy.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -28,26 +28,26 @@
 ":	c #767676",
 "<	c #F5F5F5",
 "                        ",
-" .............          ",
-" .+@@@@@@@@@#$.         ",
-" .@%%%%%%%%%%%.         ",
-" .@&**=%+*%*+%.         ",
-" .@%%%%%%%%---.         ",
-" .@;>%,*+-............  ",
-" .@%%%%%%.'))))))))))!. ",
-" .@&**%*~.)))))))))))). ",
-" .@%%%%%-.){]]&)^])]^). ",
-" .@;>>%,/.)))))))))))). ",
-" .@%%%%%(.)_;):]^)^])). ",
-" .@&**%*~.)))))))))))). ",
-" .<%%%%%-.){]])]]^)&]). ",
-" .$%%%%%-.)))))))))))). ",
-"  ........)_;;):]^)^]). ",
-"         .)))))))))))). ",
-"         .){]])]]^)&]). ",
-"         .)))))))))))). ",
-"         .!))))))))))!. ",
-"         .............. ",
 "                        ",
 "                        ",
+".............           ",
+".+@@@@@@@@@#$.          ",
+".@%%%%%%%%%%%.          ",
+".@&**=%+*%*+%.          ",
+".@%%%%%%%%---.          ",
+".@;>%,*+-............   ",
+".@%%%%%%.'))))))))))!.  ",
+".@&**%*~.)))))))))))).  ",
+".@%%%%%-.){]]&)^])]^).  ",
+".@;>>%,/.)))))))))))).  ",
+".@%%%%%(.)_;):]^)^])).  ",
+".@&**%*~.)))))))))))).  ",
+".<%%%%%-.){]])]]^)&]).  ",
+".$%%%%%-.)))))))))))).  ",
+" ........)_;;):]^)^]).  ",
+"        .)))))))))))).  ",
+"        .){]])]]^)&]).  ",
+"        .)))))))))))).  ",
+"        .!))))))))))!.  ",
+"        ..............  ",
 "                        "};
--- a/etc/images/low-color/copy.xpm	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/images/low-color/copy.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -1,33 +1,33 @@
 /* XPM */
-static char * copy2_xpm[] = {
+static char * copy_xpm[] = {
 "24 24 6 1",
 " 	c None",
-".	c #FFFFFF",
-"+	c #000100",
-"@	c #6B6B66",
-"#	c #BBBDBA",
+".	c #000100",
+"+	c #BBBDBA",
+"@	c #FFFFFF",
+"#	c #6B6B66",
 "$	c #504D46",
 "                        ",
-" +++++++++++++          ",
-" +#..........#+         ",
-" +............+         ",
-" +.#@@@.#@.@#.+         ",
-" +............+         ",
-" +.@$.@@#.++++++++++++  ",
-" +.......+#..........#+ ",
-" +.#@@.@@+............+ ",
-" +.......+.#@@#.#@.@#.+ ",
-" +.@$$.@@+............+ ",
-" +.......+.@@.@@#.#@..+ ",
-" +.#@@.@@+............+ ",
-" +.......+.#@@.@@#.#@.+ ",
-" +#......+............+ ",
-"  ++++++++.@@@.@@#.#@.+ ",
-"         +............+ ",
-"         +.#@@.@@#.#@.+ ",
-"         +............+ ",
-"         +#..........#+ ",
-"         ++++++++++++++ ",
 "                        ",
 "                        ",
+".............           ",
+".+@@@@@@@@@@+.          ",
+".@@@@@@@@@@@@.          ",
+".@+###@+#@#+@.          ",
+".@@@@@@@@@@@@.          ",
+".@#$@##+@............   ",
+".@@@@@@@.+@@@@@@@@@@+.  ",
+".@+##@##.@@@@@@@@@@@@.  ",
+".@@@@@@@.@+##+@+#@#+@.  ",
+".@#$$@##.@@@@@@@@@@@@.  ",
+".@@@@@@@.@##@##+@+#@@.  ",
+".@+##@##.@@@@@@@@@@@@.  ",
+".@@@@@@@.@+##@##+@+#@.  ",
+".+@@@@@@.@@@@@@@@@@@@.  ",
+" ........@###@##+@+#@.  ",
+"        .@@@@@@@@@@@@.  ",
+"        .@+##@##+@+#@.  ",
+"        .@@@@@@@@@@@@.  ",
+"        .+@@@@@@@@@@+.  ",
+"        ..............  ",
 "                        "};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/images/low-color/next-node.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,35 @@
+/* XPM */
+static char * next_node_xpm[] = {
+"24 24 8 1",
+" 	c None",
+".	c #BBBDBA",
+"+	c #000000",
+"@	c #FFFFFF",
+"#	c #87AF85",
+"$	c #504D46",
+"%	c #6B6B66",
+"&	c #000100",
+"  ++++++++++++++++++    ",
+"  +@@@@@@@@@@@@@@@..+   ",
+"  +@@@@@@@@@@@@@@@.@.+  ",
+"  +@@@%.@@@@@@@@@@.#%&+ ",
+"  +@@@++..@@@@@@@@.#%&+ ",
+"  +@@@+#+...@.@@@@@@..+ ",
+"  +@..+.#+...@@.......+ ",
+"+++++++.##+....@......+ ",
+"+.......###+..........+ ",
+"+.####.#####+.........+ ",
+"+..........##+........+ ",
+"+###########$+#.......+ ",
+"+##########$+#........+ ",
+"+#########$+%#........+ ",
+"+++++++##$+#..........+ ",
+"  +..#+#$+%#..........+ ",
+"  +...+$+#............+ ",
+"  +@..++##............+ ",
+"  +@..+...............+ ",
+"  +@..................+ ",
+"  +@..................+ ",
+"  +++++++++++++++++++++ ",
+"                        ",
+"                        "};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/images/low-color/prev-node.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,34 @@
+/* XPM */
+static char * prev_node_xpm[] = {
+"24 24 7 1",
+" 	c None",
+".	c #BBBDBA",
+"+	c #000000",
+"@	c #FFFFFF",
+"#	c #87AF85",
+"$	c #504D46",
+"%	c #000100",
+"    ++++++++++++++++++  ",
+"   %@.@@@@@@@@@@@@@@.+  ",
+"  %@@#.@@@@@@@@@@@@@.+  ",
+" +..##.@@@@@@@@@.+...+  ",
+" +#....@@@@@@@@.++...+  ",
+" +.@@@@@@@@@...+.+...+  ",
+" +.@@@@@@@@@@.+.#+...+  ",
+" +@@@@@@@@...+.##+++++++",
+" +@@@@@@@...+.##......#+",
+" +@@@@@@@..+@####.#####+",
+" +@.@.....+...........#+",
+" +@.@.....+###########$+",
+" +@........+##########$+",
+" +@........#+#####$$$$$+",
+" +@.........#+##$+++++++",
+" +@..........#+#$+###+  ",
+" +@...........#+$+#..+  ",
+" +@............#++...+  ",
+" +@.............#+...+  ",
+" +@..................+  ",
+" +@..................+  ",
+" +++++++++++++++++++++  ",
+"                        ",
+"                        "};
--- a/etc/images/low-color/save.xpm	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/images/low-color/save.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -1,39 +1,39 @@
 /* XPM */
-static char * save2_xpm[] = {
+static char * save_xpm[] = {
 "24 24 12 1",
 " 	c None",
-".	c #FFFFFF",
-"+	c #000100",
-"@	c #BBBDBA",
-"#	c #7A98B0",
-"$	c #6B6B66",
-"%	c #EBA291",
-"&	c #3E4850",
-"*	c #B0CCE2",
-"=	c #4D687C",
-"-	c #504D46",
-";	c #974F3D",
+".	c #000100",
+"+	c #B0CCE2",
+"@	c #6B6B66",
+"#	c #EBA291",
+"$	c #BBBDBA",
+"%	c #7A98B0",
+"&	c #974F3D",
+"*	c #4D687C",
+"=	c #FFFFFF",
+"-	c #3E4850",
+";	c #504D46",
+"                        ",
 "                        ",
-"  +++++++++++++++++++   ",
-" +**$%%%%%%%%%%%%@$**+  ",
-" +*#$%%%%%%%%;;%;;$#=+  ",
-" +*#$%%%%%%;%;%;;;$#=+  ",
-" +*#$.............$#=+  ",
-" +*#$.............$#=+  ",
-" +*#$@@@@@@@@@@@@@$#=+  ",
-" +*#$.............$#=+  ",
-" +*#$.............$#=+  ",
-" +*#$@@@@@@@@@@@@@$#$+  ",
-" +*#$.............$#&+  ",
-" +*##$$$$$$$$$$$$$$#&+  ",
-" +*#################&+  ",
-" +*###&&&==$$$$&&&#*&+  ",
-" +*##&@@....@@@@$==*&+  ",
-" +*##&@.$--@@@@@&==*&+  ",
-" +*##&..$--@@@@@&==*&+  ",
-" +*##&..---@@@..&==*&+  ",
-" +###&@@---@@...&==*&+  ",
-"  +==&@@@@@@..@@&==*&+  ",
-"   ++++++++++++++++&+   ",
-"                        ",
+"  ...................   ",
+" .++@############$@++.  ",
+" .+%@########&&#&&@%*.  ",
+" .+%@######&#&#&&&@%*.  ",
+" .+%@=============@%*.  ",
+" .+%@=============@%*.  ",
+" .+%@$$$$$$$$$$$$$@%*.  ",
+" .+%@=============@%*.  ",
+" .+%@=============@%*.  ",
+" .+%@$$$$$$$$$$$$$@%@.  ",
+" .+%@=============@%-.  ",
+" .+%%@@@@@@@@@@@@@@%-.  ",
+" .+%%%%%%%%%%%%%%%%%-.  ",
+" .+%%%---**@@@@---%+-.  ",
+" .+%%-$$====$$$$@**+-.  ",
+" .+%%-$=@;;$$$$$-**+-.  ",
+" .+%%-==@;;$$$$$-**+-.  ",
+" .+%%-==;;;$$$==-**+-.  ",
+" .%%%-$$;;;$$===-**+-.  ",
+"  .**-$$$$$$==$$-**+-.  ",
+"   ................-.   ",
 "                        "};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/images/low-color/up-node.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,35 @@
+/* XPM */
+static char * up_node_xpm[] = {
+"24 24 8 1",
+" 	c None",
+".	c #FFFFFF",
+"+	c #BBBDBA",
+"@	c #000000",
+"#	c #87AF85",
+"$	c #504D46",
+"%	c #6B6B66",
+"&	c #000100",
+"  @@@@@@@@@@@@@@@@@@    ",
+"  @...............++@   ",
+"  @...............+.+@  ",
+"  @...............+#%&@ ",
+"  @...............+#%&@ ",
+"  @.................++@ ",
+"  @............+++++++@ ",
+"  @.............++++++@ ",
+"  @............+++++++@ ",
+"  @.....++++#+++++++++@ ",
+"  @...+.+++@@##+++++++@ ",
+"  @....+++@#$@%+++++++@ ",
+"  @...+++@###$@##+++++@ ",
+"  @...++@##+##$@%+++++@ ",
+"  @..++@###+###$@##+++@ ",
+"  @..+@####+####$@#+++@ ",
+"  @.+@#+++#+#####$@+++@ ",
+"  @.%@@@@+++###@@@@@++@ ",
+"  @....+@+#+###@#+++++@ ",
+"  @....+@+#+###@++++++@ ",
+"  @.....@+#+###@++..++@ ",
+"  @@@@@@@+#+###@@@@@@@@ ",
+"        @+++###@        ",
+"        @@@@@@@@        "};
Binary file etc/images/next-node.pbm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/images/next-node.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,45 @@
+/* XPM */
+static char * next_node2_xpm[] = {
+"24 24 18 1",
+" 	c None",
+".	c #000000",
+"+	c #FFFFFF",
+"@	c #DADAD6",
+"#	c #BCBCB8",
+"$	c #506B46",
+"%	c #778E6F",
+"&	c #0F1308",
+"*	c #77A16E",
+"=	c #C2D7BE",
+"-	c #6B9060",
+";	c #A9C7A6",
+">	c #C1D6BD",
+",	c #BDD3B8",
+"'	c #B0CAAD",
+")	c #A4C3A2",
+"!	c #445B2C",
+"~	c #8CA782",
+"  ..................    ",
+"  .+++++++++++++++@#.   ",
+"  .+++++++++++++++#+#.  ",
+"  .+++$#++++++++++#%$&. ",
+"  .+++..#@++++++++@%$&. ",
+"  .+++.*.#@@+@++++++@#. ",
+"  .+@@.=-.#@@++@@@@@@#. ",
+".......=;-.#@@@+@@@@@#. ",
+".=>>>>>,;;-.#@@@@@@@@#. ",
+".=;;;;';;;;-.##@@@@@@#. ",
+".@>,,,>,,,,;-.#@@@@@@#. ",
+".)----------!.%#@@@@@#. ",
+".~---------!.%##@@@@##. ",
+".*--------!.$%##@@@@@#. ",
+".......--!.%####@@@@@#. ",
+"  .##%.-!.$%####@@@@##. ",
+"  .@##.!.%####@####@##. ",
+"  .+##..%%#####@@@@@@#. ",
+"  .+@#.#####@@@####@@#. ",
+"  .+@@#####@@@@####@##. ",
+"  .+##################. ",
+"  ..................... ",
+"                        ",
+"                        "};
Binary file etc/images/prev-node.pbm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/images/prev-node.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,44 @@
+/* XPM */
+static char * prev_node3_xpm[] = {
+"24 24 17 1",
+" 	c None",
+".	c #000000",
+"+	c #0F1308",
+"@	c #FFFFFF",
+"#	c #BCBCB8",
+"$	c #DADAD6",
+"%	c #778E6F",
+"&	c #C2D7BE",
+"*	c #A6BFA0",
+"=	c #A9C7A6",
+"-	c #BDD3B8",
+";	c #B0CAAD",
+">	c #C1D6BD",
+",	c #8CA782",
+"'	c #5B7950",
+")	c #6B9060",
+"!	c #445B2C",
+"    ..................  ",
+"   +@#@@@@@@@@@@@@@@$.  ",
+"  +@@%$@@@@@@@@@@@@@$.  ",
+" .$#%%$@@@@@@@@@$.$$$.  ",
+" .%$##$@@@@@@@@#..$$$.  ",
+" .#@@@@@@@@@$$#.&.#$$.  ",
+" .$@@@@@@@@@@#.$*.##$.  ",
+" .@@@@@@@@$$#.$=*.......",
+" .@@@@@@@$$#.$==-&&&&&*.",
+" .@@@@@@@$#.@====;====%.",
+" .@$@$$$$#.$>>>>>>>>>>,.",
+" .@$@$$$$#.'))))))))))!.",
+" .@$$$$$$##.')))))))))!.",
+" .@$$$$$$##%.')))'!!!!!.",
+" .@$$$$$##$#%.')!.......",
+" .@$$$$$$$###%.'!.%%%.  ",
+" .@$$#####$$##%.!.%##.  ",
+" .@$$$$$$$#####%..###.  ",
+" .@$$#####$$$###%.###.  ",
+" .@$$$$$$$$$$$#######.  ",
+" .@##################.  ",
+" .....................  ",
+"                        ",
+"                        "};
Binary file etc/images/save.pbm has changed
--- a/etc/images/save.xpm	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/images/save.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -222,6 +222,7 @@
 "6+	c #363C41",
 "7+	c #28323E",
 "                                                ",
+"                                                ",
 "    . . . . . . . . . . . . . . . . . . .       ",
 "  . + @ # $ % & * = - ; > , > , ' ) ! ~ { .     ",
 "  . ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 .     ",
@@ -243,5 +244,4 @@
 "  . #+$+%+&+*+=+-+;+;+w.>+,+'+,+)+!+~+{+]+.     ",
 "    ^+/+(+_+:+w.x.<+<+[+}+d.|+1+2+3+4+5+6+.     ",
 "      . . . . . . . . . . . . . . . . 7+.       ",
-"                                                ",
 "                                                "};
Binary file etc/images/up-node.pbm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/images/up-node.xpm	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,45 @@
+/* XPM */
+static char * up_node2_xpm[] = {
+"24 24 18 1",
+" 	c None",
+".	c #000000",
+"+	c #FFFFFF",
+"@	c #DADAD6",
+"#	c #BCBCB8",
+"$	c #778E6F",
+"%	c #506B46",
+"&	c #0F1308",
+"*	c #6B9060",
+"=	c #445B2C",
+"-	c #A9C7A6",
+";	c #BDD3B8",
+">	c #77A16E",
+",	c #C2D7BE",
+"'	c #C1D6BD",
+")	c #B0CAAD",
+"!	c #A4C3A2",
+"~	c #8CA782",
+"  ..................    ",
+"  .+++++++++++++++@#.   ",
+"  .+++++++++++++++#+#.  ",
+"  .+++++++++++++++#$%&. ",
+"  .+++++++++++++++@$%&. ",
+"  .+++++++++++++++++@#. ",
+"  .++++++++++++@@@@@@#. ",
+"  .+++++++++++++@@@@@#. ",
+"  .++++++++++++@@@@@@#. ",
+"  .+++++@@##$####@#@@#. ",
+"  .+++@+@@#..$$####@@#. ",
+"  .++++@@#.*=.%####@##. ",
+"  .+++@@#.*-*=.$$###@#. ",
+"  .+++@#.*-;**=.%###@#. ",
+"  .++@#.*--;***=.$$###. ",
+"  .++#.*---;****=.$###. ",
+"  .+#.>,,;-;*****=.#@#. ",
+"  .+%....')'***.....@#. ",
+"  .++++@.'-;***.$#####. ",
+"  .++++@.'-;***.###@##. ",
+"  .+++++.'-;***.#@++##. ",
+"  .......'-;***........ ",
+"        .,,@!~>.        ",
+"        ........        "};
--- a/etc/orgcard.tex	Mon Nov 07 14:17:18 2005 +0000
+++ b/etc/orgcard.tex	Mon Nov 07 14:56:19 2005 +0000
@@ -1,4 +1,4 @@
-% Reference Card for Org Mode 3.18
+% Reference Card for Org Mode 3.19
 %
 %**start of header
 \newcount\columnsperpage
@@ -32,8 +32,8 @@
 
 % 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.
+% the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+% Boston, MA 02110-1301, USA.
 
 % This file is intended to be processed by plain TeX (TeX82).
 %
@@ -58,7 +58,7 @@
 % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
 % for their many good ideas.
 
-\def\orgversionnumber{3.18}
+\def\orgversionnumber{3.19}
 \def\year{2005}
 
 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
@@ -332,7 +332,7 @@
 \key{view TODO's in sparse tree}{C-c C-v}
 \key{create sparse tree with all deadlines due}{C-c C-w}
 \key{time sorted view of current org file}{C-c C-r}
-\key{agenda for the week}{C-c a$1$}
+\key{agenda for the week}{C-c a$2$}
 \key{agenda for date at cursor}{C-c C-o}
 
 \section{TODO Items}
@@ -592,7 +592,7 @@
 
 \key{export as iCalendar file}{C-c C-x i}
 \key{export all agenda files as iCalendar files}{C-c C-x C-i}
-\key{compine all agenda files to single iCal file}{C-c C-x C-c}
+\key{combine all agenda files to single iCal file}{C-c C-x C-c}
 
 \key{insert template of export options}{C-c C-x t}
 
--- a/leim/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/leim/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,12 @@
+2005-11-03  Andreas Schwab  <schwab@suse.de>
+
+	* Makefile.in (GZIP_PROG): Renamed from GZIP.
+	(install): Adjust.
+
+2005-11-01  Romain Francoise  <romain@orebokech.com>
+
+	* Makefile.in (install): Compress source files.
+
 2005-10-28  Juri Linkov  <juri@jurta.org>
 
 	* quail/symbol-ksc.el: Add missing characters from 1st pos of
--- a/leim/Makefile.in	Mon Nov 07 14:17:18 2005 +0000
+++ b/leim/Makefile.in	Mon Nov 07 14:56:19 2005 +0000
@@ -1,7 +1,7 @@
 # Makefile for leim subdirectory in GNU Emacs.
 # Copyright (C) 1997,98,1999,2000,2001 Electrotechnical Laboratory, JAPAN.
 #   Licensed to the Free Software Foundation.
-# Copyright (C) 1997,98,1999,2000,01,02,03,2004
+# Copyright (C) 1997,98,1999,2000,01,02,03,2004,2005
 #   Free Software Foundation, Inc.
 # Copyright (C) 2001,02,03,2004
 #   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -37,6 +37,8 @@
 # Where to install LEIM files.
 INSTALLDIR=${datadir}/emacs/${version}/leim
 
+GZIP_PROG = @GZIP_PROG@
+
 # On Xenix and the IBM RS6000, double-dot gets screwed up.
 dot = .
 
@@ -238,6 +240,14 @@
 	  rm -f  ${INSTALLDIR}/*~         ${INSTALLDIR}/*/*~ ; \
 	  rm -f  ${INSTALLDIR}/*.orig     ${INSTALLDIR}/*/*.orig ; \
 	else true; fi
+	-unset CDPATH; \
+	if [ -n "${GZIP_PROG}" ]; \
+	then \
+	   echo "Compressing *.el ..." ; \
+	   (cd ${INSTALLDIR}; for f in `find . -name "*.elc" -print`; do \
+		${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
+	    done) \
+	else true; fi
 	-chmod -R a+r ${INSTALLDIR}
 
 clean mostlyclean:
--- a/lisp/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,769 @@
+2005-11-06  Richard M. Stallman  <rms@gnu.org>
+
+	* progmodes/compile.el (compilation-internal-error-properties):
+	save-excursion around the computation of MARKER.
+
+2005-11-06  Piet van Oostrum  <piet@cs.uu.nl>
+
+	* textmodes/flyspell.el (flyspell-external-point-words):
+	flyspell-get-word returns a list, not just a string.
+
+2005-11-06  John Paul Wallington  <jpw@pobox.com>
+
+	* ibuffer.el (ibuffer): Search all visible frames when getting
+	Ibuffer buffer's window.
+
+2005-11-07  Masatake YAMATO  <jet@gyve.org>
+
+	* man.el (Man-reference-regexp): Accpet spaces between 
+	`Man-name-regexp' and `Man-section-regexp'.
+	(Man-apropos-regexp): New variable.
+	(Man-abstract-xref-man-page): Use value for `Man-target-string'
+	if available.
+	(Man-highlight-references, Man-highlight-references0): Handle 
+	the case when `Man-arguments' includes "-k".
+	(Man-highlight-references0): Rename the argument `TARGET-POS' to 
+	`TARGET'. `TARGET' can be a number, function or nil.
+
+2005-11-06  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-var-create-handler, gdb-var-delete)
+	(gdb-edit-value, gdb-speedbar-expand-node, gdb-get-create-buffer)
+	(gdb-breakpoints-mode, gdb-toggle-breakpoint, gdb-delete-breakpoint)
+	(gdb-goto-breakpoint, gdb-frames-mode, gdb-registers-mode)
+	(gdb-locals-mode, gdb-find-file-hook): Use buffer-local-value.
+	(gdb-send-item): Use buffer-local-value and simplify.
+
+2005-11-05  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* startup.el (command-line): Use `custom-reevaluate-setting' for
+	`global-font-lock-mode'.
+
+	* font-core.el (global-font-lock-mode): Enable `global-font-lock-mode'
+	by default, except in batch mode or when the -D option is given.
+
+	* emacs-lisp/easy-mmode.el (define-global-minor-mode): Pass all
+	specified keyword args on to `define-minor-mode'.  Update docstring.
+
+2005-11-05  Romain Francoise  <romain@orebokech.com>
+
+	* replace.el (occur-engine): Add marker at end of line, too.
+
+2005-11-04  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* font-lock.el: Don't deal with font-lock-face-attributes here,
+	move the code ...
+
+	* startup.el (command-line): ... here. Use face-spec-set instead
+	of custom-declare-face.
+
+	* faces.el (face-spec-set): Reset the face if spec is not nil.
+
+2005-11-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* newcomment.el (comment-region-internal): Box more tightly in the
+	common case where there's no TAB in the boxed text.
+
+2005-11-04  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* info.el (info-tool-bar-map): Use images prev-node, next-node and
+	up-node.
+
+2005-11-04  Ulf Jasper  <ulf.jasper@web.de>
+
+	* newsticker.el: Commentary updated. Code formatting changed.
+	(newsticker-version): Change to "1.9".
+	(newsticker, newsticker-feed): Doc fix.
+	(newsticker-url-list): Doc fix.  Add option "Weekly".
+	(newsticker-retrieval-interval): Add option "Weekly".
+	(newsticker-headline-processing): Doc fix.
+	(newsticker-auto-mark-filter): Remove.
+	(newsticker-auto-mark-filter-list): New.
+	(newsticker-layout, newsticker-sort-method): Doc fix.
+	(newsticker-hide-old-items-in-newsticker-buffer)
+	(newsticker-heading-format, newsticker-item-format)
+	(newsticker-desc-format): Doc fix.
+	(newsticker-show-all-rss-elements): Remove.
+	(newsticker-show-all-news-elements): New.
+	(newsticker-faces, newsticker-ticker): Doc fix.
+	(remove-from-invisibility-spec): Code formatting.
+	(newsticker--process-ids): New.
+	(newsticker-mode): Doc fix.
+	(newsticker-mode): Change mode-line-format.
+	(newsticker-start): Remove debug output.
+	(newsticker-start-ticker): Doc fix.  Add Autoload cookie.
+	(newsticker-w3m-show-inline-images): Code formatting.
+	(newsticker-next-item): Call `force-mode-line-update'.
+	(newsticker-previous-item): Call `force-mode-line-update'.
+	(newsticker-next-feed): Call `force-mode-line-update'.
+	(newsticker-previous-feed): Call `force-mode-line-update'.
+	(newsticker-mark-all-items-at-point-as-read): Code formatting.
+	(newsticker-show-old-items): Do not show descs.
+	(newsticker-hide-entry): Hide too much.
+	(newsticker-hide-entry, newsticker-show-entry)
+	(newsticker-toggle-auto-narrow-to-feed): Code formatting.
+	(newsticker-set-auto-narrow-to-feed): Update buffer immediately.
+	(newsticker-toggle-auto-narrow-to-item): Code formatting.
+	(newsticker-set-auto-narrow-to-item): Update buffer immediately.
+	(newsticker-running-p, newsticker-ticker-running-p): Autoload cookie.
+	(newsticker-get-news): Call `force-mode-line-update'.
+	Collect process ids.
+	(newsticker--sentinel): Change coding system handling.
+	Move image retrieval to new functions newsticker--get-logo-url-*.
+	Move feed parsing to new functions newsticker--parse-*.
+	Update list of process ids.
+	(newsticker--get-logo-url-atom-1.0, newsticker--get-logo-url-atom-0.3)
+	(newsticker--get-logo-url-rss-2.0, newsticker--get-logo-url-rss-1.0)
+	(newsticker--get-logo-url-rss-0.92, newsticker--get-logo-url-rss-0.91)
+	(newsticker--parse-atom-0.3, newsticker--parse-atom-1.0)
+	(newsticker--parse-rss-0.91, newsticker--parse-rss-0.92)
+	(newsticker--parse-rss-1.0, newsticker--parse-rss-2.0)
+	(newsticker--parse-generic-feed, newsticker--parse-generic-items): New.
+	(newsticker--decode-coding-string): Remove.
+	(newsticker--decode-numeric-entities): Check input.  Format code.
+	(newsticker--remove-whitespace): Check input.
+	(newsticker--do-forget-preformatted): Doc fix.
+	(newsticker--decode-rfc822-date): Allow for missing time.
+	(newsticker--update-process-ids): New.
+	(newsticker--image-sentinel): Change comment.
+	(newsticker--image-read): Change error message.
+	(newsticker--imenu-goto): Doc fix.  Show headline title.
+	(newsticker--buffer-set-uptodate): Call `force-mode-line-update'.
+	(newsticker--buffer-do-insert-text): Clean whitespace in
+	html-rendered headline title.  Code formatting.
+	Call `newsticker--buffer-print-extra-elements'.
+	(newsticker--buffer-print-extra-element): Remove.
+	(newsticker--buffer-print-extra-elements): New.
+	(newsticker--buffer-do-print-extra-element): New.
+	(newsticker--buffer-insert-enclosure): Doc fix.  Use MBytes for
+	large sizes.
+	(newsticker--run-auto-mark-filter)
+	(newsticker--do-run-auto-mark-filter):
+	Use `newsticker-auto-mark-filter-list'.
+
+2005-11-04  Ryan Yeske  <rcyeske@gmail.com>
+
+	* net/rcirc.el: Use split-string OMIT-NULLS argument.
+	(rcirc-print): Force redisplay before running hooks.  Do long
+	buffer truncation after making new text read-only.  Deal with nil
+	text when decoding strings.  If TARGET is nil, use either the
+	currently selected buffer, if it is an rcirc buffer and of the
+	same process or the process buffer.
+	(rcirc-mode): Remove header-line.  Recompute short buffer names.
+	Initialize rcirc-buffer-alist here instead of rcirc-get-buffer-create.
+	(rcirc-short-buffer-name): Add variable.
+	(rcirc-kill-buffer-hook): Recompute short buffer names.
+	Remove nick from private channel.
+	(rcirc-send-input): Send command text to current-buffer.
+	Don't clear overlay arrow here.
+	(rcirc-short-buffer-name): Return a short buffer name.
+	(rcirc-update-short-buffer-names, rcirc-abbreviate)
+	(rcirc-rebuild-tree, rcirc-make-trees): Add functions to generate
+	buffer-name abbreviations.
+	(rcirc-kill-buffer-hook-1): Split to make debugging easier.
+	Do not touch nick-table when killing a parted channel.
+	(rcirc-window-configuration-change): Rename from rcirc-update-activity.
+	Clear arrow from current buffer if it is now hidden.
+	(rcirc-current-buffer): Add variable.
+	(rcirc-my-nick, rcirc-other-nick, rcirc-server)
+	(rcirc-nick-in-message, rcirc-prompt, rcirc-mode-line-nick):
+	Remove -face from names.
+	(rcirc-update-activity-string): Print "DND" when globally ignoring
+	activity.
+	(rcirc-ignore-buffer-activity-flag): Rename from
+	rcirc-ignore-channel-activity.
+	(rcirc-ignore-all-activity-flag): Doc fix.
+	(rcirc-channels): Remove variable.
+	(rcirc-kill-buffer-hook):
+	(rcirc-get-buffer-create): Add nick to private channel.
+	(rcirc-multiline-edit-submit): Remove tabs.
+	(rcirc-put-nick-channel, rcirc-channel-nicks): Look up nicks case
+	folded.
+	(rcirc-remove-nick-channel): Bug fix.
+	(rcirc-toggle-ignore-buffer-activity): Rename from
+	rcirc-toggle-ignore-channel-activity.
+	(rcirc-record-activity): Add buffers to the front of the list.
+	(rcirc-update-activity): Remove killed buffers from list.
+	(rcirc-process-server-response-1): Remove last argument if it is
+	null before calling handler.
+	(rcirc): Add "rcirc" defcustom prefix.
+	(rcirc-prompt): Simplify default prompt.
+	Use custom-initialize-default.
+	(rcirc-private-chats): Remove variable.
+	(rcirc-prompt): Change initialization.
+	(rcirc-version): Remove function.
+	(rcirc-id-string): Add constant.
+	(rcirc-last-buffer): Remove variable.
+	(rcirc-buffer-alist): Add variable.
+	(rcirc-connect): Update variable setup.
+	(rcirc-sentinel, rcirc-update-prompt): Use `rcirc-buffer-alist'.
+	(rcirc-trap-errors-flag): Rename from `rcirc-trap-errors' change
+	default.
+	(rcirc-handler-generic): Trigger activity.
+	(rcirc-send-message): Create the buffor of the target.
+	(rcirc-generate-new-buffer-name): Rename from `rcirc-get-buffer-name'.
+	(rcirc-get-buffer): Just return nil if there is no matching buffer.
+	(rcirc-multiline-edit-cancel): Remove function.
+	(rcirc-set-last-buffer): Remove function.
+	(rcirc-get-any-buffer): Add function.
+	(rcirc-join-channels): Don't print /join text.
+	(rcirc-toggle-ignore-channel-activity): Add and update echo area
+	messages.
+	(rcirc-cmd-ctcp): Use rcirc-send-string to send request.
+	(rcirc-handler-NOTICE): Recognize CTCP responses.
+	(rcirc-handler-332, rcirc-handler-332): Use a temp buffer for
+	constructing TOPIC string for buffers we are not JOINed.
+	(rcirc-handler-CTCP-response): Add handler.
+	(rcirc-multiline-edit-submit): Restore the window-configuration
+	before adjusting point.
+	(rcirc): Add customization group.
+	(rcirc-server, rcirc-port, rcirc-nick, rcirc-user-name)
+	(rcirc-user-full-name, rcirc-startup-channels-alist)
+	(rcirc-fill-flag, rcirc-fill-column, rcirc-fill-prefix)
+	(rcirc-ignore-all-activity-flag, rcirc-time-format)
+	(rcirc-input-ring-size, rcirc-read-only-flag)
+	(rcirc-buffer-maximum-lines, rcirc-authinfo-file-name)
+	(rcirc-auto-authenticate-flag, rcirc-prompt, rcirc-print-hooks):
+	Change defvar to defcustom.
+	(rcirc-update-prompt): Add optional ALL arg, which will update
+	prompts in all rcirc buffers.  Regexp quote replacement text.
+	(rcirc-fill-column): Accept 'frame-width as a value.
+	(rcirc-set-changed): Add function.
+	(rcirc-next-active-buffer): Write more meaningful messages.
+	(rcirc-faces): Add customization group.
+	(rcirc-my-nick-face, rcirc-other-nick-face, rcirc-server-face)
+	(rcirc-nick-in-message-face, rcirc-prompt-face)
+	(rcirc-mode-line-nick-face): Move into rcirc-faces group.
+	(with-rcirc-process-buffer): Move before first usage.
+	(rcirc-debug-buffer): Rename from `rcirc-log-buffer'.
+	(rcirc-debug-flag): Rename from `rcirc-log-p'.
+	(rcirc-debug): Rename from `rcirc-log'.
+	(rcirc-format-response-string): Do not print '-' chars for a
+	NOTICE with no sender.  Simplify output of server responses.
+
+2005-11-04  Henrik Enberg  <henrik.enberg@telia.com>
+
+	(rcirc-browse-url-map, rcirc-browse-url-at-point)
+	(rcirc-browse-url-at-mouse, rcirc-mangle-text): Make urls
+	mouse and RET clickable.
+
+2005-11-04  Henrik Enberg  <henrik.enberg@telia.com>
+
+	* mail/rmailout.el (rmail-output-to-rmail-file, rmail-output): Doc fix.
+
+2005-11-04 Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
+	(pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
+	(pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
+	(pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
+	argument to all these routines, so the passphrase can be managed
+	externally and passed in to the system.
+	(pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
+	pgg-add-passphrase-to-cache function.
+
+	* pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
+	(pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
+	(pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
+	(pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase'
+	argument to all these routines, so the passphrase can be managed
+	externally and passed in to the system.
+	(pgg-pgp5-sign-region): Use new name of	pgg-add-passphrase-to-cache
+	function.
+
+2005-11-04  Edward O'Connor  <hober0@gmail.com>  (tiny change)
+
+	* net/goto-addr.el (goto-address-url-regexp): Remove `data:' URLs
+	from goto-address-url-regexp.
+
+2005-11-04  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el (org-read-date, org-goto-calendar)
+	(org-recenter-calendar, org-agenda-goto-calendar):
+	Temporarily clear 'calendar-move-hook'.
+
+2005-11-04  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+	* ediff-merge.el (ediff-merge-region-is-non-clash): Return t, if not
+	merging.
+
+	* ediff-util.el (ediff-previous-difference): Don't skip regions that
+	have merge clashes.
+
+2005-11-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event):
+	Undo previous change.
+
+	* startup.el (command-line): Use `custom-reevaluate-setting' for
+	mouse-wheel-down-event and mouse-wheel-up-event.  Don't call
+	tty-register-default-colors on Mac.
+
+2005-11-04  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-buffer-type): Remove duplicate declaration.
+	(gdb-buffer-type): Make it automatically buffer local...
+	(gdb-get-create-buffer): ...and set it accordingly.
+	(gdb-frame-gdb-buffer, gdb-display-gdb-buffer): Make these
+	actually work.
+
+2005-11-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* font-lock.el (font-lock-warning-face): Use the more vivid red1,
+	not red.
+
+2005-11-04  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gud-watch): Use save-selected-window in
+	case GUD buffer is not visible.
+	(gdb-goto-breakpoint): Try to force display in source buffer.
+	(gdb-frame-gdb-buffer): Copy other similar functions.
+	(gdb-restore-windows): Don't display source if not asked for.
+	(gdb-assembler-buffer-name): Don't capitalise.
+
+2005-11-03  Richard M. Stallman  <rms@gnu.org>
+
+	* wid-edit.el (key-sequence): New widget type.
+
+	* simple.el (set-mark-command-repeat-pop): New variable.
+	(set-mark-command): Only interpret plan C-@ after a pop as a pop
+	if set-mark-command-repeat-pop is true.
+
+	* info.el (Info-fontify-node): Don't display extra "see" if there
+	already is one here.
+
+	* mouse.el: Fix special handling of DEL after dragging a region:
+	(mouse-drag-region-1): Treat mouse-set-region like mouse-set-point.
+	(mouse-region-delete-keys): Add [backspace].
+
+	* mail/feedmail.el: Use insert-buffer-substring, not insert-buffer.
+
+	* textmodes/ispell.el (ispell-command-loop): Change `i' description
+	not to assume it pertains to an affix.
+
+	* textmodes/flyspell.el (flyspell-post-command-hook):
+	Bind deactivate-mark to prevent deactivation.
+
+2005-11-03  Lars Hansen  <larsh@soem.dk>
+
+	* dired-x.el: Add menu bindings for dired-do-find-marked-files,
+	dired-do-relsymlink, dired-flag-extension, dired-mark-extension,
+	dired-mark-omitted, dired-do-relsymlink-regexp, dired-omit-mode.
+
+2005-11-03  Romain Francoise  <romain@orebokech.com>
+
+	* net/eudcb-mab.el: Now part of GNU Emacs.  Update FSF's address.
+	Update copyright years.
+
+2005-11-03  Sam Steingold  <sds@gnu.org>
+
+	* mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event):
+	Use system-type instead of window-system because window-system is not
+	correctly defined during loadup.
+
+2005-11-02  Mark A. Hershberger  <mah@everybody.org>
+
+	* xml.el (xml-syntax-table): Allow xml.el to compile in xemacs.
+	(xml-parse-tag): Join strings separated by a comment properly.
+
+2005-11-02  Andreas Schwab  <schwab@suse.de>
+
+	* emacs-lisp/byte-opt.el (byte-optimize-pure-func): Fix last fix.
+
+2005-11-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/byte-opt.el (string-to-syntax): Mark it as pure.
+	(byte-optimize-pure-func): Quote the eval'd value.
+
+	* progmodes/perl-mode.el (perl-font-lock-special-syntactic-constructs):
+	Rename from perl-font-lock-syntactic-face-function.
+	Change the calling convention so it can be used as a font-lock MATCHER.
+	Do the parse-partial-sexp loop outselves.
+	(perl-font-lock-syntactic-keywords): Use it.
+	(perl-mode): Don't set font-lock-syntactic-face-function any more.
+
+2005-11-02  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-mouse-until): Make it work in the
+	disassembly buffer too.
+	(gdb-exited): Remove overlay arrows when execution has finished.
+	(gdb-info-frames-custom, gdb-info-threads-custom)
+	(gdb-info-registers-custom): Don't add inappropriate text
+	properties if inferior is not active.
+
+2005-11-02  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/fortran.el (fortran-blink-match):
+	Use `blink-matching-delay'.
+
+2005-11-02  John Mongan <jmongan@mccammon.ucsd.edu>  (tiny change)
+
+	* progmodes/f90.el (f90-match-end): Use `blink-matching-delay'.
+
+2005-11-02  Lars Hansen  <larsh@soem.dk>
+
+	* net/tramp.el (tramp-action-out-of-band): Handle scp message
+	"Permission denied".
+
+2005-11-01  Richard M. Stallman  <rms@gnu.org>
+
+	* textmodes/flyspell.el (flyspell-external-point-words):
+	Pass nil to flyspell-get-word.
+
+2005-11-02  Kim F. Storm  <storm@cua.dk>
+
+	* menu-bar.el (menu-bar-options-menu): Show "Shift Movement (CUA)"
+	item instead of "C-x/C-c/C-v (CUA)" if cua-enable-cua-keys is nil.
+
+2005-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* calendar/cal-menu.el (date, event): Don't declare as dynamic-var.
+	(calendar-mouse-holidays, calendar-mouse-view-diary-entries)
+	(calendar-mouse-print-dates): Add optional `event' argument.
+	Update interactive-spec.
+	(calendar-mouse-cal-tex-menu, cal-tex-mouse-filofax):
+	Use `calendar-event-to-date' instead of `event'.
+
+2005-11-02  Masatake YAMATO  <jet@gyve.org>
+
+	* progmodes/ld-script.el (ld-script-builtins):
+	Add more words: "DATA_SEGMENT_ALIGN", "DATA_SEGMENT_END",
+	"DATA_SEGMENT_RELRO_END", "LENGTH", "ORIGIN", and "SEGMENT_START".
+	(auto-mode-alist): Accept .ld, .lds, ld.in and .lds.in.
+
+2005-11-01  Romain Francoise  <romain@orebokech.com>
+
+	* vc-sccs.el: Update copyright year.
+	* ezimage.el: Likewise.
+
+2005-11-01  KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp>  (tiny change)
+
+	* info.el (Info-fontify-node): Use `string-width' for fontifying
+	underlined titles.
+
+2005-11-01  Juri Linkov  <juri@jurta.org>
+
+	* info.el (Info-fontify-node): Downcase node header keywords Node,
+	Prev, Next, Up before comparison.
+	(Info-history): Insert absolute directory name, and put invisible
+	property on it.
+
+2005-11-01  Juri Linkov  <juri@jurta.org>
+
+	* info.el (Info-file-supports-index-cookies): New variable.
+	(Info-find-node-2): Check makeinfo version for index cookie support.
+	(Info-index-nodes): Search for nodes with index cookies only when
+	Info-file-supports-index-cookies is t.  Otherwise, search nodes
+	with "Index" in the node name.
+	(Info-index-node): Search index cookie in the current node only when
+	Info-file-supports-index-cookies is t.  Otherwise, check the word
+	"Index" in the node name.
+	(Info-find-emacs-command-nodes): Remove code that searches nodes
+	with "Index" node name in the top menu.
+
+2005-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/scheme.el (scheme-mode-variables): Use the default
+	comment-indent-function.
+
+	* faces.el (face-attribute): Handle the case where a face inherits from
+	a non-existent face.
+
+	* simple.el (eval-expression-print-format): Use lisp-readable syntax
+	for octal and hexa output, and merge the char into the paren.
+	(kill-new): Use push.
+	(copy-to-buffer): Use with-current-buffer.
+	(completion-setup-function): Move code in loop to remove redundancy.
+	(minibuffer-local-must-match-map): Don't add bindings that duplicate
+	those inherited from minibuffer-local-completion-map.
+
+	* savehist.el (savehist-mode) <defcustom>:
+	Use custom-set-minor-mode if available.
+	(savehist-mode) <defun>: Run the minor mode hook, set the custom state
+	and emit a message if applicable.
+
+2005-11-01  Hrvoje Niksic  <hniksic@xemacs.org>
+
+	* savehist.el: Sync up to version 19.
+	(savehist-mode): New minor mode.
+	(savehist-file): Use ~/.emacs.d or ~/.xemacs if available.
+	(savehist-length): Remove (use history-length instead).
+	(savehist-file-modes): Rename from savehist-modes.
+	(savehist-save-hook, savehist-loaded): New vars.
+	(savehist-load): Use savehist-mode.  Try to smooth up transition from
+	old format to new format.
+	(savehist-install): Allow savehist-autosave-interval to be nil.
+	(savehist-save): Run the new hook.  Be more careful to only trim the
+	history variables.
+	(savehist-trim-history): New fun.  Replaces savehist-process-for-saving.
+	(savehist-printable): Print into a buffer rather than char-by-char.
+
+2005-11-01  John Wiegley  <johnw@newartisans.com>
+
+	* iswitchb.el (iswitchb-define-mode-map): Re-enable the
+	toggle-ignore keybinding (C-a).  The author said it had been
+	disabled much earlier due to a possible incompatibility, but after
+	many months of usage I have encountered no problems (and it is a
+	rather useful option, especially for switching to " *temp*").
+
+	* net/eudcb-mab.el (eudc-mab-query-internal): Add backend
+	support for OS/X's AddressBook, by calling out to the open source
+	program "contacts" (installable through Fink).
+
+	* net/eudc.el (eudc-expand-inline): If the
+	`eudc-multiple-match-handling-method' is set to `all', delete the
+	query string before inserting the query result.
+
+	* eshell/em-ls.el (eshell-do-ls): Add no-op support for --dired
+	flag, to prevent Eshell from using the system ls when
+	`eshell-ls-insert-directory' is in used.
+	(eshell-ls-insert-directory): Disable font-lock in directory
+	buffer so that Eshell's own fontification is seen.  This broke
+	recently due to changes in font-lock, so this goes back to version
+	21 behavior.
+
+2005-11-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-use-inferior-io-buffer): New function.
+	(menu, toggle-gdb-use-inferior-io-buffer): Get rid of defadvice.
+	(gdb-many-windows): Doc fix.
+
+2005-10-31  Romain Francoise  <romain@orebokech.com>
+
+	* help-fns.el (describe-simplify-lib-file-name): Add autoload cookie.
+
+2005-10-31  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* loadup.el: Load emacs-lisp/syntax, font-lock and jit-lock so
+	that global-font-lock-mode can be enabled by default.
+
+	* font-lock.el (font-lock-keywords, font-lock-mode-internal)
+	(font-lock-add-keywords, font-lock-remove-keywords)
+	(font-lock-fontify-buffer): Remove autoload cookies.
+
+	* jit-lock.el (jit-lock-register): Likewise.
+
+	* emacs-lisp/syntax.el (syntax-ppss): Likewise.
+
+2005-10-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-many-windows): Leave window configuration
+	intact if there is no gud-comint-buffer.
+
+2005-10-31  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* progmodes/gud.el (gud-filter): Use comint-update-fence to delete
+	old prompt comint-prompt-read-only is t and GDB commands are
+	issued from tool bar etc.
+
+2005-10-31  Masatake YAMATO  <jet@gyve.org>
+
+	* vc.el (vc-directory-exclusion-list): Add "{arch}".
+
+2005-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* thumbs.el (thumbs-thumbsdir): Default to ~/.emacs.d/thumbs.
+	(thumbs-thumbsdir): Make .emacs.d if it does not exist.
+
+2005-10-30  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
+	starting at beginning of line.  Fontification is messed up when
+	`open-paren-in-column-0-is-defun-start' set to t.
+	Reported by John Paul Wallington <jpw@pobox.com>.
+
+2005-10-30  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* comint.el (comint-send-input): Call `comint-update-fence' when
+	`comint-process-echoes' and `comint-prompt-read-only' are both
+	non-nil, to avoid leftover read-only newline.
+
+2005-10-30  Richard M. Stallman  <rms@gnu.org>
+
+	* textmodes/flyspell.el (flyspell-external-point-words):
+	Detect when WORD can't be checked properly because
+	flyspell-get-word finds just part of it, and move on.
+
+	* textmodes/ispell.el (ispell-dictionary-alist-5): Add . as
+	boundarychar for Polish.
+	(ispell-dictionary-alist-4): Add . as boundarychar for Italian.
+	(ispell-dictionary-alist-3): Add . and @ as boundarychars for French.
+
+2005-10-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-tooltip-print-1): Fix regexp.
+	(gdb-registers-font-lock-keywords): Delete.
+	(gdb-registers-mode): Don't fontify.
+	(gdb-info-registers-custom): Use text properties instead as, in
+	future, changed register values will use font-lock-warning-face.
+	(gdb-local-font-lock-keywords): Rename to...
+	(gdb-locals-font-lock-keywords): ...for consistency.
+
+2005-10-30  Andre Spiegel  <spiegel@gnu.org>
+
+	* vc.el (vc-switch-backend): Better error message if the buffer is
+	not visiting a file under version control.
+
+	* vc-cvs.el (vc-cvs-delete-file): Commit the file after removing it.
+
+2005-10-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (command-line): Use ~/.emacs.d/init.el instead of
+	~/.emacs.d/.emacs.
+
+2005-10-29  Richard M. Stallman  <rms@gnu.org>
+
+	* replace.el (occur-mode-mouse-goto): Always go to other window.
+	(occur-mode-goto-occurrence): Always switch in same window.
+
+	* simple.el (undo): Display message at end, not at start.
+
+	* emacs-lisp/timer.el (timer-activate, timer-activate-when-idle):
+	New arg REUSE-CELL.
+	(cancel-timer-internal): New function.
+	(timer-event-handler): Use cancel-timer-internal,
+	and pass the cell it returns to timer-activate...
+
+	* jit-lock.el (jit-lock-function, jit-lock-stealth-fontify)
+	(jit-lock-deferred-fontify, jit-lock-context-fontify)
+	(jit-lock-after-change): Test memory-full.
+
+2005-10-29  Roland Winkler  <roland.winkler@physik.uni-erlangen.de>
+
+	* textmodes/conf-mode.el (conf-assignment-sign)
+	(conf-assignment-regexp): Fix docstrings.
+	(conf-mode-initialize): New function.
+	(conf-mode): Remove optional args.  Use delay-mode-hooks to
+	recognize recursive calls.
+	(conf-unix-mode, conf-windows-mode, conf-javaprop-mode)
+	(conf-space-mode, conf-colon-mode, conf-ppd-mode)
+	(conf-xdefaults-mode): Use define-derived-mode and
+	conf-mode-initialize.
+
+2005-10-29  Romain Francoise  <romain@orebokech.com>
+
+	* help-fns.el (describe-simplify-lib-file-name): Fix regexp.
+
+2005-10-29  Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right
+	part of the decoded armor to find the key-identifier.
+	(pgg-gpg-lookup-key-owner): New function to return the
+	human-readable identifier of a key owner.
+	(pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the
+	key itself.
+	(pgg-gpg-decrypt-region): Prompt with the key owner (rather than
+	the key value) if we have a key and can match it against a secret
+	key.  Also, added a note pointing out fact that the prompt only
+	indicates the first matching key.
+
+	* pgg.el (pgg-decrypt): Passing along 'passphrase' in call to
+	pgg-decrypt-region.
+	(pgg-pending-timers): A new hash for tracking the passphrase cache
+	timers, so that new ones supercede old ones.
+	(pgg-add-passphrase-to-cache): Rename from
+	`pgg-add-passphrase-cache' to reduce confusion (all callers
+	changed).  Modified to cancel old timers when new ones are added.
+	(pgg-remove-passphrase-from-cache): Rename from
+	`pgg-remove-passphrase-cache' to reduce confusion (all callers
+	changed).  Modified to cancel old timers when their keys are
+	removed from the cache.
+	(pgg-cancel-timer): In Emacs, an alias for cancel-timer; in
+	XEmacs, an indirection to delete-itimer.
+	(pgg-read-passphrase-from-cache, pgg-read-passphrase):
+	Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so
+	users can only check cache without risk of prompting.  Correct bug in
+	notruncate behavior.
+	(pgg-read-passphrase-from-cache, pgg-read-passphrase)
+	(pgg-add-passphrase-cache, pgg-remove-passphrase-cache):
+	Add informative docstrings.
+	(pgg-decrypt): Convey provided passphrase in subordinate call to
+	pgg-decrypt-region.
+
+2005-10-20  Ken Manheimer <ken.manheimer+emacs@gmail.com>
+
+	* pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region)
+	(pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region)
+	(pgg-decrypt, pgg-sign-region, pgg-sign): Add optional
+	'passphrase' argument, so the passphrase can be managed externally
+	and then passed in to the system.
+
+	* pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache)
+	(pgg-remove-passphrase-cache): Add optional 'notruncate' argument,
+	so the passphrase cache can be used reliably with identifiers
+	besides a pgp packet's key id.
+
+	* pgg-gpg.el (pgg-pgp-encrypt-region)
+	(pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
+	(pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
+	(pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
+	argument to all these routines, so the passphrase can be managed
+	externally and passed in to the system.
+
+	* pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional
+	'notruncate' argument, so the passphrase cache can be used
+	reliably with identifiers besides a pgp packet's key id.
+
+2005-10-29  Sascha Wilde  <swilde@sha-bang.de>
+
+	* pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for
+	symmetric encryption.
+	(pgg-gpg-symmetric-key-p): New function to check for an symmetric
+	encrypted session key.
+	(pgg-gpg-decrypt-region): When decrypting a symmetric encrypted
+	message ask for the passphrase in a proper way.
+
+	* pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region):
+	New user commands for symmetric encryption.
+
+2005-10-28  Bill Wohler  <wohler@newt.com>
+
+	* help-mode.el (help-url): New button type. Calls browse-url.
+	(help-xref-url-regexp): New regexp to recognize URLs in docstring.
+	Similar to Info nodes: URL `url'.
+	(help-make-xrefs): Create help-url buttons for
+	help-xref-url-regexp matches.
+
+2005-10-29  Nick Roberts  <nickrob@snap.net.nz>
+
+	* tool-bar.el (tool-bar-add-item-from-menu)
+	(tool-bar-local-item-from-menu): Fix doc strings.
+
+2005-10-28  Romain Francoise  <romain@orebokech.com>
+
+	* ldefs-boot.el: Update.
+
+	* subr.el (locate-library): Move from help-fns.el.
+	* help-fns.el (locate-library): Move to subr.el.
+
+2005-10-28  Richard M. Stallman  <rms@gnu.org>
+
+	* net/tramp.el (tramp-completion-mode): defvar moved up.
+
+	* emacs-lisp/easymenu.el (easy-menu-change): Doc fix.
+
+	* tool-bar.el (tool-bar-mode): Delete autoload cookie.
+
+	* files.el (find-file-noselect): Use %d to format large file size.
+
+	* bindings.el (mode-line-format): Add %e.
+
+	* loadup.el ("facemenu"): Load unconditionally.
+	("image", "international/fontset", "dnd", "mwheel", "tool-bar"):
+	("x-dnd"): Load, when appropriate.
+
+	* startup.el (command-line): Call before-init-hook earlier.
+	Warn about some bad characters in -u user name.
+
+	* textmodes/flyspell.el (flyspell-large-region): Pass -t if Tex file.
+	(flyspell-external-point-words): Error if misspelled word is not found.
+	Set flyspell-large-region-beg at end of word.
+
+2005-10-28  Andreas Schwab  <schwab@suse.de>
+
+	* view.el (View-revert-buffer-scroll-page-forward):
+	Use view-page-size-default.
+
 2005-10-28  Juri Linkov  <juri@jurta.org>
 
 	* international/quail.el (quail-get-current-str): Translate last
@@ -90,8 +856,7 @@
 
 2005-10-25  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* net/browse-url.el (browse-url-of-buffer): Add ".html" to
-	filename.
+	* net/browse-url.el (browse-url-of-buffer): Add ".html" to filename.
 
 2005-10-25  Masatake YAMATO  <jet@gyve.org>
 
--- a/lisp/bindings.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/bindings.el	Mon Nov 07 14:56:19 2005 +0000
@@ -291,6 +291,7 @@
        (dashes (propertize "--" 'help-echo help-echo)))
   (setq-default mode-line-format
     (list
+     "%e"
      (propertize "-" 'help-echo help-echo)
      'mode-line-mule-info
      'mode-line-modified
--- a/lisp/calendar/cal-menu.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/calendar/cal-menu.el	Mon Nov 07 14:56:19 2005 +0000
@@ -38,10 +38,8 @@
 
 ;;; Code:
 
-(defvar date)
 (defvar displayed-month)
 (defvar displayed-year)
-(defvar event)
 
 (eval-when-compile (require 'calendar))
 
@@ -325,9 +323,9 @@
 (autoload 'check-calendar-holidays "holidays")
 (autoload 'diary-list-entries "diary-lib")
 
-(defun calendar-mouse-holidays ()
+(defun calendar-mouse-holidays (&optional event)
   "Pop up menu of holidays for mouse selected date."
-  (interactive)
+  (interactive "e")
   (let* ((date (calendar-event-to-date))
          (l (mapcar 'list (check-calendar-holidays date)))
          (selection
@@ -340,12 +338,12 @@
              (if l l '("None")))))))
     (and selection (call-interactively selection))))
 
-(defun calendar-mouse-view-diary-entries (&optional date diary)
+(defun calendar-mouse-view-diary-entries (&optional date diary event)
   "Pop up menu of diary entries for mouse-selected date.
 Use optional DATE and alternative file DIARY.
 
 Any holidays are shown if `holidays-in-diary-buffer' is t."
-  (interactive)
+  (interactive "i\ni\ne")
   (let* ((date (if date date (calendar-event-to-date)))
          (diary-file (if diary diary diary-file))
          (diary-list-include-blanks nil)
@@ -490,10 +488,10 @@
     (calendar-mouse-goto-date (calendar-event-to-date))
     (cal-tex-cursor-year-landscape nil)))
 
-(defun calendar-mouse-print-dates ()
+(defun calendar-mouse-print-dates (&optional event)
   "Pop up menu of equivalent dates to mouse selected date."
-  (interactive)
-  (let ((date (calendar-event-to-date))
+  (interactive "e")
+  (let* ((date (calendar-event-to-date))
         (selection
          (cal-menu-x-popup-menu
           event
@@ -524,8 +522,8 @@
             (list
              (list (format "Chinese date: %s"
                            (calendar-chinese-date-string date))))
-;            (list '("Chinese date (select to echo Chinese date)"
-;                    . calendar-mouse-chinese-date))
+            ;; (list '("Chinese date (select to echo Chinese date)"
+            ;;         . calendar-mouse-chinese-date))
             (let ((c (calendar-coptic-date-string date)))
               (if (not (string-equal c ""))
                   (list (list (format "Coptic date: %s" c)))))
@@ -580,7 +578,7 @@
   (let* ((selection
           (cal-menu-x-popup-menu
            event
-           (list (calendar-date-string date t nil)
+           (list (calendar-date-string (calendar-event-to-date t) t nil)
                  (list
                   ""
                   '("Daily (1 page)" . cal-tex-mouse-day)
@@ -603,7 +601,7 @@
   (let* ((selection
           (cal-menu-x-popup-menu
            event
-           (list (calendar-date-string date t nil)
+           (list (calendar-date-string (calendar-event-to-date t) t nil)
                  (list
                   ""
                   '("Filofax Daily (one-day-per-page)" .
@@ -639,5 +637,5 @@
 
 (provide 'cal-menu)
 
-;;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
+;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
 ;;; cal-menu.el ends here
--- a/lisp/comint.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/comint.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1550,7 +1550,11 @@
 		  ;; problems when `comint-prompt-read-only' is non-nil.
 		  (let ((inhibit-read-only t))
 		    (delete-region comint-last-input-end
-				   (+ comint-last-input-end echo-len))))))
+				   (+ comint-last-input-end echo-len))
+		    (when comint-prompt-read-only
+		      (save-excursion
+			(goto-char comint-last-input-end)
+			(comint-update-fence)))))))
 
 	  ;; This used to call comint-output-filter-functions,
 	  ;; but that scrolled the buffer in undesirable ways.
--- a/lisp/dired-x.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/dired-x.el	Mon Nov 07 14:56:19 2005 +0000
@@ -261,6 +261,72 @@
 (if dired-bind-info
     (define-key dired-mode-map "I" 'dired-info))
 
+;;; MENU BINDINGS
+
+(let ((menu-bar (lookup-key dired-mode-map [menu-bar])))
+  (let ((menu (lookup-key menu-bar [operate])))
+    (define-key-after
+      menu
+      [find-files]
+      '(menu-item
+        "Find files"
+        dired-do-find-marked-files
+        :help "Find current or marked files")
+      'delete)
+    (define-key-after
+      menu
+      [relsymlink]
+      '(menu-item
+        "Relative symlink to..."
+        dired-do-relsymlink
+        :visible (fboundp 'make-symbolic-link)
+        :help "Make relative symbolic links for current or marked files")
+      'symlink))
+  (let ((menu (lookup-key menu-bar [mark])))
+    (define-key-after
+      menu
+      [flag-extension]
+      '(menu-item
+        "Flag extension..."
+        dired-flag-extension
+        :help "Flag files with a certain extension for deletion")
+      'garbage-files)
+    (define-key-after
+      menu
+      [mark-extension]
+      '(menu-item
+        "Mark extension..."
+        dired-mark-extension
+        :help "Mark files with a certain extension")
+      'symlinks)
+    (define-key-after
+      menu
+      [mark-omitted]
+      '(menu-item
+        "Mark omitted"
+        dired-mark-omitted
+        :help "Mark files matching `dired-omit-files' and `dired-omit-extensions'")
+      'mark-extension))
+  (let ((menu (lookup-key menu-bar [regexp])))
+    (define-key-after
+      menu
+      [relsymlink-regexp]
+      '(menu-item
+        "Relative symlink..."
+        dired-do-relsymlink-regexp
+        :visible (fboundp 'make-symbolic-link)
+        :help "Make relative symbolic links for files matching regexp")
+      'symlink))
+  (let ((menu (lookup-key menu-bar [immediate])))
+    (define-key-after
+      menu
+      [omit-mode]
+      '(menu-item
+        "Omit mode" dired-omit-mode
+        :button (:toggle . dired-omit-mode)
+        :help "Enable or disable omitting \"uninteresting\" files")
+      'dashes)))
+
 ;;; GLOBAL BINDING.
 (if dired-bind-jump
     (progn
--- a/lisp/ediff-merg.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/ediff-merg.el	Mon Nov 07 14:56:19 2005 +0000
@@ -104,8 +104,11 @@
 (make-variable-buffer-local 'ediff-skip-merge-regions-that-differ-from-default)
 
 ;; check if there is no clash between the ancestor and one of the variants.
+;; if it is not a merge job then return true
 (defsubst ediff-merge-region-is-non-clash (n)
-  (string-match "prefer" (or (ediff-get-state-of-merge n) "")))
+  (if (ediff-merge-job)
+      (string-match "prefer" (or (ediff-get-state-of-merge n) ""))
+    t))
 
 ;; If ediff-show-clashes-only, check if there is no clash between the ancestor
 ;; and one of the variants.
--- a/lisp/ediff-util.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/ediff-util.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1794,6 +1794,7 @@
 		     skip-changed
 		     ;; skip difference regions that differ in white space
 		     (and ediff-ignore-similar-regions
+			  (ediff-merge-region-is-non-clash n)
 			  (or (eq (ediff-no-fine-diffs-p n) t)
 			      (and (ediff-merge-job)
 				   (eq (ediff-no-fine-diffs-p n) 'C)))
--- a/lisp/emacs-lisp/byte-opt.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/emacs-lisp/byte-opt.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1121,6 +1121,7 @@
 (put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func)
 (put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func)
 (put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func)
+(put 'string-to-syntax 'byte-optimizer 'byte-optimize-pure-func)
 (defun byte-optimize-pure-func (form)
   "Do constant folding for pure functions.
 This assumes that the function will not have any side-effects and that
@@ -1134,7 +1135,7 @@
 	  (setq constant nil))
       (setq args (cdr args)))
     (if constant
-	(eval form)
+	(list 'quote (eval form))
       form)))
 
 ;; Avoid having to write forward-... with a negative arg for speed.
--- a/lisp/emacs-lisp/easy-mmode.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Mon Nov 07 14:56:19 2005 +0000
@@ -272,8 +272,14 @@
   "Make GLOBAL-MODE out of the buffer-local minor MODE.
 TURN-ON is a function that will be called with no args in every buffer
   and that should try to turn MODE on if applicable for that buffer.
-KEYS is a list of CL-style keyword arguments:
-:group to specify the custom group.
+KEYS is a list of CL-style keyword arguments.  As the minor mode
+  defined by this function is always global, any :global keyword is
+  ignored.  Other keywords have the same meaning as in `define-minor-mode',
+  which see.  In particular, :group specifies the custom group.
+  The most useful keywords are those that are passed on to the
+  `defcustom'.  It normally makes no sense to pass the :lighter
+  or :keymap keywords to `define-global-minor-mode', since these
+  are usually passed to the buffer-local version of the minor mode.
 
 If MODE's set-up depends on the major mode in effect when it was
 enabled, then disabling and reenabling MODE should make MODE work
@@ -285,21 +291,23 @@
 	 (pretty-name (easy-mmode-pretty-mode-name mode))
 	 (pretty-global-name (easy-mmode-pretty-mode-name global-mode))
 	 (group nil)
-	 (extra-args nil)
+	 (extra-keywords nil)
 	 (MODE-buffers (intern (concat global-mode-name "-buffers")))
 	 (MODE-enable-in-buffers
 	  (intern (concat global-mode-name "-enable-in-buffers")))
 	 (MODE-check-buffers
 	  (intern (concat global-mode-name "-check-buffers")))
 	 (MODE-cmhh (intern (concat global-mode-name "-cmhh")))
-	 (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))))
+	 (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode")))
+	 keyw)
 
     ;; Check keys.
-    (while (keywordp (car keys))
-      (case (pop keys)
-	(:extra-args (setq extra-args (pop keys)))
+    (while (keywordp (setq keyw (car keys)))
+      (setq keys (cdr keys))
+      (case keyw
 	(:group (setq group (nconc group (list :group (pop keys)))))
-	(t (setq keys (cdr keys)))))
+	(:global (setq keys (cdr keys)))
+	(t (push keyw extra-keywords) (push (pop keys) extra-keywords))))
 
     (unless group
       ;; We might as well provide a best-guess default group.
@@ -317,7 +325,7 @@
 %s is actually not turned on in every buffer but only in those
 in which `%s' turns it on."
 		  pretty-name pretty-global-name pretty-name turn-on)
-	 :global t :extra-args ,extra-args ,@group
+	 :global t ,@group ,@(nreverse extra-keywords)
 
 	 ;; Setup hook to handle future mode changes and new buffers.
 	 (if ,global-mode
--- a/lisp/emacs-lisp/easymenu.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/emacs-lisp/easymenu.el	Mon Nov 07 14:56:19 2005 +0000
@@ -454,8 +454,8 @@
 If the optional argument BEFORE is present, add it just before
 the submenu named BEFORE, otherwise add it at the end of the menu.
 
-Either call this from `menu-bar-update-hook' or use a menu filter,
-to implement dynamic menus."
+To implement dynamic menus, either call this from
+`menu-bar-update-hook' or use a menu filter."
   (easy-menu-add-item nil path (easy-menu-create-menu name items) before))
 
 ;; XEmacs needs the following two functions to add and remove menus.
--- a/lisp/emacs-lisp/syntax.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/emacs-lisp/syntax.el	Mon Nov 07 14:56:19 2005 +0000
@@ -109,7 +109,6 @@
 	      (error nil)))
 	  syntax-ppss-stats))
 
-;;;###autoload
 (defun syntax-ppss (&optional pos)
   "Parse-Partial-Sexp State at POS.
 The returned value is the same as `parse-partial-sexp' except that
--- a/lisp/emacs-lisp/timer.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/emacs-lisp/timer.el	Mon Nov 07 14:56:19 2005 +0000
@@ -161,8 +161,11 @@
   (aset timer 6 args)
   timer)
 
-(defun timer-activate (timer &optional triggered-p)
-  "Put TIMER on the list of active timers."
+(defun timer-activate (timer &optional triggered-p reuse-cell)
+  "Put TIMER on the list of active timers.
+
+REUSE-CELL, if non-nil, is a cons cell to reuse instead
+of allocating a new one."
   (if (and (timerp timer)
 	   (integerp (aref timer 1))
 	   (integerp (aref timer 2))
@@ -180,20 +183,28 @@
 			     (> (aref timer 3) (aref (car timers) 3)))))
 	  (setq last timers
 		timers (cdr timers)))
+	(if reuse-cell
+	    (progn
+	      (setcar reuse-cell timer)
+	      (setcdr reuse-cell timers))
+	  (setq reuse-cell (cons timer timers)))
 	;; Insert new timer after last which possibly means in front of queue.
 	(if last
-	    (setcdr last (cons timer timers))
-	  (setq timer-list (cons timer timers)))
+	    (setcdr last reuse-cell)
+	  (setq timer-list reuse-cell))
 	(aset timer 0 triggered-p)
 	(aset timer 7 nil)
 	nil)
     (error "Invalid or uninitialized timer")))
 
-(defun timer-activate-when-idle (timer &optional dont-wait)
+(defun timer-activate-when-idle (timer &optional dont-wait reuse-cell)
   "Arrange to activate TIMER whenever Emacs is next idle.
 If optional argument DONT-WAIT is non-nil, then enable the
 timer to activate immediately, or at the right time, if Emacs
-is already idle."
+is already idle.
+
+REUSE-CELL, if non-nil, is a cons cell to reuse instead
+of allocating a new one."
   (if (and (timerp timer)
 	   (integerp (aref timer 1))
 	   (integerp (aref timer 2))
@@ -211,10 +222,15 @@
 			     (> (aref timer 3) (aref (car timers) 3)))))
 	  (setq last timers
 		timers (cdr timers)))
+	(if reuse-cell
+	    (progn
+	      (setcar reuse-cell timer)
+	      (setcdr reuse-cell timers))
+	  (setq reuse-cell (cons timer timers)))
 	;; Insert new timer after last which possibly means in front of queue.
 	(if last
-	    (setcdr last (cons timer timers))
-	  (setq timer-idle-list (cons timer timers)))
+	    (setcdr last reuse-cell)
+	  (setq timer-idle-list reuse-cell))
 	(aset timer 0 (not dont-wait))
 	(aset timer 7 t)
 	nil)
@@ -231,6 +247,18 @@
   (setq timer-idle-list (delq timer timer-idle-list))
   nil)
 
+;; Remove TIMER from the list of active timers or idle timers.
+;; Only to be used in this file.  It returns the cons cell
+;; that was removed from the list.
+(defun cancel-timer-internal (timer)
+  (let ((cell1 (memq timer timer-list))
+	(cell2 (memq timer timer-idle-list)))
+    (if cell1
+	(setq timer-list (delq timer timer-list)))
+    (if cell2
+	(setq timer-idle-list (delq timer timer-idle-list)))
+    (or cell1 cell2)))
+
 ;;;###autoload
 (defun cancel-function-timers (function)
   "Cancel all timers scheduled by `run-at-time' which would run FUNCTION."
@@ -270,13 +298,13 @@
   (setq timer-event-last timer)
   (let ((inhibit-quit t))
     (if (timerp timer)
-	(let (retrigger)
-	  ;; Delete from queue.
-	  (cancel-timer timer)
+	(let (retrigger cell)
+	  ;; Delete from queue.  Record the cons cell that was used.
+	  (setq cell (cancel-timer-internal timer))
 	  ;; Re-schedule if requested.
 	  (if (aref timer 4)
 	      (if (aref timer 7)
-		  (timer-activate-when-idle timer)
+		  (timer-activate-when-idle timer nil cell)
 		(timer-inc-time timer (aref timer 4) 0)
 		;; If real time has jumped forward,
 		;; perhaps because Emacs was suspended for a long time,
@@ -287,7 +315,7 @@
 				      (aref timer 4))))
 		      (if (> repeats timer-max-repeats)
 			  (timer-inc-time timer (* (aref timer 4) repeats)))))
-		(timer-activate timer t)
+		(timer-activate timer t cell)
 		(setq retrigger t)))
 	  ;; Run handler.
 	  ;; We do this after rescheduling so that the handler function
--- a/lisp/eshell/em-ls.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/eshell/em-ls.el	Mon Nov 07 14:56:19 2005 +0000
@@ -279,7 +279,8 @@
       (if (stringp switches)
 	  (setq switches (split-string switches)))
       (let (eshell-current-handles
-	    eshell-current-subjob-p)
+	    eshell-current-subjob-p
+	    font-lock-mode)
 	;; use the fancy highlighting in `eshell-ls' rather than font-lock
 	(when (and eshell-ls-use-colors
 		   (featurep 'font-lock))
@@ -320,7 +321,8 @@
   (defvar show-recursive)
   (defvar show-size)
   (defvar sort-method)
-  (defvar ange-cache))
+  (defvar ange-cache)
+  (defvar dired-flag))
 
 (defun eshell-do-ls (&rest args)
   "Implementation of \"ls\" in Lisp, passing ARGS."
@@ -333,7 +335,7 @@
    `((?a "all" nil show-all
 	 "show all files in directory")
      (?c nil by-ctime sort-method
-	 "sort by modification time")
+	 "sort by last status change time")
      (?d "directory" nil dir-literal
 	 "list directory entries instead of contents")
      (?k "kilobytes" 1024 block-size
@@ -372,6 +374,8 @@
 	 "sort alphabetically by entry extension")
      (?1 nil single-column listing-style
 	 "list one file per line")
+     (nil "dired" nil dired-flag
+	  "Here for compatibility with GNU ls.")
      (nil "help" nil nil
 	  "show this usage display")
      :external "ls"
--- a/lisp/ezimage.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/ezimage.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1,6 +1,7 @@
 ;;; ezimage --- Generalized Image management
 
-;;; Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
+;;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
--- a/lisp/faces.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/faces.el	Mon Nov 07 14:56:19 2005 +0000
@@ -374,8 +374,11 @@
       ;; VALUE is relative, so merge with inherited faces
       (let ((inh-from (face-attribute face :inherit frame)))
 	(unless (or (null inh-from) (eq inh-from 'unspecified))
-	  (setq value
-		(face-attribute-merged-with attribute value inh-from frame)))))
+          (condition-case nil
+              (setq value
+                    (face-attribute-merged-with attribute value inh-from frame))
+            ;; The `inherit' attribute may point to non existent faces.
+            (error nil)))))
     (when (and inherit
 	       (not (eq inherit t))
 	       (face-attribute-relative-p attribute value))
@@ -1445,7 +1448,7 @@
 do it on all frames.  See `defface' for information about SPEC.
 If SPEC is nil, do nothing."
   (let ((attrs (face-spec-choose spec frame)))
-    (when attrs
+    (when spec
       (face-spec-reset-face face frame))
     (while attrs
       (let ((attribute (car attrs))
--- a/lisp/files.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/files.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1414,7 +1414,7 @@
 		   (not (or buf nowarn))
 		   (> (nth 7 attributes) large-file-warning-threshold)
 		   (not (y-or-n-p
-			 (format "File %s is large (%sMB), really open? "
+			 (format "File %s is large (%dMB), really open? "
 				 (file-name-nondirectory filename)
 				   (/ (nth 7 attributes) 1048576)))))
 	  (error "Aborted"))
--- a/lisp/font-core.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/font-core.el	Mon Nov 07 14:56:19 2005 +0000
@@ -293,7 +293,9 @@
 
 (easy-mmode-define-global-mode
  global-font-lock-mode font-lock-mode turn-on-font-lock-if-enabled
- :extra-args (dummy))
+ :extra-args (dummy)
+ :initialize 'custom-initialize-safe-default
+ :init-value (not (or noninteractive emacs-basic-display)))
 
 ;;; End of Global Font Lock mode.
 
--- a/lisp/font-lock.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/font-lock.el	Mon Nov 07 14:56:19 2005 +0000
@@ -340,7 +340,6 @@
 
 ;; Fontification variables:
 
-;;;###autoload
 (defvar font-lock-keywords nil
   "A list of the keywords to highlight.
 There are two kinds of values: user-level, and compiled.
@@ -630,7 +629,6 @@
   ;; Shut up the byte compiler.
   (defvar font-lock-face-attributes))	; Obsolete but respected if set.
 
-;;;###autoload
 (defun font-lock-mode-internal (arg)
   ;; Turn on Font Lock mode.
   (when arg
@@ -652,7 +650,6 @@
     (font-lock-unfontify-buffer)
     (font-lock-turn-off-thing-lock)))
 
-;;;###autoload
 (defun font-lock-add-keywords (mode keywords &optional append)
   "Add highlighting KEYWORDS for MODE.
 
@@ -771,7 +768,6 @@
 ;;      is added and removed several times.
 ;;
 ;; (II) The keywords are removed from the current buffer.
-;;;###autoload
 (defun font-lock-remove-keywords (mode keywords)
   "Remove highlighting KEYWORDS for MODE.
 
@@ -981,7 +977,6 @@
 ;; directives correctly and cleanly.  (It is the same problem as fontifying
 ;; multi-line strings and comments; regexps are not appropriate for the job.)
 
-;;;###autoload
 (defun font-lock-fontify-buffer ()
   "Fontify the current buffer the way the function `font-lock-mode' would."
   (interactive)
@@ -1651,37 +1646,8 @@
 
 ;;; Colour etc. support.
 
-;; Originally face attributes were specified via `font-lock-face-attributes'.
-;; Users then changed the default face attributes by setting that variable.
-;; However, we try and be back-compatible and respect its value if set except
-;; for faces where M-x customize has been used to save changes for the face.
-(when (boundp 'font-lock-face-attributes)
-  (let ((face-attributes font-lock-face-attributes))
-    (while face-attributes
-      (let* ((face-attribute (pop face-attributes))
-	     (face (car face-attribute)))
-	;; Rustle up a `defface' SPEC from a `font-lock-face-attributes' entry.
-	(unless (get face 'saved-face)
-	  (let ((foreground (nth 1 face-attribute))
-		(background (nth 2 face-attribute))
-		(bold-p (nth 3 face-attribute))
-		(italic-p (nth 4 face-attribute))
-		(underline-p (nth 5 face-attribute))
-		face-spec)
-	    (when foreground
-	      (setq face-spec (cons ':foreground (cons foreground face-spec))))
-	    (when background
-	      (setq face-spec (cons ':background (cons background face-spec))))
-	    (when bold-p
-	      (setq face-spec (append '(:weight bold) face-spec)))
-	    (when italic-p
-	      (setq face-spec (append '(:slant italic) face-spec)))
-	    (when underline-p
-	      (setq face-spec (append '(:underline t) face-spec)))
-	    (custom-declare-face face (list (list t face-spec)) nil)))))))
-
-;; But now we do it the custom way.  Note that `defface' will not overwrite any
-;; faces declared above via `custom-declare-face'.
+;; Note that `defface' will not overwrite any faces declared above via
+;; `custom-declare-face'.
 (defface font-lock-comment-face
   '((((class grayscale) (background light))
      (:foreground "DimGray" :weight bold :slant italic))
@@ -1808,7 +1774,7 @@
 (defface font-lock-warning-face
   '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold))
     (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
-    (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
+    (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold))
     (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
     (((class color) (min-colors 8)) (:foreground "red"))
     (t (:inverse-video t :weight bold)))
--- a/lisp/gnus/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/gnus/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,28 @@
+2005-10-27  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* flow-fill.el (fill-flowed-encode-tests): Restore trailing
+	whitespace removed in revision 7.8.  Use concatenated string to
+	protect trailing whitespace.
+
+2005-10-27  Jouni K Seppanen <jks@iki.fi>  (tiny change)
+
+	* nnimap.el (nnimap-search-uids-not-since-is-evil): Add variable.
+	(nnimap-request-expire-articles): Use it to avoid sending 'UID
+	SEARCH UID ... NOT SINCE' queries, for inefficient servers like
+	Courier IMAP ("some version from 2004").  Mostly based on similar
+	code in the same function.
+
+2005-10-26  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* message.el (message-display-completion-list): New function.
+	(message-expand-group): Use it; make sure the Completions buffer
+	is modifiable.
+
+2005-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* imap.el (imap-open): Handle case where buffer is a buffer
+	object.
+
 2005-10-24  Eli Zaretskii  <eliz@gnu.org>
 
 	* pgg-def.el:
--- a/lisp/gnus/flow-fill.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/gnus/flow-fill.el	Mon Nov 07 14:56:19 2005 +0000
@@ -161,38 +161,43 @@
   (defvar show-trailing-whitespace))
 
 (defvar fill-flowed-encode-tests
-  '(
+  `(
     ;; The syntax of each list element is:
     ;; (INPUT . EXPECTED-OUTPUT)
-    ("> Thou villainous ill-breeding spongy dizzy-eyed
-> reeky elf-skinned pigeon-egg!
->> Thou artless swag-bellied milk-livered
->> dismal-dreaming idle-headed scut!
->>> Thou errant folly-fallen spleeny reeling-ripe
->>> unmuzzled ratsbane!
->>>> Henceforth, the coding style is to be strictly
->>>> enforced, including the use of only upper case.
->>>>> I've noticed a lack of adherence to the coding
->>>>> styles, of late.
->>>>>> Any complaints?
-" . "> Thou villainous ill-breeding spongy dizzy-eyed reeky elf-skinned
-> pigeon-egg!
->> Thou artless swag-bellied milk-livered dismal-dreaming idle-headed
->> scut!
->>> Thou errant folly-fallen spleeny reeling-ripe unmuzzled ratsbane!
->>>> Henceforth, the coding style is to be strictly enforced,
->>>> including the use of only upper case.
->>>>> I've noticed a lack of adherence to the coding styles, of late.
->>>>>> Any complaints?
-")
-;    ("
-;> foo
-;>
-;>
-;> bar
-;" . "
-;> foo bar
-;")
+    (,(concat
+       "> Thou villainous ill-breeding spongy dizzy-eyed \n"
+       "> reeky elf-skinned pigeon-egg! \n"
+       ">> Thou artless swag-bellied milk-livered \n"
+       ">> dismal-dreaming idle-headed scut!\n"
+       ">>> Thou errant folly-fallen spleeny reeling-ripe \n"
+       ">>> unmuzzled ratsbane!\n"
+       ">>>> Henceforth, the coding style is to be strictly \n"
+       ">>>> enforced, including the use of only upper case.\n"
+       ">>>>> I've noticed a lack of adherence to the coding \n"
+       ">>>>> styles, of late.\n"
+       ">>>>>> Any complaints?")
+     .
+     ,(concat
+       "> Thou villainous ill-breeding spongy dizzy-eyed reeky elf-skinned\n"
+       "> pigeon-egg! \n"
+       ">> Thou artless swag-bellied milk-livered dismal-dreaming idle-headed\n"
+       ">> scut!\n"
+       ">>> Thou errant folly-fallen spleeny reeling-ripe unmuzzled ratsbane!\n"
+       ">>>> Henceforth, the coding style is to be strictly enforced,\n"
+       ">>>> including the use of only upper case.\n"
+       ">>>>> I've noticed a lack of adherence to the coding styles, of late.\n"
+       ">>>>>> Any complaints?\n"
+       ))
+    ;; (,(concat
+    ;;    "\n"
+    ;;    "> foo\n"
+    ;;    "> \n"
+    ;;    "> \n"
+    ;;    "> bar\n")
+    ;;  .
+    ;;  ,(concat
+    ;;    "\n"
+    ;;    "> foo bar\n"))
     ))
 
 (defun fill-flowed-test ()
--- a/lisp/gnus/imap.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/gnus/imap.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1038,8 +1038,11 @@
 			   stream))
 		      ;; We're done, kill the first connection
 		      (imap-close buffer)
-		      (kill-buffer buffer)
-		      (rename-buffer buffer)
+		      (let ((name (if (stringp buffer)
+				      buffer
+				    (buffer-name buffer))))
+			(kill-buffer buffer)
+			(rename-buffer name))
 		      (message "imap: Reconnecting with stream `%s'...done"
 			       stream)
 		      (setq imap-stream stream)
--- a/lisp/gnus/message.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/gnus/message.el	Mon Nov 07 14:56:19 2005 +0000
@@ -6652,6 +6652,17 @@
 		 (lookup-key global-map "\t")
 		 'indent-relative))))
 
+(eval-and-compile
+  (condition-case nil
+      (with-temp-buffer
+	(let ((standard-output (current-buffer)))
+	  (eval '(display-completion-list nil "")))
+	(defalias 'message-display-completion-list 'display-completion-list))
+    (error ;; Don't use `wrong-number-of-arguments' here because of XEmacs.
+     (defun message-display-completion-list (completions &optional ignore)
+       "Display the list of completions, COMPLETIONS, using `standard-output'."
+       (display-completion-list completions)))))
+
 (defun message-expand-group ()
   "Expand the group name under point."
   (let* ((b (save-excursion
@@ -6690,7 +6701,9 @@
 	  (let ((buffer-read-only nil))
 	    (erase-buffer)
 	    (let ((standard-output (current-buffer)))
-	      (display-completion-list (sort completions 'string<) string))
+	      (message-display-completion-list (sort completions 'string<)
+					       string))
+	    (setq buffer-read-only nil)
 	    (goto-char (point-min))
 	    (delete-region (point) (progn (forward-line 3) (point))))))))))
 
--- a/lisp/gnus/nnimap.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/gnus/nnimap.el	Mon Nov 07 14:56:19 2005 +0000
@@ -317,6 +317,11 @@
 Unlike other backends, you do not need to take special care if you
 flip this variable.")
 
+(defvoo nnimap-search-uids-not-since-is-evil nil
+  "If non-nil, avoid \"UID SEARCH UID ... NOT SINCE\" queries when expiring.
+Instead, use \"UID SEARCH SINCE\" to prune the list of expirable
+articles within Gnus.  This seems to be faster on Courier in some cases.")
+
 (defvoo nnimap-expunge-on-close 'always ; 'ask, 'never
   "Whether to expunge a group when it is closed.
 When a IMAP group with articles marked for deletion is closed, this
@@ -1438,6 +1443,21 @@
 			     (gnus-compress-sequence oldarts)) "\\Deleted")
 		       (setq articles (gnus-set-difference
 				       articles oldarts))))))
+		((and nnimap-search-uids-not-since-is-evil (numberp days))
+		 (let* ((all-new-articles
+			 (gnus-compress-sequence
+			  (imap-search (format "SINCE %s"
+					       (nnimap-date-days-ago days)))))
+			(oldartseq
+			 (gnus-range-difference artseq all-new-articles))
+			(oldarts (gnus-uncompress-range oldartseq)))
+		   (when oldarts
+		     (nnimap-expiry-target oldarts group server)
+		     (when (imap-message-flags-add
+			    (imap-range-to-message-set oldartseq)
+			    "\\Deleted")
+		       (setq articles (gnus-set-difference
+				       articles oldarts))))))
 		((numberp days)
 		 (let ((oldarts (imap-search
 				 (format nnimap-expunge-search-string
--- a/lisp/help-fns.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/help-fns.el	Mon Nov 07 14:56:19 2005 +0000
@@ -100,34 +100,6 @@
       (setq buffer-undo-list nil)
       (set-buffer-modified-p nil))))
 
-;;;###autoload
-(defun locate-library (library &optional nosuffix path interactive-call)
-  "Show the precise file name of Emacs library LIBRARY.
-This command searches the directories in `load-path' like `\\[load-library]'
-to find the file that `\\[load-library] RET LIBRARY RET' would load.
-Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
-to the specified name LIBRARY.
-
-If the optional third arg PATH is specified, that list of directories
-is used instead of `load-path'.
-
-When called from a program, the file name is normaly returned as a
-string.  When run interactively, the argument INTERACTIVE-CALL is t,
-and the file name is displayed in the echo area."
-  (interactive (list (completing-read "Locate library: "
-				      'locate-file-completion
-				      (cons load-path load-suffixes))
-		     nil nil
-		     t))
-  (let ((file (locate-file library
-			   (or path load-path)
-			   (append (unless nosuffix load-suffixes) '("")))))
-    (if interactive-call
-	(if file
-	    (message "Library is file %s" (abbreviate-file-name file))
-	  (message "No library %s in search path" library)))
-    file))
-
 
 ;; Functions
 
@@ -311,6 +283,7 @@
   ;; Return value is like the one from help-split-fundoc, but highlighted
   (cons usage doc))
 
+;;;###autoload
 (defun describe-simplify-lib-file-name (file)
   "Simplify a library name FILE to a relative name, and make it a source file."
   (if file
@@ -319,7 +292,7 @@
 	;; Now convert that back to a file name and see if we get
 	;; the original one.  If so, they are equivalent.
 	(if (equal file (locate-file libname load-path '("")))
-	    (if (string-match "[.]elc?\\'" libname)
+	    (if (string-match "[.]elc\\'" libname)
 		(substring libname 0 -1)
 	      libname)
 	  file))))
--- a/lisp/help-mode.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/help-mode.el	Mon Nov 07 14:56:19 2005 +0000
@@ -126,7 +126,12 @@
 (define-button-type 'help-info
   :supertype 'help-xref
   'help-function #'info
-  'help-echo (purecopy"mouse-2, RET: read this Info node"))
+  'help-echo (purecopy "mouse-2, RET: read this Info node"))
+
+(define-button-type 'help-url
+  :supertype 'help-xref
+  'help-function #'browse-url
+  'help-echo (purecopy "mouse-2, RET: view this URL in a browser"))
 
 (define-button-type 'help-customize-variable
   :supertype 'help-xref
@@ -257,6 +262,10 @@
   (purecopy "\\<[Ii]nfo[ \t\n]+\\(node\\|anchor\\)[ \t\n]+`\\([^']+\\)'")
   "Regexp matching doc string references to an Info node.")
 
+(defconst help-xref-url-regexp
+  (purecopy "\\<[Uu][Rr][Ll][ \t\n]+`\\([^']+\\)'")
+  "Regexp matching doc string references to a URL.")
+
 ;;;###autoload
 (defun help-setup-xref (item interactive-p)
   "Invoked from commands using the \"*Help*\" buffer to install some xref info.
@@ -338,6 +347,11 @@
 		      (unless (string-match "^([^)]+)" data)
 			(setq data (concat "(emacs)" data))))
 		    (help-xref-button 2 'help-info data))))
+              ;; URLs
+              (save-excursion
+                (while (re-search-forward help-xref-url-regexp nil t)
+                  (let ((data (match-string 1)))
+		    (help-xref-button 1 'help-url data))))
 	      ;; Mule related keywords.  Do this before trying
 	      ;; `help-xref-symbol-regexp' because some of Mule
 	      ;; keywords have variable or function definitions.
--- a/lisp/ibuffer.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/ibuffer.el	Mon Nov 07 14:56:19 2005 +0000
@@ -2288,7 +2288,7 @@
       (save-selected-window
 	;; We switch to the buffer's window in order to be able
 	;; to modify the value of point
-	(select-window (get-buffer-window buf))
+	(select-window (get-buffer-window buf 0))
 	(or (eq major-mode 'ibuffer-mode)
 	    (ibuffer-mode))
 	(setq ibuffer-restore-window-config-on-quit other-window-p)
--- a/lisp/info.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/info.el	Mon Nov 07 14:56:19 2005 +0000
@@ -310,6 +310,9 @@
 (defvar Info-current-file-completions nil
   "Cached completion list for current Info file.")
 
+(defvar Info-file-supports-index-cookies nil
+  "Non-nil if current Info file supports index cookies.")
+
 (defvar Info-index-alternatives nil
   "List of possible matches for last `Info-index' command.")
 
@@ -842,6 +845,19 @@
                 (info-insert-file-contents filename nil)
                 (setq default-directory (file-name-directory filename))))
               (set-buffer-modified-p nil)
+
+	      ;; Check makeinfo version for index cookie support
+	      (let ((found nil))
+		(goto-char (point-min))
+		(condition-case ()
+		    (if (and (re-search-forward
+			      "makeinfo version \\([0-9]+.[0-9]+\\)"
+			      (line-beginning-position 3) t)
+			     (not (version< (match-string 1) "4.7")))
+			(setq found t))
+		  (error nil))
+		(set (make-local-variable 'Info-file-supports-index-cookies) found))
+
               ;; See whether file has a tag table.  Record the location if yes.
               (goto-char (point-max))
               (forward-line -8)
@@ -1945,7 +1961,9 @@
               (if (and (string-equal file curr-file)
                        (string-equal node curr-node))
                   (setq p (point)))
-              (insert "* " node ": (" (file-name-nondirectory file)
+              (insert "* " node ": ("
+		      (propertize (or (file-name-directory file) "") 'invisible t)
+		      (file-name-nondirectory file)
                       ")" node ".\n"))
             (setq hl (cdr hl))))))
     (Info-find-node "history" "Top")
@@ -2649,62 +2667,63 @@
       (and (member file '("dir" "history" "toc" "apropos"))
            (setq Info-index-nodes (cons (cons file nil) Info-index-nodes)))
       (not (stringp file))
-      ;; Find nodes with index cookie
-      (let* ((default-directory (or (and (stringp file)
-                                         (file-name-directory
-                                          (setq file (Info-find-file file))))
-                                    default-directory))
-             Info-history Info-history-list Info-fontify-maximum-menu-size
-             (main-file file) subfiles nodes node)
-        (condition-case nil
-            (with-temp-buffer
-              (while (or main-file subfiles)
-                (erase-buffer)
-                (info-insert-file-contents (or main-file (car subfiles)))
-                (goto-char (point-min))
-                (while (search-forward "\0\b[index\0\b]" nil 'move)
-                  (save-excursion
-                    (re-search-backward "^\^_")
-                    (search-forward "Node: ")
-                    (setq nodes (cons (Info-following-node-name) nodes))))
-                (if main-file
-                    (save-excursion
-                      (goto-char (point-min))
-                      (if (search-forward "\n\^_\nIndirect:" nil t)
-                          (let ((bound (save-excursion (search-forward "\n\^_" nil t))))
-                            (while (re-search-forward "^\\(.*\\): [0-9]+$" bound t)
-                              (setq subfiles (cons (match-string-no-properties 1)
-                                                   subfiles)))))
-                      (setq subfiles (nreverse subfiles)
-                            main-file nil))
-                  (setq subfiles (cdr subfiles)))))
-          (error nil))
-        (if nodes
-            (setq nodes (nreverse nodes)
-                  Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
-        nodes)
-      ;; Find nodes with the word "Index" in the node name
-      (let ((case-fold-search t)
-            Info-history Info-history-list Info-fontify-maximum-menu-size
-            nodes node)
-        (condition-case nil
-            (with-temp-buffer
-              (Info-mode)
-              (Info-find-node file "Top")
-              (when (and (search-forward "\n* menu:" nil t)
-                         (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t))
-                (goto-char (match-beginning 1))
-                (setq nodes (list (Info-extract-menu-node-name)))
-                (Info-goto-node (car nodes))
-                (while (and (setq node (Info-extract-pointer "next" t))
-                            (string-match "\\<Index\\>" node))
-                  (setq nodes (cons node nodes))
-                  (Info-goto-node node))))
-          (error nil))
-        (if nodes
-            (setq nodes (nreverse nodes)
-                  Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
-        nodes)
+      (if Info-file-supports-index-cookies
+	  ;; Find nodes with index cookie
+	  (let* ((default-directory (or (and (stringp file)
+					     (file-name-directory
+					      (setq file (Info-find-file file))))
+					default-directory))
+		 Info-history Info-history-list Info-fontify-maximum-menu-size
+		 (main-file file) subfiles nodes node)
+	    (condition-case nil
+		(with-temp-buffer
+		  (while (or main-file subfiles)
+		    (erase-buffer)
+		    (info-insert-file-contents (or main-file (car subfiles)))
+		    (goto-char (point-min))
+		    (while (search-forward "\0\b[index\0\b]" nil 'move)
+		      (save-excursion
+			(re-search-backward "^\^_")
+			(search-forward "Node: ")
+			(setq nodes (cons (Info-following-node-name) nodes))))
+		    (if main-file
+			(save-excursion
+			  (goto-char (point-min))
+			  (if (search-forward "\n\^_\nIndirect:" nil t)
+			      (let ((bound (save-excursion (search-forward "\n\^_" nil t))))
+				(while (re-search-forward "^\\(.*\\): [0-9]+$" bound t)
+				  (setq subfiles (cons (match-string-no-properties 1)
+						       subfiles)))))
+			  (setq subfiles (nreverse subfiles)
+				main-file nil))
+		      (setq subfiles (cdr subfiles)))))
+	      (error nil))
+	    (if nodes
+		(setq nodes (nreverse nodes)
+		      Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
+	    nodes)
+	;; Else find nodes with the word "Index" in the node name
+	(let ((case-fold-search t)
+	      Info-history Info-history-list Info-fontify-maximum-menu-size
+	      nodes node)
+	  (condition-case nil
+	      (with-temp-buffer
+		(Info-mode)
+		(Info-find-node file "Top")
+		(when (and (search-forward "\n* menu:" nil t)
+			   (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t))
+		  (goto-char (match-beginning 1))
+		  (setq nodes (list (Info-extract-menu-node-name)))
+		  (Info-goto-node (car nodes))
+		  (while (and (setq node (Info-extract-pointer "next" t))
+			      (string-match "\\<Index\\>" node))
+		    (setq nodes (cons node nodes))
+		    (Info-goto-node node))))
+	    (error nil))
+	  (if nodes
+	      (setq nodes (nreverse nodes)
+		    Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
+	  nodes))
       ;; If file has no index nodes, still add it to the cache
       (setq Info-index-nodes (cons (cons file nil) Info-index-nodes)))
   (cdr (assoc file Info-index-nodes)))
@@ -2718,17 +2737,17 @@
       (member (or node Info-current-node) (Info-index-nodes file))
     ;; Don't search all index nodes if request is only for the current node
     ;; and file is not in the cache of index nodes
-    (or
-     (save-match-data
-       (string-match "\\<Index\\>" (or node Info-current-node "")))
-     (save-excursion
-       (goto-char (+ (or (save-excursion
-                           (search-backward "\n\^_" nil t))
-                         (point-min)) 2))
-       (search-forward "\0\b[index\0\b]"
-                       (or (save-excursion
-                             (search-forward "\n\^_" nil t))
-                           (point-max)) t)))))
+    (if Info-file-supports-index-cookies
+	(save-excursion
+	  (goto-char (+ (or (save-excursion
+			      (search-backward "\n\^_" nil t))
+			    (point-min)) 2))
+	  (search-forward "\0\b[index\0\b]"
+			  (or (save-excursion
+				(search-forward "\n\^_" nil t))
+			      (point-max)) t))
+      (save-match-data
+	(string-match "\\<Index\\>" (or node Info-current-node ""))))))
 
 (defun Info-goto-index ()
   "Go to the first index node."
@@ -3162,11 +3181,11 @@
   (if (display-graphic-p)
       (let ((map (make-sparse-keymap)))
 	(tool-bar-local-item-from-menu 'Info-exit "close" map Info-mode-map)
-	(tool-bar-local-item-from-menu 'Info-prev "left-arrow" map Info-mode-map)
-	(tool-bar-local-item-from-menu 'Info-next "right-arrow" map Info-mode-map)
-	(tool-bar-local-item-from-menu 'Info-up "up-arrow" map Info-mode-map)
-	(tool-bar-local-item-from-menu 'Info-history-back "back-arrow" map Info-mode-map)
-	(tool-bar-local-item-from-menu 'Info-history-forward "fwd-arrow" map Info-mode-map)
+	(tool-bar-local-item-from-menu 'Info-prev "prev-node" map Info-mode-map)
+	(tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map)
+	(tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map)
+	(tool-bar-local-item-from-menu 'Info-history-back "left-arrow" map Info-mode-map)
+	(tool-bar-local-item-from-menu 'Info-history-forward "right-arrow" map Info-mode-map)
 	(tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
 	(tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map)
 	(tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map)
@@ -3504,10 +3523,6 @@
 		(setq info-file file file-list nil))
 	    (setq file-list (cdr file-list))))))
     (Info-find-node info-file "Top")
-    (or (and (search-forward "\n* menu:" nil t)
-	     (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t))
-	(error "Info file `%s' appears to lack an index" info-file))
-    (goto-char (match-beginning 1))
     ;; Bind Info-history to nil, to prevent the index nodes from
     ;; getting into the node history.
     (let ((Info-history nil)
@@ -3649,7 +3664,7 @@
                  (nend (match-end 2))
                  (tbeg (match-beginning 1))
                  (tag (match-string 1)))
-            (if (string-equal tag "Node")
+            (if (string-equal (downcase tag) "node")
                 (put-text-property nbeg nend 'font-lock-face 'info-header-node)
               (put-text-property nbeg nend 'font-lock-face 'info-header-xref)
               (put-text-property tbeg nend 'mouse-face 'highlight)
@@ -3660,11 +3675,12 @@
               ;; Always set up the text property keymap.
               ;; It will either be used in the buffer
               ;; or copied in the header line.
-              (put-text-property tbeg nend 'keymap
-                                 (cond
-                                  ((equal tag "Prev") Info-prev-link-keymap)
-                                  ((equal tag "Next") Info-next-link-keymap)
-                                  ((equal tag "Up") Info-up-link-keymap))))))
+              (put-text-property
+	       tbeg nend 'keymap
+	       (cond
+		((string-equal (downcase tag) "prev") Info-prev-link-keymap)
+		((string-equal (downcase tag) "next") Info-next-link-keymap)
+		((string-equal (downcase tag) "up"  ) Info-up-link-keymap))))))
         (when Info-use-header-line
           (goto-char (point-min))
           (let* ((header-end (line-end-position))
@@ -3706,8 +3722,8 @@
                     ;; underline has the same size as the text.  A typical
                     ;; counter example is when a continuation "..." is alone
                     ;; on a line.
-                    (= (- (match-end 1) (match-beginning 1))
-                       (- (match-end 2) (match-beginning 2))))
+                    (= (string-width (match-string 1))
+                       (string-width (match-string 2))))
           (let* ((c (preceding-char))
                  (face
                   (cond ((= c ?*) 'info-title-1)
@@ -3741,7 +3757,9 @@
 		    ;; an end of sentence
 		    (skip-syntax-backward " ("))
                   (setq other-tag
-                        (cond ((memq (char-before) '(nil ?\. ?! ??))
+			(cond ((save-match-data (looking-back "\\<see"))
+			       "")
+			      ((memq (char-before) '(nil ?\. ?! ??))
                                "See ")
 			      ((save-match-data
 				 (save-excursion
--- a/lisp/iswitchb.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/iswitchb.el	Mon Nov 07 14:56:19 2005 +0000
@@ -559,7 +559,7 @@
     (define-key map "\C-j" 'iswitchb-select-buffer-text)
     (define-key map "\C-t" 'iswitchb-toggle-regexp)
     (define-key map "\C-x\C-f" 'iswitchb-find-file)
-    ;;(define-key map "\C-a" 'iswitchb-toggle-ignore)
+    (define-key map "\C-a" 'iswitchb-toggle-ignore)
     (define-key map "\C-c" 'iswitchb-toggle-case)
     (define-key map "\C-k" 'iswitchb-kill-buffer)
     (define-key map "\C-m" 'iswitchb-exit-minibuffer)
--- a/lisp/jit-lock.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/jit-lock.el	Mon Nov 07 14:56:19 2005 +0000
@@ -264,7 +264,6 @@
 	 (remove-hook 'after-change-functions 'jit-lock-after-change t)
 	 (remove-hook 'fontification-functions 'jit-lock-function))))
 
-;;;###autoload
 (defun jit-lock-register (fun &optional contextual)
   "Register FUN as a fontification function to be called in this buffer.
 FUN will be called with two arguments START and END indicating the region
@@ -299,7 +298,7 @@
   "Fontify current buffer starting at position START.
 This function is added to `fontification-functions' when `jit-lock-mode'
 is active."
-  (when (and jit-lock-mode (not (memory-full-p)))
+  (when (and jit-lock-mode (not memory-full))
     (if (null jit-lock-defer-time)
 	;; No deferral.
 	(jit-lock-fontify-now start (+ start jit-lock-chunk-size))
@@ -427,6 +426,7 @@
 `jit-lock-stealth-time' seconds."
   ;; I used to check `inhibit-read-only' here, but I can't remember why.  -stef
   (unless (or executing-kbd-macro
+	      memory-full
 	      (window-minibuffer-p (selected-window)))
     (let ((buffers (buffer-list))
 	  (outer-buffer (current-buffer))
@@ -490,7 +490,7 @@
 
 (defun jit-lock-deferred-fontify ()
   "Fontify what was deferred."
-  (when jit-lock-defer-buffers
+  (when (and jit-lock-defer-buffers (not memory-full))
     ;; Mark the deferred regions back to `fontified = nil'
     (dolist (buffer jit-lock-defer-buffers)
       (when (buffer-live-p buffer)
@@ -517,33 +517,34 @@
 
 (defun jit-lock-context-fontify ()
   "Refresh fontification to take new context into account."
-  (dolist (buffer (buffer-list))
-    (with-current-buffer buffer
-      (when jit-lock-context-unfontify-pos
-	;; (message "Jit-Context %s" (buffer-name))
-	(save-restriction
-	  (widen)
-	  (when (and (>= jit-lock-context-unfontify-pos (point-min))
-		     (< jit-lock-context-unfontify-pos (point-max)))
-	    ;; If we're in text that matches a complex multi-line
-	    ;; font-lock pattern, make sure the whole text will be
-	    ;; redisplayed eventually.
-	    ;; Despite its name, we treat jit-lock-defer-multiline here
-	    ;; rather than in jit-lock-defer since it has to do with multiple
-	    ;; lines, i.e. with context.
-	    (when (get-text-property jit-lock-context-unfontify-pos
-				     'jit-lock-defer-multiline)
-	      (setq jit-lock-context-unfontify-pos
-		    (or (previous-single-property-change
-			 jit-lock-context-unfontify-pos
-			 'jit-lock-defer-multiline)
-			(point-min))))
-	    (with-buffer-prepared-for-jit-lock
-	     ;; Force contextual refontification.
-	     (remove-text-properties
-	      jit-lock-context-unfontify-pos (point-max)
-	      '(fontified nil jit-lock-defer-multiline nil)))
-	    (setq jit-lock-context-unfontify-pos (point-max))))))))
+  (unless memory-full
+    (dolist (buffer (buffer-list))
+      (with-current-buffer buffer
+	(when jit-lock-context-unfontify-pos
+	  ;; (message "Jit-Context %s" (buffer-name))
+	  (save-restriction
+	    (widen)
+	    (when (and (>= jit-lock-context-unfontify-pos (point-min))
+		       (< jit-lock-context-unfontify-pos (point-max)))
+	      ;; If we're in text that matches a complex multi-line
+	      ;; font-lock pattern, make sure the whole text will be
+	      ;; redisplayed eventually.
+	      ;; Despite its name, we treat jit-lock-defer-multiline here
+	      ;; rather than in jit-lock-defer since it has to do with multiple
+	      ;; lines, i.e. with context.
+	      (when (get-text-property jit-lock-context-unfontify-pos
+				       'jit-lock-defer-multiline)
+		(setq jit-lock-context-unfontify-pos
+		      (or (previous-single-property-change
+			   jit-lock-context-unfontify-pos
+			   'jit-lock-defer-multiline)
+			  (point-min))))
+	      (with-buffer-prepared-for-jit-lock
+	       ;; Force contextual refontification.
+	       (remove-text-properties
+		jit-lock-context-unfontify-pos (point-max)
+		'(fontified nil jit-lock-defer-multiline nil)))
+	      (setq jit-lock-context-unfontify-pos (point-max)))))))))
 
 (defun jit-lock-after-change (start end old-len)
   "Mark the rest of the buffer as not fontified after a change.
@@ -553,7 +554,7 @@
 This function ensures that lines following the change will be refontified
 in case the syntax of those lines has changed.  Refontification
 will take place when text is fontified stealthily."
-  (when (and jit-lock-mode (not (memory-full-p)))
+  (when (and jit-lock-mode (not memory-full))
     (save-excursion
       (with-buffer-prepared-for-jit-lock
        ;; It's important that the `fontified' property be set from the
--- a/lisp/ldefs-boot.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/ldefs-boot.el	Mon Nov 07 14:56:19 2005 +0000
@@ -7658,8 +7658,8 @@
 If the optional argument BEFORE is present, add it just before
 the submenu named BEFORE, otherwise add it at the end of the menu.
 
-Either call this from `menu-bar-update-hook' or use a menu filter,
-to implement dynamic menus.
+To implement dynamic menus, either call this from
+`menu-bar-update-hook' or use a menu filter.
 
 \(fn PATH NAME ITEMS &optional BEFORE)" nil nil)
 
@@ -12340,22 +12340,6 @@
 
 \(fn &optional ARG)" t nil)
 
-(autoload (quote locate-library) "help-fns" "\
-Show the precise file name of Emacs library LIBRARY.
-This command searches the directories in `load-path' like `\\[load-library]'
-to find the file that `\\[load-library] RET LIBRARY RET' would load.
-Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
-to the specified name LIBRARY.
-
-If the optional third arg PATH is specified, that list of directories
-is used instead of `load-path'.
-
-When called from a program, the file name is normaly returned as a
-string.  When run interactively, the argument INTERACTIVE-CALL is t,
-and the file name is displayed in the echo area.
-
-\(fn LIBRARY &optional NOSUFFIX PATH INTERACTIVE-CALL)" t nil)
-
 (autoload (quote describe-function) "help-fns" "\
 Display the full documentation of FUNCTION (a symbol).
 
@@ -12367,7 +12351,8 @@
 
 \(fn SUBR-OR-VAR KIND)" nil nil)
 
-(defface help-argument-name (quote ((((supports :slant italic)) :inherit italic))) "Face to highlight argument names in *Help* buffers." :group (quote help))
+(defface help-argument-name (quote ((((supports :slant italic)) :inherit italic))) "\
+Face to highlight argument names in *Help* buffers." :group (quote help))
 
 (autoload (quote describe-function-1) "help-fns" "\
 Not documented
@@ -24634,6 +24619,27 @@
 
 ;;;***
 
+;;;### (autoloads (locate-library) "subr" "subr.el" (17250 21630))
+;;; Generated autoloads from subr.el
+
+(autoload (quote locate-library) "subr" "\
+Show the precise file name of Emacs library LIBRARY.
+This command searches the directories in `load-path' like `\\[load-library]'
+to find the file that `\\[load-library] RET LIBRARY RET' would load.
+Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
+to the specified name LIBRARY.
+
+If the optional third arg PATH is specified, that list of directories
+is used instead of `load-path'.
+
+When called from a program, the file name is normaly returned as a
+string.  When run interactively, the argument INTERACTIVE-CALL is t,
+and the file name is displayed in the echo area.
+
+\(fn LIBRARY &optional NOSUFFIX PATH INTERACTIVE-CALL)" t nil)
+
+;;;***
+
 ;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
 ;;;;;;  (17229 28053))
 ;;; Generated autoloads from mail/supercite.el
@@ -27869,6 +27875,12 @@
 
 ;;;***
 
+;;;### (autoloads nil "utf-7" "international/utf-7.el" (17245 4870))
+;;; Generated autoloads from international/utf-7.el
+(autoload-coding-system 'utf-7 '(require 'utf-7))
+
+;;;***
+
 ;;;### (autoloads (uudecode-decode-region uudecode-decode-region-internal
 ;;;;;;  uudecode-decode-region-external) "uudecode" "gnus/uudecode.el"
 ;;;;;;  (17187 59901))
@@ -29934,7 +29946,7 @@
 ;;;;;;  "progmodes/mantemp.el" "progmodes/xscheme.el" "register.el"
 ;;;;;;  "replace.el" "s-region.el" "saveplace.el" "sb-image.el" "scroll-bar.el"
 ;;;;;;  "select.el" "simple.el" "soundex.el" "startup.el" "subdirs.el"
-;;;;;;  "subr.el" "tempo.el" "term/AT386.el" "term/apollo.el" "term/bobcat.el"
+;;;;;;  "tempo.el" "term/AT386.el" "term/apollo.el" "term/bobcat.el"
 ;;;;;;  "term/cygwin.el" "term/internal.el" "term/iris-ansi.el" "term/linux.el"
 ;;;;;;  "term/lk201.el" "term/mac-win.el" "term/news.el" "term/pc-win.el"
 ;;;;;;  "term/rxvt.el" "term/sun-mouse.el" "term/sun.el" "term/sup-mouse.el"
--- a/lisp/loadup.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/loadup.el	Mon Nov 07 14:56:19 2005 +0000
@@ -134,10 +134,11 @@
 (load "frame")
 (load "term/tty-colors")
 (load "font-core")
+(load "emacs-lisp/syntax")
+(load "font-lock")
+(load "jit-lock")
 
-(if (fboundp 'frame-face-alist)
-    (progn
-      (load "facemenu")))
+(load "facemenu")
 (if (fboundp 'track-mouse)
     (progn
       (load "mouse")
@@ -166,6 +167,19 @@
 (load "abbrev")
 (load "buff-menu")
 (load "server") ; server-getenv is used throughout the terminal initialization code
+
+(if (fboundp 'x-create-frame)
+    (progn
+      (load "image")
+      (load "international/fontset")
+      (load "dnd")
+      (load "mwheel")
+      (load "tool-bar")
+      (load "term/x-win")))
+(if (featurep 'x)
+    (load "x-dnd"))
+(message "%s" (garbage-collect))
+
 (if (eq system-type 'vax-vms)
     (progn
       (load "vms-patch")))
@@ -193,20 +207,11 @@
       (load "emacs-lisp/float-sup")))
 (message "%s" (garbage-collect))
 
-;; Load auxiliary settings for X displays if we support them.
-(when (fboundp 'x-create-frame)
-  (load "mouse")
-  (load "international/fontset")
-  (load "dnd")
-  (load "x-dnd")
-  (load "term/x-win"))
-
-(message "%s" (garbage-collect))
-
 (load "vc-hooks")
 (load "jka-cmpr-hook")
 (load "ediff-hook")
 (if (fboundp 'x-show-tip) (load "tooltip"))
+
 (message "%s" (garbage-collect))
 
 ;If you want additional libraries to be preloaded and their
--- a/lisp/mail/feedmail.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mail/feedmail.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1372,7 +1372,7 @@
 	      (if (string-match tracer (buffer-name buffy))
 		  (progn
 		    (insert "SMTP Trace from " (buffer-name buffy) "\n---------------")
-		    (insert-buffer buffy)
+		    (insert-buffer-substring buffy)
 		    (insert "\n\n"))))
 	   (buffer-list))))))
 
@@ -1989,7 +1989,7 @@
 	  (set-buffer feedmail-prepped-text-buffer) (erase-buffer)
 
 	  ;; jam contents of user-supplied mail buffer into our scratch buffer
-	  (insert-buffer feedmail-raw-text-buffer)
+	  (insert-buffer-substring feedmail-raw-text-buffer)
 
 	  ;; require one newline at the end.
 	  (goto-char (point-max))
@@ -2215,7 +2215,7 @@
 		(erase-buffer)
 		;; not life's most efficient methodology, but spraying isn't
 		;; an every-5-minutes event either
-		(insert-buffer feedmail-prepped-text-buffer)
+		(insert-buffer-substring feedmail-prepped-text-buffer)
 		;; There's a good case to me made that each separate transmission of
 		;; a message in the spray should have a distinct Message-Id:.  There
 		;; is also a less compelling argument in the other direction.  I think
--- a/lisp/mail/rmailout.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mail/rmailout.el	Mon Nov 07 14:56:19 2005 +0000
@@ -123,11 +123,11 @@
 The default file name comes from `rmail-default-rmail-file',
 which is updated to the name you use in this command.
 
-A prefix argument N says to output N consecutive messages
+A prefix argument COUNT says to output that many consecutive messages,
 starting with the current one.  Deleted messages are skipped and don't count.
 
-If optional argument STAY is non-nil, then leave the last filed
-mesasge up instead of moving forward to the next non-deleted message."
+If the optional argument STAY is non-nil, then leave the last filed
+message up instead of moving forward to the next non-deleted message."
   (interactive
    (list (rmail-output-read-rmail-file-name)
 	 (prefix-numeric-value current-prefix-arg)))
@@ -265,9 +265,9 @@
 ;;;###autoload
 (defun rmail-output (file-name &optional count noattribute from-gnus)
   "Append this message to system-inbox-format mail file named FILE-NAME.
-A prefix argument N says to output N consecutive messages
+A prefix argument COUNT says to output that many consecutive messages,
 starting with the current one.  Deleted messages are skipped and don't count.
-When called from lisp code, N may be omitted.
+When called from lisp code, COUNT may be omitted and defaults to 1.
 
 If the pruned message header is shown on the current message, then
 messages will be appended with pruned headers; otherwise, messages
--- a/lisp/man.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/man.el	Mon Nov 07 14:56:19 2005 +0000
@@ -286,9 +286,13 @@
 This regular expression should start with a `^' character.")
 
 (defvar Man-reference-regexp
-  (concat "\\(" Man-name-regexp "\\)(\\(" Man-section-regexp "\\))")
+  (concat "\\(" Man-name-regexp "\\)[ \t]*(\\(" Man-section-regexp "\\))")
   "Regular expression describing a reference to another manpage.")
 
+(defvar Man-apropos-regexp
+  (concat "\\\[\\(" Man-name-regexp "\\)\\\][ \t]*(\\(" Man-section-regexp "\\))")
+  "Regular expression describing a reference to manpages in \"man -k output\".")
+
 (defvar Man-synopsis-regexp "SYNOPSIS"
   "Regular expression for SYNOPSIS heading (or your equivalent).
 This regexp should not start with a `^' character.")
@@ -421,7 +425,8 @@
   'func nil
   'action (lambda (button) (funcall 
 			    (button-get button 'func)
-			    (button-label button))))
+			    (or (button-get button 'Man-target-string)
+				(button-label button)))))
 
 (define-button-type 'Man-xref-man-page 
   :supertype 'Man-abstract-xref-man-page
@@ -918,9 +923,20 @@
 If XREF-MAN-TYPE is used as the button type for items
 in SEE ALSO section. If it is nil, default type, 
 `Man-xref-man-page' is used."
-  (let ((dummy 0))
+  (if (string-match "-k " Man-arguments)
+      (progn
+	(Man-highlight-references0
+	 nil Man-reference-regexp 1 nil
+	 (or xref-man-type 'Man-xref-man-page))
+	(Man-highlight-references0
+	 nil Man-apropos-regexp 1 (lambda () 
+				    (format "%s(%s)"
+					    (match-string 1)
+					    (match-string 2)))
+	 (or xref-man-type 'Man-xref-man-page))
+	)
     (Man-highlight-references0
-     Man-see-also-regexp Man-reference-regexp 1 dummy
+     Man-see-also-regexp Man-reference-regexp 1 nil
      (or xref-man-type 'Man-xref-man-page))
     (Man-highlight-references0
      Man-synopsis-regexp Man-header-regexp 0 2
@@ -929,21 +945,30 @@
      Man-files-regexp Man-normal-file-regexp 0 0
      'Man-xref-normal-file)))
 
-(defun Man-highlight-references0 (start-section regexp button-pos target-pos type)
+(defun Man-highlight-references0 (start-section regexp button-pos target type)
   ;; Based on `Man-build-references-alist'
-  (when (Man-find-section start-section)
-    (forward-line 1)
-    (let ((end (save-excursion
-                 (Man-next-section 1)
-                 (point))))
-      (back-to-indentation)
+  (when (or (null start-section)
+	    (Man-find-section start-section))
+    (let ((end (if start-section
+		   (progn
+		     (forward-line 1)
+		     (back-to-indentation)
+		     (save-excursion
+		       (Man-next-section 1)
+		       (point)))
+		 (goto-char (point-min))
+		 (point-max))))
       (while (re-search-forward regexp end t)
 	(make-text-button
 	 (match-beginning button-pos)
 	 (match-end button-pos)
 	 'type type
-	 'Man-target-string (match-string target-pos)
-	 )))))
+	 'Man-target-string (cond
+			     ((numberp target) 
+			      (match-string target))
+			     ((functionp target)
+			      (funcall target))
+			     (t nil)))))))
 
 (defun Man-cleanup-manpage (&optional interactive)
   "Remove overstriking and underlining from the current buffer.
--- a/lisp/menu-bar.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/menu-bar.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1003,7 +1003,16 @@
 (define-key menu-bar-options-menu [cua-mode]
   (menu-bar-make-mm-toggle cua-mode
 			   "C-x/C-c/C-v Cut and Paste (CUA)"
-			   "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"))
+			   "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
+			   (:visible (or (not (boundp 'cua-enable-cua-keys))
+					 cua-enable-cua-keys))))
+
+(define-key menu-bar-options-menu [cua-emulation-mode]
+  (menu-bar-make-mm-toggle cua-mode
+			   "Shift movement mark region (CUA)"
+			   "Use shifted movement keys to set and extend the region."
+			   (:visible (and (boundp 'cua-enable-cua-keys)
+					  (not cua-enable-cua-keys)))))
 
 (define-key menu-bar-options-menu [case-fold-search]
   (menu-bar-make-toggle toggle-case-fold-search case-fold-search
--- a/lisp/mh-e/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,123 @@
+2005-11-04  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
+	Move to mh-init.el to minimize bulk of mh-customize.el.
+
+	* mh-init.el: Modify commentary since file is used for load and
+	initialization as well as setting and getting the variant.
+	(mh-min-colors-defined-flag, mh-defface-compat): Move
+	here from mh-customize.el. 
+
+	* mh-customize.el: Refactor faces. Move grayscale requirements
+	last before t. Use uniform line breaks.
+	(mh-min-colors-defined-flag): New variable.
+	(mh-defface-compat): New function. Provides backward compatibility
+	for face specs.
+	(mh-show-header, mh-show-date, mh-show-cc, mh-folder-to) 
+	(mh-folder-refiled, mh-folder-cur-msg-number, mh-folder-cur-msg) 
+	(mh-folder-body): Use mh-defface-compat.
+
+2005-11-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* mh-customize.el (mh-folder-body-face, mh-folder-cur-msg-face)
+	(mh-folder-cur-msg-number-face, mh-folder-refiled-face)
+	(mh-folder-to-face): Use the min-colors attribute instead of the
+	type attribute.
+
+2005-11-03  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (mh-refile-preserves-sequences-flag)
+	(mh-tick-seq, mh-update-sequences-after-mh-show-flag): Sync
+	docstrings with manual.
+
+	* mh-e.el (mh-update-sequences): Sync docstrings with manual.
+
+	* mh-seq.el (mh-delete-seq, mh-list-sequences, mh-narrow-to-seq) 
+	(mh-widen, mh-toggle-tick, mh-narrow-to-tick): Sync docstrings
+	with manual.
+
+2005-11-01  Bill Wohler  <wohler@newt.com>
+
+	* mh-comp.el (mh-redist-full-contents) Convert defvar to
+	defcustom.
+	(mh-smail, mh-extract-rejected-mail, mh-forward, mh-redistribute)
+	(mh-reply, mh-send, mh-send-other-window)
+	(mh-fill-paragraph-function): Sync docstrings with manual.
+	(mh-edit-again, mh-extract-rejected-mail, mh-redistribute): Rename
+	msg argument to message (to make for a better docstring).
+
+	* mh-customize.el (mh-redist-full-contents-flag): Convert defvar
+	to defcustom. Rename by adding -flag.
+	(mh-compose-forward-as-mime-flag)
+	(mh-compose-letter-function, mh-forward-subject-format)
+	(mh-insert-x-mailer-flag, mh-reply-default-reply-to)
+	(mh-reply-show-message-flag, mh-letter-mode-hook): Sync docstrings
+	with manual.
+
+	* mh-print.el (mh-ps-spool-buffer, mh-ps-spool-a-msg) 
+	(mh-ps-print-msg): Remove debugging messages.
+	(mh-ps-print-msg-show, mh-ps-print-msg-show) 
+	(mh-ps-print-toggle-color, mh-ps-print-toggle-mime): Remove period
+	after message per conventions.
+
+2005-10-30  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (mh-scan-good-msg-regexp, mh-scan-deleted-msg-regexp) 
+	(mh-scan-refiled-msg-regexp, mh-scan-cur-msg-number-regexp): Sync
+	docstrings with manual.
+
+	* mh-customize.el (mh-compose-space-does-completion-flag)
+	(mh-signature-separator-flag, mh-interpret-number-as-range-flag)
+	(mh-adaptive-cmd-note-flag): Use "Non-nil means" instead of "On
+	means" to remain checkdoc clean and consistent with Emacs. I
+	raised this issue with the Emacs developers and Stallman agrees
+	that "On means" should be allowed in custom docstrings but that
+	this change requires thought and should wait until after the Emacs
+	22 release.
+
+2005-10-28  Bill Wohler  <wohler@newt.com>
+
+	* mh-comp.el (mh-annotate-msg): Use new variable
+	mh-scan-field-destination-offset rather than hard-coding 1.
+
+	* mh-customize.el (mh-interpret-number-as-range-flag): Add * to
+	docstring.
+	(mh-adaptive-cmd-note-flag-check, mh-scan-format-file-check): New
+	functions to check input for mh-adaptive-cmd-note-flag and
+	mh-scan-format-file respectively.
+	(mh-adaptive-cmd-note-flag, mh-scan-format-file): Docstring fixes,
+	add :set.
+
+	* mh-e.el: (mh-scan-field-destination-offset): New variable. The
+	destination is the -, t, b, c, or n character for Replied, To, cc,
+	Bcc, or Newsgroups respectively.
+	(mh-make-folder, mh-regenerate-headers, mh-generate-new-cmd-note)
+	Call new function mh-msg-num-width-to-column to make leap between
+	width and column more explicit.
+	(mh-msg-num-width-to-column): New function that steals logic from
+	old mh-set-cmd-note. Also, throw error if mh-scan-format-file
+	isn't t since we can't adapt the scan lines in this case.
+	(mh-set-cmd-note): Now just simply sets mh-cmd-note which will
+	make the documentation more clear.
+	(mh-generate-new-cmd-note): Docstring fix--mh-cmd-note is a
+	column, not a width.
+	(mh-add-sequence-notation, mh-remove-sequence-notation): Use new
+	variable mh-scan-field-destination-offset rather than hard-coding
+	1. 
+
+	* mh-utils.el (mh-cmd-note) Synced docstring with manual.
+	(mh-notate): Use new variable mh-scan-field-destination-offset
+	rather than hard-coding 1.
+	(mh-message-number-width): Rename to mh-msg-num-width to be
+	consistent with mh-get-msg-num and mh-msg-num-width-to-column.
+
+	* mh-customize.el (mh-x-face-file, mh-show-use-xface-flag)
+	(mail-citation-hook): Quote URLs in docstrings and precede with
+	`URL'. The former will suppress checkdoc warnings, the latter will
+	turn them into hyperlinks in Emacs 22 (I just added the code
+	to do that today).
+	(mh-scan-format-file): Checkdoc fix.
+
 2005-10-27  Bill Wohler  <wohler@newt.com>
 
 	* mh-customize.el (mh-adaptive-cmd-note-flag)
--- a/lisp/mh-e/ChangeLog.1	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/ChangeLog.1	Mon Nov 07 14:56:19 2005 +0000
@@ -165,7 +165,7 @@
 
 	* mh-comp.el (mh-insert-auto-fields): Inset identity regardless of
 	whether one was already set, since if one used a default identity
-	it would never be overridden.
+	it would never be overridden (closes SF #1204506).
 
 2005-06-02  Bill Wohler  <wohler@newt.com>
 
--- a/lisp/mh-e/mh-comp.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-comp.el	Mon Nov 07 14:56:19 2005 +0000
@@ -86,11 +86,6 @@
   "Name of the MH send program.
 Some sites need to change this because of a name conflict.")
 
-(defvar mh-redist-full-contents nil
-  "Non-nil if the `dist' command needs whole letter for redistribution.
-This is the case only when `send' is compiled with the BERK option.
-If MH will not allow you to redist a previously redist'd msg, set to nil.")
-
 (defvar mh-redist-background nil
   "If non-nil redist will be done in background like send.
 This allows transaction log to be visible if -watch, -verbose or -snoop are
@@ -195,24 +190,29 @@
 
 ;;;###autoload
 (defun mh-smail ()
-  "Compose and send mail with the MH mail system.
-This function is an entry point to MH-E, the Emacs interface to the MH mail
-system.
-
+  "Compose a message with the MH mail system.
 See `mh-send' for more details on composing mail."
   (interactive)
   (mh-find-path)
   (call-interactively 'mh-send))
 
+;;;###autoload
+(defun mh-smail-other-window ()
+  "Compose a message with the MH mail system in other window.
+See `mh-send' for more details on composing mail."
+  (interactive)
+  (mh-find-path)
+  (call-interactively 'mh-send-other-window))
+
 (defvar mh-error-if-no-draft nil)       ;raise error over using old draft
 
 ;;;###autoload
 (defun mh-smail-batch (&optional to subject other-headers &rest ignored)
-  "Set up a mail composition draft with the MH mail system.
-This function is an entry point to MH-E, the Emacs interface to the MH mail
-system. This function does not prompt the user for any header fields, and thus
+  "Compose a message with the MH mail system.
+
+This function does not prompt the user for any header fields, and thus
 is suitable for use by programs that want to create a mail buffer. Users
-should use `mh-smail' to compose mail.
+should use \\[mh-smail] to compose mail.
 
 Optional arguments for setting certain fields include TO, SUBJECT, and
 OTHER-HEADERS. Additional arguments are IGNORED."
@@ -245,10 +245,25 @@
       (setq other-headers (cdr other-headers)))))
 
 ;;;###mh-autoload
-(defun mh-edit-again (msg)
-  "Clean up a draft or a message MSG previously sent and make it resendable.
-Default is the current message.
-The variable `mh-new-draft-cleaned-headers' specifies the headers to remove.
+(defun mh-edit-again (message)
+  "Edit a MESSAGE to send it again.
+
+If you don't complete a draft for one reason or another, and if the draft
+buffer is no longer available, you can pick your draft up again with this
+command. If you don't use a draft folder, your last \"draft\" file will be
+used. If you use draft folders, you'll need to visit the draft folder with
+\"\\[mh-visit-folder] drafts <RET>\", use \\[mh-next-undeleted-msg] to move to
+the appropriate message, and then use \\[mh-edit-again] to prepare the message
+for editing.
+
+This command can also be used to take messages that were sent to you and to
+send them to more people.
+
+Don't use this command to re-edit a message from a Mailer-Daemon who
+complained that your mail wasn't posted for some reason or another (see
+`mh-extract-rejected-mail').
+
+The default message is the current message.
 
 See also `mh-send'."
   (interactive (list (mh-get-msg-num t)))
@@ -256,8 +271,9 @@
          (config (current-window-configuration))
          (draft
           (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
-                 (pop-to-buffer (find-file-noselect (mh-msg-filename msg)) t)
-                 (rename-buffer (format "draft-%d" msg))
+                 (pop-to-buffer (find-file-noselect (mh-msg-filename message))
+                                t)
+                 (rename-buffer (format "draft-%d" message))
                  ;; Make buffer writable...
                  (setq buffer-read-only nil)
                  ;; If buffer was being used to display the message reinsert
@@ -267,7 +283,7 @@
                    (insert-file-contents buffer-file-name))
                  (buffer-name))
                 (t
-                 (mh-read-draft "clean-up" (mh-msg-filename msg) nil)))))
+                 (mh-read-draft "clean-up" (mh-msg-filename message) nil)))))
     (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)
     (mh-insert-header-separator)
     (goto-char (point-min))
@@ -278,16 +294,20 @@
     (mh-letter-adjust-point)))
 
 ;;;###mh-autoload
-(defun mh-extract-rejected-mail (msg)
-  "Extract message MSG returned by the mail system and make it resendable.
-Default is the current message.  The variable `mh-new-draft-cleaned-headers'
-gives the headers to clean out of the original message.
+(defun mh-extract-rejected-mail (message)
+  "Edit a MESSAGE that was returned by the mail system.
+
+This command prepares the message for editing by removing the Mailer-Daemon
+envelope and unneeded header fields. Fix whatever addressing problem you had,
+and send the message again with \\[mh-send-letter].
+
+The default message is the current message.
 
 See also `mh-send'."
   (interactive (list (mh-get-msg-num t)))
   (let ((from-folder mh-current-folder)
         (config (current-window-configuration))
-        (draft (mh-read-draft "extraction" (mh-msg-filename msg) nil)))
+        (draft (mh-read-draft "extraction" (mh-msg-filename message) nil)))
     (goto-char (point-min))
     (cond ((re-search-forward mh-rejected-letter-start nil t)
            (skip-chars-forward " \t\n")
@@ -298,7 +318,7 @@
     (mh-insert-header-separator)
     (goto-char (point-min))
     (save-buffer)
-    (mh-compose-and-send-mail draft "" from-folder msg
+    (mh-compose-and-send-mail draft "" from-folder message
                               (mh-get-header-field "To:")
                               (mh-get-header-field "From:")
                               (mh-get-header-field "Cc:")
@@ -307,14 +327,20 @@
 
 ;;;###mh-autoload
 (defun mh-forward (to cc &optional range)
-  "Forward messages to the recipients TO and CC.
-Use optional RANGE argument to specify a message or sequence to forward.
-Default is the displayed message.
+  "Forward message(s).
+
+You are prompted for the TO and CC recipients. You are given a draft to edit
+that looks like it would if you had run the MH command \"forw\". You are given
+a chance to add some text.
 
-Check the documentation of `mh-interactive-range' to see how RANGE is read in
-interactive use.
+You can forward several messages by using a RANGE. All of the messages in the
+range are inserted into your draft. Check the documentation of
+`mh-interactive-range' to see how RANGE is read in interactive use.
 
-See also `mh-send'."
+The default message is the current message.
+
+See also `mh-compose-forward-as-mime-flag', `mh-forward-subject-format',
+and `mh-send'."
   (interactive (list (mh-interactive-read-address "To: ")
                      (mh-interactive-read-address "Cc: ")
                      (mh-interactive-range "Forward")))
@@ -398,33 +424,30 @@
            (setq from (substring from (1+ comment) (1- (length from)))))))
   (format mh-forward-subject-format from subject))
 
-;;;###autoload
-(defun mh-smail-other-window ()
-  "Compose and send mail in other window with the MH mail system.
-This function is an entry point to MH-E, the Emacs interface to the MH mail
-system.
+;;;###mh-autoload
+(defun mh-redistribute (to cc &optional message)
+  "Redistribute a message.
 
-See `mh-send' for more details on composing mail."
-  (interactive)
-  (mh-find-path)
-  (call-interactively 'mh-send-other-window))
+This command is similar in function to forwarding mail, but it does not allow
+you to edit the message, nor does it add your name to the \"From\" header
+field. It appears to the recipient as if the message had come from the
+original sender. When you run this command, you are prompted for the TO and CC
+recipients. The default MESSAGE is the current message.
 
-;;;###mh-autoload
-(defun mh-redistribute (to cc &optional msg)
-  "Redistribute displayed message to recipients TO and CC.
-Use optional argument MSG to redistribute another message.
-Depending on how your copy of MH was compiled, you may need to change the
-setting of the variable `mh-redist-full-contents'.  See its documentation."
+Also investigate the \\[mh-edit-again] command for another way to redistribute
+messages.
+
+See also `mh-redist-full-contents-flag'."
   (interactive (list (mh-read-address "Redist-To: ")
                      (mh-read-address "Redist-Cc: ")
                      (mh-get-msg-num t)))
-  (or msg
-      (setq msg (mh-get-msg-num t)))
+  (or message
+      (setq message (mh-get-msg-num t)))
   (save-window-excursion
     (let ((folder mh-current-folder)
           (draft (mh-read-draft "redistribution"
-                                (if mh-redist-full-contents
-                                    (mh-msg-filename msg)
+                                (if mh-redist-full-contents-flag
+                                    (mh-msg-filename message)
                                   nil)
                                 nil)))
       (mh-goto-header-end 0)
@@ -438,17 +461,18 @@
       (message "Redistributing...")
       (let ((env "mhdist=1"))
         ;; Setup environment...
-        (setq env (concat env " mhaltmsg=" (if mh-redist-full-contents
-                                               buffer-file-name
-                                             (mh-msg-filename msg folder))))
-        (unless mh-redist-full-contents
+        (setq env (concat env " mhaltmsg="
+                          (if mh-redist-full-contents-flag
+                              buffer-file-name
+                            (mh-msg-filename message folder))))
+        (unless mh-redist-full-contents-flag
           (setq env (concat env " mhannotate=1")))
         ;; Redistribute...
         (if mh-redist-background
             (mh-exec-cmd-env-daemon env mh-send-prog nil buffer-file-name)
           (mh-exec-cmd-error env mh-send-prog "-push" buffer-file-name))
         ;; Annotate...
-        (mh-annotate-msg msg folder mh-note-dist
+        (mh-annotate-msg message folder mh-note-dist
                          "-component" "Resent:"
                          "-text" (format "\"%s %s\"" to cc)))
       (kill-buffer draft)
@@ -481,21 +505,48 @@
 
 ;;;###mh-autoload
 (defun mh-reply (message &optional reply-to includep)
-  "Reply to MESSAGE.
-Default is the displayed message.
-If the optional argument REPLY-TO is not given, prompts for type of addresses
-to reply to:
-   from    sender only,
-   to      sender and primary recipients,
-   cc/all  sender and all recipients.
-If optional prefix argument INCLUDEP provided, then include the message
-in the reply using filter `mhl.reply' in your MH directory.
-If the file named by `mh-repl-formfile' exists, it is used as a skeleton for
-the reply. If REPLY-TO is cc or all and you're using either the nmh or GNU
-mailutils variants and the file names by `mh-repl-group-formfile' exists, it
-is used instead.
+  "Reply to a MESSAGE.
+
+When you reply to a message, you are first prompted with \"Reply to whom?\"
+\(unless the optional argument REPLY-TO is provided). You have several choices
+here.
+
+     Response     Reply Goes To
+
+     from         The person who sent the message.  This is the default,
+                  so <RET> is sufficient.
+
+     to           Replies to the sender, plus all recipients in the
+                  \"To:\" header field.
+
+     all
+     cc           Forms a reply to the sender, plus all recipients.
 
-See also `mh-send'."
+Depending on your answer, \"repl\" is given a different argument to form your
+reply. Specifically, a choice of \"from\" or none at all runs \"repl -nocc
+all\", and a choice of \"to\" runs \"repl -cc to\". Finally, either \"cc\" or
+\"all\" runs \"repl -cc all -nocc me\".
+
+Two windows are then created. One window contains the message to which you are
+replying in an MH-Show buffer. Your draft, in MH-Letter mode
+\(see `mh-letter-mode'), is in the other window.
+
+If you supply a prefix argument INCLUDEP, the message you are replying to is
+inserted in your reply after having first been run through \"mhl\" with the
+format file \"mhl.reply\".
+
+Alternatively, you can customize the option `mh-yank-behavior' and choose one
+of its \"Automatically\" variants to do the same thing. If you do so, the
+prefix argument has no effect.
+
+Another way to include the message automatically in your draft is to use
+\"repl: -filter repl.filter\" in your MH profile.
+
+If you wish to customize the header or other parts of the reply draft, please
+see \"repl\" and \"mh-format\".
+
+See also `mh-reply-show-message-flag', `mh-reply-default-reply-to', and
+`mh-send'."
   (interactive (list
                 (mh-get-msg-num t)
                 (let ((minibuffer-help-form
@@ -560,14 +611,19 @@
 
 ;;;###mh-autoload
 (defun mh-send (to cc subject)
-  "Compose and send a letter.
-Do not call this function from outside MH-E; use \\[mh-smail] instead.
+  "Compose a message.
+
+Your letter appears in an Emacs buffer whose mode is MH-Letter (see
+`mh-letter-mode').
 
-The file named by `mh-comp-formfile' will be used as the form.
-The letter is composed in `mh-letter-mode'; see its documentation for more
-details.
-If `mh-compose-letter-function' is defined, it is called on the draft and
-passed three arguments: TO, CC, and SUBJECT."
+The arguments TO, CC, and SUBJECT can be used to prefill the draft fields or
+suppress the prompts if `mh-compose-prompt-flag' is on. They are also passed
+to the function set in the option `mh-compose-letter-function'.
+
+See also `mh-insert-x-mailer-flag' and `mh-letter-mode-hook'.
+
+Outside of an MH-Folder buffer (`mh-folder-mode'), you must call either
+\\[mh-smail] or \\[mh-smail-other-window] to compose a new message."
   (interactive (list
                 (mh-interactive-read-address "To: ")
                 (mh-interactive-read-address "Cc: ")
@@ -578,15 +634,10 @@
 
 ;;;###mh-autoload
 (defun mh-send-other-window (to cc subject)
-  "Compose and send a letter in another window.
-Do not call this function from outside MH-E; use \\[mh-smail-other-window]
-instead.
+  "Compose a message in another window.
 
-The file named by `mh-comp-formfile' will be used as the form.
-The letter is composed in `mh-letter-mode'; see its documentation for more
-details.
-If `mh-compose-letter-function' is defined, it is called on the draft and
-passed three arguments: TO, CC, and SUBJECT."
+See `mh-send' for more information and a description of how the TO, CC, and
+SUBJECT arguments are used."
   (interactive (list
                 (mh-interactive-read-address "To: ")
                 (mh-interactive-read-address "Cc: ")
@@ -698,7 +749,8 @@
     (cond ((get-buffer buffer)          ; Buffer may be deleted
            (set-buffer buffer)
            (mh-iterate-on-range nil msg
-             (mh-notate nil note (1+ mh-cmd-note)))))))
+             (mh-notate nil note
+                        (+ mh-cmd-note mh-scan-field-destination-offset)))))))
 
 (defun mh-insert-fields (&rest name-values)
   "Insert the NAME-VALUES pairs in the current buffer.
@@ -859,7 +911,7 @@
 (defun mh-fill-paragraph-function (arg)
   "Fill paragraph at or after point.
 Prefix ARG means justify as well. This function enables `fill-paragraph' to
-work better in MH-Letter mode."
+work better in MH-Letter mode (see `mh-letter-mode')."
   (interactive "P")
   (let ((fill-paragraph-function) (fill-prefix))
     (if (mh-in-header-p)
--- a/lisp/mh-e/mh-customize.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-customize.el	Mon Nov 07 14:56:19 2005 +0000
@@ -781,12 +781,12 @@
   :group 'mh-letter)
 
 (defcustom mh-compose-space-does-completion-flag nil
-  "*On means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
+  "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
   :type 'boolean
   :group 'mh-letter)
 
 (defcustom mh-delete-yanked-msg-window-flag nil
-  "*On means delete any window displaying the message.
+  "*Non-nil means delete any window displaying the message.
 This deletes the window containing the original message after yanking it with
 \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make more room on your screen for
 your reply."
@@ -869,7 +869,7 @@
   :group 'mh-letter)
 
 (defcustom mh-signature-separator-flag t
-  "*On means a signature separator should be inserted.
+  "*Non-nil means a signature separator should be inserted.
 It is not recommended that you change this option since various mail user
 agents, including MH-E, use the separator to present the signature
 differently, and to suppress the signature when replying or yanking a letter
@@ -885,14 +885,16 @@
 Otherwise it is assumed that the file contains the value of the \"X-Face:\"
 header field.
 
-The \"X-Face:\" header field, which is a low-resolution, black and white
-image, can be generated using the \"compface\"
-\(ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z) command. The
-\"Online X-Face Converter\" (http://www.dairiki.org/xface/) is a useful
-resource for quick conversion of images into \"X-Face:\" header fields.
+The \"X-Face:\" header field, which is a low-resolution, black
+and white image, can be generated using the \"compface\" command
+\(see URL `ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z').
+The \"Online X-Face Converter\" is a useful resource for quick
+conversion of images into \"X-Face:\" header fields (see URL
+`http://www.dairiki.org/xface/').
 
-Use the \"make-face\" (http://quimby.gnus.org/circus/face/make-face) script to
-convert a JPEG image to the higher resolution, color, \"Face:\" header field.
+Use the \"make-face\" script to convert a JPEG image to the
+higher resolution, color, \"Face:\" header field (see URL
+`http://quimby.gnus.org/circus/face/make-face').
 
 The URL of any image can be used for the \"X-Image-URL:\" field and no
 processing of the image is required.
@@ -946,7 +948,7 @@
 ;;; Ranges (:group 'mh-ranges)
 
 (defcustom mh-interpret-number-as-range-flag t
-  "On means interpret a number as a range.
+  "*Non-nil means interpret a number as a range.
 Since one of the most frequent ranges used is \"last:N\", MH-E will interpret
 input such as \"200\" as \"last:200\" if this option is on (which is the
 default). If you need to scan just the message 200, then use the range
@@ -958,18 +960,44 @@
 
 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
 
+;;; Forward definition to avoid compiler and runtime error.
+(defvar mh-scan-format-file t)
+
+(defun mh-adaptive-cmd-note-flag-check (symbol value)
+  "Check if desired setting is legal.
+Throw an error if user tries to turn on `mh-adaptive-cmd-note-flag' when
+`mh-scan-format-file' isn't t. Otherwise, set SYMBOL to VALUE."
+  (if (and value
+           (not (eq mh-scan-format-file t)))
+      (error "%s %s" "Can't turn on unless mh-scan-format-file"
+             "is set to \"Use MH-E scan Format\"")
+    (set-default symbol value)))
+
+(defun mh-scan-format-file-check (symbol value)
+  "Check if desired setting is legal.
+Throw an error if user tries to set `mh-scan-format-file' to anything but t
+when `mh-adaptive-cmd-note-flag' is on. Otherwise, set SYMBOL to VALUE."
+  (if (and (not (eq value t))
+           (eq mh-adaptive-cmd-note-flag t))
+      (error "%s %s" "You must turn off mh-adaptive-cmd-note-flag"
+             "unless you use \"Use MH-E scan Format\"")
+    (set-default symbol value)))
+
 (defcustom mh-adaptive-cmd-note-flag t
-  "*On means that the message number width is determined dynamically.
+  "*Non-nil means that the message number width is determined dynamically.
 If you've created your own format to handle long message numbers, you'll be
 pleased to know you no longer need it since MH-E adapts its internal format
 based upon the largest message number if this option is on (the default).
+This option may only be turned on when `mh-scan-format-file' is set to \"Use
+MH-E scan Format\".
 
 If you prefer fixed-width message numbers, turn off this option and call
-`mh-set-cmd-note' with the width specified by your format file (see
-`mh-scan-format-file'). For example, the default width is 4, so you would use
-\"(mh-set-cmd-note 4)\"."
+`mh-set-cmd-note' with the width specified by your format file
+\(see `mh-scan-format-file'). For example, the default width is 4, so you would
+use \"(mh-set-cmd-note 4)\"."
   :type 'boolean
-  :group 'mh-scan-line-formats)
+  :group 'mh-scan-line-formats
+  :set 'mh-adaptive-cmd-note-flag-check)
 
 (defcustom mh-scan-format-file t
   "Specifies the format file to pass to the scan program.
@@ -977,23 +1005,24 @@
 The default setting for this option is \"Use MH-E scan Format\". This means
 that the format string will be taken from the either `mh-scan-format-mh' or
 `mh-scan-format-nmh' depending on whether MH or nmh (or GNU mailutils) is in
-use. You can also set this option to \"Use Default scan Format\" to get the
+use. This setting also enables you to turn on the `mh-adaptive-cmd-note-flag'
+option.
+
+You can also set this option to \"Use Default scan Format\" to get the
 same output as you would get if you ran \"scan\" from the shell. If you have a
 format file that you want MH-E to use but not MH, you can set this option to
 \"Specify a scan Format File\" and enter the name of your format file.
 
 If you change the format of the scan lines you'll need to tell MH-E how to
 parse the new format. As you will see, quite a lot of variables are involved
-to do that. Use \"M-x apropos RET mh-scan.*regexp\" to obtain a list of these
-variables. You may also have to call `mh-set-cmd-note' to modify `mh-cmd-note'
-with the column for your notations if you turn off
-`mh-adaptive-cmd-note-flag'. However, you will need to set the `mh-cmd-note'
-variable manually with `setq' if `mh-scan-format-file' is set to anything
-other than \"Use MH-E scan Format\"."
+to do that. Use \"\\[apropos] RET mh-scan.*regexp\" to obtain a list of these
+variables. You will also have to call `mh-set-cmd-note' if your notations are
+not in column 4 (columns in Emacs start with 0)."
   :type '(choice (const :tag "Use MH-E scan Format" t)
                  (const :tag "Use Default scan Format" nil)
                  (file  :tag "Specify a scan Format File"))
-  :group 'mh-scan-line-formats)
+  :group 'mh-scan-line-formats
+  :set 'mh-scan-format-file-check)
 
 (defcustom mh-scan-prog "scan"
   "*Program used to scan messages.
@@ -1010,13 +1039,26 @@
 ;;; Sending Mail (:group 'mh-sending-mail)
 
 (defcustom mh-compose-forward-as-mime-flag t
-  "Non-nil means that messages are forwarded as a MIME part."
+  "*Non-nil means that messages are forwarded as attachments.
+
+By default, this option is on which means that the forwarded messages are
+included as attachments. If you would prefer to forward your messages verbatim
+\(as text, inline), then turn off this option. Forwarding messages verbatim
+works well for short, textual messages, but your recipient won't be able to
+view any non-textual attachments that were in the forwarded message. Be aware
+that if you have \"forw: -mime\" in your MH profile, then forwarded messages
+will always be included as attachments regardless of the settings of this
+option."
   :type 'boolean
   :group 'mh-sending-mail)
 
 (defcustom mh-compose-letter-function nil
-  "Invoked when setting up a letter draft.
-It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
+  "Invoked when starting a new draft.
+
+However, it is the last function called before you edit your message. The
+consequence of this is that you can write a function to write and send the
+message for you. This function is passed three arguments: the contents of the
+TO, SUBJECT, and CC header fields."
   :type '(choice (const nil) function)
   :group 'mh-sending-mail)
 
@@ -1026,36 +1068,56 @@
   :group 'mh-sending-mail)
 
 (defcustom mh-forward-subject-format "%s: %s"
-  "*Format to generate the Subject: line contents for a forwarded message.
-The two string arguments to the format are the sender of the original
-message and the original subject line."
+  "*Format string for forwarded message subject.
+
+This option is a string which includes two escapes (\"%s\"). The first \"%s\"
+is replaced with the sender of the original message, and the second one is
+replaced with the original \"Subject:\"."
   :type 'string
   :group 'mh-sending-mail)
 
 (defcustom mh-insert-x-mailer-flag t
-  "*Non-nil means append an X-Mailer field to the header."
+  "*Non-nil means append an \"X-Mailer:\" header field to the header.
+
+This header field includes the version of MH-E and Emacs that you are using.
+If you don't want to participate in our marketing, you can turn this option
+off."
+  :type 'boolean
+  :group 'mh-sending-mail)
+
+(defcustom mh-redist-full-contents-flag nil
+  "*Non-nil means the \"dist\" command needs entire letter for redistribution.
+
+This option must be turned on if \"dist\" requires the whole letter for
+redistribution, which is the case if \"send\" is compiled with the BERK option
+\(which many people abhor). If you find that MH will not allow you to
+redistribute a message that has been redistributed before, turn off this
+option."
   :type 'boolean
   :group 'mh-sending-mail)
 
 (defcustom mh-reply-default-reply-to nil
   "*Sets the person or persons to whom a reply will be sent.
-If nil, prompt for recipient.  If non-nil, then \\<mh-folder-mode-map>`\\[mh-reply]' will use this
-value and it should be one of \"from\", \"to\", \"cc\", or \"all\".
-The values \"cc\" and \"all\" do the same thing."
+
+This option is set to \"Prompt\" by default so that you are prompted for the
+recipient of a reply. If you find that most of the time that you specify
+\"cc\" when you reply to a message, set this option to \"cc\". Other choices
+include \"from\", \"to\", or \"all\". You can always edit the recipients in
+the draft."
   :type '(choice (const :tag "Prompt" nil)
-                 (const "from") (const "to")
-                 (const "cc") (const "all"))
+                 (const "from")
+                 (const "to")
+                 (const "cc")
+                 (const "all"))
   :group 'mh-sending-mail)
 
 (defcustom mh-reply-show-message-flag t
-  "*Non-nil means the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].
+  "*Non-nil means the MH-Show buffer is displayed when replying.
 
-The setting of this variable determines whether the MH `show-buffer' is
-displayed with the current message when using `mh-reply' without a prefix
-argument.  Set it to nil if you already include the message automatically
-in your draft using
- repl: -filter repl.filter
-in your ~/.mh_profile file."
+If you include the message automatically, you can hide the MH-Show
+buffer by turning off this option.
+
+See also `mh-reply'."
   :type 'boolean
   :group 'mh-sending-mail)
 
@@ -1069,29 +1131,34 @@
 
 (defcustom mh-refile-preserves-sequences-flag t
   "*Non-nil means that sequences are preserved when messages are refiled.
-If this variable is non-nil and a message belonging to a sequence other than
-cur or Previous-Sequence (see mh-profile 5) is refiled then it is put in the
-same sequence in the destination folder."
+
+If a message is in any sequence (except \"Previous-Sequence:\" and \"cur\")
+when it is refiled, then it will still be in those sequences in the
+destination folder. If this behavior is not desired, then turn off this
+option."
   :type 'boolean
   :group 'mh-sequences)
 
 (defcustom mh-tick-seq 'tick
   "The name of the MH sequence for ticked messages.
-You would change this option if you already use the `tick' sequence for your
-own use. You can also disable all of the ticking functions by choosing the
-`Disable Ticking' item but there isn't much advantage to that."
+
+You can customize this option if you already use the \"tick\" sequence for
+your own use. You can also disable all of the ticking functions by choosing
+the \"Disable Ticking\" item but there isn't much advantage to that."
   :type '(choice (const :tag "Disable Ticking" nil)
                  symbol)
   :group 'mh-sequences)
 
 (defcustom mh-update-sequences-after-mh-show-flag t
   "*Non-nil means flush MH sequences to disk after message is shown.
+
 Three sequences are maintained internally by MH-E and pushed out to MH when a
 message is shown. They include the sequence specified by your
-`Unseen-Sequence:' profile entry, `cur', and the sequence listed by
-the `mh-tick-seq' option which is `tick' by default.
-If you do not like this behavior, set this option to nil. You can then update
-the state manually with the \\<mh-folder-mode-map>`\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]' commands."
+\"Unseen-Sequence:\" profile entry, \"cur\", and the sequence listed by the
+option `mh-tick-seq' which is \"tick\" by default. If you do not like this
+behavior, turn off this option. You can then update the state manually with
+the `\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]'
+commands."
   :type 'boolean
   :group 'mh-sequences)
 
@@ -1515,20 +1582,19 @@
 
 The first header field used, if present, is the Gnus-specific `Face:' field.
 The `Face:' field appeared in GNU Emacs 21 and XEmacs. For more information,
-see http://quimby.gnus.org/circus/face/. Next is the traditional `X-Face:'
-header field. The display of this field requires the `uncompface' program
-which can be obtained from
-ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. Recent versions of
-XEmacs have internal support for `X-Face:' images. If your version of XEmacs
-does not, then you'll need both `uncompface' and the x-face package which is
-available at ftp://ftp.jpl.org/pub/elisp/.
+see URL `http://quimby.gnus.org/circus/face/'. Next is the traditional
+`X-Face:' header field. The display of this field requires the `uncompface'
+program (see URL `ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z').
+Recent versions of XEmacs have internal support for `X-Face:' images. If your
+version of XEmacs does not, then you'll need both `uncompface' and the x-face
+package (see URL `ftp://ftp.jpl.org/pub/elisp/').
 
 Finally, MH-E will display images referenced by the `X-Image-URL:' header
 field if neither the `Face:' nor the `X-Face:' fields are present. The display
-of the images requires `wget' (available from
-http://www.gnu.org/software/wget/wget.html), `fetch', or `curl' to fetch the
-image and the `convert' program from the ImageMagick suite, available from
-http://www.imagemagick.org/. Of the three header fields this is the most
+of the images requires `wget' (see URL
+`http://www.gnu.org/software/wget/wget.html'), `fetch', or `curl' to fetch the
+image and the `convert' program from the ImageMagick suite (see URL
+`http://www.imagemagick.org/'). Of the three header fields this is the most
 efficient in terms of network usage since the image doesn't need to be
 transmitted with every single mail.
 
@@ -2034,9 +2100,9 @@
 mark around the modified citation text for the next hook function. The
 standard prefix `mh-ins-buf-prefix' is not added if this hook is set.
 
-For example, if you use the hook function trivial-cite
-\(http://shasta.cs.uiuc.edu/~lrclause/tc.html) (which is NOT part of Emacs),
-set `mh-yank-behavior' to \"Body and Header\"."
+For example, if you use the hook function trivial-cite (which is NOT part of
+Emacs), set `mh-yank-behavior' to \"Body and Header\" (see URL
+`http://shasta.cs.uiuc.edu/~lrclause/tc.html')."
   :type 'hook
   :options '(trivial-cite)
   :group 'mh-hooks
@@ -2134,7 +2200,7 @@
   :group 'mh-letter)
 
 (defcustom mh-letter-mode-hook nil
-  "Invoked in `mh-letter-mode' on a new letter."
+  "Invoked by `mh-letter-mode' on a new letter."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-sending-mail)
@@ -2187,39 +2253,55 @@
 (defvar mh-folder-body-face 'mh-folder-body
   "Face used to highlight body text in MH-Folder buffers.")
 (defface mh-folder-body
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
-    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
-    (((class color) (background light)) (:foreground "RosyBrown"))
-    (((class color) (background dark)) (:foreground "LightSalmon"))
-    (t (:italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "RosyBrown"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightSalmon"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "DimGray" :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "LightGray" :italic t))
+     (t
+      (:italic t))))
   "Face used to highlight body text in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-cur-msg-face 'mh-folder-cur-msg
   "Face used for the current message line in MH-Folder buffers.")
 (defface mh-folder-cur-msg
-  '((((type tty pc) (class color))
-     (:background "LightGreen"))
-    (((class color) (background light))
-     (:background "LightGreen")         ;Use this for solid background colour
-     ;;  (:underline t)                 ;Use this for underlining
-     )
-    (((class color) (background dark))
-     (:background "DarkOliveGreen4"))
-    (t (:underline t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:background "LightGreen")        ;Use this for solid background colour
+      ;;  (:underline t)                 ;Use this for underlining
+      )
+     (((class color) (min-colors 88) (background dark))
+      (:background "DarkOliveGreen4"))
+     (((class color))
+      (:background "LightGreen"))
+     (t
+      (:underline t))))
   "Face used for the current message line in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number
   "Face used to highlight the current message in MH-Folder buffers.")
 (defface mh-folder-cur-msg-number
-  '((((type tty) (class color)) (:foreground "cyan" :weight bold))
-    (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
-    (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
-    (((class color) (background light)) (:foreground "Purple"))
-    (((class color) (background dark)) (:foreground "Cyan"))
-    (t (:bold t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "Purple"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "Cyan"))
+     (((class color))
+      (:foreground "cyan" :weight bold))
+     (((class grayscale) (background light))
+      (:foreground "LightGray" :bold t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t))
+     (t
+      (:bold t))))
   "Face used to highlight the current message in MH-Folder buffers."
   :group 'mh-folder-faces)
 
@@ -2266,14 +2348,19 @@
 (defvar mh-folder-refiled-face 'mh-folder-refiled
   "Face used to highlight refiled messages in MH-Folder buffers.")
 (defface mh-folder-refiled
-  '((((type tty) (class color)) (:foreground "yellow" :weight light))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t :italic t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t :italic t))
-    (((class color) (background light)) (:foreground "DarkGoldenrod"))
-    (((class color) (background dark)) (:foreground "LightGoldenrod"))
-    (t (:bold t :italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "DarkGoldenrod"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightGoldenrod"))
+     (((class color))
+      (:foreground "yellow" :weight light))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t :italic t))
+     (t
+      (:bold t :italic t))))
   "Face used to highlight refiled messages in MH-Folder buffers."
   :group 'mh-folder-faces)
 
@@ -2292,9 +2379,12 @@
   :group 'mh-folder-faces)
 
 (defface mh-folder-tick
-  '((((class color) (background dark)) (:background "#dddf7e"))
-    (((class color) (background light)) (:background "#dddf7e"))
-    (t (:underline t)))
+  '((((class color) (background dark))
+     (:background "#dddf7e"))
+    (((class color) (background light))
+     (:background "#dddf7e"))
+    (t
+     (:underline t)))
   "Face used to show ticked messages."
   :group 'mh-folder-faces)
 
@@ -2309,12 +2399,19 @@
 (defvar mh-folder-to-face 'mh-folder-to
   "Face used to highlight the To: string in MH-Folder buffers.")
 (defface mh-folder-to
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
-    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
-    (((class color) (background light)) (:foreground "RosyBrown"))
-    (((class color) (background dark)) (:foreground "LightSalmon"))
-    (t (:italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "RosyBrown"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightSalmon"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "DimGray" :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "LightGray" :italic t))
+     (t
+      (:italic t))))
   "Face used to highlight the To: string in MH-Folder buffers."
   :group 'mh-folder-faces)
 
@@ -2343,7 +2440,8 @@
      (:background "gray90"))
     (((class color) (background dark))
      (:background "gray10"))
-    (t (:bold t)))
+    (t
+     (:bold t)))
   "Face used to display header fields in draft buffers."
   :group 'mh-letter-faces)
 
@@ -2354,45 +2452,65 @@
 (defvar mh-show-cc-face 'mh-show-cc
   "Face used to highlight cc: header fields.")
 (defface mh-show-cc
-  '((((type tty) (class color)) (:foreground "yellow" :weight light))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t :italic t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t :italic t))
-    (((class color) (background light)) (:foreground "DarkGoldenrod"))
-    (((class color) (background dark)) (:foreground "LightGoldenrod"))
-    (t (:bold t :italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "DarkGoldenrod"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightGoldenrod"))
+     (((class color))
+      (:foreground "yellow" :weight light))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t :italic t))
+     (t
+      (:bold t :italic t))))
   "Face used to highlight cc: header fields."
   :group 'mh-show-faces)
 
 (defvar mh-show-date-face 'mh-show-date
   "Face used to highlight the Date: header field.")
 (defface mh-show-date
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "Gray90" :bold t))
-    (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
-    (((class color) (background light)) (:foreground "ForestGreen"))
-    (((class color) (background dark)) (:foreground "PaleGreen"))
-    (t (:bold t :underline t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "ForestGreen"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "PaleGreen"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t))
+     (t
+      (:bold t :underline t))))
   "Face used to highlight the Date: header field."
   :group 'mh-show-faces)
 
 (defvar mh-show-header-face 'mh-show-header
   "Face used to deemphasize unspecified header fields.")
 (defface mh-show-header
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
-    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
-    (((class color) (background light)) (:foreground "RosyBrown"))
-    (((class color) (background dark)) (:foreground "LightSalmon"))
-    (t (:italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "RosyBrown"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightSalmon"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "DimGray" :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "LightGray" :italic t))
+     (t
+      (:italic t))))
   "Face used to deemphasize unspecified header fields."
   :group 'mh-show-faces)
 
 (defvar mh-show-pgg-good-face 'mh-show-pgg-good
   "Face used to highlight a good PGG signature.")
 (defface mh-show-pgg-good
-  '((t (:bold t :foreground "LimeGreen")))
+  '((t
+     (:bold t :foreground "LimeGreen")))
   "Face used to highlight a good PGG signature."
   :group 'mh-show-faces)
 
@@ -2400,7 +2518,8 @@
   "Face used to highlight a PGG signature whose status is unknown.
 This face is also used for a signature when the signer is untrusted.")
 (defface mh-show-pgg-unknown
-  '((t (:bold t :foreground "DarkGoldenrod2")))
+  '((t
+     (:bold t :foreground "DarkGoldenrod2")))
   "Face used to highlight a PGG signature whose status is unknown.
 This face is also used for a signature when the signer is untrusted."
   :group 'mh-show-faces)
@@ -2408,12 +2527,14 @@
 (defvar mh-show-pgg-bad-face 'mh-show-pgg-bad
   "Face used to highlight a bad PGG signature.")
 (defface mh-show-pgg-bad
-  '((t (:bold t :foreground "DeepPink1")))
+  '((t
+     (:bold t :foreground "DeepPink1")))
   "Face used to highlight a bad PGG signature."
   :group 'mh-show-faces)
 
 (defface mh-show-signature
-  '((t (:italic t)))
+  '((t
+     (:italic t)))
   "Face used to highlight the message signature."
   :group 'mh-show-faces)
 
@@ -2422,12 +2543,14 @@
 (if (boundp 'facemenu-unlisted-faces)
     (add-to-list 'facemenu-unlisted-faces "^mh-show"))
 (defface mh-show-to
-  '((((class grayscale) (background light))
+  '((((class color) (background light))
+     (:foreground "SaddleBrown"))
+    (((class color) (background dark))
+     (:foreground "burlywood"))
+    (((class grayscale) (background light))
      (:foreground "DimGray" :underline t))
     (((class grayscale) (background dark))
      (:foreground "LightGray" :underline t))
-    (((class color) (background light)) (:foreground "SaddleBrown"))
-    (((class color) (background dark))  (:foreground "burlywood"))
     (t (:underline t)))
   "Face used to highlight the To: header field."
   :group 'mh-show-faces)
@@ -2445,7 +2568,8 @@
   :group 'mh-show-faces)
 
 (defface mh-show-xface
-  '((t (:foreground "black" :background "white")))
+  '((t
+     (:foreground "black" :background "white")))
   "Face used to display the X-Face image.
 The background and foreground is used in the image."
   :group 'mh-show-faces)
@@ -2471,17 +2595,20 @@
      (:foreground "red1" :underline t))
     (((class color) (background dark))
      (:foreground "red1" :underline t))
-    (t (:underline t)))
+    (t
+     (:underline t)))
   "Face used for the current folder."
   :group 'mh-speed-faces)
 
 (defface mh-speedbar-folder-with-unseen-messages
-  '((t (:inherit mh-speedbar-folder :bold t)))
+  '((t
+     (:inherit mh-speedbar-folder :bold t)))
   "Face used for folders in the speedbar buffer which have unread messages."
   :group 'mh-speed-faces)
 
 (defface mh-speedbar-selected-folder-with-unseen-messages
-  '((t (:inherit mh-speedbar-selected-folder :bold t)))
+  '((t
+     (:inherit mh-speedbar-selected-folder :bold t)))
   "Face used for the current folder when it has unread messages."
   :group 'mh-speed-faces)
 
--- a/lisp/mh-e/mh-e.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-e.el	Mon Nov 07 14:56:19 2005 +0000
@@ -114,7 +114,7 @@
 ;; The following scan formats are passed to the scan program if the setting of
 ;; `mh-scan-format-file' is t. They are identical except the later one makes
 ;; use of the nmh `decode' function to decode RFC 2047 encodings. If you just
-;; want to change the width of the msg number, use the `mh-set-cmd-note'
+;; want to change the column of the notations, use the `mh-set-cmd-note'
 ;; function.
 
 (defvar mh-scan-format-mh
@@ -184,24 +184,30 @@
 It must match from the beginning of the line. Note that the default setting of
 `mh-folder-font-lock-keywords' expects this expression to contain at least one
 parenthesized expression which matches the message number as in the default of
-\"^\\\\( *[0-9]+\\\\)[^D^0-9]\". This regular expression should be correct as
-it is needed by non-fontifying functions.")
+\"^\\\\( *[0-9]+\\\\)[^D^0-9]\". This expression includes the leading space
+within the parenthesis since it looks better to highlight it as well. This
+regular expression should be correct as it is needed by non-fontifying
+functions.")
 
 (defvar mh-scan-deleted-msg-regexp "^\\( *[0-9]+\\)D"
   "This regular expression matches deleted messages.
 It must match from the beginning of the line. Note that the default setting of
 `mh-folder-font-lock-keywords' expects this expression to contain at least one
 parenthesized expression which matches the message number as in the default of
-\"^\\\\( *[0-9]+\\\\)D\". This regular expression should be correct as it is
-needed by non-fontifying functions. See also `mh-note-deleted'.")
+\"^\\\\( *[0-9]+\\\\)D\". This expression includes the leading space within
+the parenthesis since it looks better to highlight it as well. This regular
+expression should be correct as it is needed by non-fontifying functions. See
+also `mh-note-deleted'.")
 
 (defvar mh-scan-refiled-msg-regexp  "^\\( *[0-9]+\\)\\^"
   "This regular expression matches refiled messages.
 It must match from the beginning of the line. Note that the default setting of
 `mh-folder-font-lock-keywords' expects this expression to contain at least one
 parenthesized expression which matches the message number as in the default of
-\"^\\\\( *[0-9]+\\\\)\\\\^\". This regular expression should be correct as it
-is needed by non-fontifying functions. See also `mh-note-refiled'.")
+\"^\\\\( *[0-9]+\\\\)\\\\^\". This expression includes the leading space
+within the parenthesis since it looks better to highlight it as well. This
+regular expression should be correct as it is needed by non-fontifying
+functions. See also `mh-note-refiled'.")
 
 (defvar mh-scan-valid-regexp "^ *[0-9]"
   "This regular expression describes a valid scan line.
@@ -213,8 +219,10 @@
 It must match from the beginning of the line. Note that the default setting of
 `mh-folder-font-lock-keywords' expects this expression to contain at least one
 parenthesized expression which matches the message number as in the default of
-\"^\\\\( *[0-9]+\\\\+\\\\).*\". This regular expression should be correct as
-it is needed by non-fontifying functions. See also `mh-note-cur'.")
+\"^\\\\( *[0-9]+\\\\+\\\\).*\". This expression includes the leading space and
+current message marker \"+\" within the parenthesis since it looks better to
+highlight these items as well. This regular expression should be correct as it
+is needed by non-fontifying functions. See also `mh-note-cur'.")
 
 (defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)"
   "This regular expression matches a valid date.
@@ -338,6 +346,10 @@
   "Number of columns consumed by whitespace after from-mbox in `mh-scan-format'.
 This column will only ever have spaces in it.")
 
+(defvar mh-scan-field-destination-offset
+  (+ mh-scan-cmd-note-width)
+  "The offset from the `mh-cmd-note' for the destination column.")
+
 (defvar mh-scan-field-from-start-offset
   (+ mh-scan-cmd-note-width
      mh-scan-destination-width
@@ -1242,8 +1254,11 @@
 
 
 (defun mh-update-sequences ()
-  "Update MH's Unseen-Sequence and current folder and message.
-Flush MH-E's state out to MH. The message at the cursor becomes current."
+  "Flush MH-E's state out to MH.
+This function updates the sequence specified by your \"Unseen-Sequence:\"
+profile component, \"cur\", and the sequence listed by the `mh-tick-seq'
+option which is \"tick\" by default. The message at the cursor is used for
+\"cur\"."
   (interactive)
   ;; mh-update-sequences is the opposite of mh-read-folder-sequences,
   ;; which updates MH-E's state from MH.
@@ -1402,7 +1417,7 @@
   (setq buffer-read-only nil)
   (erase-buffer)
   (if mh-adaptive-cmd-note-flag
-      (mh-set-cmd-note (mh-message-number-width name)))
+      (mh-set-cmd-note (mh-msg-num-width-to-column (mh-msg-num-width name))))
   (setq buffer-read-only t)
   (mh-folder-mode)
   (mh-set-folder-modified-p nil)
@@ -1719,20 +1734,24 @@
   (when (mh-outstanding-commands-p)
     (mh-notate-deleted-and-refiled)))
 
-(defun mh-set-cmd-note (width)
-  "Set `mh-cmd-note' to WIDTH (minimum of 2).
-
-If `mh-scan-format-file' is set to \"Use Default scan Format\" or \"Specify a
-scan Format File\", then this function will NOT update `mh-cmd-note'. In these
-cases, the user should change `mh-cmd-note' with `setq' if necessary.
+(defun mh-msg-num-width-to-column (width)
+  "Return the column for notations given message number WIDTH.
+Note that columns in Emacs start with 0.
 
+If `mh-scan-format-file' is set to \"Use MH-E scan Format\" this means that
+either `mh-scan-format-mh' or `mh-scan-format-nmh' are in use. This function
+therefore assumes that the first column is empty (to provide room for the
+cursor), the following WIDTH columns contain the message number, and the
+column for notations comes after that."
+  (if (eq mh-scan-format-file t)
+      (max (1+ width) 2)
+    (error "%s %s" "Can't call mh-msg-num-width-to-column"
+           "when mh-scan-format-file is not t")))
+
+(defun mh-set-cmd-note (column)
+  "Set `mh-cmd-note' to COLUMN.
 Note that columns in Emacs start with 0."
-  ;; Add one to the width to always have whitespace in column zero.
-  (setq width (max (1+ width) 2))
-  (if (and (equal mh-scan-format-file t)
-           (not (eq mh-cmd-note width)))
-      (setq mh-cmd-note width))
-  mh-cmd-note)
+  (setq mh-cmd-note column))
 
 (defun mh-regenerate-headers (range &optional update)
   "Scan folder over range RANGE.
@@ -1747,7 +1766,8 @@
           (goto-char (point-max))
         (delete-region (point-min) (point-max))
         (if mh-adaptive-cmd-note-flag
-            (mh-set-cmd-note (mh-message-number-width folder))))
+            (mh-set-cmd-note (mh-msg-num-width-to-column (mh-msg-num-width
+                                                          folder)))))
       (setq scan-start (point))
       (apply #'mh-exec-cmd-output
              mh-scan-prog nil
@@ -1781,9 +1801,9 @@
 After doing an `mh-get-new-mail' operation in this FOLDER, at least
 one line that looks like a truncated message number was found.
 
-Remove the text added by the last `mh-inc' command. It should be the
-messages cur-last. Call `mh-set-cmd-note' with the widest message number
-in FOLDER.
+Remove the text added by the last `mh-inc' command. It should be the messages
+cur-last. Call `mh-set-cmd-note', adjusting the notation column with the width
+of the largest message number in FOLDER.
 
 Reformat the message number width on each line in the buffer and trim
 the line length to fit in the window.
@@ -1800,7 +1820,7 @@
       (delete-char (- (point-max) (point)))
       ;; Update the current buffer to reflect the new mh-cmd-note
       ;; value needed to display messages.
-      (mh-set-cmd-note (mh-message-number-width folder))
+      (mh-set-cmd-note (mh-msg-num-width-to-column (mh-msg-num-width folder)))
       (setq mh-cmd-note-fmt (concat "%" (format "%d" mh-cmd-note) "d"))
       ;; Cleanup the messages that are in the buffer right now
       (goto-char (point-min))
@@ -1958,11 +1978,12 @@
             (mh-notate nil nil mh-cmd-note)
             (when font-lock-mode
               (font-lock-fontify-region (point) (line-end-position))))
-        (forward-char (1+ mh-cmd-note))
+        (forward-char (+ mh-cmd-note mh-scan-field-destination-offset))
         (let ((stack (gethash msg mh-sequence-notation-history)))
           (setf (gethash msg mh-sequence-notation-history)
                 (cons (char-after) stack)))
-        (mh-notate nil mh-note-seq (1+ mh-cmd-note))))))
+        (mh-notate nil mh-note-seq
+                   (+ mh-cmd-note mh-scan-field-destination-offset))))))
 
 (defun mh-remove-sequence-notation (msg internal-seq-flag &optional all)
   "Remove sequence notation from the MSG on the current line.
@@ -1981,7 +2002,7 @@
         (when stack
           (save-excursion
             (beginning-of-line)
-            (forward-char (1+ mh-cmd-note))
+            (forward-char (+ mh-cmd-note mh-scan-field-destination-offset))
             (delete-char 1)
             (insert (car stack))))
         (setf (gethash msg mh-sequence-notation-history) (cdr stack))))))
--- a/lisp/mh-e/mh-init.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-init.el	Mon Nov 07 14:56:19 2005 +0000
@@ -26,12 +26,14 @@
 
 ;;; Commentary:
 
-;; Sets up the MH variant (currently nmh or MH).
+;; Sets up the MH variant (currently nmh, MH, or GNU mailutils).
 ;;
 ;; Users may customize `mh-variant' to switch between available variants.
 ;; Available MH variants are described in the variable `mh-variants'.
 ;; Developers may check which variant is currently in use with the
 ;; variable `mh-variant-in-use' or the function `mh-variant-p'.
+;;
+;; Also contains code that is used at load or initialization time only.
 
 ;;; Change Log:
 
@@ -300,6 +302,8 @@
                     (add-to-list 'mh-variants variant)))))
       mh-variants)))
 
+
+
 (defvar mh-image-load-path-called-flag nil)
 
 ;;;###mh-autoload
@@ -325,6 +329,32 @@
         (add-to-list 'load-path mh-image-load-path)))
     (setq mh-image-load-path-called-flag t)))
 
+
+
+(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
+                                        (>= emacs-major-version 22))
+  "Non-nil means defface supports min-colors display requirement.")
+
+(defun mh-defface-compat (spec)
+  "Converts SPEC for defface if necessary to run on older platforms.
+See `defface' for the spec definition.
+
+When `mh-min-colors-defined-flag' is nil, this function finds a display with a
+single \"class\" requirement with a \"color\" item, renames the requirement to
+\"tty\" and moves it to the beginning of the list. It then strips any
+\"min-colors\" requirements."
+  (when (not mh-min-colors-defined-flag)
+    ;; Insert ((class tty)) display with ((class color)) attributes.
+    (let ((attributes (cdr (assoc '((class color)) spec))))
+      (cons (cons '((class tty)) attributes) spec))
+    ;; Delete ((class color)) display.
+    (delq (assoc '((class color)) spec) spec)
+    ;; Strip min-colors.
+    (loop for entry in spec do
+          (when (not (eq (car entry) t))
+            (if (assoc 'min-colors (car entry))
+                (delq (assoc 'min-colors (car entry)) (car entry)))))))
+  
 (provide 'mh-init)
 
 ;;; Local Variables:
--- a/lisp/mh-e/mh-print.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-print.el	Mon Nov 07 14:56:19 2005 +0000
@@ -64,7 +64,6 @@
 ;; XXX - Default print buffer is bogus
 (defun mh-ps-spool-buffer (buffer)
   "Send BUFFER to printer queue."
-  (message "mh-ps-spool-buffer %s" buffer)
   (save-excursion
     (set-buffer buffer)
     (let ((ps-print-color-p mh-ps-print-color-option)
@@ -85,8 +84,6 @@
   "Print MSG.
 First the message is decoded in BUFFER before the results are sent to the
 printer."
-  (message "mh-ps-spool-a-msg msg %s buffer %s"
-		   msg buffer)
   (let ((mh-show-buffer mh-show-buffer)
 	(folder mh-current-folder)
         ;; The following is commented out because
@@ -113,8 +110,6 @@
 Check the documentation of `mh-interactive-range' to see how RANGE is read in
 interactive use."
   (interactive (list (mh-interactive-range "Print")))
-  (message "mh-ps-print-msg range %s keys %s"
-		    range (this-command-keys))
   (mh-iterate-on-range msg range
     (let ((buffer (get-buffer-create mh-temp-buffer)))
       (unwind-protect
@@ -152,8 +147,6 @@
 (defun mh-ps-print-msg-show (file)
   "Print current show buffer to FILE."
   (interactive (list (mh-ps-print-preprint current-prefix-arg)))
-  (message "mh-ps-print-msg-show file %s keys %s mh-show-buffer %s"
-		   file (this-command-keys) mh-show-buffer)
   (let ((msg (mh-get-msg-num t))
         (folder mh-current-folder)
         (show-buffer mh-show-buffer)
@@ -164,8 +157,8 @@
 	      (progn
 		(mh-ps-spool-buffer show-buffer)
 		(ps-despool file))
-	    (message "Current message is not being shown(1).")))
-      (message "Current message is not being shown(2)."))))
+	    (message "Current message is not being shown(1)")))
+      (message "Current message is not being shown(2)"))))
 
 ;;;###mh-autoload
 (defun mh-ps-print-toggle-faces ()
@@ -185,13 +178,13 @@
  (if (eq mh-ps-print-color-option nil)
      (progn
        (setq mh-ps-print-color-option 'black-white)
-       (message "Colors will be printed as black & white."))
+       (message "Colors will be printed as black & white"))
    (if (eq mh-ps-print-color-option 'black-white)
        (progn
 	 (setq mh-ps-print-color-option t)
-	 (message "Colors will be printed."))
+	 (message "Colors will be printed"))
      (setq mh-ps-print-color-option nil)
-     (message "Colors will not be printed."))))
+     (message "Colors will not be printed"))))
 
 ;;; XXX: Check option 3. Documentation doesn't sound right.
 ;;;###mh-autoload
@@ -205,13 +198,13 @@
   (if (eq mh-ps-print-mime nil)
       (progn
         (setq mh-ps-print-mime t)
-        (message "Inline parts will be printed, attachments will not be printed."))
+        (message "Inline parts will be printed, attachments will not be printed"))
     (if (eq mh-ps-print-mime t)
         (progn
           (setq mh-ps-print-mime 1)
-          (message "Both Inline parts and attachments will be printed."))
+          (message "Both Inline parts and attachments will be printed"))
       (setq mh-ps-print-mime nil)
-      (message "Neither inline parts nor attachments will be printed."))))
+      (message "Neither inline parts nor attachments will be printed"))))
 
 ;;; Old non-PS based printing
 ;;;###mh-autoload
--- a/lisp/mh-e/mh-seq.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-seq.el	Mon Nov 07 14:56:19 2005 +0000
@@ -140,7 +140,11 @@
 
 ;;;###mh-autoload
 (defun mh-delete-seq (sequence)
-  "Delete the SEQUENCE."
+  "Delete SEQUENCE.
+
+You are prompted for the sequence to delete. Note that this deletes only the
+sequence, not the messages in the sequence. If you want to delete the
+messages, use \"\\[universal-argument] \\[mh-delete-msg]\"."
   (interactive (list (mh-read-seq-default "Delete" t)))
   (let ((msg-list (mh-seq-to-msgs sequence))
         (internal-flag (mh-internal-seq sequence))
@@ -161,7 +165,8 @@
 
 ;;;###mh-autoload
 (defun mh-list-sequences ()
-  "List the sequences defined in the folder being visited."
+  "List all sequences in folder.
+The list appears in a buffer named \"*MH-E Sequences*\"."
   (interactive)
   (let ((folder mh-current-folder)
         (temp-buffer mh-sequences-buffer)
@@ -228,8 +233,13 @@
 
 ;;;###mh-autoload
 (defun mh-narrow-to-seq (sequence)
-  "Restrict display of this folder to just messages in SEQUENCE.
-Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
+  "Restrict display to messages in SEQUENCE.
+
+You are prompted for the name of the sequence. What this command does is show
+only those messages that are in the selected sequence in the MH-Folder buffer.
+In addition, it limits further MH-E searches to just those messages.
+
+When you want to widen the view to all your messages again, use \\[mh-widen]."
   (interactive (list (mh-read-seq "Narrow to" t)))
   (with-mh-folder-updating (t)
     (cond ((mh-seq-to-msgs sequence)
@@ -296,7 +306,7 @@
 
 ;;;###mh-autoload
 (defun mh-widen (&optional all-flag)
-  "Restore the previous limit.
+  "Remove last restriction.
 If optional prefix argument ALL-FLAG is non-nil, remove all limits."
   (interactive "P")
   (let ((msg (mh-get-msg-num nil)))
@@ -1669,7 +1679,14 @@
 
 ;;;###mh-autoload
 (defun mh-toggle-tick (range)
-  "Toggle tick mark of all messages in RANGE."
+  "Toggle tick mark of all messages in RANGE.
+
+This command adds messages to the \"tick\" sequence (which you can customize
+via the option `mh-tick-seq'). This sequence can be viewed later with the
+\\[mh-index-ticked-messages] command.
+
+Check the documentation of `mh-interactive-range' to see how RANGE is read in
+interactive use."
   (interactive (list (mh-interactive-range "Tick")))
   (unless mh-tick-seq
     (error "Enable ticking by customizing `mh-tick-seq'"))
@@ -1696,9 +1713,13 @@
 
 ;;;###mh-autoload
 (defun mh-narrow-to-tick ()
-  "Limit to messages in `mh-tick-seq'.
+  "Limit to ticked messages.
 
-Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
+What this command does is show only those messages that are in the \"tick\"
+sequence (which you can customize via the `mh-tick-seq' option) in the
+MH-Folder buffer. In addition, it limits further MH-E searches to just those
+messages. When you want to widen the view to all your messages again, use
+\\[mh-widen]."
   (interactive)
   (cond ((not mh-tick-seq)
          (error "Enable ticking by customizing `mh-tick-seq'"))
--- a/lisp/mh-e/mh-utils.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mh-e/mh-utils.el	Mon Nov 07 14:56:19 2005 +0000
@@ -111,10 +111,9 @@
 number within the expression as in the default of \"^[^0-9]*%d[^0-9]\".")
 
 (defvar mh-cmd-note 4
-  "Column where notations begin.
+  "Column for notations.
 This variable should be set with the function `mh-set-cmd-note'. This variable
-may be updated dynamically if `mh-adaptive-cmd-note-flag' is on and
-`mh-scan-format-file' is set to \"Use MH-E scan Format\".
+may be updated dynamically if `mh-adaptive-cmd-note-flag' is on.
 
 Note that columns in Emacs start with 0.")
 (make-variable-buffer-local 'mh-cmd-note)
@@ -1827,8 +1826,10 @@
         (with-mh-folder-updating (t)
           (beginning-of-line)
           (forward-char offset)
-          (let* ((change-stack-flag (and (equal offset (1+ mh-cmd-note))
-                                         (not (eq notation mh-note-seq))))
+          (let* ((change-stack-flag
+                  (and (equal offset
+                              (+ mh-cmd-note mh-scan-field-destination-offset))
+                       (not (eq notation mh-note-seq))))
                  (msg (and change-stack-flag (or msg (mh-get-msg-num nil))))
                  (stack (and msg (gethash msg mh-sequence-notation-history)))
                  (notation (or notation (char-after))))
@@ -1992,8 +1993,8 @@
                  (substring fmt end))))
       fmt))
 
-(defun mh-message-number-width (folder)
-  "Return the widest message number in this FOLDER."
+(defun mh-msg-num-width (folder)
+  "Return the width of the largest message number in this FOLDER."
   (or mh-progs (mh-find-path))
   (let ((tmp-buffer (get-buffer-create mh-temp-buffer))
         (width 0))
--- a/lisp/mouse.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/mouse.el	Mon Nov 07 14:56:19 2005 +0000
@@ -961,7 +961,7 @@
 	  (let* ((fun (key-binding (vector (car event))))
 		 (do-multi-click   (and (> (event-click-count event) 0)
 					(functionp fun)
-					(not (eq fun 'mouse-set-point)))))
+					(not (memq fun '(mouse-set-point mouse-set-region))))))
             ;; Run the binding of the terminating up-event, if possible.
 	    (if (and (not (= (overlay-start mouse-drag-overlay)
 			     (overlay-end mouse-drag-overlay)))
@@ -1075,7 +1075,7 @@
 	     (forward-char 1))))))
 
 (defun mouse-start-end (start end mode)
-"Return a list of region bounds based on START and END according to MODE.
+  "Return a list of region bounds based on START and END according to MODE.
 If MODE is 0 then set point to (min START END), mark to (max START END).
 If MODE is 1 then set point to start of word at (min START END),
 mark to end of word at (max START END).
@@ -1181,8 +1181,10 @@
 
 ;; Momentarily show where the mark is, if highlighting doesn't show it.
 
-(defvar mouse-region-delete-keys '([delete] [deletechar])
-  "List of keys which shall cause the mouse region to be deleted.")
+(defcustom mouse-region-delete-keys '([delete] [deletechar] [backspace])
+  "List of keys that should cause the mouse region to be deleted."
+  :group 'mouse
+  :type '(repeat key-sequence))
 
 (defun mouse-show-mark ()
   (let ((inhibit-quit t)
--- a/lisp/net/eudc.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/net/eudc.el	Mon Nov 07 14:56:19 2005 +0000
@@ -380,7 +380,7 @@
 BEG and END delimit the text which is to be replaced."
   (let ((replacement))
    (setq replacement
-	 (completing-read "Multiple matches found; choose one:"
+	 (completing-read "Multiple matches found; choose one: "
 			  (mapcar 'list choices)))
    (delete-region beg end)
    (insert replacement)))
@@ -923,6 +923,7 @@
 	     ((eq eudc-multiple-match-handling-method 'select)
 	      (eudc-select response-strings beg end))
 	     ((eq eudc-multiple-match-handling-method 'all)
+	      (delete-region beg end)
 	      (insert (mapconcat 'identity response-strings ", ")))
 	     ((eq eudc-multiple-match-handling-method 'abort)
 	      (error "There is more than one match for the query"))))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/net/eudcb-mab.el	Mon Nov 07 14:56:19 2005 +0000
@@ -0,0 +1,133 @@
+;;; eudcb-mab.el --- Emacs Unified Directory Client - AddressBook backend
+
+;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Keywords: comm
+
+;; This file is part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;    This library provides an interface to use the Mac's AddressBook,
+;;    by way of the "contacts" command-line utility which can be found
+;;    by searching on the Net.
+
+;;; Code:
+
+(require 'eudc)
+(require 'executable)
+
+;;{{{      Internal cooking
+
+(defvar eudc-mab-conversion-alist nil)
+(defvar eudc-buffer-time nil)
+(defvar eudc-contacts-file
+  "~/Library/Application Support/AddressBook/AddressBook.data")
+
+(eudc-protocol-set 'eudc-query-function 'eudc-mab-query-internal 'mab)
+(eudc-protocol-set 'eudc-list-attributes-function nil 'mab)
+(eudc-protocol-set 'eudc-mab-conversion-alist nil 'mab)
+(eudc-protocol-set 'eudc-protocol-has-default-query-attributes nil 'mab)
+
+(defun eudc-mab-query-internal (query &optional return-attrs)
+  "Query MAB  with QUERY.
+QUERY is a list of cons cells (ATTR . VALUE) where ATTRs should be valid
+MAB attribute names.
+RETURN-ATTRS is a list of attributes to return, defaulting to
+`eudc-default-return-attributes'."
+
+  (let ((fmt-string "%ln:%fn:%p:%e")
+	(mab-buffer (get-buffer-create " *mab contacts*"))
+	(modified (nth 5 (file-attributes eudc-contacts-file)))
+	result)
+    (with-current-buffer mab-buffer
+      (make-local-variable 'eudc-buffer-time)
+      (goto-char (point-min))
+      (when (or (eobp) (time-less-p eudc-buffer-time modified))
+	(erase-buffer)
+	(call-process (executable-find "contacts") nil t nil
+		      "-H" "-l" "-f" fmt-string)
+	(setq eudc-buffer-time modified))
+      (goto-char (point-min))
+      (while (not (eobp))
+	(let* ((args (split-string (buffer-substring (point)
+						     (line-end-position))
+				   "\\s-*:\\s-*"))
+	       (lastname (nth 0 args))
+	       (firstname (nth 1 args))
+	       (phone (nth 2 args))
+	       (mail (nth 3 args))
+	       (matched t))
+
+	  (if (string-match "\\s-+\\'" mail)
+	      (setq mail (replace-match "" nil nil mail)))
+
+	  (dolist (term query)
+	    (cond
+	     ((eq (car term) 'name)
+	      (unless (string-match (cdr term)
+				    (concat firstname " " lastname))
+		(setq matched nil)))
+	     ((eq (car term) 'email)
+	      (unless (string= (cdr term) mail)
+		(setq matched nil)))
+	     ((eq (car term) 'phone))))
+
+	  (when matched
+	    (setq result
+		  (cons `((firstname . ,firstname)
+			  (lastname . ,lastname)
+			  (name . ,(concat firstname " " lastname))
+			  (phone . ,phone)
+			  (email . ,mail)) result))))
+	(forward-line)))
+    (if (null return-attrs)
+	result
+      (let (eudc-result)
+	(dolist (entry result)
+	  (let (entry-attrs abort)
+	    (dolist (attr entry)
+	      (when (memq (car attr) return-attrs)
+		(if (= (length (cdr attr)) 0)
+		    (setq abort t)
+		  (setq entry-attrs
+			(cons attr entry-attrs)))))
+	    (if (and entry-attrs (not abort))
+		(setq eudc-result
+		      (cons entry-attrs eudc-result)))))
+	eudc-result))))
+
+;;}}}
+
+;;{{{      High-level interfaces (interactive functions)
+
+(defun eudc-mab-set-server (dummy)
+  "Set the EUDC server to MAB."
+  (interactive)
+  (eudc-set-server dummy 'mab)
+  (message "MAB server selected"))
+
+;;}}}
+
+
+(eudc-register-protocol 'mab)
+
+(provide 'eudcb-mab)
+
+;; arch-tag: 4bef8e65-f109-47c7-91b9-8a6ea3ed7bb1
+;;; eudcb-mab.el ends here
--- a/lisp/net/goto-addr.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/net/goto-addr.el	Mon Nov 07 14:56:19 2005 +0000
@@ -105,12 +105,18 @@
   "A regular expression probably matching an e-mail address.")
 
 (defvar goto-address-url-regexp
-  (concat "\\<\\("
-	  (mapconcat 'identity
-		     (delete "mailto:" (copy-sequence thing-at-point-uri-schemes))
-		     "\\|")
-	  "\\)"
-          thing-at-point-url-path-regexp)
+  (concat
+   "\\<\\("
+   (mapconcat 'identity
+              (delete "mailto:"
+		      ;; Remove `data:', as it's not terribly useful to follow
+		      ;; those.  Leaving them causes `use Data::Dumper;' to be
+		      ;; fontified oddly in Perl files.
+                      (delete "data:"
+                              (copy-sequence thing-at-point-uri-schemes)))
+              "\\|")
+   "\\)"
+   thing-at-point-url-path-regexp)
   ;; (concat "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|"
   ;; 	  "telnet\\|wais\\):\\(//[-a-zA-Z0-9_.]+:"
   ;; 	  "[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*"
--- a/lisp/net/newsticker.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/net/newsticker.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1,4 +1,4 @@
-;;; newsticker.el --- A news-ticker for Emacs.
+;;; newsticker.el --- A Newsticker for Emacs.
 
 ;; Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
 
@@ -8,7 +8,10 @@
 ;; Filename:    newsticker.el
 ;; URL:         http://www.nongnu.org/newsticker
 ;; Created:     17. June 2003
-;; Keywords:    News, RSS
+;; Keywords:    News, RSS, Atom
+;; Time-stamp:  "1. November 2005, 21:16:53 (ulf)"
+
+;; ======================================================================
 
 ;; 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
@@ -24,30 +27,41 @@
 ;; along with this program; if not, write to the Free Software Foundation,
 ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
-(defconst newsticker-version "1.8" "Version number of newsticker.el.")
+(defconst newsticker-version "1.9" "Version number of newsticker.el.")
 
 ;; ======================================================================
-
 ;;; Commentary:
 
 ;; Overview
 ;; --------
 
-;; Newsticker provides a newsticker for Emacs. A newsticker is a thing that
-;; asynchronously retrieves headlines from a list of news sites, prepares
-;; these headlines for reading, and allows for loading the corresponding
-;; articles in a web browser.
-
-;; Headlines consist of a title and (possibly) a small description. They
-;; are contained in RSS (RDF Site Summary) files. Newsticker should work
-;; with all RSS files that follow the RDF Rich Site Summary 1.0
-;; specification. It should also work with version 2.0 as well as
-;; other/older/alternative RSS formats (like 0.9<something> or such). In
-;; other words: Newsticker is a "RSS reader" or "RSS aggregator".
+;; Newsticker provides a newsticker for Emacs.  A newsticker is a thing
+;; that asynchronously retrieves headlines from a list of news sites,
+;; prepares these headlines for reading, and allows for loading the
+;; corresponding articles in a web browser.
+
+;; Headlines consist of a title and (possibly) a small description.  They
+;; are contained in "RSS" (RDF Site Summary) or "Atom" files.  Newsticker
+;; should work with the following RSS formats:
+;;  * RSS 0.91
+;;    (see http://backend.userland.com/rss091 or
+;;    http://my.netscape.com/publish/formats/rss-spec-0.91.html)
+;;  * RSS 0.92
+;;    (see http://backend.userland.com/rss092)
+;;  * RSS 1.0
+;;    (see http://purl.org/rss/1.0/spec)
+;;  * RSS 2.0
+;;    (see http://blogs.law.harvard.edu/tech/rss)
+;; as well as the following Atom formats:
+;;  * Atom 0.3
+;;  * Atom 1.0
+;;    (see http://www.ietf.org/internet-drafts/draft-ietf-atompub-format-11.txt)
+;; That makes Newsticker.el an "Atom aggregator, "RSS reader", "RSS
+;; aggregator", and "Feed Reader".
 
 ;; Newsticker provides several commands for reading headlines, navigating
 ;; through them, marking them as read/unread, hiding old headlines
-;; etc. Headlines can be displayed as plain text or as rendered HTML.
+;; etc.  Headlines can be displayed as plain text or as rendered HTML.
 
 ;; Headlines can be displayed in the echo area, either scrolling like
 ;; messages in a stock-quote ticker, or just changing.
@@ -56,36 +70,52 @@
 ;; hooks and (sample) functions for automatically downloading images and
 ;; enclosed files (as delivered by podcasts, e.g.).
 
-
-
 ;; Requirements
 ;; ------------
-;; Newsticker can be used with Emacs version 21.1 or later as well as
-;; XEmacs. It requires an XML-parser (`xml.el') which is part of
-;; Emacs. If you are using XEmacs you want to get the `net-utils' package
+;; Newsticker can be used with GNU Emacs version 21.1 or later as well as
+;; XEmacs.  It requires an XML-parser (`xml.el') which is part of GNU
+;; Emacs.  If you are using XEmacs you want to get the `net-utils' package
 ;; which contains `xml.el' for XEmacs.
 
 ;; Newsticker requires a program which can retrieve files via http and
-;; prints them to stdout. By default Newsticker will use wget for this
+;; prints them to stdout.  By default Newsticker will use wget for this
 ;; task.
 
+;; Installation
+;; ------------
+
+;; If you are using Newsticker as part of GNU Emacs there is no need to
+;; perform any installation steps in order to use Newsticker.  Otherwise
+;; place Newsticker in a directory where Emacs can find it.  Add the
+;; following line to your Emacs startup file (`~/.emacs').
+;;   (add-to-list 'load-path "/path/to/newsticker/")
+;;   (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t)
+;;   (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t)
+
+;; If you are using `imenu', which allows for navigating with the help of a
+;; menu, you should add the following to your Emacs startup file
+;; (`~/.emacs').
+;;   (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
+
+;; That's it.
+
 ;; Usage
 ;; -----
 ;; The command newsticker-show-news will display all available headlines in
-;; a special buffer, called `*newsticker*'. It will also start the
-;; asynchronous download of headlines. The modeline in the `*newsticker*'
-;; buffer informs whenever new headlines have arrived. Clicking
+;; a special buffer, called `*newsticker*'.  It will also start the
+;; asynchronous download of headlines.  The modeline in the `*newsticker*'
+;; buffer informs whenever new headlines have arrived.  Clicking
 ;; mouse-button 2 or pressing RET in this buffer on a headline will call
 ;; browse-url to load the corresponding news story in your favourite web
 ;; browser.
 
 ;; The scrolling, or flashing of headlines in the echo area, can be started
-;; with the command newsticker-start-ticker. It can be stopped with
+;; with the command newsticker-start-ticker.  It can be stopped with
 ;; newsticker-stop-ticker.
 
 ;; If you just want to start the periodic download of headlines use the
-;; command newsticker-start. Calling newsticker-stop will stop the periodic
-;; download, but will call newsticker-stop-ticker as well.
+;; command newsticker-start.  Calling newsticker-stop will stop the
+;; periodic download, but will call newsticker-stop-ticker as well.
 
 ;; Configuration
 ;; -------------
@@ -110,7 +140,7 @@
 ;;   o newsticker-keep-obsolete-items decides whether unread headlines that
 ;;     have been removed from the feed are kept in the Newsticker cache.
 ;; * newsticker-layout contains options that define how the buffer for
-;;   reading RSS headlines is formatted.
+;;   reading news headlines is formatted.
 ;;   o newsticker-item-format defines how the title of a headline is
 ;;     formatted.
 ;; * newsticker-ticker contains options that define how headlines are shown
@@ -120,7 +150,7 @@
 ;; * newsticker-hooks contains options for hooking other Emacs commands to
 ;;   newsticker functions.
 ;;   o newsticker-new-item-functions allows for automatic processing of
-;;     headlines. See `newsticker-download-images', and
+;;     headlines.  See `newsticker-download-images', and
 ;;     `newsticker-download-enclosures' for sample functions.
 ;; * newsticker-miscellaneous contains other Newsticker options.
 
@@ -134,14 +164,30 @@
 ;; such a tool from slightly attenuating your Editor's responsiveness every
 ;; once in a while.
 
-;; Newsticker-mode supports imenu. It allows for navigating with the help
-;; of a menu. In order to use this feature you should also add the
-;; following.
-;;   (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
+;; Byte-compiling newsticker.el is recommended.
 
 ;; ======================================================================
 ;;; History:
 
+;; 1.9 (2005-11-01)
+;;     * Rewrote feed parsing part.  Newsticker now supports RSS 0.91,
+;;       0.92, 1.0, 2.0 as well as Atom 0.3 and 1.0 -- thanks to Thien-Thi
+;;       Nguyen.
+;;     * Changed auto-marking mechanism: Replaced variable
+;;       `newsticker-auto-mark-filter' with new variable
+;;       `newsticker-auto-mark-filter-list', which allows for looking not
+;;       only at the title but also at the description of a headline.
+;;     * Call `newsticker--ticker-text-setup' only after all pending
+;;       downloads processes have finished.
+;;     * Improved handling of coding systems.
+;;     * Added magic autoload comments.
+;;     * Bugfixes:
+;;       - `hide-entry' was hiding too much when called for the last
+;;          headline,
+;;       - update mode-line and menu-bar when necessary,
+;;       - repaired `newsticker--imenu-goto',
+;;       - other minor things.
+
 ;; 1.8 (2005-08-26)
 ;;     * Added commands `newsticker-show-extra' and `newsticker-hide-extra'
 ;;       to show and hide extra RSS elements, bound to "sx" and "hx"
@@ -156,7 +202,8 @@
 ;;     * Tool-bar support: most important commands can be called from
 ;;       tool-bar buttons.
 ;;     * Auto-Narrowing introduced: *newsticker* buffer can be narrowed to
-;;       a single item (bound to key `xi') or a single feed (bound to `xf').
+;;       a single item (bound to key `xi') or a single feed (bound to
+;;       `xf').
 ;;     * Enclosure support: enclosed items are shown (see
 ;;       `newsticker-enclosure-face') and can be (automatically) downloaded
 ;;       (see below). For those of you who read "podcasts".
@@ -179,25 +226,27 @@
 ;;     * Better support for w3, added command
 ;;       `newsticker-w3m-show-inline-images' for displaying all inline
 ;;       images.
-;;     * Insert an artificial headline which notifies about failed retrievals.
+;;     * Insert an artificial headline which notifies about failed
+;;       retrievals.
 ;;     * Use pubDate element (RSS 2.0) instead of retrieval time when
 ;;       available.
 ;;     * Customizable options grouped.
 ;;     * Bugfixes: `newsticker--imenu-create-index'; strip whitespace
 ;;       from links; apply coding-system to extra-elements; time-comparison
 ;;       for obsolete items; and others which I have forgotten.
-;;     * Workaround for another bug in xml-parse-region -- thanks to anonymous
-;;       for sending patch.
+;;     * Workaround for another bug in xml-parse-region -- thanks to
+;;       anonymous for sending patch.
 ;;     * Renamed invisible buffers ` *wget-newsticker-<feed>*' to
 ;;       ` *newsticker-wget-<feed>*'.
-;;     * Tested with Emacs versions 21.3 and 22.0 and XEmacs 21.something.
+;;     * Tested with GNU Emacs versions 21.3 and 22.0 and XEmacs
+;;       21.something.
 
 ;; 1.6 * Support for (some) optional RSS elements: guid, dc:date. See
 ;;       `newsticker-show-all-rss-elements' `newsticker-extra-face'.
 ;;     * Better support for w3m -- `newsticker-default-face' is obsolete
 ;;       now, removed `newsticker-w3m-toggle-inline-image'.
-;;     * Added `newsticker-desc-comp-max' -- comparison of item descriptions
-;;       can take quite some time.
+;;     * Added `newsticker-desc-comp-max' -- comparison of item
+;;       descriptions can take quite some time.
 ;;     * Added `newsticker--buffer-make-item-completely-visible' to
 ;;       ensure that the current item is fully visible.
 ;;     * Allow for non-positive retrieval-interval, which make newsticker
@@ -346,7 +395,7 @@
 ;;; Customizables
 ;; ======================================================================
 (defgroup newsticker nil
-  "RSS aggregator."
+  "Aggregator for RSS and Atom feeds."
   :group 'applications)
 
 (defconst newsticker--raw-url-list-defaults
@@ -476,7 +525,7 @@
 
 ;; customization group feed
 (defgroup newsticker-feed nil
-  "Settings for the RSS feeds."
+  "Settings for news feeds."
   :group 'newsticker)
 
 (defcustom newsticker-url-list-defaults
@@ -506,7 +555,7 @@
 The LABEL gives the name of the news feed.  It can be an arbitrary string.
 
 The URL gives the location of the news feed.  It must point to a valid
-RSS file.  The RSS file is retrieved by calling wget, or whatever you
+RSS or Atom file.  The file is retrieved by calling wget, or whatever you
 specify as `newsticker-wget-name'.
 
 The START-TIME can be either a string, or nil.  If it is a string it
@@ -535,6 +584,7 @@
                                (const   :tag "Default" nil)
                                (const   :tag "Hourly" 3600)
                                (const   :tag "Daily" 86400)
+                               (const   :tag "Weekly" 604800)
                                (integer :tag "Interval"))
                        (choice :tag "Wget Arguments"
                                (const  :tag "Default arguments" nil)
@@ -569,6 +619,7 @@
                  (const   :tag "No automatic retrieval" 0)
                  (const   :tag "Hourly" 3600)
                  (const   :tag "Daily" 86400)
+                 (const   :tag "Weekly" 604800)
                  (integer :tag "Interval"))
   :set 'newsticker--set-customvar
   :group 'newsticker-feed)
@@ -584,7 +635,7 @@
 
 ;; customization group behaviour
 (defgroup newsticker-headline-processing nil
-  "Settings for the automatic processing of RSS headlines."
+  "Settings for the automatic processing of headlines."
   :group 'newsticker)
 
 (defcustom newsticker-automatically-mark-items-as-old
@@ -623,40 +674,51 @@
   :type 'integer
   :group 'newsticker-headline-processing)
 
-(defcustom newsticker-auto-mark-filter
+(defcustom newsticker-auto-mark-filter-list
   nil
-  "A filter for automatically marking headlines.
-
-This is an alist of the form (FEED-NAME OLD-LIST IMMORTAL-LIST).  I.e. each
-element consists of a FEED-NAME and two lists.  Each list consists a set of
-regular expressions.  The first list contains patterns of headlines which
-will be marked as old.  The second list contains patterns of headlines which
-will be marked as immortal.
-
-This filter is checked after a new headline has been retrieved.  If
-FEED-NAME matches the name of the corresponding news feed, both sublists
-are checked: If the title of the headline matches any of the regular
-expressions in OLD-LIST, this headline is marked as old, if it matches any
-of the expressions in IMMORTAL-LIST it is marked as immortal.
-
-If, for example, `newsticker-auto-mark-filter' looks like
- \((slashdot (\"^Forget me!$\") (\"^Read me$\" \"important\")))
-then all articles from slashdot are marked as old if they have the title
-\"Forget me!\".  All articles which have the title \"Read me\" and all
-articles which contain the string \"important\" in their title are marked
-as immortal."
-  :type '(repeat (list :tag "Feed filter rule"
+  "A list of filters for automatically marking headlines.
+
+This is an alist of the form (FEED-NAME PATTERN-LIST).  I.e. each
+element consists of a FEED-NAME a PATTERN-LIST.  Each element of
+the pattern-list has the form (AGE TITLE-OR-DESCRIPTION REGEXP).
+AGE must be one of the symbols 'old or 'immortal.
+TITLE-OR-DESCRIPTION must be on of the symbols 'title,
+'description, or 'all.  REGEXP is a regular expression, i.e. a
+string.
+
+This filter is checked after a new headline has been retrieved.
+If FEED-NAME matches the name of the corresponding news feed, the
+pattern-list is checked: The new headline will be marked as AGE
+if REGEXP matches the headline's TITLE-OR-DESCRIPTION.
+
+If, for example, `newsticker-auto-mark-filter-list' looks like
+ \((slashdot ('old 'title \"^Forget me!$\") ('immortal 'title \"Read me\")
+  \('immortal 'all \"important\"))))
+
+then all articles from slashdot are marked as old if they have
+the title \"Forget me!\".  All articles with a title containing
+the string \"Read me\" are marked as immortal.  All articles which
+contain the string \"important\" in their title or their
+description are marked as immortal."
+  :type '(repeat (list :tag "Auto mark filter"
                        (string :tag "Feed name")
-                       ;;(choice ,@(mapcar (lambda (i)
-                         ;;                  (list :tag (car i) (car i)))
-                           ;;              newsticker-url-list))
-                       (repeat :tag "Mark as old" string)
-                       (repeat :tag "Mark as immortal" string)))
+                       (repeat
+                        (list :tag "Filter element"
+                              (choice
+                               :tag "Auto-assigned age"
+                               (const :tag "Old" old)
+                               (const :tag "Immortal" immortal))
+                              (choice
+                               :tag "Title/Description"
+                               (const :tag "Title" title)
+                               (const :tag "Description" description)
+                               (const :tag "All" all))
+                              (string :tag "Regexp")))))
   :group 'newsticker-headline-processing)
 
 ;; customization group layout
 (defgroup newsticker-layout nil
-  "Settings for layout of the RSS reader."
+  "Settings for layout of the feed reader."
   :group 'newsticker)
 
 (defcustom newsticker-sort-method
@@ -664,7 +726,7 @@
   "Sort method for news items.
 The following sort methods are available:
 * `sort-by-original-order' keeps the order in which the items
-  appear in the RSS file (please note that for immortal items,
+  appear in the headline file (please note that for immortal items,
   which have been removed from the news feed, there is no original
   order),
 * `sort-by-time' looks at the time at which an item has been seen
@@ -680,9 +742,9 @@
 (defcustom newsticker-hide-old-items-in-newsticker-buffer
   nil
   "Decides whether to automatically hide old items in the *newsticker* buffer.
-If set to t old items will be completely folded and only new items
-will show up in the *newsticker* buffer.  Otherwise old as well as new
-items will be visible."
+If set to t old items will be completely folded and only new
+items will show up in the *newsticker* buffer.  Otherwise old as
+well as new items will be visible."
   :type 'boolean
   :set 'newsticker--set-customvar
   :group 'newsticker-layout)
@@ -702,7 +764,7 @@
   "Format string for feed headings.
 The following printf-like specifiers can be used:
 %d  The date the feed was retrieved.  See `newsticker-date-format'.
-%l  The logo (image) of the feed.  Most RSS feeds provide a small
+%l  The logo (image) of the feed.  Most news feeds provide a small
     image as logo.  Newsticker can display them, if Emacs can --
     see `image-types' for a list of supported image types.
 %L  The logo (image) of the feed.  If the logo is not available
@@ -718,7 +780,7 @@
   "Format string for news item headlines.
 The following printf-like specifiers can be used:
 %d  The date the item was (first) retrieved.  See `newsticker-date-format'.
-%l  The logo (image) of the feed.  Most RSS feeds provide a small
+%l  The logo (image) of the feed.  Most news feeds provide a small
     image as logo.  Newsticker can display them, if Emacs can --
     see `image-types' for a list of supported image types.
 %L  The logo (image) of the feed.  If the logo is not available
@@ -733,7 +795,8 @@
   "Format string for news descriptions (contents).
 The following printf-like specifiers can be used:
 %c  The contents (description) of the item.
-%d  The date the item was (first) retrieved.  See `newsticker-date-format'."
+%d  The date the item was (first) retrieved.  See
+    `newsticker-date-format'."
   :type 'string
   :set 'newsticker--set-customvar
   :group 'newsticker-layout)
@@ -759,9 +822,9 @@
   :set 'newsticker--set-customvar
   :group 'newsticker-layout)
 
-(defcustom newsticker-show-all-rss-elements
+(defcustom newsticker-show-all-news-elements
   nil
-  "Show all RSS elements."
+  "Show all news elements."
   :type 'boolean
   ;;:set 'newsticker--set-customvar
   :group 'newsticker-layout)
@@ -835,7 +898,7 @@
 
 ;; faces
 (defgroup newsticker-faces nil
-  "Settings for the faces of the RSS reader."
+  "Settings for the faces of the feed reader."
   :group 'newsticker-layout)
 
 (defface newsticker-feed-face
@@ -922,7 +985,7 @@
 
 ;; customization group ticker
 (defgroup newsticker-ticker nil
-  "Settings for the RSS ticker."
+  "Settings for the headline ticker."
   :group 'newsticker)
 
 (defcustom newsticker-display-interval
@@ -1119,7 +1182,8 @@
   (defun remove-from-invisibility-spec (arg)
     "Remove elements from `buffer-invisibility-spec'."
     (if (consp buffer-invisibility-spec)
-        (setq buffer-invisibility-spec (delete arg buffer-invisibility-spec)))))
+        (setq buffer-invisibility-spec
+              (delete arg buffer-invisibility-spec)))))
 
 ;; ======================================================================
 ;;; Internal variables
@@ -1141,6 +1205,8 @@
   "Tells whether the newsticker buffer is up to date.")
 (defvar newsticker--latest-update-time (current-time)
   "The time at which the latest news arrived.")
+(defvar newsticker--process-ids nil
+  "List of PIDs of active newsticker processes.")
 
 (defvar newsticker--cache nil "Cached newsticker data.
 This is a list of the form
@@ -2119,7 +2185,7 @@
 
 (define-derived-mode newsticker-mode fundamental-mode
   "NewsTicker"
-  "Viewing RSS news feeds in Emacs."
+  "Viewing news feeds in Emacs."
   (set (make-local-variable 'tool-bar-map) newsticker-tool-bar-map)
   (set (make-local-variable 'imenu-sort-function) nil)
   (set (make-local-variable 'scroll-conservatively) 999)
@@ -2139,12 +2205,14 @@
               '(newsticker--buffer-uptodate-p
                 "up to date"
                 "NEED UPDATE")
-              ") -- "
+              ") "
+              '(:eval (format "[%d]" (length newsticker--process-ids)))
+              " -- "
               '(:eval (newsticker--buffer-get-feed-title-at-point))
               ": "
               '(:eval (newsticker--buffer-get-item-title-at-point))
               " %-"))
-  (unless newsticker-show-all-rss-elements
+  (unless newsticker-show-all-news-elements
     (add-to-invisibility-spec 'extra))
   (newsticker--buffer-set-uptodate nil))
 
@@ -2176,7 +2244,8 @@
 (define-key newsticker-mode-map "M"  'newsticker-mark-all-items-as-read)
 (define-key newsticker-mode-map "m"
   'newsticker-mark-all-items-at-point-as-read)
-(define-key newsticker-mode-map "o"  'newsticker-mark-item-at-point-as-read)
+(define-key newsticker-mode-map "o"
+  'newsticker-mark-item-at-point-as-read)
 (define-key newsticker-mode-map "G"  'newsticker-get-all-news)
 (define-key newsticker-mode-map "g"  'newsticker-get-news-at-point)
 (define-key newsticker-mode-map "u"  'newsticker-buffer-update)
@@ -2186,8 +2255,10 @@
 (define-key newsticker-mode-map "i"
   'newsticker-mark-item-at-point-as-immortal)
 
-(define-key newsticker-mode-map "xf" 'newsticker-toggle-auto-narrow-to-feed)
-(define-key newsticker-mode-map "xi" 'newsticker-toggle-auto-narrow-to-item)
+(define-key newsticker-mode-map "xf"
+  'newsticker-toggle-auto-narrow-to-feed)
+(define-key newsticker-mode-map "xi"
+  'newsticker-toggle-auto-narrow-to-item)
 
 ;; maps for the clickable portions
 (defvar newsticker--url-keymap (make-sparse-keymap)
@@ -2336,7 +2407,7 @@
                 (if (or (not start-time)
                         (and (numberp start-time) (= start-time 0)))
                     (setq start-time 1))
-                (message "start-time %s" start-time)
+                ;; (message "start-time %s" start-time)
                 (setq timer (run-at-time start-time interval
                                          'newsticker-get-news feed-name))
                 (if interval
@@ -2347,8 +2418,9 @@
       (run-hooks 'newsticker-start-hook)
       (message "Newsticker started!"))))
 
+;;;###autoload
 (defun newsticker-start-ticker ()
-  "Start newsticker's ticker (but not the news retrieval.
+  "Start newsticker's ticker (but not the news retrieval).
 Start display timer for the actual ticker if wanted and not
 running already."
   (interactive)
@@ -2506,11 +2578,13 @@
                   (goto-char pos)
                   (when (get-text-property pos 'w3m-image)
                     (let ((invis (newsticker--lists-intersect-p
-                                  (get-text-property (1- (point)) 'invisible)
+                                  (get-text-property (1- (point))
+                                                     'invisible)
                                   buffer-invisibility-spec)))
                       (if invis
                           (w3m-remove-image
-                           pos (next-single-property-change pos 'w3m-image))
+                           pos (next-single-property-change pos
+                                                            'w3m-image))
                         (w3m-toggle-inline-image t))))))))))))
 
 ;; ======================================================================
@@ -2588,6 +2662,7 @@
 		    buffer-invisibility-spec)
 	(setq go-ahead nil))))
   (run-hooks 'newsticker-select-item-hook)
+  (force-mode-line-update)
   (point))
 
 (defun newsticker-previous-item (&optional do-not-wrap-at-bob)
@@ -2614,6 +2689,7 @@
         (goto-char (point-min))
         (setq go-ahead nil))))
   (run-hooks 'newsticker-select-item-hook)
+  (force-mode-line-update)
   (point))
 
 (defun newsticker-next-feed ()
@@ -2623,6 +2699,7 @@
   (widen)
   (newsticker--buffer-goto '(feed))
   (run-hooks 'newsticker-select-feed-hook)
+  (force-mode-line-update)
   (point))
 
 (defun newsticker-previous-feed ()
@@ -2632,6 +2709,7 @@
   (widen)
   (newsticker--buffer-goto '(feed) nil t)
   (run-hooks 'newsticker-select-feed-hook)
+  (force-mode-line-update)
   (point))
 
 (defun newsticker-mark-all-items-at-point-as-read ()
@@ -2645,7 +2723,8 @@
       (when feed
         (message "Marking all items as read for %s" (symbol-name feed))
         (newsticker--cache-replace-age newsticker--cache feed 'new 'old)
-        (newsticker--cache-replace-age newsticker--cache feed 'obsolete 'old)
+        (newsticker--cache-replace-age newsticker--cache feed 'obsolete
+                                       'old)
         (newsticker--cache-update)
         (newsticker--buffer-set-uptodate nil)
         (newsticker--ticker-text-setup)
@@ -2846,7 +2925,6 @@
 (defun newsticker-show-old-items ()
   "Show old items."
   (interactive)
-  (newsticker--buffer-hideshow 'desc-old t)
   (newsticker--buffer-hideshow 'item-old t)
   (newsticker--buffer-redraw))
 
@@ -2861,7 +2939,7 @@
       (newsticker--buffer-beginning-of-item)
       (newsticker--buffer-goto '(desc))
       (setq pos1 (max (point-min) (1- (point))))
-      (newsticker--buffer-goto '(extra feed item))
+      (newsticker--buffer-goto '(extra feed item nil))
       (setq pos2 (max (point-min) (1- (point))))
       (setq inv-prop (get-text-property pos1 'invisible))
       (setq org-inv-prop (get-text-property pos1 'org-invisible))
@@ -2869,11 +2947,13 @@
              ;; do nothing
              )
             ((eq org-inv-prop nil)
-             (add-text-properties pos1 pos2 (list 'invisible t
-                                                  'org-invisible inv-prop)))
+             (add-text-properties pos1 pos2
+                                  (list 'invisible t
+                                        'org-invisible inv-prop)))
             (t
              ;; toggle
-             (add-text-properties pos1 pos2 (list 'invisible org-inv-prop))
+             (add-text-properties pos1 pos2
+                                  (list 'invisible org-inv-prop))
              (remove-text-properties pos1 pos2 '(org-invisible))))))
   (newsticker--buffer-redraw))
 
@@ -2893,11 +2973,13 @@
       (setq inv-prop (get-text-property pos1 'invisible))
       (setq org-inv-prop (get-text-property pos1 'org-invisible))
       (cond ((eq org-inv-prop nil)
-             (add-text-properties pos1 pos2 (list 'invisible nil
-                                                  'org-invisible inv-prop)))
+             (add-text-properties pos1 pos2
+                                  (list 'invisible nil
+                                        'org-invisible inv-prop)))
             (t
              ;; toggle
-             (add-text-properties pos1 pos2 (list 'invisible org-inv-prop))
+             (add-text-properties pos1 pos2
+                                  (list 'invisible org-inv-prop))
              (remove-text-properties pos1 pos2 '(org-invisible))))))
   (newsticker--buffer-redraw))
 
@@ -2906,7 +2988,8 @@
 If auto-narrowing is active, only news item of the current feed
 are visible."
   (interactive)
-  (newsticker-set-auto-narrow-to-feed (not newsticker--auto-narrow-to-feed)))
+  (newsticker-set-auto-narrow-to-feed
+   (not newsticker--auto-narrow-to-feed)))
 
 (defun newsticker-set-auto-narrow-to-feed (value)
   "Turn narrowing to current news feed on or off.
@@ -2915,6 +2998,7 @@
   (setq newsticker--auto-narrow-to-item nil)
   (setq newsticker--auto-narrow-to-feed value)
   (widen)
+  (newsticker--buffer-make-item-completely-visible)
   (run-hooks 'newsticker-narrow-hook))
 
 (defun newsticker-toggle-auto-narrow-to-item ()
@@ -2922,7 +3006,8 @@
 If auto-narrowing is active, only one item of the current feed
 is visible."
   (interactive)
-  (newsticker-set-auto-narrow-to-item (not newsticker--auto-narrow-to-item)))
+  (newsticker-set-auto-narrow-to-item
+   (not newsticker--auto-narrow-to-item)))
 
 (defun newsticker-set-auto-narrow-to-item (value)
   "Turn narrowing to current news item on or off.
@@ -2931,6 +3016,7 @@
   (setq newsticker--auto-narrow-to-feed nil)
   (setq newsticker--auto-narrow-to-item value)
   (widen)
+  (newsticker--buffer-make-item-completely-visible)
   (run-hooks 'newsticker-narrow-hook))
 
 (defun newsticker-customize ()
@@ -2993,14 +3079,16 @@
           (and (memq  age '(new old obsolete)) t)))))
 
 ;; ======================================================================
-;;; local stuff
+;;; Newsticker status
 ;; ======================================================================
+;;;###autoload
 (defun newsticker-running-p ()
   "Check whether newsticker is running.
 Return t if newsticker is running, nil otherwise.  Newsticker is
 considered to be running if the newsticker timer list is not empty."
   (> (length newsticker--retrieval-timer-list) 0))
 
+;;;###autoload
 (defun newsticker-ticker-running-p ()
   "Check whether newsticker's actual ticker is running.
 Return t if ticker is running, nil otherwise.  Newsticker is
@@ -3038,8 +3126,10 @@
              (proc (apply 'start-process feed-name buffername
                           newsticker-wget-name args)))
         (set-process-coding-system proc 'no-conversion 'no-conversion)
-        (set-process-sentinel proc 'newsticker--sentinel)))))
-
+        (set-process-sentinel proc 'newsticker--sentinel)
+        (setq newsticker--process-ids (cons (process-id proc)
+                                            newsticker--process-ids))
+        (force-mode-line-update)))))
 
 (defun newsticker-mouse-browse-url (event)
   "Call `browse-url' for the link of the item at which the EVENT occurred."
@@ -3115,7 +3205,7 @@
                  (format-time-string "%A, %H:%M" (current-time))
                  (process-name process))
         (throw 'oops nil))
-      (let* ((coding-system nil)
+      (let* ((coding-system 'utf-8)
              (node-list
               (save-current-buffer
                 (set-buffer (process-buffer process))
@@ -3160,11 +3250,23 @@
                     "<description><![CDATA[ \\1 ]]></description>"))
                 ;;
                 (set-buffer-modified-p nil)
+                ;; check coding system
                 (goto-char (point-min))
                 (if (re-search-forward "encoding=\"\\([^\"]+\\)\""
                                        nil t)
-                    (setq coding-system (intern
-                                         (downcase(match-string 1)))))
+                    (setq coding-system (intern (downcase (match-string 1))))
+                  (setq coding-system
+                        (condition-case nil
+                              (check-coding-system coding-system)
+                          (coding-system-error
+                           (message
+                            "newsticker.el: ignoring coding system %s for %s"
+                            coding-system name)
+                           nil))))
+                ;; Decode if possible
+                (when coding-system
+                  (decode-coding-region (point-min) (point-max)
+                                        coding-system))
                 (condition-case errordata
                     ;; The xml parser might fail
                     ;; or the xml might be bugged
@@ -3174,8 +3276,7 @@
                          (throw 'oops nil)))))
              (topnode (car node-list))
              (channelnode (car (xml-get-children topnode 'channel)))
-             (imageurl nil)
-             (position 0))
+             (imageurl nil))
         ;; mark all items as obsolete
         (newsticker--cache-replace-age newsticker--cache
                                        name-symbol
@@ -3186,171 +3287,49 @@
         (newsticker--cache-replace-age newsticker--cache
                                        name-symbol
                                        'feed 'obsolete-old)
-        ;; gather the news
-        (if (eq (xml-node-name topnode) 'rss)
-            ;; this is RSS 0.91 or something similar
-            ;; all items are inside the channel node
-            (setq topnode channelnode))
-        (setq imageurl
-              (car (xml-node-children
-                    (car (xml-get-children
-                          (car (xml-get-children
-                                topnode
-                                'image))
-                          'url)))))
-        (let ((title (or (car (xml-node-children (car (xml-get-children
-                                                       channelnode 'title))))
-                         "[untitled]"))
-              (link (or (car (xml-node-children (car (xml-get-children
-                                                      channelnode 'link))))
-                        ""))
-              (desc (or (car (xml-node-children (car (xml-get-children
-                                                      channelnode
-                                                      'content:encoded))))
-                        (car (xml-node-children (car (xml-get-children
-                                                      channelnode
-                                                      'description))))
-                        "[No description available]"))
-              (old-item nil))
-          ;; check coding system
-          (setq coding-system
-                (condition-case nil
-                    (check-coding-system coding-system)
-                  (coding-system-error
-                   (message "newsticker.el: %s %s %s %s"
-                            "ignoring coding system "
-                            coding-system
-                            " for "
-                            name)
-                   nil)))
-          ;; apply coding system
-          (when coding-system
-            (setq title (newsticker--decode-coding-string title coding-system))
-            (if desc
-                (setq desc (newsticker--decode-coding-string desc
-                                                             coding-system)))
-            (setq link (newsticker--decode-coding-string link coding-system)))
-          ;; decode numeric entities
-          (setq title (newsticker--decode-numeric-entities title))
-          (setq desc  (newsticker--decode-numeric-entities desc))
-          (setq link  (newsticker--decode-numeric-entities link))
-          ;; remove whitespace from title, desc, and link
-          (setq title (newsticker--remove-whitespace title))
-          (setq desc (newsticker--remove-whitespace desc))
-          (setq link (newsticker--remove-whitespace link))
-
-          ;; handle the feed itself
-          (unless (newsticker--cache-contains newsticker--cache
-                                              name-symbol title
-                                              desc link 'feed)
-            (setq something-was-added t))
-          (setq newsticker--cache
-                (newsticker--cache-add
-                 newsticker--cache name-symbol
-                 title desc link time 'feed position
-                 (xml-node-children channelnode)
-                 'feed time))
-          ;; gather all items for this feed
-          (mapc (lambda (node)
-                  (when (eq (xml-node-name node) 'item)
-                    (setq position (1+ position))
-                    (setq title (or (car (xml-node-children
-                                          (car (xml-get-children
-                                                node 'title))))
-                                    "[untitled]"))
-                    (setq link (or (car (xml-node-children
-                                         (car (xml-get-children
-                                               node 'link))))
-                                   ""))
-                    (setq desc (or
-                                (car (xml-node-children
-                                      (car (xml-get-children
-                                            node 'content:encoded))))
-                                (car (xml-node-children
-                                      (car (xml-get-children
-                                            node 'description))))))
-                    ;; use pubDate value if present
-                    (setq time (or (newsticker--decode-rfc822-date
-                                    (car (xml-node-children
-                                          (car (xml-get-children
-                                                node 'pubDate)))))
-                                   time))
-                    ;; use dc:date value if present
-                    (setq time (or (newsticker--decode-iso8601-date
-                                    (car (xml-node-children
-                                          (car (xml-get-children
-                                                node 'dc:date)))))
-                                   time))
-                    ;; It happened that the title or description
-                    ;; contained evil HTML code that confused the
-                    ;; xml parser.  Therefore:
-                    (unless (stringp title)
-                      (setq title (prin1-to-string title)))
-                    (unless (or (stringp desc) (not desc))
-                      (setq desc (prin1-to-string desc)))
-                    ;; ignore items with empty title AND empty desc
-                    (when (or (> (length title) 0)
-                              (> (length desc) 0))
-                      ;; apply coding system
-                      (when coding-system
-                        (setq title (newsticker--decode-coding-string
-                                     title coding-system))
-                        (if desc
-                            (setq desc (newsticker--decode-coding-string desc
-                                                             coding-system)))
-                        (setq link (newsticker--decode-coding-string
-                                    link coding-system)))
-                      ;; decode numeric entities
-                      (setq title (newsticker--decode-numeric-entities title))
-                      (when desc
-                        (setq desc  (newsticker--decode-numeric-entities desc)))
-                      (setq link (newsticker--decode-numeric-entities link))
-                      ;; remove whitespace from title, desc, and link
-                      (setq title (newsticker--remove-whitespace title))
-                      (setq desc (newsticker--remove-whitespace desc))
-                      (setq link (newsticker--remove-whitespace link))
-                      ;; add data to cache
-                      ;; do we have this item already?
-                      (let* ((tguid (assoc 'guid (xml-node-children node)))
-                             (guid (if (stringp tguid)
-                                       tguid
-                                     (car (xml-node-children tguid)))))
-                        ;;(message "guid=%s" guid)
-                        (setq old-item
-                              (newsticker--cache-contains newsticker--cache
-                                                          name-symbol title
-                                                          desc link nil guid)))
-                      ;; add this item, or mark it as old, or do nothing
-                      (let ((age1 'new)
-                            (age2 'old)
-                            (item-new-p nil))
-                        (if old-item
-                            (let ((prev-age (newsticker--age old-item)))
-                              (unless
-                                  newsticker-automatically-mark-items-as-old
-                                (if (eq prev-age 'obsolete-old)
-                                    (setq age2 'old)
-                                  (setq age2 'new)))
-                              (if (eq prev-age 'immortal)
-                                  (setq age2 'immortal)))
-                          ;; item was not there
-                          (setq item-new-p t)
-                          (setq something-was-added t))
-                        (setq newsticker--cache
-                              (newsticker--cache-add
-                               newsticker--cache name-symbol title desc link
-                               time age1 position (xml-node-children node)
-                               age2))
-                        (when item-new-p
-                          (let ((item (newsticker--cache-contains
-                                       newsticker--cache
-                                       name-symbol title
-                                       desc link nil)))
-                            (if newsticker-auto-mark-filter
-                                (newsticker--run-auto-mark-filter name item))
-                            (run-hook-with-args
-                             'newsticker-new-item-functions name item)))))))
-                (xml-get-children topnode 'item)))
+        
+        ;; check Atom/RSS version and call corresponding parser
+        (condition-case error-data
+            (if (cond
+                 ;; RSS 0.91
+                 ((and (eq 'rss (xml-node-name topnode))
+                       (string= "0.91" (xml-get-attribute topnode 'version)))
+                  (setq imageurl (newsticker--get-logo-url-rss-0.91 topnode))
+                  (newsticker--parse-rss-0.91 name time topnode))
+                 ;; RSS 0.92
+                 ((and (eq 'rss (xml-node-name topnode))
+                       (string= "0.92" (xml-get-attribute topnode 'version)))
+                  (setq imageurl (newsticker--get-logo-url-rss-0.92 topnode))
+                  (newsticker--parse-rss-0.92 name time topnode))
+                 ;; RSS 1.0
+                 ((eq 'rdf:RDF (xml-node-name topnode))
+                  (setq imageurl (newsticker--get-logo-url-rss-1.0 topnode))
+                  (newsticker--parse-rss-1.0 name time topnode))
+                 ;; RSS 2.0
+                 ((and (eq 'rss (xml-node-name topnode))
+                       (string= "2.0" (xml-get-attribute topnode 'version)))
+                  (setq imageurl (newsticker--get-logo-url-rss-2.0 topnode))
+                  (newsticker--parse-rss-2.0 name time topnode))
+                 ;; Atom 0.3
+                 ((and (eq 'feed (xml-node-name topnode))
+                       (string= "http://purl.org/atom/ns#"
+                                (xml-get-attribute topnode 'xmlns)))
+                  (setq imageurl (newsticker--get-logo-url-atom-0.3 topnode))
+                  (newsticker--parse-atom-0.3 name time topnode))
+                 ;; Atom 1.0
+                 ((and (eq 'feed (xml-node-name topnode))
+                       (string= "http://www.w3.org/2005/Atom"
+                                (xml-get-attribute topnode 'xmlns)))
+                  (setq imageurl (newsticker--get-logo-url-atom-1.0 topnode))
+                  (newsticker--parse-atom-1.0 name time topnode))
+                 ;; unknown feed type
+                 (t
+                  (newsticker--debug-msg "Feed type unknown: %s: %s"
+                                         (xml-node-name topnode) name)
+                  nil))
+                (setq something-was-added t))
+          (xerror (message "sentinelerror in %s: %s" name error-data)))
+
         ;; Remove those old items from cache which have been removed from
         ;; the feed
         (newsticker--cache-replace-age newsticker--cache
@@ -3371,10 +3350,10 @@
           (newsticker--cache-replace-age newsticker--cache
                                          name-symbol 'obsolete-new
                                          'obsolete))
-        ;; bring cache data into proper order....
-        ;; (newsticker--cache-sort)
+        (newsticker--update-process-ids)
         ;; setup scrollable text
-        (newsticker--ticker-text-setup)
+        (when (= 0 (length newsticker--process-ids))
+          (newsticker--ticker-text-setup))
         (setq newsticker--latest-update-time (current-time))
         (when something-was-added
           ;; FIXME: should we care about removed items as well?
@@ -3388,6 +3367,474 @@
                    (string-match "%l" newsticker-heading-format))
           (newsticker--image-get name imageurl))))))
 
+(defun newsticker--get-logo-url-atom-1.0 (node)
+  "Return logo URL from atom 1.0 data in NODE."
+  (car (xml-node-children
+        (car (xml-get-children node 'logo)))))
+
+(defun newsticker--get-logo-url-atom-0.3 (node)
+  "Return logo URL from atom 0.3 data in NODE."
+  (car (xml-node-children
+        (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
+
+(defun newsticker--get-logo-url-rss-2.0 (node)
+  "Return logo URL from RSS 2.0 data in NODE."
+  (car (xml-node-children
+        (car (xml-get-children
+              (car (xml-get-children
+                    (car (xml-get-children node 'channel)) 'image)) 'url)))))
+
+(defun newsticker--get-logo-url-rss-1.0 (node)
+  "Return logo URL from RSS 1.0 data in NODE."
+  (car (xml-node-children
+        (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
+
+(defun newsticker--get-logo-url-rss-0.92 (node)
+  "Return logo URL from RSS 0.92 data in NODE."
+  (car (xml-node-children
+        (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
+
+(defun newsticker--get-logo-url-rss-0.91 (node)
+  "Return logo URL from RSS 0.91 data in NODE."
+  (car (xml-node-children
+        (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
+
+(defun newsticker--parse-atom-0.3 (name time topnode)
+  "Parse Atom 0.3 data.
+Return value as well as arguments NAME, TIME, and TOPNODE are the
+same as in `newsticker--parse-generic-rss'."
+  (newsticker--debug-msg "Parsing Atom 0.3 feed %s" name)
+  (let (new-feed new-item)
+    (setq new-feed (newsticker--parse-generic-feed
+                    name time
+                    ;; title
+                    (car (xml-node-children
+                          (car (xml-get-children topnode 'title))))
+                    ;; desc
+                    (car (xml-node-children
+                          (car (xml-get-children topnode 'content))))
+                    ;; link
+                    (xml-get-attribute
+                     (car (xml-get-children topnode 'link)) 'href)
+                    ;; extra-elements
+                    (xml-node-children topnode)))
+    (setq new-item (newsticker--parse-generic-items
+                    name time (xml-get-children topnode 'entry)
+                    ;; title-fn
+                    (lambda (node)
+                      (car (xml-node-children
+                            (car (xml-get-children node 'title)))))
+                    ;; desc-fn
+                    (lambda (node)
+                      (or (car (xml-node-children
+                                (car (xml-get-children node 'content))))
+                          (car (xml-node-children
+                                (car (xml-get-children node 'summary))))))
+                    ;; link-fn
+                    (lambda (node)
+                      (xml-get-attribute
+                       (car (xml-get-children node 'link)) 'href))
+                    ;; time-fn
+                    (lambda (node)
+                      (newsticker--decode-rfc822-date
+                            (car (xml-node-children
+                                  (car (xml-get-children node 'modified))))))
+                    ;; guid-fn
+                    (lambda (node)
+                      (let ((tguid (assoc 'guid (xml-node-children node))))
+                        (if (stringp tguid)
+                            tguid
+                          (car (xml-node-children tguid)))))
+                    ;; extra-fn
+                    (lambda (node)
+                      (xml-node-children node))))
+    (or new-item new-feed)))
+
+(defun newsticker--parse-atom-1.0 (name time topnode)
+  "Parse Atom 1.0 data.
+Argument NAME gives the name of a news feed.  TIME gives the
+system time at which the data have been retrieved.  TOPNODE
+contains the feed data as returned by the xml parser.
+
+For the Atom 1.0 specification see
+http://www.atompub.org/2005/08/17/draft-ietf-atompub-format-11.html"
+  (newsticker--debug-msg "Parsing Atom 1.0 feed %s" name)
+  (let (new-feed new-item)
+    (setq new-feed (newsticker--parse-generic-feed
+                    name time
+                    ;; title
+                    (car (xml-node-children
+                          (car (xml-get-children topnode 'title))))
+                    ;; desc
+                    (car (xml-node-children
+                          (car (xml-get-children topnode 'subtitle))))
+                    ;; link
+                    (car (xml-node-children
+                          (car (xml-get-children topnode 'link))))
+                    ;; extra-elements
+                    (xml-node-children topnode)))
+    (setq new-item (newsticker--parse-generic-items
+                    name time (xml-get-children topnode 'entry)
+                    ;; title-fn
+                    (lambda (node)
+                      (car (xml-node-children
+                            (car (xml-get-children node 'title)))))
+                    ;; desc-fn
+                    (lambda (node)
+                      (or (car (xml-node-children
+                                (car (xml-get-children node 'content))))
+                          (car (xml-node-children
+                                (car (xml-get-children node 'summary))))))
+                    ;; link-fn
+                    (lambda (node)
+                      (car (xml-node-children
+                            (car (xml-get-children node 'link)))))
+                    ;; time-fn
+                    (lambda (node)
+                      (newsticker--decode-iso8601-date
+                       (or (car (xml-node-children
+                                 (car (xml-get-children node 'updated))))
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'published)))))))
+                    ;; guid-fn
+                    (lambda (node)
+                      (car (xml-node-children
+                            (car (xml-get-children node 'id)))))
+                    ;; extra-fn
+                    (lambda (node)
+                      (xml-node-children node))))
+    (or new-item new-feed)))
+
+(defun newsticker--parse-rss-0.91 (name time topnode)
+  "Parse RSS 0.91 data.
+Return value as well as arguments NAME, TIME, and TOPNODE are the
+same as in `newsticker--parse-atom-1.0'.
+
+For the RSS 0.91 specification see http://backend.userland.com/rss091 or
+http://my.netscape.com/publish/formats/rss-spec-0.91.html."
+  (newsticker--debug-msg "Parsing RSS 0.91 feed %s" name)
+  (let* ((channelnode (car (xml-get-children topnode 'channel)))
+         (pub-date (newsticker--decode-rfc822-date
+                    (car (xml-node-children
+                          (car (xml-get-children channelnode 'pubDate))))))
+         is-new-feed has-new-items)
+    (setq is-new-feed (newsticker--parse-generic-feed
+                       name time
+                       ;; title
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'title))))
+                       ;; desc
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode
+                                                    'description))))
+                       ;; link
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'link))))
+                       ;; extra-elements
+                       (xml-node-children channelnode)))
+    (setq has-new-items (newsticker--parse-generic-items
+                         name time (xml-get-children channelnode 'item)
+                         ;; title-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'title)))))
+                         ;; desc-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'description)))))
+                         ;; link-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'link)))))
+                         ;; time-fn
+                         (lambda (node)
+                           pub-date)
+                         ;; guid-fn
+                         (lambda (node)
+                           nil)
+                         ;; extra-fn
+                         (lambda (node)
+                           (xml-node-children node))))
+    (or has-new-items is-new-feed)))
+
+(defun newsticker--parse-rss-0.92 (name time topnode)
+  "Parse RSS 0.92 data.
+Return value as well as arguments NAME, TIME, and TOPNODE are the
+same as in `newsticker--parse-atom-1.0'.
+
+For the RSS 0.92 specification see http://backend.userland.com/rss092."
+  (newsticker--debug-msg "Parsing RSS 0.92 feed %s" name)
+  (let* ((channelnode (car (xml-get-children topnode 'channel)))
+         (pub-date (newsticker--decode-rfc822-date
+                    (car (xml-node-children
+                          (car (xml-get-children channelnode 'pubDate))))))
+         is-new-feed has-new-items)
+    (setq is-new-feed (newsticker--parse-generic-feed
+                       name time
+                       ;; title
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'title))))
+                       ;; desc
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode
+                                                    'description))))
+                       ;; link
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'link))))
+                       ;; extra-elements
+                       (xml-node-children channelnode)))
+    (setq has-new-items (newsticker--parse-generic-items
+                         name time (xml-get-children channelnode 'item)
+                         ;; title-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'title)))))
+                         ;; desc-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'description)))))
+                         ;; link-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'link)))))
+                         ;; time-fn
+                         (lambda (node)
+                           pub-date)
+                         ;; guid-fn
+                         (lambda (node)
+                           nil)
+                         ;; extra-fn
+                         (lambda (node)
+                           (xml-node-children node))))
+    (or has-new-items is-new-feed)))
+
+(defun newsticker--parse-rss-1.0 (name time topnode)
+  "Parse RSS 1.0 data.
+Return value as well as arguments NAME, TIME, and
+TOPNODE are the same as in `newsticker--parse-atom-1.0'.
+
+For the RSS 1.0 specification see http://web.resource.org/rss/1.0/spec."
+  (newsticker--debug-msg "Parsing RSS 1.0 feed %s" name)
+  (let* ((channelnode (car (xml-get-children topnode 'channel)))
+         is-new-feed has-new-items)
+    (setq is-new-feed (newsticker--parse-generic-feed
+                       name time
+                       ;; title
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'title))))
+                       ;; desc
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode
+                                                    'description))))
+                       ;; link
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'link))))
+                       ;; extra-elements
+                       (xml-node-children channelnode)))
+    (setq has-new-items (newsticker--parse-generic-items
+                         name time (xml-get-children topnode 'item)
+                         ;; title-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'title)))))
+                         ;; desc-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node
+                                                        'description)))))
+                         ;; link-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'link)))))
+                         ;; time-fn
+                         (lambda (node)
+                           (newsticker--decode-iso8601-date
+                            (car (xml-node-children
+                                  (car (xml-get-children node 'dc:date))))))
+                         ;; guid-fn
+                         (lambda (node)
+                           nil)
+                         ;; extra-fn
+                         (lambda (node)
+                           (xml-node-children node))))
+    (or has-new-items is-new-feed)))
+
+(defun newsticker--parse-rss-2.0 (name time topnode)
+  "Parse RSS 2.0 data.
+Return value as well as arguments NAME, TIME, and TOPNODE are the
+same as in `newsticker--parse-atom-1.0'.
+
+For the RSS 2.0 specification see http://blogs.law.harvard.edu/tech/rss."
+  (newsticker--debug-msg "Parsing RSS 2.0 feed %s" name)
+  (let* ((channelnode (car (xml-get-children topnode 'channel)))
+         is-new-feed has-new-items)
+    (setq is-new-feed (newsticker--parse-generic-feed
+                       name time
+                       ;; title
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'title))))
+                       ;; desc
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode
+                                                    'description))))
+                       ;; link
+                       (car (xml-node-children
+                             (car (xml-get-children channelnode 'link))))
+                       ;; extra-elements
+                       (xml-node-children channelnode)))
+    (setq has-new-items (newsticker--parse-generic-items
+                         name time (xml-get-children channelnode 'item)
+                         ;; title-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'title)))))
+                         ;; desc-fn
+                         (lambda (node)
+                           (or (car (xml-node-children
+                                     (car (xml-get-children node
+                                                            'content:encoded))))
+                               (car (xml-node-children
+                                     (car (xml-get-children node
+                                                            'description))))))
+                         ;; link-fn
+                         (lambda (node)
+                           (car (xml-node-children
+                                 (car (xml-get-children node 'link)))))
+                         ;; time-fn
+                         (lambda (node)
+                           (newsticker--decode-rfc822-date
+                            (car (xml-node-children
+                                  (car (xml-get-children node 'pubDate))))))
+                         ;; guid-fn
+                         (lambda (node)
+                           (let* ((tguid (assoc 'guid
+                                                (xml-node-children node))))
+                             (if (stringp tguid)
+                                 tguid
+                               (car (xml-node-children tguid)))))
+                         ;; extra-fn
+                         (lambda (node)
+                           (xml-node-children node))))
+    (or has-new-items is-new-feed)))
+
+(defun newsticker--parse-generic-feed (name time title desc link
+                                            extra-elements)
+  "Parse generic news feed data.
+Argument NAME gives the name of a news feed.  TIME gives the
+system time at which the data have been retrieved.  CHANNELNODE
+is the node in the feed data which contains the description, link
+etc.  of the feed itself.
+
+The arguments TITLE, DESC, LINK, and EXTRA-ELEMENTS give the feed's title,
+description, link, and extra elements resp."
+  (let ((title (or title "[untitled]"))
+        (link (or link ""))
+        (old-item nil)
+        (position 0)
+        (something-was-added nil))
+    ;; decode numeric entities
+    (setq title (newsticker--decode-numeric-entities title))
+    (setq desc  (newsticker--decode-numeric-entities desc))
+    (setq link  (newsticker--decode-numeric-entities link))
+    ;; remove whitespace from title, desc, and link
+    (setq title (newsticker--remove-whitespace title))
+    (setq desc (newsticker--remove-whitespace desc))
+    (setq link (newsticker--remove-whitespace link))
+
+    ;; handle the feed itself
+    (unless (newsticker--cache-contains newsticker--cache
+                                        (intern name) title
+                                        desc link 'feed)
+      (setq something-was-added t))
+    (setq newsticker--cache
+          (newsticker--cache-add newsticker--cache (intern name)
+                                 title desc link time 'feed position
+                                 extra-elements 'feed time))
+    something-was-added))
+
+(defun newsticker--parse-generic-items (name time itemlist
+                                             title-fn desc-fn
+                                             link-fn time-fn
+                                             guid-fn extra-fn)
+  "Parse generic news feed data.
+Argument NAME gives the name of a news feed.  TIME gives the
+system time at which the data have been retrieved.  ITEMLIST
+contains the news items returned by the xml parser.
+
+The arguments TITLE-FN, DESC-FN, LINK-FN, TIME-FN, GUID-FN, and
+EXTRA-FN give functions for extracting title, description, link,
+time, guid, and extra-elements resp.  They are called with one
+argument, which is one of the items in ITEMLIST."
+  (let (title desc link
+        (old-item nil)
+        (position 0)
+        (something-was-added nil))
+    ;; gather all items for this feed
+    (mapc (lambda (node)
+            (setq position (1+ position))
+            (setq title (or (funcall title-fn node) "[untitled]"))
+            (setq desc (funcall desc-fn node))
+            (setq link (or (funcall link-fn node) ""))
+            (setq time (or (funcall time-fn node) time))
+            ;; It happened that the title or description
+            ;; contained evil HTML code that confused the
+            ;; xml parser.  Therefore:
+            (unless (stringp title)
+              (setq title (prin1-to-string title)))
+            (unless (or (stringp desc) (not desc))
+              (setq desc (prin1-to-string desc)))
+            ;; ignore items with empty title AND empty desc
+            (when (or (> (length title) 0)
+                      (> (length desc) 0))
+              ;; decode numeric entities
+              (setq title (newsticker--decode-numeric-entities title))
+              (when desc
+                (setq desc  (newsticker--decode-numeric-entities desc)))
+              (setq link (newsticker--decode-numeric-entities link))
+              ;; remove whitespace from title, desc, and link
+              (setq title (newsticker--remove-whitespace title))
+              (setq desc (newsticker--remove-whitespace desc))
+              (setq link (newsticker--remove-whitespace link))
+              ;; add data to cache
+              ;; do we have this item already?
+              (let* ((guid (funcall guid-fn node)))
+                ;;(message "guid=%s" guid)
+                (setq old-item
+                      (newsticker--cache-contains newsticker--cache
+                                                  (intern name) title
+                                                  desc link nil guid)))
+              ;; add this item, or mark it as old, or do nothing
+              (let ((age1 'new)
+                    (age2 'old)
+                    (item-new-p nil))
+                (if old-item
+                    (let ((prev-age (newsticker--age old-item)))
+                      (unless
+                          newsticker-automatically-mark-items-as-old
+                        (if (eq prev-age 'obsolete-old)
+                            (setq age2 'old)
+                          (setq age2 'new)))
+                      (if (eq prev-age 'immortal)
+                          (setq age2 'immortal)))
+                  ;; item was not there
+                  (setq item-new-p t)
+                  (setq something-was-added t))
+                (setq newsticker--cache
+                      (newsticker--cache-add
+                       newsticker--cache (intern name) title desc link
+                       time age1 position (funcall extra-fn node)
+                       age2))
+                (when item-new-p
+                  (let ((item (newsticker--cache-contains
+                               newsticker--cache (intern name) title
+                               desc link nil)))
+                    (if newsticker-auto-mark-filter-list
+                        (newsticker--run-auto-mark-filter name item))
+                    (run-hook-with-args
+                     'newsticker-new-item-functions name item))))))
+          itemlist)
+    something-was-added))
+
 (defun newsticker--display-tick ()
   "Called from the display timer.
 This function calls a display function, according to the variable
@@ -3460,45 +3907,36 @@
 ;; ======================================================================
 ;;; misc
 ;; ======================================================================
-(defun newsticker--decode-coding-string (string coding-system)
-  "Wrapper around `decode-coding-string'.
-This functions passes the arguments STRING and CODING-SYSTEM to
-`decode-coding-string'.  If the decoding is successful the
-decoded string is returned, otherwise the unmodified input string
-is returned."
-  (condition-case nil
-      (decode-coding-string string coding-system)
-    (error
-     (message "Cannot decode encoded string `%s'" string)
-     string)))
-
 (defun newsticker--decode-numeric-entities (string)
   "Decode SGML numeric entities by their respective utf characters.
 This function replaces numeric entities in the input STRING and
 returns the modified string.  For example \"&#42;\" gets replaced
 by \"*\"."
-  (let ((start 0))
-    (while (string-match "&#\\([0-9]+\\);" string start)
-      (condition-case nil
-          (setq string (replace-match
-                        (string (read (substring string (match-beginning 1)
-                                                 (match-end 1))))
-                        nil nil string))
-        (error nil))
-      (setq start (1+ (match-beginning 0))))
-    string))
+  (if (and string (stringp string))
+      (let ((start 0))
+        (while (string-match "&#\\([0-9]+\\);" string start)
+          (condition-case nil
+              (setq string (replace-match
+                            (string (read (substring string
+                                                     (match-beginning 1)
+                                                     (match-end 1))))
+                            nil nil string))
+            (error nil))
+          (setq start (1+ (match-beginning 0))))
+        string)
+    nil))
 
 (defun newsticker--remove-whitespace (string)
   "Remove leading and trailing whitespace from STRING."
   ;; we must have ...+ but not ...* in the regexps otherwise xemacs loops
   ;; endlessly...
-  (when string
+  (when (and string (stringp string))
     (replace-regexp-in-string
      "[ \t\r\n]+$" ""
      (replace-regexp-in-string "^[ \t\r\n]+" "" string))))
 
 (defun newsticker--do-forget-preformatted (item)
-  "Forget all cached pre-formatted data.
+  "Forget pre-formatted data for ITEM.
 Remove the pre-formatted from `newsticker--cache'."
   (if (nthcdr 7 item)
       (setcar (nthcdr 7 item) nil))
@@ -3582,20 +4020,23 @@
 Converts from RFC822 to Emacs representation.
 Examples:
 Sat, 07 Sep 2002 00:00:01 GMT
-07 Sep 2002 00:00:01 GMT"
-  (if rfc822-string
+07 Sep 2002 00:00:01 GMT
+07 Sep 2002"
+  (if (and rfc822-string (stringp rfc822-string))
       (when (string-match
              (concat
               "\\s-*"
               ;; week day
-              "\\(\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\)\\s-*,?\\)\\s-+"
+              "\\(\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\)\\s-*,?\\)?\\s-*"
               ;; day
               "\\([0-9]\\{1,2\\}\\)\\s-+"
               ;; month
               "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|"
               "Sep\\|Oct\\|Nov\\|Dec\\)\\s-+"
               ;; year
-              "\\([0-9]\\{2,4\\}\\)\\s-+"
+              "\\([0-9]\\{2,4\\}\\)"
+              ;; time may be missing
+              "\\(\\s-+"
               ;; hour
               "\\([0-9]\\{2\\}\\)"
               ;; minute
@@ -3603,17 +4044,17 @@
               ;; second
               "\\(:\\([0-9]\\{2\\}\\)\\)?"
               ;; zone -- fixme
-              "\\(\\s-+.*\\)?")
+              "\\(\\s-+.*\\)?"
+              "\\)?")
              rfc822-string)
         (let ((day (read (match-string 3 rfc822-string)))
               (month-name (match-string 4 rfc822-string))
               (month 0)
               (year (read (match-string 5 rfc822-string)))
-              (hour (read (match-string 6 rfc822-string)))
-              (minute (read (match-string 7 rfc822-string)))
-              (second (read (or (match-string 9 rfc822-string)
-                                "0")))
-              ;;(zone (match-string 10 rfc822-string))
+              (hour (read (or (match-string 7 rfc822-string) "0")))
+              (minute (read (or (match-string 8 rfc822-string) "0")))
+              (second (read (or (match-string 10 rfc822-string) "0")))
+              ;;(zone (match-string 11 rfc822-string))
               )
           (condition-case error-data
               (let ((i 1))
@@ -3639,6 +4080,19 @@
           list1)
     result))
 
+(defun newsticker--update-process-ids ()
+  "Update list of ids of active newsticker processes.
+Checks list of active processes against list of newsticker processes."
+  (let ((active-procs (process-list))
+        (new-list nil))
+    (mapc (lambda (proc)
+            (let ((id (process-id proc)))
+              (if (memq id newsticker--process-ids)
+                  (setq new-list (cons id new-list)))))
+          active-procs)
+    (setq newsticker--process-ids new-list))
+  (force-mode-line-update))
+
 ;; ======================================================================
 ;;; images
 ;; ======================================================================
@@ -3685,7 +4139,7 @@
   (let* ((p-status (process-status process))
          (exit-status (process-exit-status process))
          (feed-name (process-name process)))
-    ;; catch known errors (zombie processes, rubbish-xml etc.
+    ;; catch known errors (zombie processes, rubbish-xml, etc.)
     ;; if an error occurs the news feed is not updated!
     (catch 'oops
       (unless (and (eq p-status 'exit)
@@ -3730,8 +4184,8 @@
                                 'heuristic)
                      :ascent 70))
         (error
-         (message "Error: cannot create image: %s"
-                  (cadr error-data)))))
+         (message "Error: cannot create image for %s: %s"
+                  feed-name-symbol error-data))))
     img))
 
 ;; ======================================================================
@@ -3764,9 +4218,20 @@
       index-alist)))
 
 (defun newsticker--imenu-goto (name pos &rest args)
-  "Go item NAME at position POS and show item.
+  "Go to item NAME at position POS and show item.
 ARGS are ignored."
   (goto-char pos)
+  ;; show headline
+  (newsticker--buffer-goto '(desc extra feed item))
+  (let* ((inhibit-read-only t)
+         (pos1 (max (point-min) (1- pos)))
+         (pos2 (max pos1 (1- (point))))
+         (inv-prop (get-text-property pos 'invisible))
+         (org-inv-prop (get-text-property pos 'org-invisible)))
+    (when (eq org-inv-prop nil)
+      (add-text-properties pos1 pos2 (list 'invisible nil
+                                          'org-invisible inv-prop))))
+  ;; show desc
   (newsticker-show-entry))
 
 ;; ======================================================================
@@ -3783,7 +4248,7 @@
        (if value
            (setq mode-name "Newsticker -- up to date -- ")
          (setq mode-name "Newsticker -- NEED UPDATE -- ")))
-      (sit-for 0))))
+      (force-mode-line-update 0))))
 
 (defun newsticker--buffer-redraw ()
   "Sometimes (CVS) Emacs forgets to update the window..."
@@ -3992,6 +4457,14 @@
                  (error
                   (message "Error: HTML rendering failed: %s, %s"
                            (car error-data) (cdr error-data)))))
+             ;; After html rendering there might be chunks of blank
+             ;; characters between rendered text and date, statistics or
+             ;; whatever.  Remove it
+             (when (and (eq type 'item) is-rendered-HTML)
+               (goto-char pos)
+               (while (re-search-forward "[ \t]*\n[ \t]*" nil t)
+                 (replace-match " " nil nil))
+               (goto-char (point-max)))
              (when (and newsticker-justification
                         (eq type 'desc)
                         (not is-rendered-HTML))
@@ -4000,7 +4473,7 @@
                      (fill-region pos (point-max) newsticker-justification))
                  (error nil))))
 
-             ;; remove leading and trailing newlines
+           ;; remove leading and trailing newlines
            (goto-char pos)
            (unless (= 0 (skip-chars-forward " \t\r\n"))
              (delete-region pos (point)))
@@ -4009,7 +4482,6 @@
              (unless (= 0 (skip-chars-backward " \t\r\n" (1+ pos)))
                (delete-region (point) end)))
            (goto-char (point-max))
-
            ;; closing newline
            (unless nil ;;(eq pos (point))
              (insert "\n")
@@ -4025,16 +4497,7 @@
            (when (eq type 'desc)
              (goto-char (point-max))
              (setq pos-extra-start (point))
-             (mapc (lambda (extra-element)
-                     (unless (memq (car extra-element)
-                                   '(items link title description
-                                           content:encoded
-                                           dc:subject dc:date item guid
-                                           pubDate
-                                           enclosure))
-                       (newsticker--buffer-print-extra-element
-                        extra-element)))
-                   (newsticker--extra item))
+             (newsticker--buffer-print-extra-elements item)
              (setq pos-extra-end (point)))
 
            ;; text properties
@@ -4083,9 +4546,30 @@
 		   (newsticker--cache-set-preformatted-title
 		    item (buffer-substring pos (point)))))))))
 
-(defun newsticker--buffer-print-extra-element (extra-element)
-  "Insert EXTRA-ELEMENT in a pretty form into the current buffer."
-  (insert (format "%s:\t" (car extra-element)))
+(defun newsticker--buffer-print-extra-elements (item)
+  "Insert extra-elements of ITEM in a pretty form into the current buffer."
+  (let ((ignored-elements '(items link title description
+                                  content:encoded
+                                  dc:subject dc:date item guid
+                                  pubDate enclosure))
+        (left-column-width 1))
+    (mapc (lambda (extra-element)
+            (unless (memq (car extra-element) ignored-elements)
+              (setq left-column-width (max left-column-width
+                                           (length (symbol-name
+                                                    (car extra-element)))))))
+          (newsticker--extra item))
+    (mapc (lambda (extra-element)
+            (unless (memq (car extra-element) ignored-elements)
+              (newsticker--buffer-do-print-extra-element extra-element
+                                                         left-column-width)))
+          (newsticker--extra item))))
+
+(defun newsticker--buffer-do-print-extra-element (extra-element width)
+  "Actually print an EXTRA-ELEMENT using the given WIDTH."
+  (let ((name (symbol-name (car extra-element))))
+    (insert (format "%s: " name))
+    (insert (make-string (- width (length name)) ? )))
   (let (;;(attributes (cadr extra-element)) ;FIXME!!!!
         (contents (cddr extra-element)))
     (cond ((listp contents)
@@ -4109,15 +4593,19 @@
     (insert "\n")))
 
 (defun newsticker--buffer-insert-enclosure (item)
-  "Insert enclosure element of an RSS ITEM into the current buffer."
+  "Insert enclosure element of a news ITEM into the current buffer."
   (let ((enclosure (newsticker--enclosure item))
         (beg (point)))
     (when enclosure
       (let ((url (cdr (assoc 'url enclosure)))
-            (length (cdr (assoc 'length enclosure)))
+            (length (string-to-number (cdr (assoc 'length enclosure))))
             (type (cdr (assoc 'type enclosure))))
-        (insert (format "Enclosed file (%s, %1.2f kBytes)" type
-                        (/ (string-to-number length) 1024)))
+        (cond ((> length 1048576)
+               (insert (format "Enclosed file (%s, %1.2f MBytes)" type
+                               (/ length 1048576))))
+              ((> length 1024)
+               (insert (format "Enclosed file (%s, %1.2f KBytes)" type
+                               (/ length 1024)))))
         (add-text-properties beg (point)
                              (list 'mouse-face 'highlight
                                    'nt-link url
@@ -4827,23 +5315,34 @@
 ;; ======================================================================
 (defun newsticker--run-auto-mark-filter (feed item)
   "Automatically mark an item as old or immortal.
-This function checks the variable `newsticker-auto-mark-filter'
+This function checks the variable `newsticker-auto-mark-filter-list'
 for an entry that matches FEED and ITEM."
- (let ((case-fold-search t))
+  (let ((case-fold-search t))
     (mapc (lambda (filter)
             (let ((filter-feed (car filter))
-                  (old-list (nth 1 filter))
-                  (imm-list (nth 2 filter)))
+                  (pattern-list (cadr filter)))
             (when (string-match filter-feed feed)
-              (newsticker--do-run-auto-mark-filter item 'old old-list)
-              (newsticker--do-run-auto-mark-filter item 'immortal imm-list))))
-          newsticker-auto-mark-filter)))
-
-(defun newsticker--do-run-auto-mark-filter (item age list)
-  "Actually compare ITEM AGE LIST against `newsticker-auto-mark-filter'."
+              (newsticker--do-run-auto-mark-filter item pattern-list))))
+          newsticker-auto-mark-filter-list)))
+
+(defun newsticker--do-run-auto-mark-filter (item list)
+  "Actually compare ITEM AGE LIST against `newsticker-auto-mark-filter-list'."
   (mapc (lambda (pattern)
-          (when (string-match pattern (newsticker--title item))
-            (setcar (nthcdr 4 item) age)))
+          (let ((age    (nth 0 pattern))
+                (place  (nth 1 pattern))
+                (regexp (nth 2 pattern))
+                (title (newsticker--title item))
+                (desc  (newsticker--desc item)))
+            (when (or (eq place 'title) (eq place 'all))
+              (when (and title (string-match regexp title))
+                (newsticker--debug-msg "Auto-marking as %s: `%s'"
+                                       age (newsticker--title item))
+                (setcar (nthcdr 4 item) age)))
+            (when (or (eq place 'description) (eq place 'all))
+              (when (and desc (string-match regexp desc))
+                (newsticker--debug-msg "Auto-marking as %s: `%s'"
+                                       age (newsticker--title item))
+                (setcar (nthcdr 4 item) age)))))
         list))
 
 
--- a/lisp/net/rcirc.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/net/rcirc.el	Mon Nov 07 14:56:19 2005 +0000
@@ -25,12 +25,17 @@
 
 ;;; Commentary:
 
-;; rcirc is an Internet Relay Chat (IRC) client for Emacs
+;; Internet Relay Chat (IRC) is a form of instant communication over
+;; the Internet. It is mainly designed for group (many-to-many)
+;; communication in discussion forums called channels, but also allows
+;; one-to-one communication.
 
-;; IRC is a form of instant communication over the Internet. It is
-;; mainly designed for group (many-to-many) communication in
-;; discussion forums called channels, but also allows one-to-one
-;; communication.
+;; Rcirc has simple defaults and clear and consistent behaviour.
+;; Message arrival timestamps, activity notification on the modeline,
+;; message filling, nick completion, and keepalive pings are all
+;; enabled by default, but can easily be adjusted or turned off.  Each
+;; discussion takes place in its own buffer and there is a single
+;; server buffer per connection.
 
 ;; Open a new irc connection with:
 ;; M-x irc RET
@@ -41,61 +46,101 @@
 (require 'time-date)
 (eval-when-compile (require 'cl))
 
-(defvar rcirc-server "irc.freenode.net"
-  "The default server to connect to.")
+(defgroup rcirc nil
+  "Simple IRC client."
+  :version "22.1"
+  :prefix "rcirc"
+  :group 'applications)
 
-(defvar rcirc-port 6667
-  "The default port to connect to.")
+(defcustom rcirc-server "irc.freenode.net"
+  "The default server to connect to."
+  :type 'string
+  :group 'rcirc)
 
-(defvar rcirc-nick (user-login-name)
-  "Your nick.")
+(defcustom rcirc-port 6667
+  "The default port to connect to."
+  :type 'integer
+  :group 'rcirc)
 
-(defvar rcirc-user-name (user-login-name)
-  "Your user name sent to the server when connecting.")
+(defcustom rcirc-nick (user-login-name)
+  "Your nick."
+  :type 'string
+  :group 'rcirc)
 
-(defvar rcirc-user-full-name (if (string= (user-full-name) "")
+(defcustom rcirc-user-name (user-login-name)
+  "Your user name sent to the server when connecting."
+  :type 'string
+  :group 'rcirc)
+
+(defcustom rcirc-user-full-name (if (string= (user-full-name) "")
 				 rcirc-user-name
 			       (user-full-name))
-  "The full name sent to the server when connecting.")
+  "The full name sent to the server when connecting."
+  :type 'string
+  :group 'rcirc)
 
-(defvar rcirc-startup-channels-alist nil
+(defcustom rcirc-startup-channels-alist nil
   "Alist of channels to join at startup.
-Each element looks like (REGEXP . CHANNEL-LIST).")
+Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
+  :type '(alist :key-type string :value-type (repeat string))
+  :group 'rcirc)
 
-(defvar rcirc-fill-flag t
-  "*Non-nil means fill messages printed in channel buffers.")
+(defcustom rcirc-fill-flag t
+  "*Non-nil means line-wrap messages printed in channel buffers."
+  :type 'boolean
+  :group 'rcirc)
 
-(defvar rcirc-fill-column nil
-  "*If non-nil, fill to this column, otherwise use value of `fill-column'.")
+(defcustom rcirc-fill-column nil
+  "*Column beyond which automatic line-wrapping should happen.
+If nil, use value of `fill-column'.  If frame-width, use the
+maximum frame width."
+  :type '(choice (const :tag "Value of `fill-column'")
+		 (const :tag "Full frame width" frame-width)
+		 (integer :tag "Number of columns"))
+  :group 'rcirc)
 
-(defvar rcirc-fill-prefix nil
+(defcustom rcirc-fill-prefix nil
   "*Text to insert before filled lines.
 If nil, calculate the prefix dynamically to line up text
-underneath each nick.")
+underneath each nick."
+  :type '(choice (const :tag "Dynamic" nil)
+		 (string :tag "Prefix text"))
+  :group 'rcirc)
 
-(defvar rcirc-ignore-channel-activity nil
-  "If non-nil, ignore activity in this channel.")
-(make-variable-buffer-local 'rcirc-ignore-channel-activity)
+(defvar rcirc-ignore-buffer-activity-flag nil
+  "If non-nil, ignore activity in this buffer.")
+(make-variable-buffer-local 'rcirc-ignore-buffer-activity-flag)
 
-(defvar rcirc-ignore-all-activity-flag nil
-  "*Non-nil means track activity, but do not display it in the modeline.")
+(defcustom rcirc-ignore-all-activity-flag nil
+  "*Non-nil means do not indicate any activity in the modeline."
+  :type 'boolean
+  :group 'rcirc)
 
-(defvar rcirc-time-format "%H:%M "
+(defcustom rcirc-time-format "%H:%M "
   "*Describes how timestamps are printed.
-Used as the first arg to `format-time-string'.")
+Used as the first arg to `format-time-string'."
+  :type 'string
+  :group 'rcirc)
 
-(defvar rcirc-input-ring-size 1024
-  "*Size of input history ring.")
+(defcustom rcirc-input-ring-size 1024
+  "*Size of input history ring."
+  :type 'integer
+  :group 'rcirc)
 
-(defvar rcirc-read-only-flag t
-  "*Non-nil means make text in irc buffers read-only.")
+(defcustom rcirc-read-only-flag t
+  "*Non-nil means make text in irc buffers read-only."
+  :type 'boolean
+  :group 'rcirc)
 
-(defvar rcirc-buffer-maximum-lines nil
+(defcustom rcirc-buffer-maximum-lines nil
   "*The maximum size in lines for rcirc buffers.
 Channel buffers are truncated from the top to be no greater than this
-number.	 If zero or nil, no truncating is done.")
+number.	 If zero or nil, no truncating is done."
+  :type '(choice (const :tag "No truncation" nil)
+		 (integer :tag "Number of lines"))
+  :group 'rcirc)
 
-(defvar rcirc-authinfo-file-name
+(defcustom rcirc-authinfo-file-name
   "~/.rcirc-authinfo"
   "File containing rcirc authentication passwords.
 The file consists of a single list, with each element itself a
@@ -111,17 +156,17 @@
 Example:
  ((\"freenode\" \"bob\" nickserv \"p455w0rd\")
   (\"freenode\" \"bob\" chanserv \"#bobland\" \"passwd99\")
-  (\"bitlbee\" \"robert\" bitlbee \"sekrit\"))")
-
-(defvar rcirc-auto-authenticate-flag (file-readable-p rcirc-authinfo-file-name)
-  "*Non-nil means automatically send authentication string to server.
-See also `rcirc-authinfo-file-name'.")
+  (\"bitlbee\" \"robert\" bitlbee \"sekrit\"))"
+  :type 'string
+  :group 'rcirc)
 
-(defvar rcirc-print-hooks nil
-  "Hook run after text is printed.
-Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT.")
+(defcustom rcirc-auto-authenticate-flag (file-readable-p rcirc-authinfo-file-name)
+  "*Non-nil means automatically send authentication string to server.
+See also `rcirc-authinfo-file-name'."
+  :type 'boolean
+  :group 'rcirc)
 
-(defvar rcirc-prompt "%n> "
+(defcustom rcirc-prompt "> "
   "Prompt string to use in irc buffers.
 
 The following replacements are made:
@@ -129,14 +174,27 @@
 %s is the server.
 %t is the buffer target, a channel or a user.
 
-Setting this alone will not affect the prompt; 
-use `rcirc-update-prompt' after changing this variable.")
+Setting this alone will not affect the prompt;
+use either M-x customize or also call `rcirc-update-prompt'."
+  :type 'string
+  :set 'rcirc-set-changed
+  :initialize 'custom-initialize-default
+  :group 'rcirc)
+
+(defcustom rcirc-print-hooks nil
+  "Hook run after text is printed.
+Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
+  :type 'hook
+  :group 'rcirc)
 
 (defvar rcirc-prompt-start-marker nil)
 (defvar rcirc-prompt-end-marker nil)
 
 (defvar rcirc-nick-table nil)
 
+;; each process has an alist of (target . buffer) pairs
+(defvar rcirc-buffer-alist nil)
+
 (defvar rcirc-activity nil
   "List of channels with unviewed activity.")
 
@@ -150,30 +208,14 @@
 (defvar rcirc-target nil
   "The channel or user associated with this buffer.")
 
-(defvar rcirc-channels nil
-  "Joined channels.")
-
-(defvar rcirc-private-chats nil
-  "Private chats open.")
-
 (defvar rcirc-urls nil
   "List of urls seen in the current buffer.")
 
 (defvar rcirc-keepalive-seconds 60
   "Number of seconds between keepalive pings.")
 
+(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version))
 
-(defun rcirc-version (&optional here)
-  "Return rcirc version string.
-If optional argument HERE is non-nil, insert string at point."
-  (interactive "P")
-  (let ((version "rcirc.el 0.9 $Revision: 1.5 $"))
-    (if here
-	(insert version)
-      (if (interactive-p)
-	  (message "%s" version)
-	version))))
-
 (defvar rcirc-startup-channels nil)
 ;;;###autoload
 (defun rcirc (&optional server port nick channels)
@@ -181,7 +223,7 @@
 
 If any of the the optional SERVER, PORT, NICK or CHANNELS are not
 supplied, they are taken from the variables `rcirc-server',
-`rcirc-port', `rcirc-nick', and `rcirc-startup-channels',
+`rcirc-port', `rcirc-nick', and `rcirc-startup-channels-alist',
 respectively."
   (interactive (list (read-string "IRC Server: " rcirc-server)
 		     (read-string "IRC Port: " (number-to-string rcirc-port))
@@ -192,19 +234,19 @@
   (or channels
       (setq channels
 	    (if (interactive-p)
-		(delete ""
-			(split-string
-			 (read-string "Channels: "
-				     (mapconcat 'identity
-						(rcirc-startup-channels server)
-						" "))
-			 "[, ]+"))
+		(split-string
+		 (read-string "Channels: "
+			      (mapconcat 'identity
+					 (rcirc-startup-channels server)
+					 " "))
+			 "[, ]+" t)
 	      (rcirc-startup-channels server))))
   (or global-mode-string (setq global-mode-string '("")))
   (and (not (memq 'rcirc-activity-string global-mode-string))
        (setq global-mode-string
 	     (append global-mode-string '(rcirc-activity-string))))
-  (add-hook 'window-configuration-change-hook 'rcirc-update-activity)
+  (add-hook 'window-configuration-change-hook
+	    'rcirc-window-configuration-change)
   (rcirc-connect server port nick rcirc-user-name rcirc-user-full-name
 		 channels))
 
@@ -213,7 +255,6 @@
 
 
 (defvar rcirc-process-output nil)
-(defvar rcirc-last-buffer nil)
 (defvar rcirc-topic nil)
 (defvar rcirc-keepalive-timer nil)
 (make-variable-buffer-local 'rcirc-topic)
@@ -233,10 +274,12 @@
       ;; set up process
       (set-process-coding-system process 'raw-text 'raw-text)
       (set-process-filter process 'rcirc-filter)
-      (switch-to-buffer (concat "*" (process-name process) "*"))
+      (switch-to-buffer (rcirc-generate-new-buffer-name process nil))
       (set-process-buffer process (current-buffer))
       (set-process-sentinel process 'rcirc-sentinel)
       (rcirc-mode process nil)
+      (make-local-variable 'rcirc-buffer-alist)
+      (setq rcirc-buffer-alist nil)
       (make-local-variable 'rcirc-nick-table)
       (setq rcirc-nick-table (make-hash-table :test 'equal))
       (make-local-variable 'rcirc-server)
@@ -245,12 +288,6 @@
       (setq rcirc-nick nick)
       (make-local-variable 'rcirc-process-output)
       (setq rcirc-process-output nil)
-      (make-local-variable 'rcirc-last-buffer)
-      (setq rcirc-last-buffer (current-buffer))
-      (make-local-variable 'rcirc-channels)
-      (setq rcirc-channels nil)
-      (make-local-variable 'rcirc-private-chats)
-      (setq rcirc-private-chats nil)
       (make-local-variable 'rcirc-startup-channels)
       (setq rcirc-startup-channels startup-channels)
 
@@ -270,34 +307,39 @@
       ;; return process object
       process)))
 
+(defmacro with-rcirc-process-buffer (process &rest body)
+  (declare (indent 1) (debug t))
+  `(with-current-buffer (process-buffer ,process)
+     ,@body))
+
 (defun rcirc-keepalive ()
   "Send keep alive pings to active rcirc processes."
   (if (rcirc-process-list)
       (mapc (lambda (process)
-              (with-current-buffer (process-buffer process)
+              (with-rcirc-process-buffer process
                 (rcirc-send-string process (concat "PING " rcirc-server))))
             (rcirc-process-list))
     (cancel-timer rcirc-keepalive-timer)
     (setq rcirc-keepalive-timer nil)))
 
-(defvar rcirc-log-buffer "*rcirc log*")
-(defvar rcirc-log-p nil
-  "If non-nil, write information to `rcirc-log-buffer'.")
-(defun rcirc-log (process text)
+(defvar rcirc-debug-buffer " *rcirc debug*")
+(defvar rcirc-debug-flag nil
+  "If non-nil, write information to `rcirc-debug-buffer'.")
+(defun rcirc-debug (process text)
   "Add an entry to the debug log including PROCESS and TEXT.
-Debug text is written to `rcirc-log-buffer' if `rcirc-log-p' is
-non-nil."
-  (when rcirc-log-p
+Debug text is written to `rcirc-debug-buffer' if `rcirc-debug-p'
+is non-nil."
+  (when rcirc-debug-flag
     (save-excursion
       (save-window-excursion
-        (set-buffer (get-buffer-create rcirc-log-buffer))
+        (set-buffer (get-buffer-create rcirc-debug-buffer))
         (goto-char (point-max))
         (insert (concat
                  "["
                  (format-time-string "%Y-%m-%dT%T ") (process-name process)
                  "] "
                  text))))))
-               
+
 (defvar rcirc-sentinel-hooks nil
   "Hook functions called when the process sentinel is called.
 Functions are called with PROCESS and SENTINEL arguments.")
@@ -305,20 +347,16 @@
 (defun rcirc-sentinel (process sentinel)
   "Called when PROCESS receives SENTINEL."
   (let ((sentinel (replace-regexp-in-string "\n" "" sentinel)))
-    (rcirc-log process (format "SENTINEL: %S %S\n" process sentinel))
-    (with-current-buffer (process-buffer process)
-      (dolist (target (append rcirc-channels
-                              rcirc-private-chats
-                              (list (current-buffer))))
-        (rcirc-print process "rcirc.el" "ERROR" target
+    (rcirc-debug process (format "SENTINEL: %S %S\n" process sentinel))
+    (with-rcirc-process-buffer process
+      (dolist (buffer (cons nil (mapcar 'cdr rcirc-buffer-alist)))
+        (rcirc-print process "rcirc.el" "ERROR" buffer
                      (format "%s: %s (%S)"
                              (process-name process)
                              sentinel
                              (process-status process)) t)
 	;; remove the prompt from buffers
-	(with-current-buffer (if (eq target (current-buffer))
-				 (current-buffer)
-			       (rcirc-get-buffer process target))
+	(with-current-buffer (or buffer (current-buffer))
 	  (let ((inhibit-read-only t))
 	    (delete-region rcirc-prompt-start-marker
 			   rcirc-prompt-end-marker)))))
@@ -329,7 +367,7 @@
   (let (ps)
     (mapc (lambda (p)
             (when (process-buffer p)
-              (with-current-buffer (process-buffer p)
+              (with-rcirc-process-buffer p
                 (when (eq major-mode 'rcirc-mode)
                   (setq ps (cons p ps))))))
           (process-list))
@@ -340,24 +378,24 @@
 Function is called with PROCESS COMMAND SENDER ARGS and LINE.")
 (defun rcirc-filter (process output)
   "Called when PROCESS receives OUTPUT."
-  (rcirc-log process output)
-  (with-current-buffer (process-buffer process)
+  (rcirc-debug process output)
+  (with-rcirc-process-buffer process
     (setq rcirc-process-output (concat rcirc-process-output output))
     (when (= (aref rcirc-process-output
                    (1- (length rcirc-process-output))) ?\n)
       (mapc (lambda (line)
               (rcirc-process-server-response process line))
-            (delete "" (split-string rcirc-process-output "[\n\r]")))
+            (split-string rcirc-process-output "[\n\r]" t))
       (setq rcirc-process-output nil))))
 
-(defvar rcirc-trap-errors nil)
+(defvar rcirc-trap-errors-flag t)
 (defun rcirc-process-server-response (process text)
-  (if rcirc-trap-errors
+  (if rcirc-trap-errors-flag
       (condition-case err
           (rcirc-process-server-response-1 process text)
         (error
          (rcirc-print process "RCIRC" "ERROR" nil
-                      (format "rcirc: error processing: \"%s\" %s" text err))))
+                      (format "\"%s\" %s" text err) t)))
     (rcirc-process-server-response-1 process text)))
 
 (defun rcirc-process-server-response-1 (process text)
@@ -369,8 +407,8 @@
         (string-match "^\\([^:]*\\):?\\(.+\\)?$" args)
         (let* ((args1 (match-string 1 args))
                (args2 (match-string 2 args))
-               (args (append (delete "" (split-string args1 " "))
-                             (list args2))))
+               (args (delq nil (append (split-string args1 " " t)
+				       (list args2)))))
         (if (not (fboundp handler))
             (rcirc-handler-generic process cmd sender args text)
           (funcall handler process sender args text))
@@ -381,24 +419,24 @@
 (defun rcirc-handler-generic (process command sender args text)
   "Generic server response handler."
   (rcirc-print process sender command nil
-               (mapconcat 'identity (cdr args) " ")))
+               (mapconcat 'identity (cdr args) " ") t))
 
 (defun rcirc-send-string (process string)
   "Send PROCESS a STRING plus a newline."
   (let ((string (concat (encode-coding-string string
                                               buffer-file-coding-system)
                         "\n")))
-    (rcirc-log process string)
+    (rcirc-debug process string)
     (process-send-string process string)))
 
 (defun rcirc-server (process)
   "Return PROCESS server, given by the 001 response."
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     rcirc-server))
 
 (defun rcirc-nick (process)
   "Return PROCESS nick."
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     rcirc-nick))
 
 (defvar rcirc-max-message-length 450
@@ -418,7 +456,9 @@
                  text))
          (more (if oversize
                    (substring message rcirc-max-message-length))))
-    (rcirc-print process (rcirc-nick process) response target text)
+    (rcirc-print process (rcirc-nick process) response
+		 (rcirc-get-buffer-create process target)
+		 text)
     (rcirc-send-string process (concat response " " target " :" text))
     (if more
         (rcirc-send-message process target more noticep))))
@@ -459,8 +499,8 @@
              rcirc-prompt-end-marker))
     (setq rcirc-nick-completions
           (let ((completion-ignore-case t))
-            (all-completions 
-	     (buffer-substring 
+            (all-completions
+	     (buffer-substring
 	      (+ rcirc-prompt-end-marker
 		 rcirc-nick-completion-start-offset)
 	      (point))
@@ -469,11 +509,11 @@
 					  (rcirc-buffer-target)))))))
   (let ((completion (car rcirc-nick-completions)))
     (when completion
-      (delete-region (+ rcirc-prompt-end-marker 
+      (delete-region (+ rcirc-prompt-end-marker
                         rcirc-nick-completion-start-offset)
                      (point))
       (insert (concat completion
-                      (if (= (+ rcirc-prompt-end-marker 
+                      (if (= (+ rcirc-prompt-end-marker
                                 rcirc-nick-completion-start-offset)
                              rcirc-prompt-end-marker)
                           ": "))))))
@@ -507,7 +547,7 @@
 (define-key rcirc-mode-map (kbd "C-c C-w") 'rcirc-cmd-whois)
 (define-key rcirc-mode-map (kbd "C-c C-x") 'rcirc-cmd-quit)
 (define-key rcirc-mode-map (kbd "C-c TAB") ; C-i
-  'rcirc-toggle-ignore-channel-activity)
+  'rcirc-toggle-ignore-buffer-activity)
 (define-key rcirc-mode-map (kbd "C-c C-s") 'rcirc-switch-to-server-buffer)
 (define-key rcirc-mode-map (kbd "C-c C-a") 'rcirc-jump-to-first-unread-line)
 
@@ -515,6 +555,15 @@
 (define-key global-map (kbd "C-c C-@") 'rcirc-next-active-buffer)
 (define-key global-map (kbd "C-c C-SPC") 'rcirc-next-active-buffer)
 
+(defvar rcirc-browse-url-map (make-sparse-keymap)
+  "Keymap used ror browsing URLs in `rcirc-mode'.")
+
+(define-key rcirc-browse-url-map (kbd "RET") 'rcirc-browse-url-at-point)
+(define-key rcirc-browse-url-map (kbd "<mouse-2>") 'rcirc-browse-url-at-mouse)
+
+(defvar rcirc-short-buffer-name nil
+  "Generated abbreviation to use to indicate buffer activity.")
+
 (defvar rcirc-mode-hook nil
   "Hook run when setting up rcirc buffer.")
 
@@ -533,11 +582,12 @@
   (setq rcirc-process process)
   (make-local-variable 'rcirc-target)
   (setq rcirc-target target)
+
+  (make-local-variable 'rcirc-short-buffer-name)
+  (setq rcirc-short-buffer-name nil)
   (make-local-variable 'rcirc-urls)
   (setq rcirc-urls nil)
   (setq use-hard-newlines t)
-  (when (rcirc-channel-p rcirc-target)
-    (setq header-line-format 'rcirc-topic))
 
   ;; setup the prompt and markers
   (make-local-variable 'rcirc-prompt-start-marker)
@@ -552,38 +602,59 @@
   (setq overlay-arrow-position (make-marker))
   (set-marker overlay-arrow-position nil)
 
+  ;; add to buffer list, and update buffer abbrevs
+  (when target				; skip server buffer
+    (let ((buffer (current-buffer)))
+      (with-rcirc-process-buffer process
+	(setq rcirc-buffer-alist (cons (cons target buffer)
+				       rcirc-buffer-alist))))
+    (rcirc-update-short-buffer-names))
+
   (run-hooks 'rcirc-mode-hook))
 
-(defmacro with-rcirc-process-buffer (process &rest body)
-  (declare (indent 1) (debug t))
-  `(with-current-buffer (process-buffer ,process)
-     ,@body))
+(defun rcirc-update-prompt (&optional all)
+  "Reset the prompt string in the current buffer.
 
-(defun rcirc-update-prompt ()
-  "Reset the prompt string in the current buffer."
-  (let ((inhibit-read-only t)
-        (prompt (or rcirc-prompt "")))
-    (mapc (lambda (rep)
-            (setq prompt 
-		  (replace-regexp-in-string (car rep) (cdr rep) prompt)))
-          (list (cons "%n" (with-rcirc-process-buffer rcirc-process
-			     rcirc-nick))
-                (cons "%s" (with-rcirc-process-buffer rcirc-process 
-			     rcirc-server))
-                (cons "%t" (or rcirc-target ""))))
-    (save-excursion
-      (delete-region rcirc-prompt-start-marker rcirc-prompt-end-marker)
-      (goto-char rcirc-prompt-start-marker)
-      (let ((start (point)))
-        (insert-before-markers prompt)
-        (set-marker rcirc-prompt-start-marker start)
-        (when (not (zerop (- rcirc-prompt-end-marker
-                             rcirc-prompt-start-marker)))
-          (add-text-properties rcirc-prompt-start-marker
-                               rcirc-prompt-end-marker
-                               (list 'face 'rcirc-prompt-face
-                                     'read-only t 'field t
-                                     'front-sticky t 'rear-nonsticky t)))))))
+If ALL is non-nil, update prompts in all IRC buffers."
+  (if all
+      (mapc (lambda (process)
+	      (mapc (lambda (buffer)
+		      (with-current-buffer buffer
+			(rcirc-update-prompt)))
+		    (with-rcirc-process-buffer process
+		      (mapcar 'cdr rcirc-buffer-alist))))
+	    (rcirc-process-list))
+    (let ((inhibit-read-only t)
+	  (prompt (or rcirc-prompt "")))
+      (mapc (lambda (rep)
+	      (setq prompt
+		    (replace-regexp-in-string (car rep) (regexp-quote (cdr rep)) prompt)))
+	    (list (cons "%n" (with-rcirc-process-buffer rcirc-process
+			       rcirc-nick))
+		  (cons "%s" (with-rcirc-process-buffer rcirc-process
+			       rcirc-server))
+		  (cons "%t" (or rcirc-target ""))))
+      (save-excursion
+	(delete-region rcirc-prompt-start-marker rcirc-prompt-end-marker)
+	(goto-char rcirc-prompt-start-marker)
+	(let ((start (point)))
+	  (insert-before-markers prompt)
+	  (set-marker rcirc-prompt-start-marker start)
+	  (when (not (zerop (- rcirc-prompt-end-marker
+			       rcirc-prompt-start-marker)))
+	    (add-text-properties rcirc-prompt-start-marker
+				 rcirc-prompt-end-marker
+				 (list 'face 'rcirc-prompt
+				       'read-only t 'field t
+				       'front-sticky t 'rear-nonsticky t))))))))
+
+(defun rcirc-set-changed (option value)
+  "Set OPTION to VALUE and do updates after a customization change."
+  (set-default option value)
+  (cond ((eq option 'rcirc-prompt)
+	 (rcirc-update-prompt 'all))
+	(t
+	 (error "Bad option %s" option))))
 
 (defun rcirc-channel-p (target)
   "Return t if TARGET is a channel name."
@@ -595,65 +666,67 @@
 (defun rcirc-kill-buffer-hook ()
   "Part the channel when killing an rcirc buffer."
   (when (eq major-mode 'rcirc-mode)
-    (rcirc-clear-activity (current-buffer))
+    (rcirc-kill-buffer-hook-1)))
+(defun rcirc-kill-buffer-hook-1 ()
+  (let ((buffer (current-buffer)))
+    (rcirc-clear-activity buffer)
     (when (and rcirc-process
-               (eq (process-status rcirc-process) 'open))
+	       (eq (process-status rcirc-process) 'open))
+      (with-rcirc-process-buffer rcirc-process
+	(setq rcirc-buffer-alist
+	      (rassq-delete-all buffer rcirc-buffer-alist)))
+      (rcirc-update-short-buffer-names)
       (if (rcirc-channel-p rcirc-target)
-          (rcirc-cmd-part "" rcirc-process rcirc-target)
-        ;; remove target from privchat list
-        (when rcirc-target
-          (let ((target (downcase rcirc-target)))
-            (with-rcirc-process-buffer rcirc-process
-              (setq rcirc-private-chats
-		    (delete target rcirc-private-chats)))))))))
+	  (rcirc-send-string rcirc-process
+			     (concat "PART " rcirc-target
+				     " :Killed buffer"))
+	(when rcirc-target
+	  (rcirc-remove-nick-channel rcirc-process
+				     (rcirc-nick rcirc-process)
+				     rcirc-target))))))
+
 (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook)
 
-(defun rcirc-get-buffer-name (process target)
-  "Return buffer name based on PROCESS and TARGET."
-  (concat (and target (downcase target)) "@" (process-name process)))
+(defun rcirc-generate-new-buffer-name (process target)
+  "Return a buffer name based on PROCESS and TARGET.
+This is used for the initial name given to irc buffers."
+  (if target
+      (concat target "@" (process-name process))
+    (concat "*" (process-name process) "*")))
 
-(defun rcirc-get-buffer (process target &optional error)
+(defun rcirc-get-buffer (process target &optional server)
   "Return the buffer associated with the PROCESS and TARGET.
-If TARGET is nil and ERROR is nil, return the process buffer."
-  (let ((buffer (and target 
-                     (get-buffer (rcirc-get-buffer-name process target)))))
-    (if (and buffer (buffer-live-p buffer))
-        buffer
-      (if error
-          (error "Buffer associated with %s does not exist" target)
-        (process-buffer process)))))
+
+If TARGET is nil, return the server buffer.
+
+If optional argument SERVER is non-nil, return the server buffer
+if there is no existing buffer for TARGET, otherwise return nil."
+  (with-rcirc-process-buffer process
+    (if (null target)
+	(current-buffer)
+      (let ((buffer (cdr (assoc-string target rcirc-buffer-alist t))))
+	(or buffer (when server (current-buffer)))))))
 
 (defun rcirc-get-buffer-create (process target)
-  "Return the buffer named associated with the PROCESS and TARGET.
-Create the buffer if it doesn't exist.  If TARGET is nil, return
-the process buffer."
-  (with-current-buffer (process-buffer process)
-    (if (not target)
-        (current-buffer)
-      (let ((target (downcase target)))
-        ;; add private chats to list.  we dont add channels here, they
-        ;; are managed by the join/part/quit handlers
-        (when (and (not (rcirc-channel-p target))
-                   (not (member target rcirc-private-chats)))
-          (with-rcirc-process-buffer process
-            (setq rcirc-private-chats (cons target rcirc-private-chats))))
-        ;; create and setup a buffer, or return the existing one
-        (let ((bufname (rcirc-get-buffer-name process target)))
-          (with-current-buffer (get-buffer-create bufname)
-            (if (or (not rcirc-process)
-                    (not (equal (process-status rcirc-process) 'open)))
-                (rcirc-mode process target)
-              (setq rcirc-target target))
-            (current-buffer)))))))
+  "Return the buffer associated with the PROCESS and TARGET.
+Create the buffer if it doesn't exist."
+  (let ((buffer (rcirc-get-buffer process target)))
+    (or buffer
+	;; create the buffer
+	(with-rcirc-process-buffer process
+	  (let ((new-buffer (get-buffer-create
+			     (rcirc-generate-new-buffer-name process target))))
+	    (with-current-buffer new-buffer
+	      (rcirc-mode process target))
+	    (rcirc-put-nick-channel process (rcirc-nick process) target)
+	    new-buffer)))))
 
 (defun rcirc-send-input ()
   "Send input to target associated with the current buffer."
   (interactive)
   (if (not (eq (process-status rcirc-process) 'open))
-      (error "Network connection to %s is not open" 
+      (error "Network connection to %s is not open"
              (process-name rcirc-process))
-    ;; update last buffer
-    (rcirc-set-last-buffer rcirc-process (current-buffer))
     (if (< (point) rcirc-prompt-end-marker)
         ;; copy the line down to the input area
         (progn
@@ -668,9 +741,6 @@
             (insert (replace-regexp-in-string
                      "\n\\s-+" " "
                      (buffer-substring-no-properties start end)))))
-      ;; assume text has been read
-      (when (marker-position overlay-arrow-position)
-	(set-marker overlay-arrow-position nil))
       ;; process input
       (goto-char (point-max))
       (let ((target (rcirc-buffer-target))
@@ -690,10 +760,10 @@
                   (with-current-buffer (current-buffer)
                     (delete-region rcirc-prompt-end-marker (point))
                     (if (string= command "me")
-                        (rcirc-print rcirc-process (rcirc-nick rcirc-process) 
-                                     "ACTION" target args)
-                      (rcirc-print rcirc-process (rcirc-nick rcirc-process) 
-                                   "COMMAND" target input))
+                        (rcirc-print rcirc-process (rcirc-nick rcirc-process)
+                                     "ACTION" (current-buffer) args)
+                      (rcirc-print rcirc-process (rcirc-nick rcirc-process)
+                                   "COMMAND" (current-buffer) input))
                     (set-marker rcirc-prompt-end-marker (point))
                     (if (fboundp fun)
                         (funcall fun args rcirc-process target)
@@ -751,15 +821,16 @@
   (interactive)
   (assert (and (eq major-mode 'rcirc-multiline-edit-mode)))
   (assert rcirc-parent-buffer)
+  (untabify (point-min) (point-max))
   (let ((text (buffer-substring (point-min) (point-max)))
         (buffer (current-buffer))
         (pos (point)))
     (set-buffer rcirc-parent-buffer)
     (goto-char (point-max))
     (insert text)
-    (goto-char (+ rcirc-prompt-end-marker (1- pos)))
     (kill-buffer buffer)
-    (set-window-configuration rcirc-window-configuration)))
+    (set-window-configuration rcirc-window-configuration)
+    (goto-char (+ rcirc-prompt-end-marker (1- pos)))))
 
 (defun rcirc-multiline-edit-cancel ()
   "Cancel the multiline edit."
@@ -768,19 +839,15 @@
   (kill-buffer (current-buffer))
   (set-window-configuration rcirc-window-configuration))
 
-(defun rcirc-last-buffer (process)
-  "Return the last working buffer for PROCESS.
-Used for displaying messages that don't have an explicit destination."
-  (with-current-buffer (process-buffer process)
-    (or (and rcirc-last-buffer
-             (buffer-live-p rcirc-last-buffer)
-             rcirc-last-buffer)
-        (current-buffer))))
-
-(defun rcirc-set-last-buffer (process buffer)
-  "Set the last working buffer for PROCESS to BUFFER."
-  (with-current-buffer (process-buffer process)
-    (setq rcirc-last-buffer buffer)))
+(defun rcirc-get-any-buffer (process)
+  "Return a buffer for PROCESS, either the one selected or the process buffer."
+  (let ((buffer (window-buffer (selected-window))))
+    (if (and buffer
+	     (with-current-buffer buffer
+	       (and (eq major-mode 'rcirc-mode)
+		    (eq rcirc-process process))))
+	buffer
+      (process-buffer process))))
 
 (defun rcirc-format-response-string (process sender response target text)
   (concat (when rcirc-time-format
@@ -792,22 +859,24 @@
                    (cond ((string= response "PRIVMSG")
                           (setq first "<" middle "> "))
                          ((string= response "NOTICE")
-                          (setq first "-" middle "- "))
+			  (when sender
+			    (setq first "-" middle "- ")))
                          (t
                           (setq first "[" middle " " end "]")))
-                   (concat first 
+                   (concat first
                            (rcirc-facify (rcirc-user-nick sender)
                                          (if (string= sender
                                                       (rcirc-nick process))
-                                             'rcirc-my-nick-face
-                                           'rcirc-other-nick-face))
+                                             'rcirc-my-nick
+                                           'rcirc-other-nick))
                            middle
                            (rcirc-mangle-text process text)
                            end)))
                 ((string= response "COMMAND")
                  text)
                 ((string= response "ERROR")
-                 (propertize text 'face 'font-lock-warning-face))
+                 (propertize (concat "!!! " text)
+			     'face 'font-lock-warning-face))
                 (t
                  (rcirc-mangle-text
                   process
@@ -817,10 +886,8 @@
 			     (concat (rcirc-user-nick sender) " "))
 			   (when (zerop (string-to-number response))
 			     (concat response " "))
-                           (when (and target (not (string= target rcirc-target)))
-                             (concat target " "))
                            text)
-                   'rcirc-server-face))))))
+                   'rcirc-server))))))
 
 (defvar rcirc-activity-type nil)
 (make-variable-buffer-local 'rcirc-activity-type)
@@ -828,14 +895,15 @@
   "Print TEXT in the buffer associated with TARGET.
 Format based on SENDER and RESPONSE.  If ACTIVITY is non-nil,
 record activity."
-  (let* ((buffer (cond ((bufferp target) 
+  (let* ((buffer (cond ((bufferp target)
                         target)
                        ((not target)
-                        (rcirc-last-buffer process))
-                       ((not (rcirc-channel-p target)) 
-                        (rcirc-get-buffer-create process target))
-                       ((rcirc-get-buffer process target))
-                       (t (process-buffer process))))
+			(rcirc-get-any-buffer process))
+		       ((not (rcirc-channel-p target))
+			(rcirc-get-buffer-create process
+						 (rcirc-user-nick sender)))
+                       ((or (rcirc-get-buffer process target)
+			    (rcirc-get-any-buffer process)))))
          (inhibit-read-only t))
     (with-current-buffer buffer
       (let ((moving (= (point) rcirc-prompt-end-marker))
@@ -844,11 +912,12 @@
 
         (unless (string= sender (rcirc-nick process))
 	  ;; only decode text from other senders, not ours
-	  (setq text (decode-coding-string text buffer-file-coding-system))
+	  (setq text (decode-coding-string (or text "")
+					   buffer-file-coding-system))
 	  ;; mark the line with overlay arrow
 	  (unless (or (marker-position overlay-arrow-position)
 		      (get-buffer-window (current-buffer)))
-	    (set-marker overlay-arrow-position 
+	    (set-marker overlay-arrow-position
 			(marker-position rcirc-prompt-start-marker))))
 
         ;; temporarily set the marker insertion-type because
@@ -869,7 +938,7 @@
                  (or rcirc-fill-prefix
                      (make-string
                       (+ (if rcirc-time-format
-                             (length (format-time-string 
+                             (length (format-time-string
                                       rcirc-time-format))
                            0)
                          (cond ((or (string= response "PRIVMSG")
@@ -882,9 +951,21 @@
 			       (t 3))		; ***
                          1)
                       ? )))
-                (fill-column (or rcirc-fill-column fill-column)))
+                (fill-column (cond ((eq rcirc-fill-column 'frame-width)
+				    (1- (frame-width)))
+				   (rcirc-fill-column
+				    rcirc-fill-column)
+				   (t fill-column))))
             (fill-region fill-start rcirc-prompt-start-marker 'left t)))
 
+        ;; set inserted text to be read-only
+        (when rcirc-read-only-flag
+          (put-text-property rcirc-prompt-start-marker fill-start 'read-only t)
+          (let ((inhibit-read-only t))
+            (put-text-property rcirc-prompt-start-marker fill-start
+			       'front-sticky t)
+            (put-text-property (1- (point)) (point) 'rear-nonsticky t)))
+
         ;; truncate buffer if it is very long
         (save-excursion
           (when (and rcirc-buffer-maximum-lines
@@ -892,20 +973,12 @@
                      (= (forward-line (- rcirc-buffer-maximum-lines)) 0))
             (delete-region (point-min) (point))))
 
-        ;; set inserted text to be read-only
-        (when rcirc-read-only-flag
-          (put-text-property rcirc-prompt-start-marker fill-start 'read-only t)
-          (let ((inhibit-read-only t))
-            (put-text-property rcirc-prompt-start-marker fill-start 
-			       'front-sticky t)
-            (put-text-property (1- (point)) (point) 'rear-nonsticky t)))
-
         ;; set the window point for buffers show in windows
         (walk-windows (lambda (w)
                         (unless (eq (selected-window) w)
-                          (when (and (eq (current-buffer) 
+                          (when (and (eq (current-buffer)
 					 (window-buffer w))
-                                     (>= (window-point w) 
+                                     (>= (window-point w)
 					 rcirc-prompt-end-marker))
                             (set-window-point w (point-max)))))
                       nil t)
@@ -924,15 +997,16 @@
 				     (regexp-quote (rcirc-nick process))
 				     "\\b")
 			     text)))
-          (when (or (not rcirc-ignore-channel-activity)
+          (when (or (not rcirc-ignore-buffer-activity-flag)
                     ;; always notice when our nick is mentioned, even
                     ;; if ignoring channel activity
                     nick-match)
             (rcirc-record-activity
-	     (current-buffer) 
+	     (current-buffer)
 	     (when (or nick-match (not (rcirc-channel-p rcirc-target)))
 	       'nick)))))
 
+      (sit-for 0)			; displayed text before hook
       (run-hook-with-args 'rcirc-print-hooks
                           process sender response target text))))
 
@@ -948,11 +1022,7 @@
   "Join CHANNELS."
   (save-window-excursion
     (mapc (lambda (channel)
-            (with-current-buffer (process-buffer process)
-              (let (rcirc-last-buffer)  ; make sure /join text is
-                                        ; printed in server buffer
-                (rcirc-print process (rcirc-nick process) "COMMAND"
-                             nil (concat "/join " channel)))
+            (with-rcirc-process-buffer process
               (rcirc-cmd-join channel process)))
           channels)))
 
@@ -972,16 +1042,16 @@
 (defun rcirc-nick-channels (process nick)
   "Return list of channels for NICK."
   (let ((nick (rcirc-user-nick nick)))
-    (with-current-buffer (process-buffer process)
+    (with-rcirc-process-buffer process
       (mapcar (lambda (x) (car x))
               (gethash nick rcirc-nick-table)))))
 
 (defun rcirc-put-nick-channel (process nick channel)
   "Add CHANNEL to list associated with NICK."
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     (let* ((nick (rcirc-user-nick nick))
            (chans (gethash nick rcirc-nick-table))
-           (record (assoc channel chans)))
+           (record (assoc-string channel chans t)))
       (if record
           (setcdr record (current-time))
         (puthash nick (cons (cons channel (current-time))
@@ -990,26 +1060,31 @@
 
 (defun rcirc-nick-remove (process nick)
   "Remove NICK from table."
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     (remhash nick rcirc-nick-table)))
 
 (defun rcirc-remove-nick-channel (process nick channel)
   "Remove the CHANNEL from list associated with NICK."
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     (let* ((nick (rcirc-user-nick nick))
            (chans (gethash nick rcirc-nick-table))
-           (newchans (assq-delete-all channel chans)))
+           (newchans
+	    ;; instead of assoc-string-delete-all:
+	    (let ((record (assoc-string channel chans t)))
+	      (when record
+		(setcar record 'delete)
+		(assq-delete-all 'delete chans)))))
       (if newchans
           (puthash nick newchans rcirc-nick-table)
         (remhash nick rcirc-nick-table)))))
 
 (defun rcirc-channel-nicks (process channel)
   "Return the list of nicks in CHANNEL sorted by last activity."
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     (let (nicks)
       (maphash
        (lambda (k v)
-         (let ((record (assoc channel v)))
+         (let ((record (assoc-string channel v t)))
            (if record
                (setq nicks (cons (cons k (cdr record)) nicks)))))
        rcirc-nick-table)
@@ -1017,12 +1092,12 @@
               (sort nicks (lambda (x y) (time-less-p (cdr y) (cdr x))))))))
 
 ;;; activity tracking
-(or (assq 'rcirc-ignore-channel-activity minor-mode-alist)
+(or (assq 'rcirc-ignore-buffer-activity-flag minor-mode-alist)
     (setq minor-mode-alist
-          (cons '(rcirc-ignore-channel-activity " Ignore") minor-mode-alist)))
+          (cons '(rcirc-ignore-buffer-activity-flag " Ignore") minor-mode-alist)))
 
-(defun rcirc-toggle-ignore-channel-activity (&optional all)
-  "Toggle the value of `rcirc-ignore-channel-activity'.
+(defun rcirc-toggle-ignore-buffer-activity (&optional all)
+  "Toggle the value of `rcirc-ignore-buffer-activity-flag'.
 If ALL is non-nil, instead toggle the value of
 `rcirc-ignore-all-activity-flag'."
   (interactive "P")
@@ -1030,13 +1105,15 @@
       (progn
         (setq rcirc-ignore-all-activity-flag
               (not rcirc-ignore-all-activity-flag))
-        (message (concat "Global activity "
-                         (if rcirc-ignore-all-activity-flag
-                             "hidden"
-                           "displayed")))
+        (message (if rcirc-ignore-all-activity-flag
+		     "Hide all buffer activity"
+		   "Display buffer activity"))
         (rcirc-update-activity-string))
-    (setq rcirc-ignore-channel-activity
-          (not rcirc-ignore-channel-activity)))
+    (setq rcirc-ignore-buffer-activity-flag
+          (not rcirc-ignore-buffer-activity-flag))
+    (message (if rcirc-ignore-buffer-activity-flag
+		 "Ignore activity in this buffer"
+	       "Notice activity in this buffer")))
   (force-mode-line-update))
 
 (defvar rcirc-switch-to-buffer-function 'switch-to-buffer
@@ -1069,29 +1146,30 @@
           (setq rcirc-last-non-irc-buffer (current-buffer)))
         (if (and (> arg 0)
                  (<= arg (length rcirc-activity)))
-            (funcall rcirc-switch-to-buffer-function 
+            (funcall rcirc-switch-to-buffer-function
 		     (nth (1- arg) rcirc-activity))
           (message "Invalid arg: %d" arg)))
     (if (eq major-mode 'rcirc-mode)
         (if (not (and rcirc-last-non-irc-buffer
                       (buffer-live-p rcirc-last-non-irc-buffer)))
-            (message "No last buffer.")
+            (message "No IRC activity.  Start something.")
+	  (message "No more IRC activity.  Go back to work.")
           (funcall rcirc-switch-to-buffer-function rcirc-last-non-irc-buffer)
           (setq rcirc-last-non-irc-buffer nil))
-      (message "No channel activity.  Go start something."))))
+      (message "No IRC activity."))))
 
 (defvar rcirc-activity-hooks nil
   "Hook to be run when there is channel activity.
 
 Functions are called with a single argument, the buffer with the
 activity.  Only run if the buffer is not visible and
-`rcirc-ignore-channel-activity' is non-nil.")
+`rcirc-ignore-buffer-activity-flag' is non-nil.")
 
 (defun rcirc-record-activity (buffer type)
   "Record BUFFER activity with TYPE."
   (with-current-buffer buffer
     (when (not (get-buffer-window (current-buffer) t))
-      (add-to-list 'rcirc-activity (current-buffer) 'append)
+      (add-to-list 'rcirc-activity (current-buffer))
       (if (not rcirc-activity-type)
           (setq rcirc-activity-type type))
       (rcirc-update-activity-string)))
@@ -1103,38 +1181,115 @@
   (with-current-buffer buffer
     (setq rcirc-activity-type nil)))
 
+;; TODO: add mouse properties
 (defun rcirc-update-activity-string ()
   "Update mode-line string."
   (setq rcirc-activity-string
-        (if (or rcirc-ignore-all-activity-flag
-                (not rcirc-activity))
-            ""
-          (concat " [" (mapconcat 
+	(cond (rcirc-ignore-all-activity-flag
+	       " DND")
+	      ((not rcirc-activity)
+	       "")
+	      (t
+	       (concat " ["
+		       (mapconcat
 			(lambda (b)
 			  (let ((s (rcirc-short-buffer-name b)))
 			    (with-current-buffer b
 			      (if (not (eq rcirc-activity-type 'nick))
 				  s
-				(rcirc-facify s 
-					      'rcirc-mode-line-nick-face)))))
-			rcirc-activity ",") "]"))))
+				(rcirc-facify s 'rcirc-mode-line-nick)))))
+			rcirc-activity ",")
+		       "]")))))
 
 (defun rcirc-short-buffer-name (buffer)
   "Return a short name for BUFFER to use in the modeline indicator."
   (with-current-buffer buffer
-    (or rcirc-target (process-name rcirc-process))))
+    (or rcirc-short-buffer-name (buffer-name))))
+
+(defvar rcirc-current-buffer nil)
+(defun rcirc-window-configuration-change ()
+  "Go through visible windows and remove buffers from activity list.
+Also, clear the overlay arrow if the current buffer is now hidden."
+  (let ((current-now-hidden t))
+    (walk-windows (lambda (w)
+		    (let ((buf (window-buffer w)))
+		      (rcirc-clear-activity buf)
+		      (when (eq buf rcirc-current-buffer)
+			(setq current-now-hidden nil)))))
+    (when (and rcirc-current-buffer current-now-hidden)
+      (with-current-buffer rcirc-current-buffer
+	(when (eq major-mode 'rcirc-mode)
+	  (marker-position overlay-arrow-position)
+	  (set-marker overlay-arrow-position nil)))))
+
+  ;; remove any killed buffers from list
+  (setq rcirc-activity
+	(delq nil (mapcar (lambda (buf) (when (buffer-live-p buf) buf))
+			  rcirc-activity)))
+  (rcirc-update-activity-string)
+  (setq rcirc-current-buffer (current-buffer)))
+
+
+;;; buffer name abbreviation
+(defun rcirc-update-short-buffer-names ()
+  (let ((bufalist
+	 (apply 'append (mapcar (lambda (process)
+				  (with-rcirc-process-buffer process
+				    rcirc-buffer-alist))
+				(rcirc-process-list)))))
+    (dolist (i (rcirc-abbreviate bufalist))
+      (with-current-buffer (cdr i)
+	(setq rcirc-short-buffer-name (car i))))))
+
+(defun rcirc-abbreviate (pairs)
+  (apply 'append (mapcar 'rcirc-rebuild-tree (rcirc-make-trees pairs))))
 
-(defun rcirc-update-activity ()
-  "Go through visible windows and remove buffers from activity list."
-  (walk-windows (lambda (w) (rcirc-clear-activity (window-buffer w))))
-  (rcirc-update-activity-string))
+(defun rcirc-rebuild-tree (tree &optional acc)
+  (let ((ch (char-to-string (car tree))))
+    (dolist (x (cdr tree))
+      (if (listp x)
+	  (setq acc (append acc
+			   (mapcar (lambda (y)
+				     (cons (concat ch (car y))
+					   (cdr y)))
+				   (rcirc-rebuild-tree x))))
+	(setq acc (cons (cons ch x) acc))))
+    acc))
 
+(defun rcirc-make-trees (pairs)
+  (let (alist)
+    (mapc (lambda (pair)
+	    (if (consp pair)
+		(let* ((str (car pair))
+		       (data (cdr pair))
+		       (char (unless (zerop (length str))
+			       (aref str 0)))
+		       (rest (unless (zerop (length str))
+			       (substring str 1)))
+		       (part (if char (assq char alist))))
+		  (if part
+		      ;; existing partition
+		      (setcdr part (cons (cons rest data) (cdr part)))
+		    ;; new partition
+		    (setq alist (cons (if char
+					  (list char (cons rest data))
+					data)
+				      alist))))
+	      (setq alist (cons pair alist))))
+	  pairs)
+    ;; recurse into cdrs of alist
+    (mapc (lambda (x)
+	    (when (and (listp x) (listp (cadr x)))
+	      (setcdr x (if (> (length (cdr x)) 1)
+			    (rcirc-make-trees (cdr x))
+			  (setcdr x (list (cdadr x)))))))
+	  alist)))
 
 ;;; /commands these are called with 3 args: PROCESS, TARGET, which is
 ;; the current buffer/channel/user, and ARGS, which is a string
 ;; containing the text following the /cmd.
 
-(defmacro defun-rcirc-command (command argument docstring interactive-form 
+(defmacro defun-rcirc-command (command argument docstring interactive-form
                                        &rest body)
   "Define a command."
   `(defun ,(intern (concat "rcirc-cmd-" (symbol-name command)))
@@ -1153,8 +1308,7 @@
   (if (null message)
       (progn
         (setq target (completing-read "Message nick: "
-                                      (with-current-buffer
-                                          (process-buffer rcirc-process)
+                                      (with-rcirc-process-buffer rcirc-process
                                         rcirc-nick-table)))
         (when (> (length target) 0)
           (setq message (read-string (format "Message %s: " target)))
@@ -1169,13 +1323,12 @@
 (defun-rcirc-command query (nick)
   "Open a private chat buffer to NICK."
   (interactive (list (completing-read "Query nick: "
-                                      (with-current-buffer
-                                          (process-buffer rcirc-process)
+                                      (with-rcirc-process-buffer rcirc-process
                                         rcirc-nick-table))))
-  (let ((new-buffer (eq (rcirc-get-buffer rcirc-process nick)
-                        (process-buffer rcirc-process))))
-    (switch-to-buffer (rcirc-get-buffer-create process nick))
-    (when new-buffer
+  (let ((existing-buffer (rcirc-get-buffer process nick)))
+    (switch-to-buffer (or existing-buffer
+			  (rcirc-get-buffer-create process nick)))
+    (when (not existing-buffer)
       (rcirc-cmd-whois nick))))
 
 (defun-rcirc-command join (args)
@@ -1185,19 +1338,21 @@
          (buffer (rcirc-get-buffer-create process channel)))
     (when (not (eq (selected-window) (minibuffer-window)))
       (funcall rcirc-switch-to-buffer-function buffer))
-    (rcirc-send-string process (concat "JOIN " args))
-    (rcirc-set-last-buffer process buffer)))
+    (rcirc-send-string process (concat "JOIN " args))))
 
 (defun-rcirc-command part (channel)
   "Part CHANNEL."
   (interactive "sPart channel: ")
   (let ((channel (if (> (length channel) 0) channel target)))
-    (rcirc-send-string process (concat "PART " channel " :" (rcirc-version)))))
+    (rcirc-send-string process (concat "PART " channel " :" rcirc-id-string))))
 
 (defun-rcirc-command quit (reason)
   "Send a quit message to server with REASON."
   (interactive "sQuit reason: ")
-  (rcirc-send-string process (concat "QUIT :" reason)))
+  (rcirc-send-string process (concat "QUIT :"
+				     (if (not (zerop (length reason)))
+					 reason
+				       rcirc-id-string))))
 
 (defun-rcirc-command nick (nick)
   "Change nick to NICK."
@@ -1232,10 +1387,8 @@
   "Request information from server about NICK."
   (interactive (list
                 (completing-read "Whois: "
-                                 (with-current-buffer
-                                     (process-buffer rcirc-process)
+                                 (with-rcirc-process-buffer rcirc-process
                                    rcirc-nick-table))))
-  (rcirc-set-last-buffer rcirc-process (current-buffer))
   (rcirc-send-string process (concat "WHOIS " nick)))
 
 (defun-rcirc-command mode (args)
@@ -1267,7 +1420,7 @@
                                                               rcirc-target))
                         (read-from-minibuffer "Kick reason: "))))
   (let* ((arglist (split-string arg))
-         (argstring (concat (car arglist) " :" 
+         (argstring (concat (car arglist) " :"
                             (mapconcat 'identity (cdr arglist) " "))))
     (rcirc-send-string process (concat "KICK " target " " argstring))))
 
@@ -1275,9 +1428,10 @@
   (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args)
       (let ((target (match-string 1 args))
             (request (match-string 2 args)))
-        (rcirc-send-message process target 
-                            (concat "\C-a" (upcase request) "\C-a")))
-    (rcirc-print process (rcirc-nick process) "ERROR" target
+        (rcirc-send-string process
+			   (format "PRIVMSG %s \C-a%s\C-a"
+				   target (upcase request))))
+    (rcirc-print process (rcirc-nick process) "ERROR" nil
                  "usage: /ctcp NICK REQUEST")))
 
 (defun rcirc-cmd-me (args &optional process target)
@@ -1287,7 +1441,7 @@
 (defun rcirc-message-leader (sender face)
   "Return a string with SENDER propertized with FACE."
   (rcirc-facify (concat "<" (rcirc-user-nick sender) "> ") face))
-  
+
 (defun rcirc-facify (string face)
   "Return a copy of STRING with FACE property added."
   (propertize (or string "") 'face face 'rear-nonsticky t))
@@ -1309,6 +1463,20 @@
                                  completions nil nil initial-input 'history)
                 arg)))
 
+(defun rcirc-browse-url-at-point (point)
+  "Send URL at point to `browse-url'."
+  (interactive "d")
+  (let ((beg (previous-single-property-change point 'mouse-face))
+	(end (next-single-property-change point 'mouse-face)))
+    (browse-url (buffer-substring-no-properties beg end))))
+
+(defun rcirc-browse-url-at-mouse (event)
+  "Send URL at mouse click to `browse-url'."
+  (interactive "e")
+  (let ((position (event-end event)))
+    (with-current-buffer (window-buffer (posn-window position))
+      (rcirc-browse-url-at-point (posn-point position)))))
+
 (defun rcirc-map-regexp (function regexp string)
   "Return a copy of STRING after calling FUNCTION for each REGEXP match.
 FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING."
@@ -1346,7 +1514,7 @@
           (rcirc-map-regexp (lambda (start end string)
                               (add-text-properties
                                start end
-                               (list 'face 'rcirc-nick-in-message-face
+                               (list 'face 'rcirc-nick-in-message
                                      'rear-nonsticky t)
                                string))
                             (concat "\\b"
@@ -1360,7 +1528,9 @@
 	   (let ((orig-face (get-text-property start 'face string)))
 	     (add-text-properties start end
 				  (list 'face (list orig-face 'bold)
-					'rear-nonsticky t)
+					'rear-nonsticky t
+					'mouse-face 'highlight
+					'keymap rcirc-browse-url-map)
 				  string))
 	     (push (substring string start end) rcirc-urls))
 	   rcirc-url-regexp
@@ -1376,13 +1546,12 @@
 (defun rcirc-handler-001 (process sender args text)
   (rcirc-handler-generic process "001" sender args text)
   ;; set the real server name
-  (with-current-buffer (process-buffer process)
+  (with-rcirc-process-buffer process
     (setq rcirc-server sender)
     (setq rcirc-nick (car args))
     (rcirc-update-prompt)
     (when rcirc-auto-authenticate-flag (rcirc-authenticate))
-    (let (rcirc-last-buffer)
-      (rcirc-join-channels process rcirc-startup-channels))))
+    (rcirc-join-channels process rcirc-startup-channels)))
 
 (defun rcirc-handler-PRIVMSG (process sender args text)
   (let ((target (if (rcirc-channel-p (car args))
@@ -1399,56 +1568,60 @@
 (defun rcirc-handler-NOTICE (process sender args text)
   (let ((target (car args))
         (message (cadr args)))
-    (rcirc-print process sender "NOTICE"
-                 (cond ((rcirc-channel-p target)
-                        target)
-                       ((string-match "^\\[\\(#[^ ]+\\)\\]" message)
-                        (match-string 1 message))
-                       (sender
-                        (if (string= sender (rcirc-server process))
-                            (process-buffer process)
-                          (rcirc-user-nick sender))))
-                 message t)
-    (and sender (rcirc-put-nick-channel process sender target))))
+    (if (string-match "^\C-a\\(.*\\)\C-a$" message)
+        (rcirc-handler-CTCP-response process target sender
+				     (match-string 1 message))
+      (rcirc-print process sender "NOTICE"
+		   (cond ((rcirc-channel-p target)
+			  target)
+			 ;;; -ChanServ- [#gnu] Welcome...
+			 ((string-match "^\\[\\(#[^ ]+\\)\\]" message)
+			  (match-string 1 message))
+			 (sender
+			  (if (string= sender (rcirc-server process))
+			      (process-buffer process)
+			    (rcirc-user-nick sender))))
+                 message t))))
+    ;; do we need this:
+    ;;(and sender (rcirc-put-nick-channel process sender target))))
 
 (defun rcirc-handler-WALLOPS (process sender args text)
   (let ((target (rcirc-user-nick sender)))
     (rcirc-print process sender "WALLOPS" target (car args) t)))
 
 (defun rcirc-handler-JOIN (process sender args text)
-  (let ((channel (downcase (car args)))
+  (let ((channel (car args))
         (nick (rcirc-user-nick sender)))
     (rcirc-get-buffer-create process channel)
     (rcirc-print process sender "JOIN" channel "")
 
     ;; print in private chat buffer if it exists
-    (if (not (eq (process-buffer rcirc-process)
-                 (rcirc-get-buffer rcirc-process nick)))
-        (rcirc-print process sender "JOIN" nick channel))
+    (when (rcirc-get-buffer rcirc-process nick)
+      (rcirc-print process sender "JOIN" nick channel))
 
-    (rcirc-put-nick-channel process sender channel)
-    (if (string= nick (rcirc-nick process))
-        (setq rcirc-channels (cons channel rcirc-channels)))))
+    (rcirc-put-nick-channel process sender channel)))
 
 ;; PART and KICK are handled the same way
 (defun rcirc-handler-PART-or-KICK (process response channel sender nick args)
   (rcirc-print process sender response channel (concat channel " " args))
 
   ;; print in private chat buffer if it exists
-  (when (not (eq (process-buffer rcirc-process)
-                 (rcirc-get-buffer rcirc-process nick)))
+  (when (rcirc-get-buffer rcirc-process nick)
     (rcirc-print process sender response nick (concat channel " " args)))
 
   (if (not (string= nick (rcirc-nick process)))
       ;; this is someone else leaving
-  (rcirc-remove-nick-channel process nick channel)
-  ;; this is us leaving
-  (mapc (lambda (n)
-          (rcirc-remove-nick-channel process n channel))
-        (rcirc-channel-nicks process channel))
-  (setq rcirc-channels (delete channel rcirc-channels))
-  (with-current-buffer (rcirc-get-buffer process channel)
-    (setq rcirc-target nil))))
+      (rcirc-remove-nick-channel process nick channel)
+    ;; this is us leaving
+    (mapc (lambda (n)
+	    (rcirc-remove-nick-channel process n channel))
+	  (rcirc-channel-nicks process channel))
+
+    ;; if the buffer is still around, make it inactive
+    (let ((buffer (rcirc-get-buffer process channel)))
+      (when buffer
+	(with-current-buffer buffer
+	  (setq rcirc-target nil))))))
 
 (defun rcirc-handler-PART (process sender args text)
   (rcirc-handler-PART-or-KICK process "PART"
@@ -1456,7 +1629,7 @@
                               (cadr args)))
 
 (defun rcirc-handler-KICK (process sender args text)
-  (rcirc-handler-PART-or-KICK process "KICK" (car args) sender (cadr args) 
+  (rcirc-handler-PART-or-KICK process "KICK" (car args) sender (cadr args)
                               (caddr args)))
 
 (defun rcirc-handler-QUIT (process sender args text)
@@ -1466,9 +1639,9 @@
           (rcirc-nick-channels process nick))
 
     ;; print in private chat buffer if it exists
-    (if (not (eq (process-buffer rcirc-process)
-                 (rcirc-get-buffer rcirc-process nick)))
-        (rcirc-print process sender "QUIT" nick (apply 'concat args)))
+    (let ((buffer (rcirc-get-buffer rcirc-process nick)))
+      (when buffer
+	(rcirc-print process sender "QUIT" buffer (apply 'concat args))))
 
     (rcirc-nick-remove process nick)))
 
@@ -1480,25 +1653,21 @@
     (dolist (target channels)
       (rcirc-print process sender "NICK" target new-nick))
     ;; update private chat buffer, if it exists
-    (with-current-buffer (rcirc-get-buffer process old-nick)
-      (when (not (equal (process-buffer rcirc-process)
-                        (current-buffer)))
-        (rcirc-print process sender "NICK" old-nick new-nick)
-        (setq rcirc-target new-nick)
-        (rename-buffer (rcirc-get-buffer-name process new-nick))))
+    (let ((chat-buffer (rcirc-get-buffer process old-nick)))
+      (when chat-buffer
+	(with-current-buffer chat-buffer
+	  (rcirc-print process sender "NICK" old-nick new-nick)
+	  (setq rcirc-target new-nick)
+	  (rename-buffer (rcirc-generate-new-buffer-name process new-nick)))))
     ;; remove old nick and add new one
-    (with-current-buffer (process-buffer process)
+    (with-rcirc-process-buffer process
       (let ((v (gethash old-nick rcirc-nick-table)))
         (remhash old-nick rcirc-nick-table)
         (puthash new-nick v rcirc-nick-table))
       ;; if this is our nick...
       (when (string= old-nick rcirc-nick)
         (setq rcirc-nick new-nick)
-        ;; update prompts
-        (mapc (lambda (target)
-                (with-current-buffer (rcirc-get-buffer process target)
-                  (rcirc-update-prompt)))
-              (append rcirc-channels rcirc-private-chats))
+	(rcirc-update-prompt t)
         ;; reauthenticate
         (when rcirc-auto-authenticate-flag (rcirc-authenticate))))))
 
@@ -1517,18 +1686,22 @@
 
 (defun rcirc-handler-332 (process sender args text)
   "RPL_TOPIC"
-  (with-current-buffer (rcirc-get-buffer process (cadr args))
-    (setq rcirc-topic (caddr args))))
+  (let ((buffer (or (rcirc-get-buffer process (cadr args))
+		    (rcirc-get-temp-buffer-create process (cadr args)))))
+    (with-current-buffer buffer
+      (setq rcirc-topic (caddr args)))))
 
 (defun rcirc-handler-333 (process sender args text)
   "Not in rfc1459.txt"
-  (with-current-buffer (rcirc-get-buffer process (cadr args))
-    (let ((setter (caddr args))
-          (time (current-time-string
-                 (seconds-to-time
-                  (string-to-number (cadddr args))))))
-      (rcirc-print process sender "TOPIC" (cadr args)
-                   (format "%s (%s on %s)" rcirc-topic setter time)))))
+  (let ((buffer (or (rcirc-get-buffer process (cadr args))
+		    (rcirc-get-temp-buffer-create process (cadr args)))))
+    (with-current-buffer buffer
+      (let ((setter (caddr args))
+	    (time (current-time-string
+		   (seconds-to-time
+		    (string-to-number (cadddr args))))))
+	(rcirc-print process sender "TOPIC" (cadr args)
+		     (format "%s (%s on %s)" rcirc-topic setter time))))))
 
 (defun rcirc-handler-477 (process sender args text)
   "ERR_NOCHANMODES"
@@ -1545,10 +1718,10 @@
 
     ;; print in private chat buffers if they exist
     (mapc (lambda (nick)
-            (when (not (eq (process-buffer rcirc-process)
-                           (rcirc-get-buffer rcirc-process nick)))
-              (rcirc-print process sender "MODE" nick msg)))
-          (cddr args))))
+	    (let ((existing-buffer (rcirc-get-buffer process nick)))
+	      (when existing-buffer
+		(rcirc-print process sender "MODE" existing-buffer msg))))
+	  (cddr args))))
 
 (defun rcirc-get-temp-buffer-create (process channel)
   "Return a buffer based on PROCESS and CHANNEL."
@@ -1557,10 +1730,10 @@
 
 (defun rcirc-handler-353 (process sender args text)
   "RPL_NAMREPLY"
-  (let ((channel (downcase (caddr args))))
+  (let ((channel (caddr args)))
     (mapc (lambda (nick)
             (rcirc-put-nick-channel process nick channel))
-          (delete "" (split-string (cadddr args) " ")))
+          (split-string (cadddr args) " " t))
     (with-current-buffer (rcirc-get-temp-buffer-create process channel)
       (goto-char (point-max))
       (insert (car (last args)) " "))))
@@ -1578,7 +1751,7 @@
   "ERR_NICKNAMEINUSE"
   (rcirc-handler-generic process "433" sender args text)
   (let* ((new-nick (concat (cadr args) "`")))
-    (with-current-buffer (process-buffer process)
+    (with-rcirc-process-buffer process
       (rcirc-cmd-nick new-nick nil process))))
 
 (defun rcirc-authenticate ()
@@ -1590,7 +1763,7 @@
            (insert-file-contents-literally rcirc-authinfo-file-name)
            (goto-char (point-min))
            (read (current-buffer)))))
-    (with-current-buffer (process-buffer rcirc-process)
+    (with-rcirc-process-buffer rcirc-process
       (dolist (i password-alist)
         (let ((server (car i))
               (nick (cadr i))
@@ -1602,22 +1775,22 @@
                    (rcirc-send-string
                     rcirc-process
                     (concat
-                     "PRIVMSG nickserv :identify " 
+                     "PRIVMSG nickserv :identify "
 		     (car args))))
                   ((equal method 'chanserv)
                    (rcirc-send-string
                     rcirc-process
                     (concat
-                     "PRIVMSG chanserv :identify " 
+                     "PRIVMSG chanserv :identify "
 		     (car args) " " (cadr args))))
                   ((equal method 'bitlbee)
                    (rcirc-send-string
                     rcirc-process
                     (concat "PRIVMSG #bitlbee :identify " (car args))))
                   (t
-                   (message "No %S authentication method defined" 
+                   (message "No %S authentication method defined"
 			    method)))))))))
- 
+
 (defun rcirc-handler-INVITE (process sender args text)
   (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t))
 
@@ -1631,18 +1804,20 @@
              (nick (rcirc-user-nick sender))
              (handler (intern-soft (concat "rcirc-handler-ctcp-" request))))
         (if (not (fboundp handler))
-            (rcirc-print process sender "ERROR" target 
-                         (format "unhandled ctcp: %s" text))
+            (rcirc-print process sender "ERROR"
+			 (rcirc-get-buffer process target)
+                         (format "%s sent unsupported ctcp: %s" nick text)
+			 t)
           (funcall handler process target sender args)
           (if (not (string= request "ACTION"))
-              (rcirc-print process sender "CTCP" target
-			   (format "%s" text)))))))
+              (rcirc-print process sender "CTCP"
+			   (rcirc-get-buffer process target)
+			   (format "%s" text) t))))))
 
 (defun rcirc-handler-ctcp-VERSION (process target sender args)
   (rcirc-send-string process
                      (concat "NOTICE " (rcirc-user-nick sender)
-                             " :\C-aVERSION " (rcirc-version)
-                             " - http://www.nongnu.org/rcirc"
+                             " :\C-aVERSION " rcirc-id-string
                              "\C-a")))
 
 (defun rcirc-handler-ctcp-ACTION (process target sender args)
@@ -1652,16 +1827,24 @@
   (rcirc-send-string process
                      (concat "NOTICE " (rcirc-user-nick sender)
                              " :\C-aTIME " (current-time-string) "\C-a")))
+
+(defun rcirc-handler-CTCP-response (process target sender message)
+  (rcirc-print process sender "CTCP" nil message t))
 
-(defface rcirc-my-nick-face
+(defgroup rcirc-faces nil
+  "Faces for rcirc."
+  :group 'rcirc
+  :group 'faces)
+
+(defface rcirc-my-nick
   '((((type tty) (class color)) (:foreground "blue" :weight bold))
     (((class color) (background light)) (:foreground "Blue"))
     (((class color) (background dark)) (:foreground "LightSkyBlue"))
     (t (:inverse-video t :bold t)))
-  "The rcirc face used to highlight my messages."
-  :group 'rcirc)
+  "The face used to highlight my messages."
+  :group 'rcirc-faces)
 
-(defface rcirc-other-nick-face
+(defface rcirc-other-nick
   '((((type tty) (class color)) (:foreground "yellow" :weight light))
     (((class grayscale) (background light))
      (:foreground "Gray90" :bold t :italic t))
@@ -1670,10 +1853,10 @@
     (((class color) (background light)) (:foreground "DarkGoldenrod"))
     (((class color) (background dark)) (:foreground "LightGoldenrod"))
     (t (:bold t :italic t)))
-  "The rcirc face used to highlight other messages."
-  :group 'rcirc)
+  "The face used to highlight other messages."
+  :group 'rcirc-faces)
 
-(defface rcirc-server-face
+(defface rcirc-server
   '((((type tty pc) (class color) (background light)) (:foreground "red"))
     (((type tty pc) (class color) (background dark)) (:foreground "red1"))
     (((class grayscale) (background light))
@@ -1683,31 +1866,31 @@
     (((class color) (background light)) (:foreground "gray40"))
     (((class color) (background dark)) (:foreground "chocolate1"))
     (t (:bold t :italic t)))
-  "The rcirc face used to highlight server messages."
-  :group 'rcirc)
+  "The face used to highlight server messages."
+  :group 'rcirc-faces)
 
-(defface rcirc-nick-in-message-face
+(defface rcirc-nick-in-message
   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
     (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
     (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
     (((class color) (background light)) (:foreground "Purple"))
     (((class color) (background dark)) (:foreground "Cyan"))
     (t (:bold t)))
-  "The rcirc face used to highlight instances of nick within messages."
-  :group 'rcirc)
+  "The face used to highlight instances of nick within messages."
+  :group 'rcirc-faces)
 
-(defface rcirc-prompt-face
+(defface rcirc-prompt
   '((((background dark)) (:foreground "cyan"))
     (t (:foreground "dark blue")))
-  "The rcirc face to use to highlight prompts."
-  :group 'rcirc)
+  "The face to use to highlight prompts."
+  :group 'rcirc-faces)
 
-(defface rcirc-mode-line-nick-face
+(defface rcirc-mode-line-nick
   '((t (:bold t)))
-  "The rcirc face used indicate activity directed at you."
-  :group 'rcirc)
+  "The face used indicate activity directed at you."
+  :group 'rcirc-faces)
 
-;; When using M-x flyspell-mode, only check words past the input marker
+;; When using M-x flyspell-mode, only check words after the prompt
 (put 'rcirc-mode 'flyspell-mode-predicate 'rcirc-looking-at-input)
 (defun rcirc-looking-at-input ()
   "Returns true if point is past the input marker."
--- a/lisp/net/tramp.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/net/tramp.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1358,6 +1358,9 @@
   (when (and (not (featurep 'xemacs))
 	     (memq system-type '(hpux)))
     500)
+;; Parentheses in docstring starting at beginning of line are escaped.
+;; Fontification is messed up when
+;; `open-paren-in-column-0-is-defun-start' set to t.
   "*If non-nil, chunksize for sending input to local process.
 It is necessary only on systems which have a buggy `process-send-string'
 implementation.  The necessity, whether this variable must be set, can be
@@ -1392,7 +1395,7 @@
         (sit-for 30))))
 
 In the Emacs normally running Tramp, evaluate the above code
-(replace \"xxx\" and \"yyy\" by the remote user and host name,
+\(replace \"xxx\" and \"yyy\" by the remote user and host name,
 respectively).  You can do this, for example, by pasting it into
 the `*scratch*' buffer and then hitting C-j with the cursor after the
 last closing parenthesis.  Note that it works only if you have configured
@@ -1409,7 +1412,7 @@
 
 When it is necessary to set `tramp-chunksize', you might consider to
 use an out-of-the-band method (like \"scp\") instead of an internal one
-(like \"ssh\"), because setting `tramp-chunksize' to non-nil decreases
+\(like \"ssh\"), because setting `tramp-chunksize' to non-nil decreases
 performance.
 
 Please raise a bug report via \"M-x tramp-bug\" if your system needs
@@ -4369,6 +4372,9 @@
 
 ;;; File name handler functions for completion mode
 
+(defvar tramp-completion-mode nil
+  "If non-nil, we are in file name completion mode.")
+
 ;; Necessary because `tramp-file-name-regexp-unified' and
 ;; `tramp-completion-file-name-regexp-unified' aren't different.
 ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to
@@ -4435,9 +4441,6 @@
   (substring
    file (length (tramp-completion-handle-file-name-directory file))))
 
-(defvar tramp-completion-mode nil
-  "If non-nil, we are in file name completion mode.")
-
 ;; Method, host name and user name completion.
 ;; `tramp-completion-dissect-file-name' returns a list of
 ;; tramp-file-name structures. For all of them we return possible completions.
@@ -5358,6 +5361,9 @@
 	       (tramp-message 10 "'set mode' error ignored.")
 	       (tramp-message 9 "Process has finished.")
 	       (throw 'tramp-action 'ok))
+	   (goto-char (point-min))
+	   (when (re-search-forward "^.cp.?: \\(.+: Permission denied.?\\)$" nil t)
+	     (error "Remote host: %s" (match-string 1)))
 	   (tramp-message 9 "Process has died.")
 	   (throw 'tramp-action 'process-died)))
 	(t nil)))
--- a/lisp/newcomment.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/newcomment.el	Mon Nov 07 14:56:19 2005 +0000
@@ -943,9 +943,13 @@
 		(setq max-indent (max max-indent (current-column)))
 		(not (or (eobp) (progn (forward-line) nil)))))
 
-	  ;; Inserting ccs can change max-indent by (1- tab-width).
 	  (setq max-indent
-		(+ max-indent (max (length cs) (length ccs)) tab-width -1))
+		(+ max-indent (max (length cs) (length ccs))
+                   ;; Inserting ccs can change max-indent by (1- tab-width)
+                   ;; but only if there are TABs in the boxed text, of course.
+                   (if (save-excursion (goto-char beg)
+                                       (search-forward "\t" end t))
+                       (1- tab-width) 0)))
 	  (unless indent (setq min-indent 0))
 
 	  ;; make the leading and trailing lines if requested
--- a/lisp/pgg-gpg.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/pgg-gpg.el	Mon Nov 07 14:56:19 2005 +0000
@@ -4,6 +4,7 @@
 ;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Symmetric encryption added by: Sascha Wilde <wilde@sha-bang.de>
 ;; Created: 1999/10/28
 ;; Keywords: PGP, OpenPGP, GnuPG
 
@@ -96,19 +97,20 @@
 	  (delete-file output-file-name))
       (set-default-file-modes orig-mode))))
 
-(defun pgg-gpg-possibly-cache-passphrase (passphrase &optional key)
+(defun pgg-gpg-possibly-cache-passphrase (passphrase &optional key notruncate)
   (if (and pgg-cache-passphrase
 	   (progn
 	     (goto-char (point-min))
 	     (re-search-forward "^\\[GNUPG:] \\(GOOD_PASSPHRASE\\>\\)\\|\\(SIG_CREATED\\)" nil t)))
-      (pgg-add-passphrase-cache
+      (pgg-add-passphrase-to-cache
        (or key
 	   (progn
 	     (goto-char (point-min))
 	     (if (re-search-forward
 		  "^\\[GNUPG:] NEED_PASSPHRASE\\(_PIN\\)? \\w+ ?\\w*" nil t)
 		 (substring (match-string 0) -8))))
-       passphrase)))
+       passphrase
+       notruncate)))
 
 (defvar pgg-gpg-all-secret-keys 'unknown)
 
@@ -139,18 +141,53 @@
 			     nil t)
 	  (substring (match-string 2) 8)))))
 
-(defun pgg-gpg-encrypt-region (start end recipients &optional sign)
+(defun pgg-gpg-lookup-key-owner (string &optional all)
+  "Search keys associated with STRING and return owner of identified key.
+
+The value may be just the bare key id, or it may be a combination of the
+user name associated with the key and the key id, with the key id enclosed
+in \"<...>\" angle brackets.
+
+Optional ALL non-nil means search all keys, including secret keys."
+  (let ((args (list "--with-colons" "--no-greeting" "--batch"
+		    (if all "--list-secret-keys" "--list-keys")
+		    string))
+        (key-regexp (concat "^\\(sec\\|pub\\)"
+                            ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*"
+                            ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):"))
+        )
+    (with-temp-buffer
+      (apply #'call-process pgg-gpg-program nil t nil args)
+      (goto-char (point-min))
+      (if (re-search-forward key-regexp
+                             nil t)
+          (match-string 3)))))
+
+(defun pgg-gpg-key-id-from-key-owner (key-owner)
+  (cond ((not key-owner) nil)
+        ;; Extract bare key id from outermost paired angle brackets, if any:
+        ((string-match "[^<]*<\\(.+\\)>[^>]*" key-owner)
+         (substring key-owner (match-beginning 1)(match-end 1)))
+        (key-owner))
+  )
+
+(defun pgg-gpg-encrypt-region (start end recipients &optional sign passphrase)
   "Encrypt the current region between START and END.
-If optional argument SIGN is non-nil, do a combined sign and encrypt."
+
+If optional argument SIGN is non-nil, do a combined sign and encrypt.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
-	 (passphrase
-	  (when sign
-	    (pgg-read-passphrase
-	     (format "GnuPG passphrase for %s: " pgg-gpg-user-id)
-	     pgg-gpg-user-id)))
+	 (passphrase (or passphrase
+                         (when sign
+                           (pgg-read-passphrase
+                            (format "GnuPG passphrase for %s: "
+                                    pgg-gpg-user-id)
+                            pgg-gpg-user-id))))
 	 (args
 	  (append
-	   (list "--batch" "--armor" "--always-trust" "--encrypt")
+	   (list "--batch" "--textmode" "--armor" "--always-trust" "--encrypt")
 	   (if sign (list "--sign" "--local-user" pgg-gpg-user-id))
 	   (if recipients
 	       (apply #'nconc
@@ -169,19 +206,46 @@
 	(pgg-gpg-possibly-cache-passphrase passphrase)))
     (pgg-process-when-success)))
 
-(defun pgg-gpg-decrypt-region (start end)
-  "Decrypt the current region between START and END."
+(defun pgg-gpg-encrypt-symmetric-region (start end &optional passphrase)
+  "Encrypt the current region between START and END with symmetric cipher.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
+  (let* ((passphrase (or passphrase
+                         (pgg-read-passphrase
+                          "GnuPG passphrase for symmetric encryption: ")))
+	 (args
+	  (append (list "--batch" "--textmode" "--armor" "--symmetric" ))))
+    (pgg-as-lbt start end 'CRLF
+      (pgg-gpg-process-region start end passphrase pgg-gpg-program args))
+    (pgg-process-when-success)))
+
+(defun pgg-gpg-decrypt-region (start end &optional passphrase)
+  "Decrypt the current region between START and END.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (let* ((current-buffer (current-buffer))
 	 (message-keys (with-temp-buffer
 			 (insert-buffer-substring current-buffer)
 			 (pgg-decode-armor-region (point-min) (point-max))))
 	 (secret-keys (pgg-gpg-lookup-all-secret-keys))
+         ;; XXX the user is stuck if they need to use the passphrase for
+         ;;     any but the first secret key for which the message is
+         ;;     encrypted.  ideally, we would incrementally give them a
+         ;;     chance with subsequent keys each time they fail with one.
 	 (key (pgg-gpg-select-matching-key message-keys secret-keys))
-	 (pgg-gpg-user-id (or key pgg-gpg-user-id pgg-default-user-id))
-	 (passphrase
-	  (pgg-read-passphrase
-	   (format "GnuPG passphrase for %s: " pgg-gpg-user-id)
-	   pgg-gpg-user-id))
+         (key-owner (and key (pgg-gpg-lookup-key-owner key t)))
+	 (key-id (pgg-gpg-key-id-from-key-owner key-owner))
+	 (pgg-gpg-user-id (or key-id key
+	                      pgg-gpg-user-id pgg-default-user-id))
+	 (passphrase (or passphrase
+                         (pgg-read-passphrase
+                          (format (if (pgg-gpg-symmetric-key-p message-keys)
+                                      "Passphrase for symmetric decryption: "
+                                    "GnuPG passphrase for %s: ")
+                                  (or key-owner "??"))
+                          pgg-gpg-user-id)))
 	 (args '("--batch" "--decrypt")))
     (pgg-gpg-process-region start end passphrase pgg-gpg-program args)
     (with-current-buffer pgg-errors-buffer
@@ -189,21 +253,31 @@
       (goto-char (point-min))
       (re-search-forward "^\\[GNUPG:] DECRYPTION_OKAY\\>" nil t))))
 
+;;;###autoload
+(defun pgg-gpg-symmetric-key-p (message-keys)
+  "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator."
+  (let (result)
+    (dolist (key message-keys result)
+      (when (and (eq (car key) 3)
+		 (member '(symmetric-key-algorithm) key))
+	(setq result key)))))
+
 (defun pgg-gpg-select-matching-key (message-keys secret-keys)
   "Choose a key from MESSAGE-KEYS that matches one of the keys in SECRET-KEYS."
   (loop for message-key in message-keys
 	for message-key-id = (and (equal (car message-key) 1)
-				  (cdr (assq 'key-identifier message-key)))
+				  (cdr (assq 'key-identifier
+                                             (cdr message-key))))
 	for key = (and message-key-id (pgg-lookup-key message-key-id 'encrypt))
 	when (and key (member key secret-keys)) return key))
 
-(defun pgg-gpg-sign-region (start end &optional cleartext)
+(defun pgg-gpg-sign-region (start end &optional cleartext passphrase)
   "Make detached signature from text between START and END."
   (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
-	 (passphrase
-	  (pgg-read-passphrase
-	   (format "GnuPG passphrase for %s: " pgg-gpg-user-id)
-	   pgg-gpg-user-id))
+	 (passphrase (or passphrase
+                         (pgg-read-passphrase
+                          (format "GnuPG passphrase for %s: " pgg-gpg-user-id)
+                          pgg-gpg-user-id)))
 	 (args
 	  (list (if cleartext "--clearsign" "--detach-sign")
 		"--armor" "--batch" "--verbose"
--- a/lisp/pgg-pgp.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/pgg-pgp.el	Mon Nov 07 14:56:19 2005 +0000
@@ -132,41 +132,57 @@
 		 (buffer-substring (point)(progn (end-of-line) (point)))))
 	 2))))))
 
-(defun pgg-pgp-encrypt-region (start end recipients)
+(defun pgg-pgp-encrypt-region (start end recipients &optional sign passphrase)
   "Encrypt the current region between START and END."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
+	 (passphrase (or passphrase
+                         (when sign
+                           (pgg-read-passphrase
+                            (format "PGP passphrase for %s: "
+                                    pgg-pgp-user-id)
+                            pgg-pgp-user-id))))
 	 (args
-	  `("+encrypttoself=off +verbose=1" "+batchmode"
-	    "+language=us" "-fate"
-	    ,@(if recipients
-		  (mapcar (lambda (rcpt) (concat "\"" rcpt "\""))
-			  (append recipients
-				  (if pgg-encrypt-for-me
-				      (list pgg-pgp-user-id))))))))
+          (append
+           `("+encrypttoself=off +verbose=1" "+batchmode"
+             "+language=us" "-fate"
+             ,@(if recipients
+                   (mapcar (lambda (rcpt) (concat "\"" rcpt "\""))
+                           (append recipients
+                                   (if pgg-encrypt-for-me
+                                       (list pgg-pgp-user-id))))))
+           (if sign '("-s" "-u" pgg-pgp-user-id)))))
     (pgg-pgp-process-region start end nil pgg-pgp-program args)
     (pgg-process-when-success nil)))
 
-(defun pgg-pgp-decrypt-region (start end)
-  "Decrypt the current region between START and END."
+(defun pgg-pgp-decrypt-region (start end &optional passphrase)
+  "Decrypt the current region between START and END.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
 	 (key (pgg-pgp-lookup-key pgg-pgp-user-id 'encrypt))
 	 (passphrase
-	  (pgg-read-passphrase
-	   (format "PGP passphrase for %s: " pgg-pgp-user-id) key))
+          (or passphrase
+              (pgg-read-passphrase
+               (format "PGP passphrase for %s: " pgg-pgp-user-id) key)))
 	 (args
-	  '("+verbose=1" "+batchmode" "+language=us" "-f")))
+          '("+verbose=1" "+batchmode" "+language=us" "-f")))
     (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
     (pgg-process-when-success
       (if pgg-cache-passphrase
-	  (pgg-add-passphrase-cache key passphrase)))))
+	  (pgg-add-passphrase-to-cache key passphrase)))))
 
-(defun pgg-pgp-sign-region (start end &optional clearsign)
-  "Make detached signature from text between START and END."
+(defun pgg-pgp-sign-region (start end &optional clearsign passphrase)
+  "Make detached signature from text between START and END.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
 	 (passphrase
-	  (pgg-read-passphrase
-	   (format "PGP passphrase for %s: " pgg-pgp-user-id)
-	   (pgg-pgp-lookup-key pgg-pgp-user-id 'sign)))
+          (or passphrase
+              (pgg-read-passphrase
+               (format "PGP passphrase for %s: " pgg-pgp-user-id)
+               (pgg-pgp-lookup-key pgg-pgp-user-id 'sign))))
 	 (args
 	  (list (if clearsign "-fast" "-fbast")
 		"+verbose=1" "+language=us" "+batchmode"
@@ -181,7 +197,7 @@
 				    (point))
 			     (point-max))))))
 	  (if pgg-cache-passphrase
-	      (pgg-add-passphrase-cache
+	      (pgg-add-passphrase-to-cache
 	       (cdr (assq 'key-identifier packet))
 	       passphrase)))))))
 
--- a/lisp/pgg-pgp5.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/pgg-pgp5.el	Mon Nov 07 14:56:19 2005 +0000
@@ -143,41 +143,51 @@
 		 (buffer-substring (match-end 0)(progn (end-of-line)(point)))))
 	 2)))))
 
-(defun pgg-pgp5-encrypt-region (start end recipients &optional sign)
+(defun pgg-pgp5-encrypt-region (start end recipients &optional sign passphrase)
   "Encrypt the current region between START and END."
   (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
+	 (passphrase (or passphrase
+                         (when sign
+                           (pgg-read-passphrase
+                            (format "PGP passphrase for %s: "
+                                    pgg-pgp5-user-id)
+                            pgg-pgp5-user-id))))
 	 (args
-	  `("+NoBatchInvalidKeys=off" "-fat" "+batchmode=1"
-	    ,@(if recipients
-		  (apply #'append
-			 (mapcar (lambda (rcpt)
-				   (list "-r"
-					 (concat "\"" rcpt "\"")))
-				 (append recipients
-					 (if pgg-encrypt-for-me
-					     (list pgg-pgp5-user-id)))))))))
+          (append
+           `("+NoBatchInvalidKeys=off" "-fat" "+batchmode=1"
+             ,@(if recipients
+                   (apply #'append
+                          (mapcar (lambda (rcpt)
+                                    (list "-r"
+                                          (concat "\"" rcpt "\"")))
+                                  (append recipients
+                                          (if pgg-encrypt-for-me
+                                              (list pgg-pgp5-user-id)))))))
+           (if sign '("-s" "-u" pgg-pgp5-user-id)))))
     (pgg-pgp5-process-region start end nil pgg-pgp5-pgpe-program args)
     (pgg-process-when-success nil)))
 
-(defun pgg-pgp5-decrypt-region (start end)
+(defun pgg-pgp5-decrypt-region (start end &optional passphrase)
   "Decrypt the current region between START and END."
   (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
 	 (passphrase
-	  (pgg-read-passphrase
-	   (format "PGP passphrase for %s: " pgg-pgp5-user-id)
-	   (pgg-pgp5-lookup-key pgg-pgp5-user-id 'encrypt)))
+          (or passphrase
+              (pgg-read-passphrase
+               (format "PGP passphrase for %s: " pgg-pgp5-user-id)
+               (pgg-pgp5-lookup-key pgg-pgp5-user-id 'encrypt))))
 	 (args
 	  '("+verbose=1" "+batchmode=1" "+language=us" "-f")))
     (pgg-pgp5-process-region start end passphrase pgg-pgp5-pgpv-program args)
     (pgg-process-when-success nil)))
 
-(defun pgg-pgp5-sign-region (start end &optional clearsign)
+(defun pgg-pgp5-sign-region (start end &optional clearsign passphrase)
   "Make detached signature from text between START and END."
   (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
 	 (passphrase
-	  (pgg-read-passphrase
-	   (format "PGP passphrase for %s: " pgg-pgp5-user-id)
-	   (pgg-pgp5-lookup-key pgg-pgp5-user-id 'sign)))
+          (or passphrase
+              (pgg-read-passphrase
+               (format "PGP passphrase for %s: " pgg-pgp5-user-id)
+               (pgg-pgp5-lookup-key pgg-pgp5-user-id 'sign))))
 	 (args
 	  (list (if clearsign "-fat" "-fbat")
 		"+verbose=1" "+language=us" "+batchmode=1"
@@ -191,7 +201,7 @@
 				    (point))
 			     (point-max))))))
 	  (if pgg-cache-passphrase
-	      (pgg-add-passphrase-cache
+	      (pgg-add-passphrase-to-cache
 	       (cdr (assq 'key-identifier packet))
 	       passphrase)))))))
 
--- a/lisp/pgg.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/pgg.el	Mon Nov 07 14:56:19 2005 +0000
@@ -4,6 +4,7 @@
 ;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Symmetric encryption added by: Sascha Wilde <wilde@sha-bang.de>
 ;; Created: 1999/10/28
 ;; Keywords: PGP
 
@@ -67,26 +68,110 @@
     (set-window-buffer window buffer)
     (shrink-window-if-larger-than-buffer window)))
 
+;; XXX `pgg-display-output-buffer' is a horrible name for this function.
+;;     It should be something like `pgg-situate-output-or-display-error'.
 (defun pgg-display-output-buffer (start end status)
+  "Situate en/decryption results or pop up an error buffer.
+
+Text from START to END is replaced by contents of output buffer if STATUS
+is true, or else the output buffer is displayed."
   (if status
-      (progn
-	(delete-region start end)
-	(insert-buffer-substring pgg-output-buffer)
-	(decode-coding-region start (point) buffer-file-coding-system))
-    (let ((temp-buffer-show-function
-	   (function pgg-temp-buffer-show-function)))
-      (with-output-to-temp-buffer pgg-echo-buffer
-	(set-buffer standard-output)
-	(insert-buffer-substring pgg-errors-buffer)))))
+      (pgg-situate-output start end)
+    (pgg-display-error-buffer)))
+
+(defun pgg-situate-output (start end)
+  "Place en/decryption result in place of current text from START to END."
+  (delete-region start end)
+  (insert-buffer-substring pgg-output-buffer)
+  (decode-coding-region start (point) buffer-file-coding-system))
+
+(defun pgg-display-error-buffer ()
+  "Pop up an error buffer indicating the reason for an en/decryption failure."
+  (let ((temp-buffer-show-function
+         (function pgg-temp-buffer-show-function)))
+    (with-output-to-temp-buffer pgg-echo-buffer
+      (set-buffer standard-output)
+      (insert-buffer-substring pgg-errors-buffer))))
 
 (defvar pgg-passphrase-cache (make-vector 7 0))
 
-(defun pgg-read-passphrase (prompt &optional key)
-  (or (and pgg-cache-passphrase
-	   key (setq key (pgg-truncate-key-identifier key))
-	   (symbol-value (intern-soft key pgg-passphrase-cache)))
+(defvar pgg-pending-timers (make-vector 7 0)
+  "Hash table for managing scheduled pgg cache management timers.
+
+We associate key and timer, so the timer can be cancelled if a new
+timeout for the key is set while an old one is still pending.")
+
+(defun pgg-read-passphrase (prompt &optional key notruncate)
+  "Using PROMPT, obtain passphrase for KEY from cache or user.
+
+Truncate the key to 8 trailing characters unless NOTRUNCATE is true
+\(default false).
+
+Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry'
+regulate cache behavior."
+  (or (pgg-read-passphrase-from-cache key notruncate)
       (read-passwd prompt)))
 
+(defun pgg-read-passphrase-from-cache (key &optional notruncate)
+  "Obtain passphrase for KEY from time-limited passphrase cache.
+
+Truncate the key to 8 trailing characters unless NOTRUNCATE is true
+\(default false).
+
+Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry'
+regulate cache behavior."
+  (and pgg-cache-passphrase
+       key (or notruncate
+                (setq key (pgg-truncate-key-identifier key)))
+       (symbol-value (intern-soft key pgg-passphrase-cache))))
+
+(defun pgg-add-passphrase-to-cache (key passphrase &optional notruncate)
+  "Associate KEY with PASSPHRASE in time-limited passphrase cache.
+
+Truncate the key to 8 trailing characters unless NOTRUNCATE is true
+\(default false).
+
+Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry'
+regulate cache behavior."
+
+  (let* ((key (if notruncate key (pgg-truncate-key-identifier key)))
+         (interned-timer-key (intern-soft key pgg-pending-timers))
+         (old-timer (symbol-value interned-timer-key))
+         new-timer)
+    (when old-timer
+        (cancel-timer old-timer)
+        (unintern interned-timer-key pgg-pending-timers))
+    (set (intern key pgg-passphrase-cache)
+         passphrase)
+    (set (intern key pgg-pending-timers)
+         (pgg-run-at-time pgg-passphrase-cache-expiry nil
+                           #'pgg-remove-passphrase-from-cache
+                           key notruncate))))
+
+(defun pgg-remove-passphrase-from-cache (key &optional notruncate)
+  "Omit passphrase associated with KEY in time-limited passphrase cache.
+
+Truncate the key to 8 trailing characters unless NOTRUNCATE is true
+\(default false).
+
+This is a no-op if there is not entry for KEY (eg, it's already expired.
+
+The memory for the passphrase is filled with underscores to clear any
+references to it.
+
+Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry'
+regulate cache behavior."
+  (let* ((passphrase (pgg-read-passphrase-from-cache key notruncate))
+         (key (if notruncate key (pgg-truncate-key-identifier key)))
+         (interned-timer-key (intern-soft key pgg-pending-timers))
+         (old-timer (symbol-value interned-timer-key)))
+    (when passphrase
+      (fillarray passphrase ?_)
+      (unintern key pgg-passphrase-cache))
+    (when old-timer
+      (pgg-cancel-timer old-timer)
+      (unintern interned-timer-key pgg-pending-timers))))
+
 (eval-when-compile
   (defmacro pgg-run-at-time-1 (time repeat function args)
     (when (featurep 'xemacs)
@@ -151,27 +236,20 @@
 
 (eval-and-compile
   (if (featurep 'xemacs)
-      (defun pgg-run-at-time (time repeat function &rest args)
-	"Emulating function run as `run-at-time'.
+      (progn
+        (defun pgg-run-at-time (time repeat function &rest args)
+          "Emulating function run as `run-at-time'.
 TIME should be nil meaning now, or a number of seconds from now.
 Return an itimer object which can be used in either `delete-itimer'
 or `cancel-timer'."
-	(pgg-run-at-time-1 time repeat function args))
-    (defalias 'pgg-run-at-time 'run-at-time)))
-
-(defun pgg-add-passphrase-cache (key passphrase)
-  (setq key (pgg-truncate-key-identifier key))
-  (set (intern key pgg-passphrase-cache)
-       passphrase)
-  (pgg-run-at-time pgg-passphrase-cache-expiry nil
-		   #'pgg-remove-passphrase-cache
-		   key))
-
-(defun pgg-remove-passphrase-cache (key)
-  (let ((passphrase (symbol-value (intern-soft key pgg-passphrase-cache))))
-    (when passphrase
-      (fillarray passphrase ?_)
-      (unintern key pgg-passphrase-cache))))
+          (pgg-run-at-time-1 time repeat function args))
+        (defun pgg-cancel-timer (timer)
+          "Emulate cancel-timer for xemacs."
+          (let ((delete-itimer 'delete-itimer))
+            (funcall delete-itimer timer)))
+        )
+    (defalias 'pgg-run-at-time 'run-at-time)
+    (defalias 'pgg-cancel-timer 'cancel-timer)))
 
 (defmacro pgg-convert-lbt-region (start end lbt)
   `(let ((pgg-conversion-end (set-marker (make-marker) ,end)))
@@ -222,93 +300,156 @@
 ;;;
 
 ;;;###autoload
-(defun pgg-encrypt-region (start end rcpts &optional sign)
+(defun pgg-encrypt-region (start end rcpts &optional sign passphrase)
   "Encrypt the current region between START and END for RCPTS.
-If optional argument SIGN is non-nil, do a combined sign and encrypt."
+
+If optional argument SIGN is non-nil, do a combined sign and encrypt.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (interactive
    (list (region-beginning)(region-end)
 	 (split-string (read-string "Recipients: ") "[ \t,]+")))
   (let ((status
 	 (pgg-save-coding-system start end
 	   (pgg-invoke "encrypt-region" (or pgg-scheme pgg-default-scheme)
-		       (point-min) (point-max) rcpts sign))))
+		       (point-min) (point-max) rcpts sign passphrase))))
+    (when (interactive-p)
+      (pgg-display-output-buffer start end status))
+    status))
+
+;;;###autoload
+(defun pgg-encrypt-symmetric-region (start end &optional passphrase)
+  "Encrypt the current region between START and END symmetric with passphrase.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+cache or user."
+  (interactive "r")
+  (let ((status
+	 (pgg-save-coding-system start end
+	   (pgg-invoke "encrypt-symmetric-region" 
+		       (or pgg-scheme pgg-default-scheme)
+		       (point-min) (point-max) passphrase))))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))
 
 ;;;###autoload
-(defun pgg-encrypt (rcpts &optional sign start end)
-  "Encrypt the current buffer for RCPTS.
-If optional argument SIGN is non-nil, do a combined sign and encrypt.
+(defun pgg-encrypt-symmetric (&optional start end passphrase)
+  "Encrypt the current buffer using a symmetric, rather than key-pair, cipher.
+
 If optional arguments START and END are specified, only encrypt within
-the region."
-  (interactive (list (split-string (read-string "Recipients: ") "[ \t,]+")))
+the region.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
+  (interactive)
   (let* ((start (or start (point-min)))
 	 (end (or end (point-max)))
-	 (status (pgg-encrypt-region start end rcpts sign)))
+	 (status (pgg-encrypt-symmetric-region start end passphrase)))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))
 
 ;;;###autoload
-(defun pgg-decrypt-region (start end)
-  "Decrypt the current region between START and END."
-  (interactive "r")
-  (let* ((buf (current-buffer))
-	 (status
-	  (pgg-save-coding-system start end
-	    (pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme)
-			(point-min) (point-max)))))
+(defun pgg-encrypt (rcpts &optional sign start end passphrase)
+  "Encrypt the current buffer for RCPTS.
+
+If optional argument SIGN is non-nil, do a combined sign and encrypt.
+
+If optional arguments START and END are specified, only encrypt within
+the region.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
+  (interactive (list (split-string (read-string "Recipients: ") "[ \t,]+")))
+  (let* ((start (or start (point-min)))
+	 (end (or end (point-max)))
+	 (status (pgg-encrypt-region start end rcpts sign passphrase)))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))
 
 ;;;###autoload
-(defun pgg-decrypt (&optional start end)
+(defun pgg-decrypt-region (start end &optional passphrase)
+  "Decrypt the current region between START and END.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
+  (interactive "r")
+  (let* ((buf (current-buffer))
+	 (status
+	  (pgg-save-coding-system start end
+	    (pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme)
+			(point-min) (point-max) passphrase))))
+    (when (interactive-p)
+      (pgg-display-output-buffer start end status))
+    status))
+
+;;;###autoload
+(defun pgg-decrypt (&optional start end passphrase)
   "Decrypt the current buffer.
+
 If optional arguments START and END are specified, only decrypt within
-the region."
+the region.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (interactive "")
   (let* ((start (or start (point-min)))
 	 (end (or end (point-max)))
-	 (status (pgg-decrypt-region start end)))
+	 (status (pgg-decrypt-region start end passphrase)))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))
 
 ;;;###autoload
-(defun pgg-sign-region (start end &optional cleartext)
+(defun pgg-sign-region (start end &optional cleartext passphrase)
   "Make the signature from text between START and END.
+
 If the optional 3rd argument CLEARTEXT is non-nil, it does not create
 a detached signature.
+
 If this function is called interactively, CLEARTEXT is enabled
-and the the output is displayed."
+and the the output is displayed.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (interactive "r")
   (let ((status (pgg-save-coding-system start end
 		  (pgg-invoke "sign-region" (or pgg-scheme pgg-default-scheme)
 			      (point-min) (point-max)
-			      (or (interactive-p) cleartext)))))
+			      (or (interactive-p) cleartext)
+                              passphrase))))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))
 
 ;;;###autoload
-(defun pgg-sign (&optional cleartext start end)
+(defun pgg-sign (&optional cleartext start end passphrase)
   "Sign the current buffer.
+
 If the optional argument CLEARTEXT is non-nil, it does not create a
 detached signature.
+
 If optional arguments START and END are specified, only sign data
 within the region.
+
 If this function is called interactively, CLEARTEXT is enabled
-and the the output is displayed."
+and the the output is displayed.
+
+If optional PASSPHRASE is not specified, it will be obtained from the
+passphrase cache or user."
   (interactive "")
   (let* ((start (or start (point-min)))
 	 (end (or end (point-max)))
-	 (status (pgg-sign-region start end (or (interactive-p) cleartext))))
+	 (status (pgg-sign-region start end
+                                  (or (interactive-p) cleartext)
+                                  passphrase)))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))
-  
+
 ;;;###autoload
 (defun pgg-verify-region (start end &optional signature fetch)
   "Verify the current region between START and END.
--- a/lisp/progmodes/compile.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/compile.el	Mon Nov 07 14:56:19 2005 +0000
@@ -707,24 +707,25 @@
       (setq marker (nth 3 (cadr marker-line))
 	    marker-line (or (car marker-line) 1))
       (with-current-buffer (marker-buffer marker)
-	(save-restriction
-	  (widen)
-	  (goto-char (marker-position marker))
-	  (when (or end-col end-line)
-	    (beginning-of-line (- (or end-line line) marker-line -1))
-	    (if (or (null end-col) (< end-col 0))
-		(end-of-line)
-	      (compilation-move-to-column
-	       end-col compilation-error-screen-columns))
-	    (setq end-marker (list (point-marker))))
-	  (beginning-of-line (if end-line
-				 (- line end-line -1)
-			       (- loc marker-line -1)))
-	  (if col
-	      (compilation-move-to-column
-	       col compilation-error-screen-columns)
-	    (forward-to-indentation 0))
-	  (setq marker (list (point-marker))))))
+	(save-excursion
+	  (save-restriction
+	    (widen)
+	    (goto-char (marker-position marker))
+	    (when (or end-col end-line)
+	      (beginning-of-line (- (or end-line line) marker-line -1))
+	      (if (or (null end-col) (< end-col 0))
+		  (end-of-line)
+		(compilation-move-to-column
+		 end-col compilation-error-screen-columns))
+	      (setq end-marker (list (point-marker))))
+	    (beginning-of-line (if end-line
+				   (- line end-line -1)
+				 (- loc marker-line -1)))
+	    (if col
+		(compilation-move-to-column
+		 col compilation-error-screen-columns)
+	      (forward-to-indentation 0))
+	    (setq marker (list (point-marker)))))))
 
     (setq loc (compilation-assq line (cdr file-struct)))
     (if end-line
--- a/lisp/progmodes/f90.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/f90.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1767,7 +1767,7 @@
                            (buffer-substring
                             (line-beginning-position)
                             (line-end-position)))
-                (sit-for 1)))
+                (sit-for blink-matching-delay)))
           (setq beg-block (car matching-beg)
                 beg-name (car (cdr matching-beg)))
           (goto-char end-point)
--- a/lisp/progmodes/fortran.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/fortran.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1251,7 +1251,7 @@
       (if message
           (message "%s" message)
         (goto-char matching)
-        (sit-for 1)
+        (sit-for blink-matching-delay)
         (goto-char end-point)))))
 
 (defun fortran-blink-matching-if ()
--- a/lisp/progmodes/gdb-ui.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Mon Nov 07 14:56:19 2005 +0000
@@ -50,6 +50,9 @@
 ;; still under development and is part of a process to migrate Emacs from
 ;; annotations to GDB/MI.
 ;;
+;; This mode SHOULD WORK WITH GDB 5.0 ONWARDS but you will NEED GDB 6.0
+;; ONWARDS TO USE WATCH EXPRESSIONS.
+;;
 ;; Windows Platforms:
 ;;
 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer
@@ -74,6 +77,8 @@
 ;; 4) Mark breakpoint locations on scroll-bar of source buffer?
 ;; 5) After release of 22.1 use '-var-list-children --all-values'
 ;;    and '-stack-list-locals 2' which need GDB 6.1 onwards.
+;; 6) With gud-print and gud-pstar, print the variable name in the GUD
+;;    buffer instead of the value's history number.
 
 ;;; Code:
 
@@ -91,7 +96,6 @@
 (defvar gdb-var-list nil "List of variables in watch window.")
 (defvar gdb-var-changed nil "Non-nil means that `gdb-var-list' has changed.")
 (defvar gdb-main-file nil "Source file from which program execution begins.")
-(defvar gdb-buffer-type nil)
 (defvar gdb-overlay-arrow-position nil)
 (defvar gdb-server-prefix nil)
 (defvar gdb-flush-pending-output nil)
@@ -107,6 +111,7 @@
 
 (defvar gdb-buffer-type nil
   "One of the symbols bound in `gdb-buffer-rules'.")
+(make-variable-buffer-local 'gdb-buffer-type)
 
 (defvar gdb-input-queue ()
   "A list of gdb command objects.")
@@ -211,12 +216,6 @@
   :group 'gud
   :version "22.1")
 
-(defcustom gdb-use-inferior-io-buffer nil
-  "Non-nil means display output from the inferior in a separate buffer."
-  :type 'boolean
-  :group 'gud
-  :version "22.1")
-
 (defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
   "Shell command for generating a list of defined macros in a source file.
 This list is used to display the #define directive associated
@@ -242,6 +241,28 @@
   :group 'gud
   :version "22.1")
 
+(defcustom gdb-use-inferior-io-buffer nil
+  "Non-nil means display output from the inferior in a separate buffer."
+  :type 'boolean
+  :group 'gud
+  :version "22.1")
+
+(defun gdb-use-inferior-io-buffer (arg)
+  "Toggle separate IO for inferior.
+With arg, use separate IO iff arg is positive."
+  (interactive "P")
+  (setq gdb-use-inferior-io-buffer
+	(if (null arg)
+	    (not gdb-use-inferior-io-buffer)
+	  (> (prefix-numeric-value arg) 0)))
+  (if (and gud-comint-buffer
+	   (buffer-name gud-comint-buffer))
+      (condition-case nil
+	  (if gdb-use-inferior-io-buffer
+	      (gdb-restore-windows)
+	    (kill-buffer (gdb-inferior-io-name)))
+	(error nil))))
+
 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
 
 (defun gdb-create-define-alist ()
@@ -277,7 +298,7 @@
   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
     (goto-char (point-min))
     (if (search-forward "expands to: " nil t)
-	(unless (looking-at "\\S+.*(.*).*")
+	(unless (looking-at "\\S-+.*(.*).*")
 	  (gdb-enqueue-input
 	   (list  (concat gdb-server-prefix "print " expr "\n")
 		  'gdb-tooltip-print))))))
@@ -404,16 +425,28 @@
   "Execute source lines by dragging the overlay arrow (fringe) with the mouse."
   (interactive "e")
   (if gud-overlay-arrow-position
-	(let ((start (event-start event))
-	      (end  (event-end event))
-	      (buffer (marker-buffer gud-overlay-arrow-position)) (line))
-	  (if (equal buffer (window-buffer (posn-window end)))
-	      (with-current-buffer buffer
-		(when (or (equal start end)
-			  (equal (posn-point start)
-				 (marker-position gud-overlay-arrow-position)))
-		  (setq line (line-number-at-pos (posn-point end)))
-		  (gud-call (concat "until " (number-to-string line)))))))))
+      (let ((start (event-start event))
+	    (end  (event-end event))
+	    (buffer (marker-buffer gud-overlay-arrow-position)) (line))
+	(if (not (string-match "Machine" mode-name))
+	    (if (equal buffer (window-buffer (posn-window end)))
+		(with-current-buffer buffer
+		  (when (or (equal start end)
+			    (equal (posn-point start)
+				   (marker-position
+				    gud-overlay-arrow-position)))
+		    (setq line (line-number-at-pos (posn-point end)))
+		    (gud-call (concat "until " (number-to-string line))))))
+	  (if (equal (marker-buffer gdb-overlay-arrow-position)
+		     (window-buffer (posn-window end)))
+	      (when (or (equal start end)
+			(equal (posn-point start)
+			       (marker-position
+				gdb-overlay-arrow-position)))
+		(save-excursion
+		  (goto-line (line-number-at-pos (posn-point end)))
+		  (forward-char 2)
+		  (gud-call (concat "until *%a")))))))))
 
 (defcustom gdb-use-colon-colon-notation nil
   "If non-nil use FUN::VAR format to display variables in the speedbar."
@@ -425,21 +458,21 @@
   "Watch expression at point."
   (interactive)
   (require 'tooltip)
-  (let ((expr (tooltip-identifier-from-point (point))))
-    (if (and (string-equal gdb-current-language "c")
-	     gdb-use-colon-colon-notation gdb-selected-frame)
-	(setq expr (concat gdb-selected-frame "::" expr)))
-    (catch 'already-watched
-      (dolist (var gdb-var-list)
-	(if (string-equal expr (car var)) (throw 'already-watched nil)))
-      (set-text-properties 0 (length expr) nil expr)
-      (gdb-enqueue-input
-       (list
-	(if (eq gud-minor-mode 'gdba)
-	    (concat "server interpreter mi \"-var-create - * "  expr "\"\n")
-	  (concat"-var-create - * "  expr "\n"))
-	     `(lambda () (gdb-var-create-handler ,expr))))))
-  (select-window (get-buffer-window gud-comint-buffer 0)))
+  (save-selected-window
+    (let ((expr (tooltip-identifier-from-point (point))))
+      (if (and (string-equal gdb-current-language "c")
+	       gdb-use-colon-colon-notation gdb-selected-frame)
+	  (setq expr (concat gdb-selected-frame "::" expr)))
+      (catch 'already-watched
+	(dolist (var gdb-var-list)
+	  (if (string-equal expr (car var)) (throw 'already-watched nil)))
+	(set-text-properties 0 (length expr) nil expr)
+	(gdb-enqueue-input
+	 (list
+	  (if (eq gud-minor-mode 'gdba)
+	      (concat "server interpreter mi \"-var-create - * "  expr "\"\n")
+	    (concat"-var-create - * "  expr "\n"))
+	  `(lambda () (gdb-var-create-handler ,expr))))))))
 
 (defconst gdb-var-create-regexp
   "name=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\",type=\"\\(.*?\\)\"")
@@ -461,8 +494,8 @@
 	  (if (equal (nth 2 var) "0")
 	      (gdb-enqueue-input
 	       (list
-		(if (with-current-buffer
-			gud-comint-buffer (eq gud-minor-mode 'gdba))
+		(if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+			'gdba)
 		    (concat "server interpreter mi \"-var-evaluate-expression "
 			    (nth 1 var) "\"\n")
 		  (concat "-var-evaluate-expression " (nth 1 var) "\n"))
@@ -564,8 +597,8 @@
 (defun gdb-var-delete ()
   "Delete watch expression at point from the speedbar."
   (interactive)
-  (if (with-current-buffer
-	  gud-comint-buffer (memq gud-minor-mode '(gdbmi gdba)))
+  (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+	    '(gdbmi gdba))
       (let ((text (speedbar-line-text)))
 	(string-match "\\(\\S-+\\)" text)
 	(let* ((expr (match-string 1 text))
@@ -574,8 +607,8 @@
 	  (unless (string-match "\\." varnum)
 	    (gdb-enqueue-input
 	     (list
-	      (if (with-current-buffer gud-comint-buffer
-		    (eq gud-minor-mode 'gdba))
+	      (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		      'gdba)
 		  (concat "server interpreter mi \"-var-delete " varnum "\"\n")
 		(concat "-var-delete " varnum "\n"))
 		   'ignore))
@@ -592,8 +625,7 @@
     (setq value (read-string "New value: "))
     (gdb-enqueue-input
      (list
-      (if (with-current-buffer gud-comint-buffer
-	    (eq gud-minor-mode 'gdba))
+      (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	  (concat "server interpreter mi \"-var-assign "
 		  varnum " " value "\"\n")
 	(concat "-var-assign " varnum " " value "\n"))
@@ -612,7 +644,7 @@
 TOKEN is data related to this node.
 INDENT is the current indentation depth."
   (cond ((string-match "+" text)        ;expand this node
-	 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+	 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	     (gdb-var-list-children token)
 	   (progn
 	     (gdbmi-var-update)
@@ -661,9 +693,9 @@
 	  (let ((trigger))
 	    (if (cdr (cdr rules))
 		(setq trigger (funcall (car (cdr (cdr rules))))))
-	    (set (make-local-variable 'gdb-buffer-type) key)
+	    (setq gdb-buffer-type key)
 	    (set (make-local-variable 'gud-minor-mode)
-		 (with-current-buffer gud-comint-buffer gud-minor-mode))
+		 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
 	    (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
 	    (if trigger (funcall trigger)))
 	  new))))
@@ -850,22 +882,21 @@
   (setq gdb-flush-pending-output nil)
   (if gdb-enable-debug-log (push (cons 'send-item item) gdb-debug-log))
   (setq gdb-current-item item)
-  (with-current-buffer gud-comint-buffer
-    (if (eq gud-minor-mode 'gdba)
+  (let ((process (get-buffer-process gud-comint-buffer)))
+    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	(if (stringp item)
 	    (progn
 	      (setq gdb-output-sink 'user)
-	      (process-send-string (get-buffer-process gud-comint-buffer) item))
+	      (process-send-string process item))
 	  (progn
 	    (gdb-clear-partial-output)
 	    (setq gdb-output-sink 'pre-emacs)
-	    (process-send-string (get-buffer-process gud-comint-buffer)
+	    (process-send-string process
 				 (car item))))
       ;; case: eq gud-minor-mode 'gdbmi
       (gdb-clear-partial-output)
       (setq gdb-output-sink 'emacs)
-      (process-send-string (get-buffer-process gud-comint-buffer)
-			   (car item)))))
+      (process-send-string process (car item)))))
 
 ;;
 ;; output -- things gdb prints to emacs
@@ -1012,6 +1043,8 @@
 function is used to change the focus of GUD tooltips to #define
 directives."
   (setq gdb-active-process nil)
+  (setq gud-overlay-arrow-position nil)
+  (setq gdb-overlay-arrow-position nil)
   (gdb-stopping ignored))
 
 (defun gdb-frame-begin (ignored)
@@ -1509,7 +1542,7 @@
   (use-local-map gdb-breakpoints-mode-map)
   (setq buffer-read-only t)
   (run-mode-hooks 'gdb-breakpoints-mode-hook)
-  (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
       'gdb-invalidate-breakpoints
     'gdbmi-invalidate-breakpoints))
 
@@ -1518,7 +1551,7 @@
   (interactive)
   (save-excursion
     (beginning-of-line 1)
-    (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+    (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	    (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)\\s-+")
 	  (looking-at
      "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
@@ -1535,7 +1568,7 @@
   "Delete the breakpoint at current line."
   (interactive)
   (beginning-of-line 1)
-  (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+  (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	  (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)")
 	(looking-at
 	 "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
@@ -1548,9 +1581,12 @@
   "Display the breakpoint location specified at current line."
   (interactive (list last-input-event))
   (if event (mouse-set-point event))
+  ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer.
+  (let ((window (get-buffer-window gud-comint-buffer)))
+    (if window (save-selected-window  (select-window window))))
   (save-excursion
     (beginning-of-line 1)
-    (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+    (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	    (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
 	  (looking-at
 	   "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+.\\s-+\\S-+\\s-+\
@@ -1593,9 +1629,10 @@
 	(while (< (point) (point-max))
 	  (setq bl (line-beginning-position)
 		el (line-end-position))
-	  (add-text-properties bl el
-			     '(mouse-face highlight
-			       help-echo "mouse-2, RET: Select frame"))
+	  (unless (looking-at "No ")
+	    (add-text-properties bl el
+				 '(mouse-face highlight
+			           help-echo "mouse-2, RET: Select frame")))
 	  (goto-char bl)
 	  (when (looking-at "^#\\([0-9]+\\)")
 	    (when (string-equal (match-string 1) gdb-frame-number)
@@ -1654,7 +1691,7 @@
   (use-local-map gdb-frames-mode-map)
   (font-lock-mode -1)
   (run-mode-hooks 'gdb-frames-mode-hook)
-  (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
       'gdb-invalidate-frames
     'gdbmi-invalidate-frames))
 
@@ -1692,9 +1729,10 @@
     (let ((buffer-read-only nil))
       (goto-char (point-min))
       (while (< (point) (point-max))
-	(add-text-properties (line-beginning-position) (line-end-position)
-			     '(mouse-face highlight
-			       help-echo "mouse-2, RET: select thread"))
+	(unless (looking-at "No ")
+	  (add-text-properties (line-beginning-position) (line-end-position)
+			       '(mouse-face highlight
+			         help-echo "mouse-2, RET: select thread")))
 	(forward-line 1)))))
 
 (defun gdb-threads-buffer-name ()
@@ -1777,7 +1815,19 @@
   gdb-info-registers-handler
   gdb-info-registers-custom)
 
-(defun gdb-info-registers-custom ())
+(defun gdb-info-registers-custom ()
+  (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
+    (save-excursion
+      (let ((buffer-read-only nil)
+	    bl)
+	(goto-char (point-min))
+	(while (< (point) (point-max))
+	  (setq bl (line-beginning-position))
+	  (when (looking-at "^[^ ]+")
+	    (unless (string-equal (match-string 0) "The")
+	      (put-text-property bl (match-end 0)
+				 'face font-lock-variable-name-face)))
+	  (forward-line 1))))))
 
 (defvar gdb-registers-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1786,12 +1836,6 @@
     (define-key map "q" 'kill-this-buffer)
      map))
 
-(defvar gdb-registers-font-lock-keywords
-  '(
-    ("^[^ ]+" . font-lock-variable-name-face)
-    )
-  "Font lock keywords used in `gdb-registers-mode'.")
-
 (defun gdb-registers-mode ()
   "Major mode for gdb registers.
 
@@ -1801,10 +1845,8 @@
   (setq mode-name "Registers:")
   (setq buffer-read-only t)
   (use-local-map gdb-registers-mode-map)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-registers-font-lock-keywords))
   (run-mode-hooks 'gdb-registers-mode-hook)
-  (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
       'gdb-invalidate-registers
     'gdbmi-invalidate-registers))
 
@@ -2160,7 +2202,7 @@
 
 ;; Abbreviate for arrays and structures.
 ;; These can be expanded using gud-display.
-(defun gdb-info-locals-handler nil
+(defun gdb-info-locals-handler ()
   (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
 				  gdb-pending-triggers))
   (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
@@ -2192,7 +2234,7 @@
     (define-key map "q" 'kill-this-buffer)
      map))
 
-(defvar gdb-local-font-lock-keywords
+(defvar gdb-locals-font-lock-keywords
   '(
     ;; var = (struct struct_tag) value
     ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
@@ -2219,9 +2261,9 @@
   (setq buffer-read-only t)
   (use-local-map gdb-locals-mode-map)
   (set (make-local-variable 'font-lock-defaults)
-       '(gdb-local-font-lock-keywords))
+       '(gdb-locals-font-lock-keywords))
   (run-mode-hooks 'gdb-locals-mode-hook)
-  (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
       'gdb-invalidate-locals
     'gdbmi-invalidate-locals))
 
@@ -2309,11 +2351,9 @@
   (define-key gud-menu-map [ui]
     `(menu-item "GDB-UI" ,menu :visible (eq gud-minor-mode 'gdba)))
   (define-key menu [gdb-use-inferior-io]
-    ;; See defadvice below.
-    (menu-bar-make-toggle toggle-gdb-use-inferior-io-buffer
-			  gdb-use-inferior-io-buffer
-     "Separate inferior IO" "Use separate IO %s"
-     "Toggle separate IO for inferior."))
+  '(menu-item "Separate inferior IO" gdb-use-inferior-io-buffer
+	      :help "Toggle separate IO for inferior."
+	      :button (:toggle . gdb-use-inferior-io-buffer)))
   (define-key menu [gdb-many-windows]
   '(menu-item "Display Other Windows" gdb-many-windows
 	      :help "Toggle display of locals, stack and breakpoint information"
@@ -2322,23 +2362,19 @@
   '(menu-item "Restore Window Layout" gdb-restore-windows
 	      :help "Restore standard layout for debug session.")))
 
-;; This function is defined above through a macro.
-(defadvice toggle-gdb-use-inferior-io-buffer (after gdb-kill-io-buffer activate)
-  (unless gdb-use-inferior-io-buffer
-    (kill-buffer (gdb-inferior-io-name))))
-
 (defun gdb-frame-gdb-buffer ()
   "Display GUD buffer in a new frame."
   (interactive)
-  (select-frame (make-frame gdb-frame-parameters))
-  (switch-to-buffer (gdb-get-create-buffer 'gdba))
-  (set-window-dedicated-p (selected-window) t))
+  (let ((special-display-regexps (append special-display-regexps '(".*")))
+	(special-display-frame-alist gdb-frame-parameters)
+	(same-window-regexps nil))
+    (display-buffer gud-comint-buffer)))
 
 (defun gdb-display-gdb-buffer ()
   "Display GUD buffer."
   (interactive)
-  (gdb-display-buffer
-   (gdb-get-create-buffer 'gdba)))
+  (let ((same-window-regexps nil))
+    (pop-to-buffer gud-comint-buffer)))
 
 (defun gdb-set-window-buffer (name)
   (set-window-buffer (selected-window) (get-buffer name))
@@ -2386,15 +2422,18 @@
   :version "22.1")
 
 (defun gdb-many-windows (arg)
-  "Toggle the number of windows in the basic arrangement."
+  "Toggle the number of windows in the basic arrangement.
+With arg, display additional buffers iff arg is positive."
   (interactive "P")
   (setq gdb-many-windows
 	(if (null arg)
 	    (not gdb-many-windows)
 	  (> (prefix-numeric-value arg) 0)))
-  (condition-case nil
-      (gdb-restore-windows)
-    (error nil)))
+  (if (and gud-comint-buffer
+	   (buffer-name gud-comint-buffer))
+      (condition-case nil
+	  (gdb-restore-windows)
+	(error nil))))
 
 (defun gdb-restore-windows ()
   "Restore the basic arrangement of windows used by gdba.
@@ -2404,13 +2443,14 @@
     (delete-other-windows)
   (if gdb-many-windows
       (gdb-setup-windows)
-    (split-window)
-    (other-window 1)
-    (switch-to-buffer
-	 (if gud-last-last-frame
-	     (gud-find-file (car gud-last-last-frame))
-	   (gud-find-file gdb-main-file)))
-    (other-window 1)))
+    (when (or gud-last-last-frame gdb-show-main)
+      (split-window)
+      (other-window 1)
+      (switch-to-buffer
+       (if gud-last-last-frame
+	   (gud-find-file (car gud-last-last-frame))
+	 (gud-find-file gdb-main-file)))
+      (other-window 1))))
 
 (defun gdb-reset ()
   "Exit a debugging session cleanly.
@@ -2485,8 +2525,8 @@
 	   ;; in case gud or gdb-ui is just loaded
 	   gud-comint-buffer
 	   (buffer-name gud-comint-buffer)
-	   (with-current-buffer gud-comint-buffer
-	     (eq gud-minor-mode 'gdba)))
+	   (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+	       'gdba))
       (condition-case nil
 	(gdb-enqueue-input
 	 (list (concat gdb-server-prefix "list "
@@ -2694,7 +2734,7 @@
 
 (defun gdb-assembler-buffer-name ()
   (with-current-buffer gud-comint-buffer
-    (concat "*Disassembly of " (gdb-get-target-string) "*")))
+    (concat "*disassembly of " (gdb-get-target-string) "*")))
 
 (defun gdb-display-assembler-buffer ()
   "Display disassembly view."
--- a/lisp/progmodes/gud.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/gud.el	Mon Nov 07 14:56:19 2005 +0000
@@ -2536,6 +2536,7 @@
 		    (let ((inhibit-read-only t))
 		      (delete-region (process-mark proc)
 				     gud-delete-prompt-marker)
+		      (comint-update-fence)
 		      (set-marker gud-delete-prompt-marker nil)))
 		;; Save the process output, checking for source file markers.
 		(setq output (gud-marker-filter string))
--- a/lisp/progmodes/ld-script.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/ld-script.el	Mon Nov 07 14:56:19 2005 +0000
@@ -97,11 +97,17 @@
     "ADDR"
     "ALIGN"
     "BLOCK"
+    "DATA_SEGMENT_ALIGN"
+    "DATA_SEGMENT_END"
+    "DATA_SEGMENT_RELRO_END"
     "DEFINED"
+    "LENGTH"
     "LOADADDR"
     "MAX"
     "MIN"
     "NEXT"
+    "ORIGIN"
+    "SEGMENT_START"
     "SIZEOF"
     "SIZEOF_HEADERS"
     "sizeof_headers")
@@ -119,7 +125,7 @@
   "Default font-lock-keywords for `ld-script-mode'.")
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.lds" . ld-script-mode))
+(add-to-list 'auto-mode-alist '("\\.ld[s]?\\(\\.in\\)?$" . ld-script-mode))
 
 ;;;###autoload
 (define-derived-mode ld-script-mode nil "LD-Script"
--- a/lisp/progmodes/perl-mode.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/perl-mode.el	Mon Nov 07 14:56:19 2005 +0000
@@ -252,8 +252,9 @@
 ;;
 ;; <file*glob>
 (defvar perl-font-lock-syntactic-keywords
-  ;; Turn POD into b-style comments
-  '(("^\\(=\\)\\sw" (1 "< b"))
+  ;; TODO: here-documents ("<<\\(\\sw\\|['\"]\\)")
+  '(;; Turn POD into b-style comments
+    ("^\\(=\\)\\sw" (1 "< b"))
     ("^=cut[ \t]*\\(\n\\)" (1 "> b"))
     ;; Catch ${ so that ${var} doesn't screw up indentation.
     ;; This also catches $' to handle 'foo$', although it should really
@@ -275,7 +276,8 @@
      (3 (if (assoc (char-after (match-beginning 3))
 		   perl-quote-like-pairs)
 	    '(15) '(7))))
-    ;; TODO: here-documents ("<<\\(\\sw\\|['\"]\\)")
+    ;; Find and mark the end of funny quotes and format statements.
+    (perl-font-lock-special-syntactic-constructs)
     ))
 
 (defvar perl-empty-syntax-table
@@ -295,88 +297,93 @@
       (modify-syntax-entry close ")" st))
     st))
 
-(defun perl-font-lock-syntactic-face-function (state)
-  (let ((char (nth 3 state)))
-    (cond
-     ((not char)
-      ;; Comment or docstring.
-      (if (nth 7 state) font-lock-doc-face font-lock-comment-face))
-     ((and (char-valid-p char) (eq (char-syntax (nth 3 state)) ?\"))
-      ;; Normal string.
-      font-lock-string-face)
-     ((eq (nth 3 state) ?\n)
-      ;; A `format' command.
-      (save-excursion
-	(when (and (re-search-forward "^\\s *\\.\\s *$" nil t)
-		   (not (eobp)))
-	  (put-text-property (point) (1+ (point)) 'syntax-table '(7)))
-	font-lock-string-face))
-     (t
-      ;; This is regexp like quote thingy.
-      (setq char (char-after (nth 8 state)))
-      (save-excursion
-	(let ((twoargs (save-excursion
-			 (goto-char (nth 8 state))
-			 (skip-syntax-backward " ")
-			 (skip-syntax-backward "w")
-			 (member (buffer-substring
-				  (point) (progn (forward-word 1) (point)))
-				 '("tr" "s" "y"))))
-	      (close (cdr (assq char perl-quote-like-pairs)))
-	      (pos (point))
-	      (st (perl-quote-syntax-table char)))
-	  (if (not close)
-	      ;; The closing char is the same as the opening char.
-	      (with-syntax-table st
-		(parse-partial-sexp (point) (point-max)
-				    nil nil state 'syntax-table)
-		(when twoargs
-		  (parse-partial-sexp (point) (point-max)
-				      nil nil state 'syntax-table)))
-	    ;; The open/close chars are matched like () [] {} and <>.
-	    (let ((parse-sexp-lookup-properties nil))
-	      (condition-case err
-		  (progn
-		    (with-syntax-table st
-		      (goto-char (nth 8 state)) (forward-sexp 1))
-		    (when twoargs
-		      (save-excursion
-			;; Skip whitespace and make sure that font-lock will
-			;; refontify the second part in the proper context.
-			(put-text-property
-			 (point) (progn (forward-comment (point-max)) (point))
-			 'font-lock-multiline t)
-			;;
-			(unless
-			    (save-excursion
-			      (with-syntax-table
-				  (perl-quote-syntax-table (char-after))
-				(forward-sexp 1))
-			      (put-text-property pos (line-end-position)
-						 'jit-lock-defer-multiline t)
-			      (looking-at "\\s-*\\sw*e"))
-			  (put-text-property (point) (1+ (point))
-					     'syntax-table
-					     (if (assoc (char-after)
-							perl-quote-like-pairs)
-						 '(15) '(7)))))))
-		;; The arg(s) is not terminated, so it extends until EOB.
-		(scan-error (goto-char (point-max))))))
-	  ;; Point is now right after the arg(s).
-	  ;; Erase any syntactic marks within the quoted text.
-	  (put-text-property pos (1- (point)) 'syntax-table nil)
-	  (when (eq (char-before (1- (point))) ?$)
-	    (put-text-property (- (point) 2) (1- (point))
-			       'syntax-table '(1)))
-	  (put-text-property (1- (point)) (point)
-			     'syntax-table (if close '(15) '(7)))
-	  font-lock-string-face))))))
-	    ;; (if (or twoargs (not (looking-at "\\s-*\\sw*e")))
-	    ;; 	font-lock-string-face
-	    ;;   (font-lock-fontify-syntactically-region
-	    ;;    ;; FIXME: `end' is accessed via dyn-scoping.
-	    ;;    pos (min end (1- (point))) nil '(nil))
-	    ;;   nil)))))))
+(defun perl-font-lock-special-syntactic-constructs (limit)
+  ;; We used to do all this in a font-lock-syntactic-face-function, which
+  ;; did not work correctly because sometimes some parts of the buffer are
+  ;; treated with font-lock-syntactic-keywords but not with
+  ;; font-lock-syntactic-face-function (mostly because of
+  ;; font-lock-syntactically-fontified).  That meant that some syntax-table
+  ;; properties were missing.  So now we do the parse-partial-sexp loop
+  ;; ourselves directly from font-lock-syntactic-keywords, so we're sure
+  ;; it's done when necessary.
+  (let ((state (syntax-ppss))
+        char)
+    (while (< (point) limit)
+      (cond
+       ((or (null (setq char (nth 3 state)))
+            (and (char-valid-p char) (eq (char-syntax (nth 3 state)) ?\")))
+        ;; Normal text, or comment, or docstring, or normal string.
+        nil)
+       ((eq (nth 3 state) ?\n)
+        ;; A `format' command.
+        (save-excursion
+          (when (and (re-search-forward "^\\s *\\.\\s *$" nil t)
+                     (not (eobp)))
+            (put-text-property (point) (1+ (point)) 'syntax-table '(7)))))
+       (t
+        ;; This is regexp like quote thingy.
+        (setq char (char-after (nth 8 state)))
+        (save-excursion
+          (let ((twoargs (save-excursion
+                           (goto-char (nth 8 state))
+                           (skip-syntax-backward " ")
+                           (skip-syntax-backward "w")
+                           (member (buffer-substring
+                                    (point) (progn (forward-word 1) (point)))
+                                   '("tr" "s" "y"))))
+                (close (cdr (assq char perl-quote-like-pairs)))
+                (pos (point))
+                (st (perl-quote-syntax-table char)))
+            (if (not close)
+                ;; The closing char is the same as the opening char.
+                (with-syntax-table st
+                  (parse-partial-sexp (point) (point-max)
+                                      nil nil state 'syntax-table)
+                  (when twoargs
+                    (parse-partial-sexp (point) (point-max)
+                                        nil nil state 'syntax-table)))
+              ;; The open/close chars are matched like () [] {} and <>.
+              (let ((parse-sexp-lookup-properties nil))
+                (condition-case err
+                    (progn
+                      (with-syntax-table st
+                        (goto-char (nth 8 state)) (forward-sexp 1))
+                      (when twoargs
+                        (save-excursion
+                          ;; Skip whitespace and make sure that font-lock will
+                          ;; refontify the second part in the proper context.
+                          (put-text-property
+                           (point) (progn (forward-comment (point-max)) (point))
+                           'font-lock-multiline t)
+                          ;;
+                          (unless
+                              (save-excursion
+                                (with-syntax-table
+                                    (perl-quote-syntax-table (char-after))
+                                  (forward-sexp 1))
+                                (put-text-property pos (line-end-position)
+                                                   'jit-lock-defer-multiline t)
+                                (looking-at "\\s-*\\sw*e"))
+                            (put-text-property (point) (1+ (point))
+                                               'syntax-table
+                                               (if (assoc (char-after)
+                                                          perl-quote-like-pairs)
+                                                   '(15) '(7)))))))
+                  ;; The arg(s) is not terminated, so it extends until EOB.
+                  (scan-error (goto-char (point-max))))))
+            ;; Point is now right after the arg(s).
+            ;; Erase any syntactic marks within the quoted text.
+            (put-text-property pos (1- (point)) 'syntax-table nil)
+            (when (eq (char-before (1- (point))) ?$)
+              (put-text-property (- (point) 2) (1- (point))
+                                 'syntax-table '(1)))
+            (put-text-property (1- (point)) (point)
+                               'syntax-table (if close '(15) '(7)))))))
+
+      (setq state (parse-partial-sexp (point) limit nil nil state
+				      'syntax-table))))
+  ;; Tell font-lock that this needs not further processing.
+  nil)
 
 
 (defcustom perl-indent-level 4
@@ -531,8 +538,6 @@
 			     nil nil ((?\_ . "w")) nil
 			     (font-lock-syntactic-keywords
 			      . perl-font-lock-syntactic-keywords)
-			     (font-lock-syntactic-face-function
-			      . perl-font-lock-syntactic-face-function)
 			     (parse-sexp-lookup-properties . t)))
   ;; Tell imenu how to handle Perl.
   (set (make-local-variable 'imenu-generic-expression)
--- a/lisp/progmodes/scheme.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/progmodes/scheme.el	Mon Nov 07 14:56:19 2005 +0000
@@ -158,8 +158,6 @@
   (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
   (make-local-variable 'comment-column)
   (setq comment-column 40)
-  (make-local-variable 'comment-indent-function)
-  (setq comment-indent-function 'lisp-comment-indent)
   (make-local-variable 'parse-sexp-ignore-comments)
   (setq parse-sexp-ignore-comments t)
   (make-local-variable 'lisp-indent-function)
--- a/lisp/replace.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/replace.el	Mon Nov 07 14:56:19 2005 +0000
@@ -755,7 +755,7 @@
       (save-excursion
 	(goto-char (posn-point (event-end event)))
 	(setq pos (occur-mode-find-occurrence))))
-    (pop-to-buffer (marker-buffer pos))
+    (switch-to-buffer-other-window (marker-buffer pos))
     (goto-char pos)))
 
 (defun occur-mode-find-occurrence ()
@@ -770,7 +770,7 @@
   "Go to the occurrence the current line describes."
   (interactive)
   (let ((pos (occur-mode-find-occurrence)))
-    (pop-to-buffer (marker-buffer pos))
+    (switch-to-buffer (marker-buffer pos))
     (goto-char pos)))
 
 (defun occur-mode-goto-occurrence-other-window ()
@@ -1140,7 +1140,8 @@
 					 'follow-link t
 					 'help-echo
 					 "mouse-2: go to this occurrence")
-			     "\n"))
+			     ;; Add marker at eol, but no mouse props.
+			     (propertize "\n" 'occur-target marker)))
 			   (data
 			    (if (= nlines 0)
 				;; The simple display style
--- a/lisp/savehist.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/savehist.el	Mon Nov 07 14:56:19 2005 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Hrvoje Niksic <hniksic@xemacs.org>
 ;; Keywords: minibuffer
-;; Version: 9
+;; Version: 19
 
 ;; This file is part of GNU Emacs.
 
@@ -32,10 +32,15 @@
 ;; variables may be specified by customizing
 ;; `savehist-additional-variables'.
 
-;; To use savehist, put the following to `~/.emacs':
+;; To use savehist, turn on savehist-mode by putting the following in
+;; `~/.emacs':
+;;
+;;     (savehist-mode 1)
 ;;
-;; (require 'savehist)
-;; (savehist-load)
+;; or with customize: `M-x customize-option RET savehist-mode RET'.
+;;
+;; You can also explicitly save history with `M-x savehist-save' and
+;; load it by loading the `savehist-file' with `M-x load-file'.
 
 ;; If you are using a version of Emacs that does not ship with this
 ;; package, be sure to have `savehist.el' in a directory that is in
@@ -53,41 +58,64 @@
   "Save minibuffer history."
   :group 'minibuffer)
 
+;;;###autoload
+(defcustom savehist-mode nil
+  "Mode for automatic saving of minibuffer history.
+Set this by calling the `savehist-mode' function or using the customize
+interface."
+  :type 'boolean
+  :set (if (fboundp 'custom-set-minor-mode)
+           'custom-set-minor-mode
+         (lambda (symbol value) (funcall symbol (or value 0))))
+  :initialize 'custom-initialize-default
+  :require 'savehist
+  :group 'savehist)
+
 (defcustom savehist-save-minibuffer-history t
-  "If non-nil, save all recorded minibuffer histories."
+  "*If non-nil, save all recorded minibuffer histories.
+If you want to save only specific histories, use `savehist-save-hook' to
+modify the value of `savehist-minibuffer-history-variables'."
   :type 'boolean
   :group 'savehist)
 
 (defcustom savehist-additional-variables ()
-  "List of additional variables to save.
+  "*List of additional variables to save.
 Each element is a symbol whose value will be persisted across Emacs
 sessions that use savehist.  The contents of variables should be
-printable with the Lisp printer.  If the variable's value is a list,
-it will be trimmed to `savehist-length' elements.
+printable with the Lisp printer.  You don't need to add minibuffer
+history variables to this list, all minibuffer histories will be
+saved automatically as long as `savehist-save-minibuffer-history' is
+non-nil.
 
-You don't need to add minibuffer history variables to this list.  All
-minibuffer histories will be saved automatically."
-  :type '(repeat (symbol :tag "Variable"))
+User options should be saved with the customize interface.  This
+list is useful for saving automatically updated variables that are not
+minibuffer histories, such as `compile-command' or `kill-ring'."
+  :type '(repeat variable)
   :group 'savehist)
 
-(defcustom savehist-file "~/.emacs-history"
-  "File name to save minibuffer history to.
-The minibuffer history is a series of Lisp expressions, which should be
-loaded using `savehist-load' from your .emacs.  See `savehist-load' for
-more details."
+(defcustom savehist-file
+  (cond
+   ;; Backward compatibility with previous versions of savehist.
+   ((file-exists-p "~/.emacs-history") "~/.emacs-history")
+   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
+    "~/.emacs.d/history")
+   ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
+    "~/.xemacs/history")
+   ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
+   (t "~/.emacs-history"))
+  "*File name where minibuffer history is saved to and loaded from.
+The minibuffer history is a series of Lisp expressions loaded
+automatically when `savehist-mode' is turned on.  See `savehist-mode'
+for more details.
+
+If you want your minibuffer history shared between Emacs and XEmacs,
+customize this value and make sure that `savehist-coding-system' is
+set to a coding system that exists in both emacsen."
   :type 'file
   :group 'savehist)
 
-(defcustom savehist-length 100
-  "Maximum length of a minibuffer list.
-Minibuffer histories with more entries are trimmed when saved, the older
-entries being removed first.  If set to nil, the length is unlimited."
-  :type '(choice integer
-		 (const :tag "Unlimited" nil))
-  :group 'savehist)
-
-(defcustom savehist-modes #o600
-  "Default permissions of the history file.
+(defcustom savehist-file-modes #o600
+  "*Default permissions of the history file.
 This is decimal, not octal.  The default is 384 (0600 in octal).
 Set to nil to use the default permissions that Emacs uses, typically
 mandated by umask.  The default is a bit more restrictive to protect
@@ -96,10 +124,17 @@
   :group 'savehist)
 
 (defcustom savehist-autosave-interval (* 5 60)
-  "The interval during which savehist should autosave the history buffer."
+  "*The interval between autosaves of minibuffer history.
+If set to nil, disables timer-based autosaving."
   :type 'integer
   :group 'savehist)
 
+(defcustom savehist-save-hook nil
+  "Hook called by `savehist-save' before saving the variables.
+You can use this hook to influence choice and content of variables to
+save."
+  :type 'hook)
+
 (defvar savehist-coding-system
   ;; UTF-8 is usually preferable to ISO-2022-8 when available, but under
   ;; XEmacs, UTF-8 is provided by external packages, and may not always be
@@ -116,34 +151,127 @@
 
 (defvar savehist-last-checksum nil)
 
-(defvar savehist-minibuffer-history-variables nil)
+(defvar savehist-minibuffer-history-variables nil
+  "List of minibuffer histories.
+The contents of this variable is built while Emacs is running, and saved
+along with minibuffer history.  You can change its value off
+`savehist-save-hook' to influence which variables are saved.")
 
 (defconst savehist-no-conversion (if (featurep 'xemacs) 'binary 'no-conversion)
-  "Coding system without conversion, only used for calculating checksums.
-It should be as discriminating as `savehist-coding-system' but faster.")
+  "Coding system without conversion, used for calculating internal checksums.
+Should be as fast as possible, ideally simply exposing the internal
+representation of buffer text.")
+
+(defvar savehist-loaded nil
+  "Whether the history has already been loaded.
+This prevents toggling `savehist-mode' from destroying existing
+minibuffer history.")
+
+(eval-when-compile
+  (when (featurep 'xemacs)
+    ;; Must declare this under XEmacs, which doesn't have built-in
+    ;; minibuffer history truncation.
+    (defvar history-length 100)))
 
 ;; Functions.
 
+;;;###autoload
+(defun savehist-mode (arg)
+  "Toggle savehist-mode.
+Positive ARG turns on `savehist-mode'.  When on, savehist-mode causes
+minibuffer history to be saved periodically and when exiting Emacs.
+When turned on for the first time in an Emacs session, it causes the
+previous minibuffer history to be loaded from `savehist-file'.
+
+This mode should normally be turned on from your Emacs init file.
+Calling it at any other time replaces your current minibuffer histories,
+which is probably undesirable."
+  (interactive "P")
+  (setq savehist-mode
+	(if (null arg)
+	    (not savehist-mode)
+	  (> (prefix-numeric-value arg) 0)))
+  (if (not savehist-mode)
+      (savehist-uninstall)
+    (when (and (not savehist-loaded)
+	       (file-exists-p savehist-file))
+      (condition-case errvar
+	  (progn
+	    ;; Don't set coding-system-for-read -- we rely on the
+	    ;; coding cookie to convey that information.  That way, if
+	    ;; the user changes the value of savehist-coding-system,
+	    ;; we can still correctly load the old file.
+	    (load savehist-file nil (not (interactive-p)))
+	    (setq savehist-loaded t))
+	(error
+	 ;; Don't install the mode if reading failed.  Doing so would
+	 ;; effectively destroy the user's data at the next save.
+	 (setq savehist-mode nil)
+	 (savehist-uninstall)
+	 (signal (car errvar) (cdr errvar)))))
+    (savehist-install))
+
+  ;; End with the usual minor-mode conventions normally provided
+  ;; transparently by define-minor-mode.
+  (run-hooks 'savehist-mode-hook)
+  (if (interactive-p)
+      (progn
+        (customize-mark-as-set 'savehist-mode)
+        (unless (current-message)
+          (message "Savehist mode %sabled" (if savehist-mode "en" "dis")))))
+  ;; Return the new setting.
+  savehist-mode)
+(add-minor-mode 'savehist-mode "")
+
+(defun savehist-load ()
+  "Obsolete function provided for transition from old versions of savehist.
+Don't call this from new code, use (savehist-mode 1) instead.
+
+This function loads the variables stored in `savehist-file' and turns on
+savehist-mode.  If savehist-file is in the old format that doesn't record
+the value of `savehist-minibuffer-history-variables', that value is
+deducted from the contents of the file."
+  (savehist-mode 1)
+  ;; Old versions of savehist distributed with XEmacs didn't save
+  ;; savehist-minibuffer-history-variables.  If that variable is nil
+  ;; after loading the file, try to intuit the intended value.
+  (when (null savehist-minibuffer-history-variables)
+    (setq savehist-minibuffer-history-variables
+          (with-temp-buffer
+	    (ignore-errors
+	      (insert-file-contents savehist-file))
+            (let ((vars ()) form)
+              (while (setq form (condition-case nil
+				    (read (current-buffer)) (error nil)))
+		;; Each form read is of the form (setq VAR VALUE).
+		;; Collect VAR, i.e. (nth form 1).
+                (push (nth 1 form) vars))
+              vars)))))
+(make-obsolete 'savehist-load 'savehist-mode)
+
 (defun savehist-install ()
   "Hook savehist into Emacs.
-This will install `savehist-autosave' in `kill-emacs-hook' and on a timer.
-To undo this, call `savehist-uninstall'."
+Normally invoked by calling `savehist-mode' to set the minor mode.
+Installs `savehist-autosave' in `kill-emacs-hook' and on a timer.   To
+undo this, call `savehist-uninstall'."
   (add-hook 'minibuffer-setup-hook 'savehist-minibuffer-hook)
   (add-hook 'kill-emacs-hook 'savehist-autosave)
   ;; Install an invocation of savehist-autosave on a timer.  This
   ;; should not cause noticeable delays for users -- savehist-autosave
   ;; executes in under 5 ms on my system.
-  (unless savehist-timer
+  (when (and savehist-autosave-interval
+	     (null savehist-timer))
     (setq savehist-timer
 	  (if (featurep 'xemacs)
 	      (start-itimer
 	       "savehist" 'savehist-autosave savehist-autosave-interval
 	       savehist-autosave-interval)
-	    (run-with-timer savehist-autosave-interval savehist-autosave-interval
-			    'savehist-autosave)))))
+	    (run-with-timer savehist-autosave-interval
+			    savehist-autosave-interval 'savehist-autosave)))))
 
 (defun savehist-uninstall ()
-  "Undo installing savehist."
+  "Undo installing savehist.
+Normally invoked by calling `savehist-mode' to unset the minor mode."
   (remove-hook 'minibuffer-setup-hook 'savehist-minibuffer-hook)
   (remove-hook 'kill-emacs-hook 'savehist-autosave)
   (when savehist-timer
@@ -152,26 +280,6 @@
       (cancel-timer savehist-timer))
     (setq savehist-timer nil)))
 
-;;;###autoload
-(defun savehist-load (&optional no-install)
-  "Load the minibuffer histories from `savehist-file'.
-Unless NO-INSTALL is present and non-nil, the function will also install
-`savehist-autosave' in `kill-emacs-hook' and on a timer, ensuring that
-history is saved before leaving Emacs.
-
-This function should be normally used from your Emacs init file.  Since
-it removes your current minibuffer histories, it is unwise to call it at
-any other time."
-  (interactive "P")
-  ;; Don't set coding-system-for-read here.  We rely on autodetection
-  ;; and the coding cookie to convey that information.  That way, if
-  ;; the user changes the value of savehist-coding-system, we can
-  ;; still correctly load the old file.
-  (load savehist-file t (not (interactive-p)))
-  (unless no-install
-    (savehist-install)))
-
-;;;###autoload
 (defun savehist-save (&optional auto-save)
   "Save the values of minibuffer history variables.
 Unbound symbols referenced in `savehist-additional-variables' are ignored.
@@ -182,21 +290,32 @@
     (insert
      (format ";; -*- mode: emacs-lisp; coding: %s -*-\n" savehist-coding-system)
      ";; Minibuffer history file, automatically generated by `savehist'.\n\n")
+    (run-hooks 'savehist-save-hook)
     (let ((print-length nil)
 	  (print-string-length nil)
 	  (print-level nil)
 	  (print-readably t)
-	  (print-quoted t)
-	  (symbol-list (append
-			(and savehist-save-minibuffer-history
-			     (cons 'savehist-minibuffer-history-variables
-				   savehist-minibuffer-history-variables))
-			savehist-additional-variables)))
-      (dolist (sym symbol-list)
-	(when (boundp sym)
-	  (let ((value (savehist-process-for-saving (symbol-value sym))))
-	    (prin1 `(setq ,sym ',value) (current-buffer))
-	    (insert ?\n)))))
+	  (print-quoted t))
+      ;; Save the minibuffer histories, along with the value of
+      ;; savehist-minibuffer-history-variables itself.
+      (when savehist-save-minibuffer-history
+	(prin1 `(setq savehist-minibuffer-history-variables
+		      ',savehist-minibuffer-history-variables)
+	       (current-buffer))
+	(insert ?\n)
+	(dolist (symbol savehist-minibuffer-history-variables)
+	  (when (boundp symbol)
+	    (let ((value (savehist-trim-history (symbol-value symbol))))
+	      (when value		; don't save empty histories
+		(prin1 `(setq ,symbol ',value) (current-buffer))
+		(insert ?\n))))))
+      ;; Save the additional variables.
+      (dolist (symbol savehist-additional-variables)
+	(when (boundp symbol)
+	  (let ((value (symbol-value symbol)))
+	    (when (savehist-printable value)
+	      (prin1 `(setq ,symbol ',value) (current-buffer))
+	      (insert ?\n))))))
     ;; If autosaving, avoid writing if nothing has changed since the
     ;; last write.
     (let ((checksum (md5 (current-buffer) nil nil savehist-no-conversion)))
@@ -210,57 +329,55 @@
 	      (coding-system-for-write savehist-coding-system))
 	  (write-region (point-min) (point-max) savehist-file nil
 			(unless (interactive-p) 'quiet)))
-	(when savehist-modes
-	  (set-file-modes savehist-file savehist-modes))
+	(when savehist-file-modes
+	  (set-file-modes savehist-file savehist-file-modes))
 	(setq savehist-last-checksum checksum)))))
 
 (defun savehist-autosave ()
-  "Save the minibuffer history if it has been modified since the last save."
-  (savehist-save t))
+  "Save the minibuffer history if it has been modified since the last save.
+Does nothing if savehist-mode is off."
+  (when savehist-mode
+    (savehist-save t)))
 
-(defun savehist-process-for-saving (value)
-  ;; Process VALUE for saving to file.  If it is a list, retain only
-  ;; the first `savehist-length' values and prune non-printable ones.
-  ;; If VALUE is not a list, return it as-is if it is printable and
-  ;; nil otherwise.
-  (cond
-   ((listp value)
-    (when (and savehist-length (> (length value) savehist-length))
-      ;; This should be: (setq value (subseq value 0 savehist-length))
-      (setq value (copy-sequence value))
-      (setcdr (nthcdr savehist-length value) nil))
-    ;; And this should be (remove-if-not #'savehist-printable value)
-    (delq nil (mapcar (lambda (x) (if (savehist-printable x) x)) value)))
-   ((savehist-printable value) value)
-   (t nil)))
+(defun savehist-trim-history (value)
+  ;; Retain only the first history-length items in VALUE.  Only used
+  ;; under XEmacs, which doesn't (yet) implement automatic trimming of
+  ;; history lists to history-length items.
+  (if (and (featurep 'xemacs)
+	   (natnump history-length)
+	   (> (length value) history-length))
+      ;; Equivalent to `(subseq value 0 history-length)', but doesn't
+      ;; need cl-extra at run-time.
+      (loop repeat history-length collect (pop value))
+    value))
 
 (defun savehist-printable (value)
   "Return non-nil if VALUE is printable."
-  ;; Quick response for oft-encountered types known to be printable.
   (cond
+   ;; Quick response for oft-encountered types known to be printable.
    ((stringp value))
    ((numberp value))
    ((symbolp value))
    (t
     ;; For others, check explicitly.
-    (condition-case nil
-	(let ((print-readably t)
-	      (print-level nil)
-	      (chars ()))
-	  ;; Print the value into a string...
-	  (prin1 value (lambda (char) (push char chars)))
+    (with-temp-buffer
+      (condition-case nil
+	  (let ((print-readably t) (print-level nil))
+	  ;; Print the value into a buffer...
+	  (prin1 value (current-buffer))
 	  ;; ...and attempt to read it.
-	  (read (apply #'string (nreverse chars)))
+	  (read (point-min-marker))
 	  ;; The attempt worked: the object is printable.
 	  t)
-      ;; The attempt failed: the object is not printable.
-      (error nil)))))
+	;; The attempt failed: the object is not printable.
+	(error nil))))))
 
 (defun savehist-minibuffer-hook ()
   (add-to-list 'savehist-minibuffer-history-variables
-               minibuffer-history-variable))
+	       minibuffer-history-variable))
 
 (provide 'savehist)
-
+
 ;; arch-tag: b3ce47f4-c5ad-4ebc-ad02-73aba705cf9f
+
 ;;; savehist.el ends here
--- a/lisp/simple.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/simple.el	Mon Nov 07 14:56:19 2005 +0000
@@ -993,8 +993,8 @@
                      (memq this-command '(eval-last-sexp eval-print-last-sexp)))
                  (prin1-char value))))
         (if char-string
-            (format " (0%o, 0x%x) = %s" value value char-string)
-          (format " (0%o, 0x%x)" value value)))))
+            (format " (#o%o, #x%x, %s)" value value char-string)
+          (format " (#o%o, #x%x)" value value)))))
 
 ;; We define this, rather than making `eval' interactive,
 ;; for the sake of completion of names like eval-region, eval-current-buffer.
@@ -1344,7 +1344,8 @@
   ;; and will get another error.  To begin undoing the undos,
   ;; you must type some other command.
   (let ((modified (buffer-modified-p))
-	(recent-save (recent-auto-save-p)))
+	(recent-save (recent-auto-save-p))
+	message)
     ;; If we get an error in undo-start,
     ;; the next command should not be a "consecutive undo".
     ;; So set `this-command' to something other than `undo'.
@@ -1373,9 +1374,9 @@
     ;; so, ask the user whether she wants to skip the redo/undo pair.
     (let ((equiv (gethash pending-undo-list undo-equiv-table)))
       (or (eq (selected-window) (minibuffer-window))
-	  (message (if undo-in-region
-		       (if equiv "Redo in region!" "Undo in region!")
-		     (if equiv "Redo!" "Undo!"))))
+	  (setq message (if undo-in-region
+			    (if equiv "Redo in region!" "Undo in region!")
+			  (if equiv "Redo!" "Undo!"))))
       (when (and (consp equiv) undo-no-redo)
 	;; The equiv entry might point to another redo record if we have done
 	;; undo-redo-undo-redo-... so skip to the very last equiv.
@@ -1417,7 +1418,10 @@
     ;; Record what the current undo list says,
     ;; so the next command can tell if the buffer was modified in between.
     (and modified (not (buffer-modified-p))
-	 (delete-auto-save-file-if-necessary recent-save))))
+	 (delete-auto-save-file-if-necessary recent-save))
+    ;; Display a message announcing success.
+    (if message
+	(message message))))
 
 (defun buffer-disable-undo (&optional buffer)
   "Make BUFFER stop keeping undo information.
@@ -2393,7 +2397,7 @@
       (menu-bar-update-yank-menu string (and replace (car kill-ring))))
   (if (and replace kill-ring)
       (setcar kill-ring string)
-    (setq kill-ring (cons string kill-ring))
+    (push string kill-ring)
     (if (> (length kill-ring) kill-ring-max)
 	(setcdr (nthcdr (1- kill-ring-max) kill-ring) nil)))
   (setq kill-ring-yank-pointer kill-ring)
@@ -3003,8 +3007,7 @@
 START and END specify the portion of the current buffer to be copied."
   (interactive "BCopy to buffer: \nr")
   (let ((oldbuf (current-buffer)))
-    (save-excursion
-      (set-buffer (get-buffer-create buffer))
+    (with-current-buffer (get-buffer-create buffer)
       (barf-if-buffer-read-only)
       (erase-buffer)
       (save-excursion
@@ -3116,6 +3119,13 @@
       (unless nomsg
 	(message "Mark activated")))))
 
+(defcustom set-mark-command-repeat-pop nil
+  "*Non-nil means that repeating \\[set-mark-command] after popping will pop.
+This means that if you type C-u \\[set-mark-command] \\[set-mark-command]
+will pop twice."
+  :type 'boolean
+  :group 'editing)
+
 (defun set-mark-command (arg)
   "Set mark at where point is, or jump to mark.
 With no prefix argument, set mark, and push old mark position on local
@@ -3148,10 +3158,13 @@
     (if arg
 	(pop-to-mark-command)
       (push-mark-command t)))
-   ((eq last-command 'pop-to-mark-command)
+   ((and set-mark-command-repeat-pop
+	 (eq last-command 'pop-to-mark-command))
     (setq this-command 'pop-to-mark-command)
     (pop-to-mark-command))
-   ((and (eq last-command 'pop-global-mark) (not arg))
+   ((and set-mark-command-repeat-pop
+	 (eq last-command 'pop-global-mark)
+	 (not arg))
     (setq this-command 'pop-global-mark)
     (pop-global-mark))
    (arg
@@ -4888,8 +4901,9 @@
 ;; This function goes in completion-setup-hook, so that it is called
 ;; after the text of the completion list buffer is written.
 (defun completion-setup-function ()
-  (let ((mainbuf (current-buffer))
-	(mbuf-contents (minibuffer-contents)))
+  (let* ((mainbuf (current-buffer))
+         (mbuf-contents (minibuffer-contents))
+         (common-string-length (length mbuf-contents)))
     ;; When reading a file name in the minibuffer,
     ;; set default-directory in the minibuffer
     ;; so it will get copied into the completion list buffer.
@@ -4901,12 +4915,11 @@
     ;; FIXME: This still doesn't work if the text to be completed
     ;; starts with a `-'.
     (when (and partial-completion-mode (not (eobp)))
-      (setq mbuf-contents
-	    (substring mbuf-contents 0 (- (point) (point-max)))))
+      (setq common-string-length
+            (- common-string-length (- (point) (point-max)))))
     (with-current-buffer standard-output
       (completion-list-mode)
-      (make-local-variable 'completion-reference-buffer)
-      (setq completion-reference-buffer mainbuf)
+      (set (make-local-variable 'completion-reference-buffer) mainbuf)
       (if minibuffer-completing-file-name
 	  ;; For file name completion,
 	  ;; use the number of chars before the start of the
@@ -4926,29 +4939,25 @@
 	      (setq completion-base-size 0))))
       ;; Put faces on first uncommon characters and common parts.
       (when (or completion-common-substring completion-base-size)
-	(let* ((common-string-length
+        (setq common-string-length
 		(if completion-common-substring
 		    (length completion-common-substring)
-		  (- (length mbuf-contents) completion-base-size)))
-	       (element-start (next-single-property-change
-			       (point-min)
-			       'mouse-face))
-	       (element-common-end
-		(and element-start
-		     (+ (or element-start nil) common-string-length)))
-	       (maxp (point-max)))
-	  (while (and element-start (< element-common-end maxp))
+                  (- common-string-length completion-base-size)))
+	(let ((element-start (point-min))
+              (maxp (point-max))
+              element-common-end)
+	  (while (and (setq element-start
+                            (next-single-property-change
+                             element-start 'mouse-face))
+                      (< (setq element-common-end
+                               (+ element-start common-string-length))
+                         maxp))
 	    (when (and (get-char-property element-start 'mouse-face)
 		       (get-char-property element-common-end 'mouse-face))
 	      (put-text-property element-start element-common-end
 				 'font-lock-face 'completions-common-part)
 	      (put-text-property element-common-end (1+ element-common-end)
-				 'font-lock-face 'completions-first-difference))
-	    (setq element-start (next-single-property-change
-				 element-start
-				 'mouse-face))
-	    (if element-start
-		(setq element-common-end  (+ element-start common-string-length))))))
+				 'font-lock-face 'completions-first-difference)))))
       ;; Insert help string.
       (goto-char (point-min))
       (if (display-mouse-p)
@@ -4960,14 +4969,8 @@
 
 (add-hook 'completion-setup-hook 'completion-setup-function)
 
-(define-key minibuffer-local-completion-map [prior]
-  'switch-to-completions)
-(define-key minibuffer-local-must-match-map [prior]
-  'switch-to-completions)
-(define-key minibuffer-local-completion-map "\M-v"
-  'switch-to-completions)
-(define-key minibuffer-local-must-match-map "\M-v"
-  'switch-to-completions)
+(define-key minibuffer-local-completion-map [prior] 'switch-to-completions)
+(define-key minibuffer-local-completion-map "\M-v"  'switch-to-completions)
 
 (defun switch-to-completions ()
   "Select the completion list window."
--- a/lisp/startup.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/startup.el	Mon Nov 07 14:56:19 2005 +0000
@@ -737,6 +737,8 @@
     (and command-line-args
          (setcdr command-line-args args)))
 
+  (run-hooks 'before-init-hook)
+
   ;; Under X Window, this creates the X frame and deletes the terminal frame.
   (when (fboundp 'frame-initialize)
     (frame-initialize))
@@ -768,14 +770,18 @@
   ;; are not set.
   (custom-reevaluate-setting 'blink-cursor-mode)
   (custom-reevaluate-setting 'tooltip-mode)
+  (custom-reevaluate-setting 'global-font-lock-mode)
+  (custom-reevaluate-setting 'mouse-wheel-down-event)
+  (custom-reevaluate-setting 'mouse-wheel-up-event)
 
   (normal-erase-is-backspace-setup-frame)
 
   ;; Register default TTY colors for the case the terminal hasn't a
-  ;; terminal init file.
-  ;; We do this regardles of whether the terminal supports colors
-  ;; or not, since they can switch that support on or off in
-  ;; mid-session by setting the tty-color-mode frame parameter.
+  ;; terminal init file.  We do this regardles of whether the terminal
+  ;; supports colors or not and regardless the current display type,
+  ;; since users can connect to color-capable terminals and also
+  ;; switch color support on or off in mid-session by setting the
+  ;; tty-color-mode frame parameter.
   (tty-register-default-colors)
 
   ;; Record whether the tool-bar is present before the user and site
@@ -794,8 +800,6 @@
 	(old-font-list-limit font-list-limit)
 	(old-face-ignored-fonts face-ignored-fonts))
 
-    (run-hooks 'before-init-hook)
-
     ;; Run the site-start library if it exists.  The point of this file is
     ;; that it is run before .emacs.  There is no point in doing this after
     ;; .emacs; that is useless.
@@ -807,12 +811,18 @@
     (setq inhibit-startup-message nil)
 
     ;; Warn for invalid user name.
-    (and init-file-user
-	 (not (file-directory-p (expand-file-name (concat "~" init-file-user))))
-	 (display-warning 'initialization
-			  (format "User %s has no home directory"
-				  init-file-user)
-			  :error))
+    (when init-file-user
+      (if (string-match "[~/:\n]" init-file-user)
+	  (display-warning 'initialization
+			   (format "Invalid user name %s"
+				   init-file-user)
+			   :error)
+	(if (file-directory-p (expand-file-name (concat "~" init-file-user)))
+	    nil
+	  (display-warning 'initialization
+			   (format "User %s has no home directory"
+				   init-file-user)
+			   :error))))
 
     ;; Load that user's init file, or the default one, or none.
     (let (debug-on-error-from-init-file
@@ -850,14 +860,12 @@
 
 		      (when (eq user-init-file t)
 			;; If we did not find ~/.emacs, try
-			;; ~/.emacs.d/.emacs.
+			;; ~/.emacs.d/init.el.
 			(let ((otherfile
 			       (expand-file-name
-				(file-name-nondirectory user-init-file-1)
+				"init"
 				(file-name-as-directory
-				 (expand-file-name
-				  ".emacs.d"
-				  (file-name-directory user-init-file-1))))))
+				 (concat "~" init-file-user "/.emacs.d")))))
 			  (load otherfile t t)
 
 			  ;; If we did not find the user's init file,
@@ -958,6 +966,38 @@
 					(or mail-host-address
 					    (system-name)))))
 
+    ;; Originally face attributes were specified via
+    ;; `font-lock-face-attributes'.  Users then changed the default
+    ;; face attributes by setting that variable.  However, we try and
+    ;; be back-compatible and respect its value if set except for
+    ;; faces where M-x customize has been used to save changes for the
+    ;; face.
+    (when (boundp 'font-lock-face-attributes)
+      (let ((face-attributes font-lock-face-attributes))
+	(while face-attributes
+	  (let* ((face-attribute (pop face-attributes))
+		 (face (car face-attribute)))
+	    ;; Rustle up a `defface' SPEC from a
+	    ;; `font-lock-face-attributes' entry.
+	    (unless (get face 'saved-face)
+	      (let ((foreground (nth 1 face-attribute))
+		    (background (nth 2 face-attribute))
+		    (bold-p (nth 3 face-attribute))
+		    (italic-p (nth 4 face-attribute))
+		    (underline-p (nth 5 face-attribute))
+		    face-spec)
+		(when foreground
+		  (setq face-spec (cons ':foreground (cons foreground face-spec))))
+		(when background
+		  (setq face-spec (cons ':background (cons background face-spec))))
+		(when bold-p
+		  (setq face-spec (append '(:weight bold) face-spec)))
+		(when italic-p
+		  (setq face-spec (append '(:slant italic) face-spec)))
+		(when underline-p
+		  (setq face-spec (append '(:underline t) face-spec)))
+		(face-spec-set face (list (list t face-spec)) nil)))))))
+
     ;; If parameter have been changed in the init file which influence
     ;; face realization, clear the face cache so that new faces will
     ;; be realized.
--- a/lisp/subr.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/subr.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1309,6 +1309,34 @@
 	(setq files (cdr files)))
       file)))
 
+;;;###autoload
+(defun locate-library (library &optional nosuffix path interactive-call)
+  "Show the precise file name of Emacs library LIBRARY.
+This command searches the directories in `load-path' like `\\[load-library]'
+to find the file that `\\[load-library] RET LIBRARY RET' would load.
+Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
+to the specified name LIBRARY.
+
+If the optional third arg PATH is specified, that list of directories
+is used instead of `load-path'.
+
+When called from a program, the file name is normaly returned as a
+string.  When run interactively, the argument INTERACTIVE-CALL is t,
+and the file name is displayed in the echo area."
+  (interactive (list (completing-read "Locate library: "
+				      'locate-file-completion
+				      (cons load-path load-suffixes))
+		     nil nil
+		     t))
+  (let ((file (locate-file library
+			   (or path load-path)
+			   (append (unless nosuffix load-suffixes) '("")))))
+    (if interactive-call
+	(if file
+	    (message "Library is file %s" (abbreviate-file-name file))
+	  (message "No library %s in search path" library)))
+    file))
+
 
 ;;;; Specifying things to do later.
 
--- a/lisp/term/x-win.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/term/x-win.el	Mon Nov 07 14:56:19 2005 +0000
@@ -2122,12 +2122,12 @@
 
 ;;;; Selections and cut buffers
 
-;;; We keep track of the last text selected here, so we can check the
-;;; current selection against it, and avoid passing back our own text
-;;; from x-cut-buffer-or-selection-value.  We track all three
-;;; seperately in case another X application only sets one of them
-;;; (say the cut buffer) we aren't fooled by the PRIMARY or
-;;; CLIPBOARD selection staying the same.
+;; We keep track of the last text selected here, so we can check the
+;; current selection against it, and avoid passing back our own text
+;; from x-cut-buffer-or-selection-value.  We track all three
+;; seperately in case another X application only sets one of them
+;; (say the cut buffer) we aren't fooled by the PRIMARY or
+;; CLIPBOARD selection staying the same.
 (defvar x-last-selected-text-clipboard nil
   "The value of the CLIPBOARD X selection last time we selected or
 pasted text.")
@@ -2141,10 +2141,9 @@
   "The value of the X cut buffer last time we selected or pasted text.
 This is the actual text stored in the X cut buffer.")
 
-;;; It is said that overlarge strings are slow to put into the cut buffer.
-;;; Note this value is overridden below.
-(defvar x-cut-buffer-max 20000
-  "Max number of characters to put in the cut buffer.")
+(defvar x-cut-buffer-max 20000 ; Note this value is overridden below.
+  "Max number of characters to put in the cut buffer.
+It is said that overlarge strings are slow to put into the cut buffer.")
 
 (defcustom x-select-enable-clipboard nil
   "Non-nil means cutting and pasting uses the clipboard.
@@ -2152,12 +2151,12 @@
   :type 'boolean
   :group 'killing)
 
-;;; Make TEXT, a string, the primary X selection.
-;;; Also, set the value of X cut buffer 0, for backward compatibility
-;;; with older X applications.
-;;; gildea@stop.mail-abuse.org says it's not desirable to put kills
-;;; in the clipboard.
 (defun x-select-text (text &optional push)
+  "Make TEXT, a string, the primary X selection.
+Also, set the value of X cut buffer 0, for backward compatibility
+with older X applications.
+gildea@stop.mail-abuse.org says it's not desirable to put kills
+in the clipboard."
   ;; Don't send the cut buffer too much text.
   ;; It becomes slow, and if really big it causes errors.
   (cond ((>= (length text) x-cut-buffer-max)
@@ -2282,12 +2281,12 @@
 	(remove-text-properties 0 (length text) '(foreign-selection nil) text))
     text))
 
-;;; Return the value of the current X selection.
-;;; Consult the selection, and the cut buffer.  Treat empty strings
-;;; as if they were unset.
-;;; If this function is called twice and finds the same text,
-;;; it returns nil the second time.  This is so that a single
-;;; selection won't be added to the kill ring over and over.
+;; Return the value of the current X selection.
+;; Consult the selection, and the cut buffer.  Treat empty strings
+;; as if they were unset.
+;; If this function is called twice and finds the same text,
+;; it returns nil the second time.  This is so that a single
+;; selection won't be added to the kill ring over and over.
 (defun x-cut-buffer-or-selection-value ()
   (let (clip-text primary-text cut-text)
     (when x-select-enable-clipboard
@@ -2526,5 +2525,5 @@
 (add-hook 'after-make-frame-functions 'x-dnd-init-frame)
 (global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
 
-;;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
+;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
 ;;; x-win.el ends here
--- a/lisp/textmodes/conf-mode.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/textmodes/conf-mode.el	Mon Nov 07 14:56:19 2005 +0000
@@ -201,11 +201,11 @@
   "Keywords to hilight in Conf Colon mode.")
 
 (defvar conf-assignment-sign ?=
-  "What sign is used for assignments.")
+  "Sign used for assignments (char or string).")
 
 (defvar conf-assignment-regexp ".+?\\([ \t]*=[ \t]*\\)"
   "Regexp to recognize assignments.
-It is anchored after the first sexp on a line.  There must a
+It is anchored after the first sexp on a line.  There must be a
 grouping for the assignment sign, including leading and trailing
 whitespace.")
 
@@ -279,7 +279,7 @@
 
 
 ;;;###autoload
-(defun conf-mode (&optional comment syntax-table name)
+(defun conf-mode ()
   "Mode for Unix and Windows Conf files and Java properties.
 Most conf files know only three kinds of constructs: parameter
 assignments optionally grouped into sections and comments.  Yet
@@ -311,7 +311,13 @@
 \\{conf-mode-map}"
 
   (interactive)
-  (if (not comment)
+  ;; `conf-mode' plays two roles: it's the parent of several sub-modes
+  ;; but it's also the function that chooses between those submodes.
+  ;; To tell the difference between those two cases where the function
+  ;; might be called, we check `delay-mode-hooks'.
+  ;; (adopted from tex-mode.el)
+  (if (not delay-mode-hooks)
+      ;; try to guess sub-mode of conf-mode based on buffer content
       (let ((unix 0) (win 0) (equal 0) (colon 0) (space 0) (jp 0))
 	(save-excursion
 	  (goto-char (point-min))
@@ -338,17 +344,14 @@
          ((or (> win unix) (and (= win unix) (eq system-type 'windows-nt)))
           (conf-windows-mode))
          (t (conf-unix-mode))))
+
     (kill-all-local-variables)
     (use-local-map conf-mode-map)
-
     (setq major-mode 'conf-mode
-	  mode-name name)
+	  mode-name "Conf[?]")
     (set (make-local-variable 'font-lock-defaults)
          '(conf-font-lock-keywords nil t nil nil))
-    (set (make-local-variable 'comment-start) comment)
-    (set (make-local-variable 'comment-start-skip)
-	 (concat (regexp-quote comment-start) "+\\s *"))
-    ;; Let newcomment.el decide this for himself.
+    ;; Let newcomment.el decide this for itself.
     ;; (set (make-local-variable 'comment-use-syntax) t)
     (set (make-local-variable 'parse-sexp-ignore-comments) t)
     (set (make-local-variable 'outline-regexp)
@@ -357,18 +360,28 @@
 	 "[\n}]")
     (set (make-local-variable 'outline-level)
 	 'conf-outline-level)
-    (set-syntax-table syntax-table)
+    (set-syntax-table conf-mode-syntax-table)
     (setq imenu-generic-expression
 	  '(("Parameters" "^[ \t]*\\(.+?\\)[ \t]*=" 1)
 	    ;; [section]
 	    (nil "^[ \t]*\\[[ \t]*\\(.+\\)[ \t]*\\]" 1)
 	    ;; section { ... }
 	    (nil "^[ \t]*\\([^=:{} \t\n][^=:{}\n]+\\)[ \t\n]*{" 1)))
-
     (run-mode-hooks 'conf-mode-hook)))
 
+(defun conf-mode-initialize (comment &optional font-lock)
+  "Intitializations for sub-modes of conf-mode.
+COMMENT initializes `comment-start' and `comment-start-skip'.
+The optional arg FONT-LOCK is the value for FONT-LOCK-KEYWORDS."
+  (set (make-local-variable 'comment-start) comment)
+  (set (make-local-variable 'comment-start-skip)
+       (concat (regexp-quote comment-start) "+\\s *"))
+  (if font-lock
+      (set (make-local-variable 'font-lock-defaults)
+           `(,font-lock nil t nil nil))))
+
 ;;;###autoload
-(defun conf-unix-mode ()
+(define-derived-mode conf-unix-mode conf-mode "Conf[Unix]"
   "Conf Mode starter for Unix style Conf files.
 Comments start with `#'.
 For details see `conf-mode'.  Example:
@@ -380,11 +393,10 @@
 	 Name=The GIMP
 	 Name[ca]=El GIMP
 	 Name[cs]=GIMP"
-  (interactive)
-  (conf-mode "#" conf-unix-mode-syntax-table "Conf[Unix]"))
+  (conf-mode-initialize "#"))
 
 ;;;###autoload
-(defun conf-windows-mode ()
+(define-derived-mode conf-windows-mode conf-mode "Conf[WinIni]"
   "Conf Mode starter for Windows style Conf files.
 Comments start with `;'.
 For details see `conf-mode'.  Example:
@@ -397,8 +409,7 @@
 
 \[{5984FFE0-28D4-11CF-AE66-08002B2E1262}]
 PersistMoniker=file://Folder.htt"
-  (interactive)
-  (conf-mode ";" conf-mode-syntax-table "Conf[WinIni]"))
+  (conf-mode-initialize ";"))
 
 ;; Here are a few more or less widespread styles.  There are others, so
 ;; obscure, they are not covered.  E.g. RFC 2614 allows both Unix and Windows
@@ -406,7 +417,7 @@
 ;; if you need it.
 
 ;;;###autoload
-(defun conf-javaprop-mode ()
+(define-derived-mode conf-javaprop-mode conf-mode "Conf[JavaProp]"
   "Conf Mode starter for Java properties files.
 Comments start with `#' but are also recognized with `//' or
 between `/*' and `*/'.
@@ -422,27 +433,23 @@
 x.1 =
 x.2.y.1.z.1 =
 x.2.y.1.z.2.zz ="
-  (interactive)
-  (conf-mode "#" conf-javaprop-mode-syntax-table "Conf[JavaProp]")
+  (conf-mode-initialize "#" 'conf-javaprop-font-lock-keywords)
   (set (make-local-variable 'conf-assignment-column)
        conf-javaprop-assignment-column)
   (set (make-local-variable 'conf-assignment-regexp)
        ".+?\\([ \t]*[=: \t][ \t]*\\|$\\)")
-  (set (make-local-variable 'conf-font-lock-keywords)
-       conf-javaprop-font-lock-keywords)
   (setq comment-start-skip "\\(?:#+\\|/[/*]+\\)\\s *")
   (setq imenu-generic-expression
 	'(("Parameters" "^[ \t]*\\(.+?\\)[=: \t]" 1))))
 
 ;;;###autoload
-(defun conf-space-mode (&optional keywords)
+(define-derived-mode conf-space-mode conf-unix-mode "Conf[Space]"
   "Conf Mode starter for space separated conf files.
 \"Assignments\" are with ` '.  Keywords before the parameters are
 recognized according to `conf-space-keywords'.  Interactively
 with a prefix ARG of `0' no keywords will be recognized.  With
 any other prefix arg you will be prompted for a regexp to match
-the keywords.  Programmatically you can pass such a regexp as
-KEYWORDS, or any non-nil non-string for no keywords.
+the keywords.
 
 For details see `conf-mode'.  Example:
 
@@ -457,30 +464,23 @@
 # Standard multimedia devices
 add /dev/audio		desktop
 add /dev/mixer		desktop"
-  (interactive
-   (list (if current-prefix-arg
-	     (if (> (prefix-numeric-value current-prefix-arg) 0)
-		 (read-string "Regexp to match keywords: ")
-	       t))))
-  (conf-unix-mode)
-  (setq mode-name "Conf[Space]")
+  (conf-mode-initialize "#" 'conf-space-font-lock-keywords)
   (set (make-local-variable 'conf-assignment-sign)
        nil)
-  (set (make-local-variable 'conf-font-lock-keywords)
-       conf-space-font-lock-keywords)
   ;; This doesn't seem right, but the next two depend on conf-space-keywords
   ;; being set, while after-change-major-mode-hook might set up imenu, needing
   ;; the following result:
   (hack-local-variables-prop-line)
   (hack-local-variables)
-  (if keywords
-      (set (make-local-variable 'conf-space-keywords)
-	   (if (stringp keywords) keywords))
-    (or conf-space-keywords
-	(not buffer-file-name)
-	(set (make-local-variable 'conf-space-keywords)
-	     (assoc-default buffer-file-name conf-space-keywords-alist
-			    'string-match))))
+  (cond (current-prefix-arg
+         (set (make-local-variable 'conf-space-keywords)
+              (if (> (prefix-numeric-value current-prefix-arg) 0)
+                  (read-string "Regexp to match keywords: "))))
+        (conf-space-keywords)
+        (buffer-file-name
+         (set (make-local-variable 'conf-space-keywords)
+              (assoc-default buffer-file-name conf-space-keywords-alist
+                             'string-match))))
   (set (make-local-variable 'conf-assignment-regexp)
        (if conf-space-keywords
 	   (concat "\\(?:" conf-space-keywords "\\)[ \t]+.+?\\([ \t]+\\|$\\)")
@@ -495,7 +495,7 @@
 	   1))))
 
 ;;;###autoload
-(defun conf-colon-mode (&optional comment syntax-table name)
+(define-derived-mode conf-colon-mode conf-unix-mode "Conf[Colon]"
   "Conf Mode starter for Colon files.
 \"Assignments\" are with `:'.
 For details see `conf-mode'.  Example:
@@ -504,11 +504,7 @@
 
 <Multi_key> <exclam> <exclam>		: \"\\241\"	exclamdown
 <Multi_key> <c> <slash>			: \"\\242\"	cent"
-  (interactive)
-  (if comment
-      (conf-mode comment syntax-table name)
-    (conf-unix-mode)
-    (setq mode-name "Conf[Colon]"))
+  (conf-mode-initialize "#" 'conf-colon-font-lock-keywords)
   (set (make-local-variable 'conf-assignment-space)
        conf-colon-assignment-space)
   (set (make-local-variable 'conf-assignment-column)
@@ -517,14 +513,12 @@
        ?:)
   (set (make-local-variable 'conf-assignment-regexp)
        ".+?\\([ \t]*:[ \t]*\\)")
-  (set (make-local-variable 'conf-font-lock-keywords)
-       conf-colon-font-lock-keywords)
   (setq imenu-generic-expression
 	`(("Parameters" "^[ \t]*\\(.+?\\)[ \t]*:" 1)
 	  ,@(cdr imenu-generic-expression))))
 
 ;;;###autoload
-(defun conf-ppd-mode ()
+(define-derived-mode conf-ppd-mode conf-colon-mode "Conf[PPD]"
   "Conf Mode starter for Adobe/CUPS PPD files.
 Comments start with `*%' and \"assignments\" are with `:'.
 For details see `conf-mode'.  Example:
@@ -533,13 +527,12 @@
 
 *DefaultTransfer: Null
 *Transfer Null.Inverse: \"{ 1 exch sub }\""
-  (interactive)
-  (conf-colon-mode "*%" conf-ppd-mode-syntax-table "Conf[PPD]")
+  (conf-mode-initialize "*%")
   ;; no sections, they match within PostScript code
   (setq imenu-generic-expression (list (car imenu-generic-expression))))
 
 ;;;###autoload
-(defun conf-xdefaults-mode ()
+(define-derived-mode conf-xdefaults-mode conf-colon-mode "Conf[Xdefaults]"
   "Conf Mode starter for Xdefaults files.
 Comments start with `!' and \"assignments\" are with `:'.
 For details see `conf-mode'.  Example:
@@ -548,8 +541,7 @@
 
 *background:			gray99
 *foreground:			black"
-  (interactive)
-  (conf-colon-mode "!" conf-xdefaults-mode-syntax-table "Conf[Xdefaults]"))
+  (conf-mode-initialize "!"))
 
 (provide 'conf-mode)
 
--- a/lisp/textmodes/flyspell.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/textmodes/flyspell.el	Mon Nov 07 14:56:19 2005 +0000
@@ -895,7 +895,9 @@
 (defun flyspell-post-command-hook ()
   "The `post-command-hook' used by flyspell to check a word in-the-fly."
   (interactive)
-  (let ((command this-command))
+  (let ((command this-command)
+	;; Prevent anything we do from affecting the mark.
+	deactivate-mark)
     (if (flyspell-check-pre-word-p)
 	(save-excursion
 	  '(flyspell-debug-signal-pre-word-checked)
@@ -1356,7 +1358,14 @@
 		  (progn
 		    (setq flyspell-large-region-beg (point))
 		    (goto-char (- (point) 1))
-		    (setq keep (flyspell-word)))
+		    (setq keep
+			  ;; Detect when WORD can't be checked properly
+			  ;; because flyspell-get-word finds
+			  ;; just part of it, and treat that as ok.
+			  (if (< (length (car (flyspell-get-word nil)))
+				 (length word))
+			      nil
+			    (flyspell-word))))
 		(error "Bug: misspelled word `%s' (output pos %d) not found in buffer"
 		       word wordpos)))))))
     ;; we are done
--- a/lisp/textmodes/ispell.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/textmodes/ispell.el	Mon Nov 07 14:56:19 2005 +0000
@@ -579,11 +579,11 @@
    ("francais"				; Francais.aff
     "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
     "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
-    "[-']" t nil "~list" iso-8859-1)
+    "[-'.@]" t nil "~list" iso-8859-1)
    ("francais-tex"			; Francais.aff
     "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
     "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
-    "[-'^`\"]" t nil "~tex" iso-8859-1)))
+    "[-'^`\".@]" t nil "~tex" iso-8859-1)))
 
 
 ;;; Fourth part of dictionary, shortened for loaddefs.el
@@ -599,7 +599,7 @@
    ("italiano"				; Italian.aff
     "[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
     "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
-    "[-]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
+    "[-.]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
    ("nederlands"			; Nederlands.aff
     "[A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
     "[^A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
@@ -624,7 +624,7 @@
    ("polish"				; Polish mode
     "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
     "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
-    "" nil nil nil iso-8859-2)
+    "." nil nil nil iso-8859-2)
    ("portugues"				; Portuguese mode
     "[a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]"
     "[^a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]"
@@ -1798,8 +1798,7 @@
 		    (setq line (1+ line))))
 	      (insert (car guess) "    ")
 	      (setq guess (cdr guess)))
-	    (insert "\nUse option `i' if this is a correct composition"
-		    " from the derivative root.\n")
+	    (insert "\nUse option `i' to accept this spelling and put it in your private dictionary.")
 	    (setq line (+ line (if choices 3 2)))))
       (while (and choices
 		  (< (if (> (+ 7 (current-column) (length (car choices))
--- a/lisp/textmodes/org.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/textmodes/org.el	Mon Nov 07 14:56:19 2005 +0000
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
 ;; Keywords: outlines, hypermedia, calendar
 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 3.18
+;; Version: 3.19
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -80,6 +80,9 @@
 ;;
 ;; Changes:
 ;; -------
+;; Version 3.19
+;;    - Bug fixes
+;;
 ;; Version 3.18
 ;;    - Export of calendar information in the standard iCalendar format.
 ;;    - Some bug fixes.
@@ -217,7 +220,7 @@
 
 ;;; Customization variables
 
-(defvar org-version "3.18"
+(defvar org-version "3.19"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -781,7 +784,7 @@
 (defcustom org-level-color-stars-only nil
   "Non-nil means fontify only the stars in each headline.
 When nil, the entire headline is fontified.
-After changing this, requires restart of Emacs to become effective."
+After changin this, requires restart of Emacs to become effective."
   :group 'org-structure
   :type 'boolean)
 
@@ -2865,7 +2868,7 @@
 	     (message "Making completion list...")
 	     (let ((list (sort (all-completions pattern table) 'string<)))
 	       (with-output-to-temp-buffer "*Completions*"
-		 (display-completion-list list pattern)))
+		 (display-completion-list list)))
 	     (message "Making completion list...%s" "done"))))))
 
 ;;; Comments, TODO and DEADLINE
@@ -3189,6 +3192,8 @@
 		(mapcar (lambda(x) (or x 0))  ;; FIXME: Problem with timezone?
 			(parse-time-string (match-string 1))))
 	     (current-time)))
+	 (calendar-move-hook nil)
+	 (view-diary-entries-initially nil)
 	 (timestr (format-time-string
 		   (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") default-time))
 	 (prompt (format "YYYY-MM-DD [%s]: " timestr))
@@ -3200,8 +3205,7 @@
 	;; Copied (with modifications) from planner.el by John Wiegley
 	(save-excursion
 	  (save-window-excursion
-	    (let ((view-diary-entries-initially nil))
-	      (calendar))
+	    (calendar)
 	    (calendar-forward-day (- (time-to-days default-time)
 				     (calendar-absolute-from-gregorian
 				      (calendar-current-date))))
@@ -3524,7 +3528,8 @@
 (defun org-recenter-calendar (date)
   "If the calendar is visible, recenter it to DATE."
   (let* ((win (selected-window))
-	 (cwin (get-buffer-window "*Calendar*" t)))
+	 (cwin (get-buffer-window "*Calendar*" t))
+	 (calendar-move-hook nil))
     (when cwin
       (select-window cwin)
       (calendar-goto-date (if (listp date) date
@@ -3536,7 +3541,9 @@
 If there is a time stamp in the current line, go to that date.
 A prefix ARG can be used force the current date."
   (interactive "P")
-  (let ((tsr org-ts-regexp) diff)
+  (let ((tsr org-ts-regexp) diff
+	(calendar-move-hook nil)
+	(view-diary-entries-initially nil))
     (if (or (org-at-timestamp-p)
 	    (save-excursion
 	      (beginning-of-line 1)
@@ -3545,8 +3552,7 @@
 	      (d2 (time-to-days
 		   (org-time-string-to-time (match-string 1)))))
 	  (setq diff (- d2 d1))))
-    (let ((view-diary-entries-initially nil))
-      (calendar))
+    (calendar)
     (calendar-goto-today)
     (if (and diff (not arg)) (calendar-forward-day diff))))
 
@@ -5248,9 +5254,10 @@
   (interactive)
   (let* ((day (or (get-text-property (point) 'day)
 		  (error "Don't know which date to open in calendar")))
-	 (date (calendar-gregorian-from-absolute day)))
-    (let ((view-diary-entries-initially nil))
-      (calendar))
+	 (date (calendar-gregorian-from-absolute day))
+	 (calendar-move-hook nil)
+	 (view-diary-entries-initially nil))
+    (calendar)
     (calendar-goto-date date)))
 
 (defun org-calendar-goto-agenda ()
@@ -9574,13 +9581,13 @@
   (let ((user user-full-name)
 	(calname "something")
 	(name (or name "unknown"))
-	(timezone "Europe/Amsterdam")) ;; FIXME:  How to get the real timezone?
+	(timezone "FIXME"))
     (princ
      (format "BEGIN:VCALENDAR
 VERSION:2.0
 X-WR-CALNAME:%s
 PRODID:-//%s//Emacs with Org-mode//EN
-X-WR-TIMEZONE:Europe/%s
+X-WR-TIMEZONE:Europe/Amsterdam
 CALSCALE:GREGORIAN\n" name user timezone))))
 
 (defun org-finish-icalendar-file ()
--- a/lisp/thumbs.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/thumbs.el	Mon Nov 07 14:56:19 2005 +0000
@@ -65,7 +65,7 @@
   :version "22.1"
   :group 'multimedia)
 
-(defcustom thumbs-thumbsdir "~/.emacs-thumbs"
+(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs"
   "*Directory to store thumbnails."
   :type 'directory
   :group 'thumbs)
@@ -190,7 +190,7 @@
   (let ((thumbs-thumbsdir (file-name-as-directory
                            (expand-file-name thumbs-thumbsdir))))
     (unless (file-directory-p thumbs-thumbsdir)
-      (make-directory thumbs-thumbsdir)
+      (make-directory thumbs-thumbsdir t)
       (message "Creating thumbnails directory"))
     thumbs-thumbsdir))
 
--- a/lisp/tool-bar.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/tool-bar.el	Mon Nov 07 14:56:19 2005 +0000
@@ -41,7 +41,9 @@
 
 ;;; Code:
 
-;;;###autoload
+;; The autoload cookie doesn't work when preloading.
+;; Deleting it means invoking this command won't work
+;; when you are on a tty.  I hope that won't cause too much trouble -- rms.
 (define-minor-mode tool-bar-mode
   "Toggle use of the tool bar.
 With numeric ARG, display the tool bar if and only if ARG is positive.
@@ -143,7 +145,7 @@
 
 ;;;###autoload
 (defun tool-bar-add-item-from-menu (command icon &optional map &rest props)
-  "Define tool bar binding for COMMAND using the given ICON in keymap MAP.
+  "Define tool bar binding for COMMAND in keymap MAP using the given ICON.
 This makes a binding for COMMAND in `tool-bar-map', copying its
 binding from the menu bar in MAP (which defaults to `global-map'), but
 modifies the binding by adding an image specification for ICON.  It
@@ -153,20 +155,21 @@
 MAP must contain appropriate binding for `[menu-bar]' which holds a keymap.
 
 Use this function only to make bindings in the global value of `tool-bar-map'.
-To define items in any other map, use `tool-bar-local-item'."
+To define items in any other map, use `tool-bar-local-item-from-menu'."
   (apply 'tool-bar-local-item-from-menu command icon
 	 (default-value 'tool-bar-map) map props))
 
 ;;;###autoload
 (defun tool-bar-local-item-from-menu (command icon in-map &optional from-map &rest props)
-  "Define tool bar binding for COMMAND using the given ICON in keymap MAP.
+  "Define local tool bar binding for COMMAND using the given ICON.
 This makes a binding for COMMAND in IN-MAP, copying its binding from
 the menu bar in FROM-MAP (which defaults to `global-map'), but
 modifies the binding by adding an image specification for ICON.  It
 finds ICON just like `tool-bar-add-item'.  PROPS are additional
 properties to add to the binding.
 
-MAP must contain appropriate binding for `[menu-bar]' which holds a keymap."
+FROM-MAP must contain appropriate binding for `[menu-bar]' which
+holds a keymap."
   (unless from-map
     (setq from-map global-map))
   (let* ((menu-bar-map (lookup-key from-map [menu-bar]))
--- a/lisp/vc-cvs.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/vc-cvs.el	Mon Nov 07 14:56:19 2005 +0000
@@ -452,7 +452,8 @@
 	(message "Checking out %s...done" filename)))))
 
 (defun vc-cvs-delete-file (file)
-  (vc-cvs-command nil 0 file "remove" "-f"))
+  (vc-cvs-command nil 0 file "remove" "-f")
+  (vc-cvs-command nil 0 file "commit" "-mRemoved."))
 
 (defun vc-cvs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
--- a/lisp/vc-sccs.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/vc-sccs.el	Mon Nov 07 14:56:19 2005 +0000
@@ -1,7 +1,7 @@
 ;;; vc-sccs.el --- support for SCCS version-control
 
 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;;   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
--- a/lisp/vc.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/vc.el	Mon Nov 07 14:56:19 2005 +0000
@@ -547,7 +547,7 @@
   :group 'vc
   :version "20.3")
 
-(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn")
+(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn" "{arch}")
   "*List of directory names to be ignored when walking directory trees."
   :type '(repeat string)
   :group 'vc)
@@ -2596,9 +2596,12 @@
 To get a prompt, use a prefix argument."
   (interactive
    (list
-    buffer-file-name
+    (or buffer-file-name
+        (error "There is no version-controlled file in this buffer"))
     (let ((backend (vc-backend buffer-file-name))
 	  (backends nil))
+      (unless backend
+        (error "File %s is not under version control" buffer-file-name))
       ;; Find the registered backends.
       (dolist (backend vc-handled-backends)
 	(when (vc-call-backend backend 'registered buffer-file-name)
--- a/lisp/view.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/view.el	Mon Nov 07 14:56:19 2005 +0000
@@ -874,7 +874,7 @@
   (interactive "P")
   (let ((view-scroll-auto-exit nil)
 	(view-try-extend-at-buffer-end t))
-    (view-scroll-lines lines nil view-page-size nil)))
+    (view-scroll-lines lines nil (view-page-size-default view-page-size) nil)))
 
 (defun View-search-regexp-forward (n regexp)
   "Search forward for first (or prefix Nth) occurrence of REGEXP in View mode.
--- a/lisp/wid-edit.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/wid-edit.el	Mon Nov 07 14:56:19 2005 +0000
@@ -3116,7 +3116,7 @@
 		       (interactive)
 		       (lisp-complete-symbol 'boundp))
   :tag "Variable")
-
+
 (defvar widget-coding-system-prompt-value-history nil
   "History of input to `widget-coding-system-prompt-value'.")
 
@@ -3159,6 +3159,29 @@
     (widget-apply widget :notify widget event)
     (widget-setup)))
 
+(defvar widget-key-sequence-prompt-value-history nil
+  "History of input to `widget-key-sequence-prompt-value'.")
+
+;; This mostly works, but I am pretty sure it needs more change
+;; to be 100% correct.  I don't know what the change should be -- rms.
+
+(define-widget 'key-sequence 'restricted-sexp
+  "A Lisp function."
+  :prompt-value 'widget-field-prompt-value
+  :prompt-internal 'widget-symbol-prompt-internal
+  :prompt-match 'fboundp
+  :prompt-history 'widget-key-sequence-prompt-value-history
+  :action 'widget-field-action
+  :match-alternatives '(stringp vectorp)
+  :validate (lambda (widget)
+	      (unless (or (stringp (widget-value widget))
+			  (vectorp (widget-value widget)))
+		(widget-put widget :error (format "Invalid key sequence: %S"
+						  (widget-value widget)))
+		widget))
+  :value 'ignore
+  :tag "Key sequence")
+
 (define-widget 'sexp 'editable-field
   "An arbitrary Lisp expression."
   :tag "Lisp expression"
--- a/lisp/xml.el	Mon Nov 07 14:17:18 2005 +0000
+++ b/lisp/xml.el	Mon Nov 07 14:56:19 2005 +0000
@@ -279,10 +279,11 @@
     (modify-syntax-entry ?. "_" table)
     (modify-syntax-entry ?: "_" table)
     ;; XML [89]
-    (dolist (c '(#x00B7 #x02D0 #x02D1 #x0387 #x0640 #x0E46 #x0EC6 #x3005
-		 #x3031 #x3032 #x3033 #x3034 #x3035 #x309D #x309E #x30FC
-		 #x30FD #x30FE))
-      (modify-syntax-entry (decode-char 'ucs c) "w" table))
+    (unless (featurep 'xemacs)
+      (dolist (c '(#x00B7 #x02D0 #x02D1 #x0387 #x0640 #x0E46 #x0EC6 #x3005
+			  #x3031 #x3032 #x3033 #x3034 #x3035 #x309D #x309E #x30FC
+			  #x30FD #x30FE))
+	(modify-syntax-entry (decode-char 'ucs c) "w" table)))
     ;; Fixme: rest of [4]
     table)
   "Syntax table used by `xml-parse-region'.")
@@ -473,7 +474,7 @@
 			      (if (stringp expansion)
 				  (if (stringp (car children))
 				      ;; The two strings were separated by a comment.
-				      (setq children (append (concat (car children) expansion)
+				      (setq children (append (list (concat (car children) expansion))
 							     (cdr children)))
 				    (setq children (append (list expansion) children)))
 				(setq children (append expansion children))))))))
--- a/lispref/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,34 @@
+2005-11-06  Richard M. Stallman  <rms@gnu.org>
+
+	* files.texi (Magic File Names): find-file-name-handler checks the
+	`operations' property of the handler.
+
+2005-11-03  Richard M. Stallman  <rms@gnu.org>
+
+	* variables.texi (Frame-Local Variables): Small clarification.
+
+2005-10-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* os.texi (Init File): Document ~/.emacs.d/init.el.
+
+2005-10-29  Richard M. Stallman  <rms@gnu.org>
+
+	* internals.texi (Garbage Collection): Document memory-full.
+
+2005-10-28  Bill Wohler  <wohler@newt.com>
+
+	* tips.texi (Documentation Tips): Help mode now creates hyperlinks
+	for URLs.
+
+2005-10-28  Richard M. Stallman  <rms@gnu.org>
+
+	* minibuf.texi (Completion Commands): Clean up prev change.
+
+2005-10-26  Kevin Ryde  <user42@zip.com.au>
+
+	* compile.texi (Eval During Compile): Explain recommended uses
+	of eval-when-compile and eval-and-compile.
+
 2005-10-27  Masatake YAMATO  <jet@gyve.org>
 
 	* minibuf.texi (Completion Commands): 
--- a/lispref/compile.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/compile.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -407,7 +407,25 @@
 
 You can get a similar result by putting @var{body} in a separate file
 and referring to that file with @code{require}.  That method is
-preferable when @var{body} is large.
+preferable when @var{body} is large.  Effectively @code{require} is
+automatically @code{eval-and-compile}, the package is loaded both when
+compiling and executing.
+
+@code{autoload} is also effectively @code{eval-and-compile} too.  It's
+recognised when compiling, so uses of such a function don't produce
+``not known to be defined'' warnings.
+
+Most uses of @code{eval-and-compile} are fairly sophisticated.
+
+If a macro has a helper function to build its result, and that macro
+is used both locally and outside the package, then
+@code{eval-and-compile} should be used to get the helper both when
+compiling and then later when running.
+
+If functions are defined programmatically (with @code{fset} say), then
+@code{eval-and-compile} can be used to have that done at compile-time
+as well as run-time, so calls to those functions are checked (and
+warnings about ``not known to be defined'' suppressed).
 @end defspec
 
 @defspec eval-when-compile body@dots{}
@@ -417,7 +435,38 @@
 you load the source file, rather than compiling it, @var{body} is
 evaluated normally.
 
-@strong{Common Lisp Note:} At top level, this is analogous to the Common
+If you have a constant that needs some calculation to produce,
+@code{eval-when-compile} can do that done at compile-time.  For
+example,
+
+@lisp
+(defvar my-regexp
+  (eval-when-compile (regexp-opt '("aaa" "aba" "abb"))))
+@end lisp
+
+If you're using another package, but only need macros from it (the
+byte compiler will expand those), then @code{eval-when-compile} can be
+used to load it for compiling, but not executing.  For example,
+
+@lisp
+(eval-when-compile
+  (require 'my-macro-package))  ;; only macros needed from this
+@end lisp
+
+The same sort of thing goes for macros or @code{defalias}es defined
+locally and only for use within the file.  They can be defined while
+compiling, but then not needed when executing.  This is good for code
+that's only a fallback for compability with other versions of Emacs.
+For example.
+
+@lisp
+(eval-when-compile
+  (unless (fboundp 'some-new-thing)
+    (defmacro 'some-new-thing ()
+      (compatibility code))))
+@end lisp
+
+@strong{Common Lisp Note:} At top level, @code{eval-when-compile} is analogous to the Common
 Lisp idiom @code{(eval-when (compile eval) @dots{})}.  Elsewhere, the
 Common Lisp @samp{#.} reader macro (but not when interpreting) is closer
 to what @code{eval-when-compile} does.
--- a/lispref/files.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/files.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -2706,11 +2706,13 @@
 @end defvar
 
 @defun find-file-name-handler file operation
-This function returns the handler function for file name @var{file}, or
-@code{nil} if there is none.  The argument @var{operation} should be the
-operation to be performed on the file---the value you will pass to the
-handler as its first argument when you call it.  The operation is needed
-for comparison with @code{inhibit-file-name-operation}.
+This function returns the handler function for file name @var{file},
+or @code{nil} if there is none.  The argument @var{operation} should
+be the operation to be performed on the file---the value you will pass
+to the handler as its first argument when you call it.  If
+@var{operation} equals @code{inhibit-file-name-operation}, or if it is
+not found in the @code{operations} property of the handler, this
+function returns @code{nil}.
 @end defun
 
 @defun file-local-copy filename
--- a/lispref/internals.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/internals.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -406,6 +406,11 @@
 memory usage.
 @end defun
 
+@defvar memory-full
+This variable is @code{t} if Emacs is close to out of memory for Lisp
+objects, and @code{nil} otherwise.
+@end defvar
+
 @defun memory-use-counts
 This returns a list of numbers that count the number of objects
 created in this Emacs session.  Each of these counters increments for
--- a/lispref/minibuf.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/minibuf.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -960,12 +960,12 @@
 the two strings is the actual completion, the second string serves as
 annotation.
 
-@var{common-substring} represents a string common prefix between all 
-completions.  @var{common-substring} is used to put faces on 
-@samp{*Completions*} to enhance visual feedback of the buffer; 
-@code{display-completion-list} use faces to highlight what all completions 
-have in common and where they begin to differ.  @var{common-substring}
-specifies the common part.
+The argument @var{common-substring} is the prefix that is common to
+all the completions.  With normal Emacs completion, it is usually the
+same as the string that was completed.  @code{display-completion-list}
+uses this to highlight text in the completion list for better visual
+feedback.  This is not needed in the minibuffer; for minibuffer
+completion, you can pass @code{nil}.
 
 This function is called by @code{minibuffer-completion-help}.  The 
 most common way to use it is together with
--- a/lispref/os.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/os.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -180,10 +180,11 @@
 
   When you start Emacs, it normally attempts to load your @dfn{init
 file}, a file in your home directory.  Its normal name is
-@file{.emacs}, but you can alternatively call it @file{.emacs.el}.
-You can also store it inside a subdirectory @file{.emacs.d}.
-Whichever place you use, you can also compile the file (@pxref{Byte
-Compilation}); then the actual file loaded will be @file{.emacs.elc}.
+@file{.emacs}, but you can also call it @file{.emacs.el}.
+Alternatively, you can use a file named @file{init.el} in a
+subdirectory @file{.emacs.d}.  Whichever place you use, you can also
+compile the file (@pxref{Byte Compilation}); then the actual file
+loaded will be @file{.emacs.elc} or @file{init.elc}.
 
   The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u}
 control whether and where to find the init file; @samp{-q} (and the
--- a/lispref/tips.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/tips.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -774,6 +774,14 @@
 See Info node `Font Lock' and Info node `(elisp)Font Lock Basics'.
 @end smallexample
 
+Finally, to create a hyperlink to URLs, write the URL in single
+quotes, preceded by @samp{URL}. For example,
+
+@smallexample
+The home page for the GNU project has more information (see URL
+`http://www.gnu.org/').
+@end smallexample
+
 @item
 Don't write key sequences directly in documentation strings.  Instead,
 use the @samp{\\[@dots{}]} construct to stand for them.  For example,
--- a/lispref/variables.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/lispref/variables.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -1644,8 +1644,7 @@
 If the variable is terminal-local, this function signals an error,
 because such variables cannot have frame-local bindings as well.
 @xref{Multiple Displays}.  A few variables that are implemented
-specially in Emacs can be (and usually are) buffer-local, but can never
-be frame-local.
+specially in Emacs can be buffer-local, but can never be frame-local.
 
 This command returns @var{variable}.
 @end deffn
--- a/man/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,3 +1,82 @@
+2005-11-04  J,bi(Br,bt(Bme Marant  <jerome@marant.org>
+
+	* misc.texi (Shell Mode): Describe how to activate password echoing.
+
+2005-11-04  Ulf Jasper  <ulf.jasper@web.de>
+
+	* newsticker.texi: VERSION changed to 1.9.  Updated UPDATED.
+	(Overview): List supported feed types.
+	(Installation): No installation necessary when using autoload.
+	(Configuration): Rename "RSS" to "news".
+
+2005-11-04 Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* pgg.texi (User Commands): Document additional passphrase
+	argument for pgg-encrypt-*, pgg-decrypt-*, and pgg-sign-* functions.
+	(Backend methods): Likewise for corresponding pgg-scheme-* functions.
+
+2005-11-04  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.texi: Version number changed to 3.19
+
+2005-11-04  Romain Francoise  <romain@orebokech.com>
+
+	* mark.texi (Mark Ring): Fix typo.
+
+2005-11-03  Richard M. Stallman  <rms@gnu.org>
+
+	* mark.texi (Mark Ring): Mention set-mark-command-repeat-pop.
+
+2005-11-01  Bill Wohler  <wohler@newt.com>
+
+	* help.texi (Help Mode): Fix typo.
+
+2005-11-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (Other GDB User Interface Buffers): Describe
+	the command gdb-use-inferior-io-buffer.
+
+2005-10-31  Romain Francoise  <romain@orebokech.com>
+
+	* files.texi (Compressed Files): Fix typo.
+
+	* buffers.texi (Misc Buffer): Downcase `*shell*'.
+
+	* windows.texi (Force Same Window): Likewise.
+
+2005-10-30  Bill Wohler  <wohler@newt.com>
+
+	* help.texi (Help Mode): URLs viewed with browse-url.
+
+2005-10-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (GDB Graphical Interface): Don't reference
+	gdb-mouse-set-clear-breakpoint.  Explain gdb-mouse-until
+	must stay in same frame.
+
+2005-10-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* custom.texi (Init File): Document ~/.emacs.d/init.el.
+
+	* anti.texi (Antinews): Likewise.
+
+2005-10-29  Sascha Wilde  <wilde@sha-bang.de>
+
+	* pgg.texi (How to use): Update the example to add autoload of
+	pgg-encrypt-symmetric-region.
+	(User Commands): Document pgg-encrypt-symmetric-region.
+	(Backend methods): Document pgg-scheme-encrypt-symmetric-region.
+
+2005-10-28  Bill Wohler  <wohler@newt.com>
+
+	* help.texi (Help): Help mode now creates hyperlinks for URLs.
+
+2005-10-28  Richard M. Stallman  <rms@gnu.org>
+
+	* files.texi (Visiting): Explain how to enter ? in a file name.
+
+	* trouble.texi (Memory Full): Mention !MEM FULL! in mode line.
+
 2005-10-27  Jay Belanger  <belanger@truman.edu>
 
 	* calc.texi (Predefined Units): Fix the symbol for a TeX points,
--- a/man/anti.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/anti.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -63,9 +63,10 @@
 functions.
 
 @item
-Emacs now looks for @file{.emacs} and @file{.emacs_SHELL} in one
-standard location---your home directory.  Don't put these files in
-@file{~/.emacs.d}; they won't be found.
+We have standardized on one location for the user init file: the file
+named @file{.emacs} in your home directory.  Emacs will not look for
+the init file in @file{~/.emacs.d/init.el}.  Similarly, don't try
+putting @file{.emacs_SHELL} in @file{~/.emacs.d}; Emacs won't find it.
 
 @item
 Emacs will not read @file{~/.abbrev_defs} automatically.  If you want
--- a/man/buffers.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/buffers.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -252,9 +252,9 @@
   @kbd{M-x rename-uniquely} renames the current buffer to a similar
 name with a numeric suffix added to make it both different and unique.
 This command does not need an argument.  It is useful for creating
-multiple shell buffers: if you rename the @samp{*Shell*} buffer, then
+multiple shell buffers: if you rename the @samp{*shell*} buffer, then
 do @kbd{M-x shell} again, it makes a new shell buffer named
-@samp{*Shell*}; meanwhile, the old shell buffer continues to exist
+@samp{*shell*}; meanwhile, the old shell buffer continues to exist
 under its new name.  This method is also good for mail buffers,
 compilation buffers, and most Emacs features that create special
 buffers with particular names.  (With some of these features, such as
--- a/man/building.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/building.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -758,10 +758,10 @@
 @kbd{Mouse-1} in the fringe or display margin of a source buffer to
 set a breakpoint there and, on a graphical display, a red bullet will
 appear.  If a breakpoint already exists on that line, this action will
-remove it (@code{gdb-mouse-set-clear-breakpoint}).  You can also
-enable or disable a breakpoint by clicking @kbd{Mouse-3} on the
-bullet.  If you drag the debugger arrow in the fringe with
-@kbd{Mouse-1}, execution will continue to where you release the button
+remove it.  You can also enable or disable a breakpoint by clicking
+@kbd{Mouse-3} on the bullet.  If you drag the debugger arrow in the
+fringe with @kbd{Mouse-1}, execution will continue to the line where
+you release the button, provided it is still in the same frame
 (@code{gdb-mouse-until}).  Alternatively, you can click @kbd{Mouse-2}
 at some point in the fringe of this buffer and execution will advance
 to there.
@@ -936,8 +936,11 @@
 @vindex gdb-use-inferior-io-buffer
 If the variable @code{gdb-use-inferior-io-buffer} is non-@code{nil},
 the executable program that is being debugged takes its input and
-displays its output here.  Some of the commands from shell mode are
-available here.  @xref{Shell Mode}.
+displays its output here, otherwise it uses the GUD buffer.  To toggle
+the use of this buffer, do @kbd{M-x gdb-use-inferior-io-buffer}.
+
+Some of the commands from shell mode are available here.  @xref{Shell
+Mode}.
 
 @item Locals Buffer
 The locals buffer displays the values of local variables of the
--- a/man/custom.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/custom.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -1983,13 +1983,15 @@
 @cindex startup (init file)
 
   When Emacs is started, it normally loads a Lisp program from the
-file @file{.emacs} or @file{.emacs.el} in your home directory.  (You
-can also put it in a subdirectory @file{~/.emacs.d} and Emacs will
-still find it.)  We call this file your @dfn{init file} because it
-specifies how to initialize Emacs for you.  You can use the command
-line switch @samp{-q} to prevent loading your init file, and @samp{-u}
-(or @samp{--user}) to specify a different user's init file
-(@pxref{Initial Options}).
+file @file{.emacs} or @file{.emacs.el} in your home directory.  We
+call this file your @dfn{init file} because it specifies how to
+initialize Emacs for you.  You can use the command line switch
+@samp{-q} to prevent loading your init file, and @samp{-u} (or
+@samp{--user}) to specify a different user's init file (@pxref{Initial
+Options}).
+
+  You can also use @file{~/.emacs.d/init.el} as the init file.  Emacs
+tries this if it cannot find @file{~/.emacs} or @file{~/.emacs.el}.
 
 @cindex @file{default.el}, the default init file
   There can also be a @dfn{default init file}, which is the library
--- a/man/files.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/files.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -281,11 +281,13 @@
 
 @cindex wildcard characters in file names
 @vindex find-file-wildcards
-  If the file name you specify contains shell-style wildcard characters,
-Emacs visits all the files that match it.  Wildcards include @samp{?},
-@samp{*}, and @samp{[@dots{}]} sequences.  @xref{Quoted File Names}, for
-information on how to visit a file whose name actually contains wildcard
-characters.  You can disable the wildcard feature by customizing
+  If the file name you specify contains shell-style wildcard
+characters, Emacs visits all the files that match it.  Wildcards
+include @samp{?}, @samp{*}, and @samp{[@dots{}]} sequences.  To enter
+the wild card @samp{?} in a file name in the minibuffer, you need to
+type @kbd{C-q ?}.  @xref{Quoted File Names}, for information on how to
+visit a file whose name actually contains wildcard characters.  You
+can disable the wildcard feature by customizing
 @code{find-file-wildcards}.
 
   If you visit a file that the operating system won't let you modify,
@@ -3082,7 +3084,7 @@
 @pindex gzip
 
   Emacs automatically uncompresses compressed files when you visit
-them, and automatically recompress them if you alter them and save
+them, and automatically recompresses them if you alter them and save
 them.  Emacs recognizes compressed files by their file names.  File
 names ending in @samp{.gz} indicate a file compressed with
 @code{gzip}.  Other endings indicate other compression programs.
--- a/man/help.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/help.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -32,8 +32,8 @@
 
   Most help buffers use a special major mode, Help mode, which lets you
 scroll conveniently with @key{SPC} and @key{DEL}.  It also offers
-hyperlinks to further help regarding cross-referenced names, Info nodes,
-customization buffers and the like.  @xref{Help Mode}.
+hyperlinks to URLs and further help regarding cross-referenced names, Info
+nodes, customization buffers and the like.  @xref{Help Mode}.
 
 @cindex searching documentation efficiently
 @cindex looking for a subject in documentation
@@ -443,6 +443,16 @@
 @key{RET}, to view the documentation of that command or variable.  Use
 @kbd{C-c C-b} to retrace your steps.
 
+@cindex URL, viewing in help
+@cindex help, viewing web pages
+@cindex viewing web pages in help
+@cindex web pages, viewing in help
+@findex browse-url
+  You can follow cross references to URLs (web pages) as well.  When
+you follow a cross reference that is a URL, the @code{browse-url}
+command is used to view the web page in a browser of your choosing.
+@xref{Browse-URL}.
+
 @kindex @key{TAB} @r{(Help mode)}
 @findex help-next-ref
 @kindex S-@key{TAB} @r{(Help mode)}
--- a/man/mark.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/mark.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -383,10 +383,12 @@
 where the mark was, and restores the mark from the ring of former
 marks.
 
-  If you repeat the character @kbd{C-@key{SPC}}, after typing @kbd{C-u
-C-@key{SPC}}, each repetition moves point to a previous mark position
-from the ring.  The mark positions you move through in this way are
-not lost; they go to the end of the ring.
+@vindex set-mark-command-repeat-pop
+  If you set @code{set-mark-command-repeat-pop} to non-@code{nil},
+then when you repeat the character @kbd{C-@key{SPC}} after typing
+@kbd{C-u C-@key{SPC}}, each repetition moves point to a previous mark
+position from the ring.  The mark positions you move through in this
+way are not lost; they go to the end of the ring.
 
   Each buffer has its own mark ring.  All editing commands use the current
 buffer's mark ring.  In particular, @kbd{C-u C-@key{SPC}} always stays in
--- a/man/misc.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/misc.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -645,12 +645,13 @@
 echoing.  This is useful when a shell command runs a program that asks
 for a password.
 
-Alternatively, you can arrange for Emacs to notice password prompts
-and turn off echoing for them, as follows:
+Please note that Emacs will not echo passwords by default.  If you
+really want them to be echoed, evaluate the following Lisp
+expression:
 
 @example
-(add-hook 'comint-output-filter-functions
-          'comint-watch-for-password-prompt)
+(remove-hook 'comint-output-filter-functions
+             'comint-watch-for-password-prompt)
 @end example
 
 @item M-x comint-continue-subjob
--- a/man/newsticker.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/newsticker.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -1,8 +1,8 @@
 \input texinfo   @c -*-texinfo-*-
 @comment %**start of header
 @setfilename ../info/newsticker
-@set VERSION 1.8
-@set UPDATED October 2005
+@set VERSION 1.9
+@set UPDATED November 2005
 @settitle Newsticker @value{VERSION}
 @syncodeindex vr cp
 @syncodeindex fn cp
@@ -75,13 +75,27 @@
 prepares these headlines for reading, and allows for loading the
 corresponding articles in a web browser.
 
-Headlines consist of a title and (possibly) a small description. They
-are contained in RSS (RDF Site Summary) files.  Newsticker should work
-with all RSS files that follow the @uref{http://purl.org/rss/1.0/spec,
-RDF Rich Site Summary 1.0} specification. It should also work with
-version 2.0 as well as other/older/alternative rss formats (like
-0.9<something> or such). In other words: Newsticker is a ``RSS
-reader'' or ``RSS aggregator''.
+
+Headlines consist of a title and (possibly) a small description.  They
+are contained in "RSS" (RDF Site Summary) or "Atom" files.  Newsticker
+should work with the following RSS formats:
+
+@itemize
+@item RSS 0.91 (see @uref{http://backend.userland.com/rss091} or
+@uref{http://my.netscape.com/publish/formats/rss-spec-0.91.html}),
+@item RSS 0.92 (see @uref{http://backend.userland.com/rss092}),
+@item RSS 1.0 (see @uref{http://purl.org/rss/1.0/spec}
+@item RSS 2.0 (see @uref{http://blogs.law.harvard.edu/tech/rss}),
+@end itemize
+@itemize
+as well as the following Atom formats:
+@item Atom 0.3
+@item Atom 1.0 (see
+@uref{http://www.ietf.org/internet-drafts/draft-ietf-atompub-format-11.txt}).
+@end itemize
+
+That makes Newsticker.el an "Atom aggregator, "RSS reader", or "RSS
+aggregator".
 
 Newsticker provides several commands for reading headlines, navigating
 through them, marking them as read/unread, hiding old headlines etc.
@@ -122,18 +136,12 @@
 @node Installation
 @chapter Installation
 
-Place Newsticker in a directory where Emacs can find it. Add the
-following line to your Emacs startup file (@file{~/.emacs}).
+As Newsticker is part of GNU Emacs there is no need to perform any
+installation steps in order to use Newsticker.
 
-@lisp
-(add-to-list 'load-path "/path/to/newsticker/")
-(autoload 'newsticker-start "newsticker" "Emacs Newsticker" t)
-(autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t)
-@end lisp
-
-Newsticker-mode supports imenu. This allows for navigating with the
-help of a menu. In order to use this feature you should also add the
-following.
+However, if you are using imenu, which allows for navigating with the
+help of a menu, you should add the following to your Emacs startup file
+(@file{~/.emacs}).
 
 @lisp
 (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
@@ -211,7 +219,7 @@
 
 @item
 @code{newsticker-layout} contains options that define how the
-buffer for reading RSS headlines is formatted.
+buffer for reading news headlines is formatted.
 
 @itemize
 @item
--- a/man/org.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/org.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -4,7 +4,7 @@
 @setfilename ../info/org
 @settitle Org Mode Manual
 
-@set VERSION 3.18
+@set VERSION 3.19
 @set DATE October 2005
 
 @dircategory Emacs
--- a/man/pgg.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/pgg.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -98,6 +98,8 @@
 @lisp
 (autoload 'pgg-encrypt-region "pgg"
   "Encrypt the current region." t)
+(autoload 'pgg-encrypt-symmetric-region "pgg"
+  "Encrypt the current region with symmetric algorithm." t)
 (autoload 'pgg-decrypt-region "pgg"
   "Decrypt the current region." t)
 (autoload 'pgg-sign-region "pgg"
@@ -127,7 +129,7 @@
 fails immediately, but if the function had been called interactively, it
 would ask you to retrieve the signer's public key from the server.
 
-@deffn Command pgg-encrypt-region start end recipients &optional sign
+@deffn Command pgg-encrypt-region start end recipients &optional sign passphrase
 Encrypt the current region between @var{start} and @var{end} for
 @var{recipients}.  When the function were called interactively, you
 would be asked about the recipients.
@@ -136,22 +138,41 @@
 the accessible portion) with the resulting data.
 
 If optional argument @var{sign} is non-@code{nil}, the function is
-request to do a combined sign and encrypt.  This currently only work
-with GnuPG.
+request to do a combined sign and encrypt.  This currently is
+confirmed to work with GnuPG, but might not work with PGP or PGP5.
+
+If optional @var{passphrase} is @code{nil}, the passphrase will be
+obtained from the passphrase cache or user.
 @end deffn
 
-@deffn Command pgg-decrypt-region start end
+@deffn Command pgg-encrypt-symmetric-region &optional start end passphrase
+Encrypt the current region between @var{start} and @var{end} using a
+symmetric cipher.  After invocation you are asked for a passphrase.
+
+If optional @var{passphrase} is @code{nil}, the passphrase will be
+obtained from the passphrase cache or user.
+
+symmetric-cipher encryption is currently only implemented for GnuPG.
+@end deffn
+
+@deffn Command pgg-decrypt-region start end &optional passphrase
 Decrypt the current region between @var{start} and @var{end}.  If
 decryption is successful, it replaces the current region contents (in
 the accessible portion) with the resulting data.
+
+If optional @var{passphrase} is @code{nil}, the passphrase will be
+obtained from the passphrase cache or user.
 @end deffn
 
-@deffn Command pgg-sign-region start end &optional cleartext
+@deffn Command pgg-sign-region start end &optional cleartext passphrase
 Make the signature from text between @var{start} and @var{end}.  If the
 optional third argument @var{cleartext} is non-@code{nil}, or the
 function is called interactively, it does not create a detached
 signature.  In such a case, it replaces the current region contents (in
 the accessible portion) with the resulting data.
+
+If optional @var{passphrase} is @code{nil}, the passphrase will be
+obtained from the passphrase cache or user.
 @end deffn
 
 @deffn Command pgg-verify-region start end &optional signature fetch
@@ -300,19 +321,26 @@
 keyrings.
 @end deffn
 
-@deffn Method pgg-scheme-encrypt-region scheme start end recipients &optional sign
+@deffn Method pgg-scheme-encrypt-region scheme start end recipients &optional sign passphrase
 Encrypt the current region between @var{start} and @var{end} for
 @var{recipients}.  If @var{sign} is non-@code{nil}, do a combined sign
 and encrypt.  If encryption is successful, it returns @code{t},
 otherwise @code{nil}.
 @end deffn
 
-@deffn Method pgg-scheme-decrypt-region scheme start end
+@deffn Method pgg-scheme-encrypt-symmetric-region scheme start end &optional passphrase
+Encrypt the current region between @var{start} and @var{end} using a
+symmetric cipher and a passphrases.  If encryption is successful, it
+returns @code{t}, otherwise @code{nil}.  This function is currently only
+implemented for GnuPG.
+@end deffn
+
+@deffn Method pgg-scheme-decrypt-region scheme start end &optional passphrase
 Decrypt the current region between @var{start} and @var{end}.  If
 decryption is successful, it returns @code{t}, otherwise @code{nil}.
 @end deffn
 
-@deffn Method pgg-scheme-sign-region scheme start end &optional cleartext
+@deffn Method pgg-scheme-sign-region scheme start end &optional cleartext passphrase
 Make the signature from text between @var{start} and @var{end}.  If the
 optional third argument @var{cleartext} is non-@code{nil}, it does not
 create a detached signature.  If signing is successful, it returns
--- a/man/trouble.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/trouble.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -311,18 +311,20 @@
 @cindex memory full
 @cindex out of memory
 
-  If you get the error message @samp{Virtual memory exceeded}, save your
-modified buffers with @kbd{C-x s}.  This method of saving them has the
-smallest need for additional memory.  Emacs keeps a reserve of memory
-which it makes available when this error happens; that should be enough
-to enable @kbd{C-x s} to complete its work.
+  If you get the error message @samp{Virtual memory exceeded}, save
+your modified buffers with @kbd{C-x s}.  This method of saving them
+has the smallest need for additional memory.  Emacs keeps a reserve of
+memory which it makes available when this error happens; that should
+be enough to enable @kbd{C-x s} to complete its work.  When the
+reserve has been used, @samp{!MEM FULL!} appears at the beginning of
+the mode line, indicating there is no more reserve.
 
-  Once you have saved your modified buffers, you can exit this Emacs job
-and start another, or you can use @kbd{M-x kill-some-buffers} to free
-space in the current Emacs job.  If you kill buffers containing a
-substantial amount of text, you can safely go on editing.  Emacs refills
-its memory reserve automatically when it sees sufficient free space
-available, in case you run out of memory another time.
+  Once you have saved your modified buffers, you can exit this Emacs
+session and start another, or you can use @kbd{M-x kill-some-buffers}
+to free space in the current Emacs job.  If this frees up sufficient
+space, Emacs will refill its memory reserve, and @samp{!MEM FULL!}
+will disappear from the mode line.  That means you can safely go on
+editing in the same Emacs session.
 
   Do not use @kbd{M-x buffer-menu} to save or kill buffers when you run
 out of memory, because the buffer menu needs a fair amount of memory
--- a/man/windows.texi	Mon Nov 07 14:17:18 2005 +0000
+++ b/man/windows.texi	Mon Nov 07 14:56:19 2005 +0000
@@ -226,7 +226,7 @@
 
   Certain Emacs commands switch to a specific buffer with special
 contents.  For example, @kbd{M-x shell} switches to a buffer named
-@samp{*Shell*}.  By convention, all these commands are written to pop up
+@samp{*shell*}.  By convention, all these commands are written to pop up
 the buffer in a separate window.  But you can specify that certain of
 these buffers should appear in the selected window.
 
--- a/src/ChangeLog	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/ChangeLog	Mon Nov 07 14:56:19 2005 +0000
@@ -1,7 +1,145 @@
+2005-11-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (Fget_lru_window, Fget_largest_window, window_loop):
+	Don't abuse the `mini' arg.  Use the `obj' arg instead.
+
+2005-11-04  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (show_mouse_face): Clear mouse face to eol.
+
+2005-11-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* Makefile.in (lisp, shortlisp): Add emacs-lisp/syntax.elc,
+	font-lock.elc and jit-lock.elc.
+
+2005-11-03  Richard M. Stallman  <rms@gnu.org>
+
+	* window.c (Fenlarge_window): Rename SIDE to HORIZONTAL.
+	(enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG.
+	(CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG.
+
+	* sheap.c (STATIC_HEAP_SIZE): Increment both definitions.
+
+	* alloc.c (refill_memory_reserve): Move decl out of conditionals.
+
+2005-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (Fdisplay_buffer): Fix last change to not use
+	a dedicated window.
+
+2005-11-01  Kim F. Storm  <storm@cua.dk>
+
+	* fringe.c (update_window_fringes): Undo 2005-10-27 change.
+	Instead, rotate the bottom angle bitmap 180 degrees to indicate
+	that the bottom row does not end in a newline.
+
+2005-11-01  Andreas Schwab  <schwab@suse.de>
+
+	* unexelf.c (unexec): Handle .plt section in BSS segment.
+
+2005-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* lread.c (readevalloop): Yet another int/Lisp_Object mixup (YAILOM).
+
+	* window.c (window_loop): For LRU and LARGEST, let the `mini' argument
+	determine whether to consider dedicated windows as well.
+	(Fget_lru_window, Fget_largest_window): Add `dedicated' argument.
+	(Fdisplay_buffer): Do consider dedicated windows in those cases where
+	we will split the window rather than reuse it.
+	Don't try to use windows on other displays.
+
+2005-10-31  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* puresize.h (BASE_PURESIZE): Increment to 1170000.
+
+2005-10-31  Romain Francoise  <romain@orebokech.com>
+
+	* macfns.c: Update copyright year.
+	* m/gould.h: Likewise.
+
+2005-10-30  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (display_line): Restore it->current_x and call
+	extend_face_to_end_of_line when last glyph doesn't fit on line.
+	(set_glyph_string_background_width): Remove specific tests  here
+	to see if face background should extend to end of line.  Simplify.
+
+2005-10-30  Richard M. Stallman  <rms@gnu.org>
+
+	* alloc.c (BYTES_USED): Use uordblks, not arena.
+	(bytes_used_when_reconsidered): New variable.
+	(emacs_blocked_free): Set that.
+
+2005-10-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* alloc.c (emacs_blocked_free): Fix typo.
+
+2005-10-29  Richard M. Stallman  <rms@gnu.org>
+
+	* data.c (Fmake_variable_frame_local): Doc fix.
+
+	* xdisp.c (handle_fontified_prop): Do nothing if memory full.
+	(format_mode_line_unwind_data): New arg SAVE_PROPTRANS
+	controls whether to save and restore mode_line_proptrans_alist.
+	Callers changed.
+	(unwind_format_mode_line): Work with that feature.
+	(redisplay_internal): Don't call prepare_menu_bars if memory full.
+	(move_elt_to_front): New function.
+	(display_mode_element): Use move_elt_to_front.
+	Don't bother munging text props on a null string.
+	Delete obsolete elts from mode_line_proptrans_alist.
+	(decode_mode_spec): Test Vmemory_full, not spare_memory.
+	(Fformat_mode_line): Clear mode_line_proptrans_alist after saving.
+
+	* lisp.h (memory_full_cons_threshold): Declare.
+	(internal_lisp_condition_case): Declare.
+
+	* alloc.c (syms_of_alloc) <memory-full>: Doc fix.
+	(Fmemory_full_p): Function deleted.
+	(syms_of_alloc): Don't defsubr it.
+	(memory_full_cons_threshold): New variable.
+	(spare_memory): Now a vector of 7 elts.
+	(buffer_memory_full): Don't set Vmemory_full here.
+	(xfree): Don't try to refill here.
+	(emacs_blocked_free): Record BYTES_USED in local var.
+	(memory_full): Now free all the slots in spare_memory.
+	(refill_memory_reserve): Allocate each slot in spare_memory.
+	(init_alloc_once): Call refill_memory_reserve.
+
+	* keyboard.c (command_loop_1): Don't set Vmemory_full here.
+
+	* eval.c (internal_lisp_condition_case): New function.
+	(Fcondition_case): Use internal_lisp_condition_case.
+	(Feval): Test Vmemory_full and memory_full_cons_threshold.
+	(Ffuncall): Likewise.
+
+	* bytecode.c (Fbyte_code): Use internal_lisp_condition_case.
+
+2005-10-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* syntax.c (Fparse_partial_sexp): Fix docstring.
+
+2005-10-28  Romain Francoise  <romain@orebokech.com>
+
+	* puresize.h (BASE_PURESIZE): Increment to 1130000.
+
+2005-10-28  Richard M. Stallman  <rms@gnu.org>
+
+	* xfns.c (syms_of_xfns): Provide `x' as feature.
+
+	* xdisp.c (decode_mode_spec): Define %e to indicate memory full.
+
+	* editfns.c (Fformat): Don't include string padding
+	between info[n].start and info[n].end.
+
+	* alloc.c (spare_memory): No longer static.
+	(xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve.
+
+	* puresize.h (BASE_PURESIZE): Increment to 1120000.
+
 2005-10-27  Chong Yidong  <cyd@stupidchicken.com>
 
-	* data.c (Fmake_variable_frame_local): Add clarification to
-	docstring.
+	* data.c (Fmake_variable_frame_local): Add clarification to docstring.
 
 	* fringe.c (update_window_fringes): Handle case where buffer ends
 	with a newline.
@@ -118,8 +256,7 @@
 
 2005-10-20  Aubrey Jaffer  <agj@alum.mit.edu>  (tiny change)
 
-	* unexelf.c (unexec): Fix calls to `fatal' with less than 3
-	arguments.
+	* unexelf.c (unexec): Fix calls to `fatal' with less than 3 arguments.
 
 2005-10-20  Olli Savia  <ops@iki.fi>  (tiny change)
 
@@ -165,7 +302,7 @@
 2005-10-16  Masatake YAMATO  <jet@gyve.org>
 
 	* minibuf.c (Fdisplay_completion_list): Add new optional
-	argument COMMON_SUBSTRING. Bind `completion-common-substring'
+	argument COMMON_SUBSTRING.  Bind `completion-common-substring'
 	to the optional argument during running `completion-setup-hook'.
 
 2005-10-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
--- a/src/Makefile.in	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/Makefile.in	Mon Nov 07 14:56:19 2005 +0000
@@ -777,6 +777,9 @@
 	${lispsource}subr.elc \
 	${lispsource}term/tty-colors.elc \
 	${lispsource}font-core.elc \
+	${lispsource}emacs-lisp/syntax.elc \
+	${lispsource}font-lock.elc \
+	${lispsource}jit-lock.elc \
 	${lispsource}textmodes/fill.elc \
 	${lispsource}textmodes/page.elc \
 	${lispsource}textmodes/paragraphs.elc \
@@ -871,6 +874,9 @@
 	../lisp/subr.elc \
 	../lisp/term/tty-colors.elc \
 	../lisp/font-core.elc \
+	../lisp/emacs-lisp/syntax.elc \
+	../lisp/font-lock.elc \
+	../lisp/jit-lock.elc \
 	../lisp/textmodes/fill.elc \
 	../lisp/textmodes/page.elc \
 	../lisp/textmodes/paragraphs.elc \
--- a/src/alloc.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/alloc.c	Mon Nov 07 14:56:19 2005 +0000
@@ -138,6 +138,8 @@
 
 static __malloc_size_t bytes_used_when_full;
 
+static __malloc_size_t bytes_used_when_reconsidered;
+
 /* Mark, unmark, query mark bit of a Lisp string.  S must be a pointer
    to a struct Lisp_String.  */
 
@@ -182,6 +184,11 @@
 
 static Lisp_Object Vgc_cons_percentage;
 
+/* Minimum number of bytes of consing since GC before next GC,
+   when memory is full.  */
+
+EMACS_INT memory_full_cons_threshold;
+
 /* Nonzero during GC.  */
 
 int gc_in_progress;
@@ -213,11 +220,12 @@
 static int total_free_floats, total_floats;
 
 /* Points to memory space allocated as "spare", to be freed if we run
-   out of memory.  */
-
-static char *spare_memory;
-
-/* Amount of spare memory to keep in reserve.  */
+   out of memory.  We keep one large block, four cons-blocks, and
+   two string blocks.  */
+
+char *spare_memory[7];
+
+/* Amount of spare memory to keep in large reserve block.  */
 
 #define SPARE_MEMORY (1 << 14)
 
@@ -351,6 +359,11 @@
   MEM_TYPE_WINDOW
 };
 
+static POINTER_TYPE *lisp_align_malloc P_ ((size_t, enum mem_type));
+static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type));
+void refill_memory_reserve ();
+
+
 #if GC_MARK_STACK || defined GC_MALLOC_CHECK
 
 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
@@ -451,6 +464,7 @@
 static void mem_delete_fixup P_ ((struct mem_node *));
 static INLINE struct mem_node *mem_find P_ ((void *));
 
+
 #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS
 static void check_gcpros P_ ((void));
 #endif
@@ -511,57 +525,10 @@
 
 
 #ifdef DOUG_LEA_MALLOC
-#  define BYTES_USED (mallinfo ().arena)
+#  define BYTES_USED (mallinfo ().uordblks)
 #else
 #  define BYTES_USED _bytes_used
 #endif
-
-
-/* Called if malloc returns zero.  */
-
-void
-memory_full ()
-{
-  Vmemory_full = Qt;
-
-#ifndef SYSTEM_MALLOC
-  bytes_used_when_full = BYTES_USED;
-#endif
-
-  /* The first time we get here, free the spare memory.  */
-  if (spare_memory)
-    {
-      free (spare_memory);
-      spare_memory = 0;
-    }
-
-  /* This used to call error, but if we've run out of memory, we could
-     get infinite recursion trying to build the string.  */
-  while (1)
-    Fsignal (Qnil, Vmemory_signal_data);
-}
-
-DEFUN ("memory-full-p", Fmemory_full_p, Smemory_full_p, 0, 0, 0,
-       doc: /* t if memory is nearly full, nil otherwise.  */)
-  ()
-{
-  return (spare_memory ? Qnil : Qt);
-}
-
-/* If we released our reserve (due to running out of memory),
-   and we have a fair amount free once again,
-   try to set aside another reserve in case we run out once more.
-
-   This is called when a relocatable block is freed in ralloc.c.  */
-
-void
-refill_memory_reserve ()
-{
-#ifndef SYSTEM_MALLOC
-  if (spare_memory == 0)
-    spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
-#endif
-}
 
 /* Called if we can't allocate relocatable space for a buffer.  */
 
@@ -579,8 +546,6 @@
   memory_full ();
 #endif
 
-  Vmemory_full = Qt;
-
   /* This used to call error, but if we've run out of memory, we could
      get infinite recursion trying to build the string.  */
   while (1)
@@ -806,6 +771,9 @@
   BLOCK_INPUT;
   free (block);
   UNBLOCK_INPUT;
+  /* We don't call refill_memory_reserve here
+     because that duplicates doing so in emacs_blocked_free
+     and the criterion should go there.  */
 }
 
 
@@ -1179,6 +1147,8 @@
      void *ptr;
      const void *ptr2;
 {
+  EMACS_INT bytes_used_now;
+
   BLOCK_INPUT_ALLOC;
 
 #ifdef GC_MALLOC_CHECK
@@ -1207,14 +1177,15 @@
   /* If we released our reserve (due to running out of memory),
      and we have a fair amount free once again,
      try to set aside another reserve in case we run out once more.  */
-  if (spare_memory == 0
+  if (! NILP (Vmemory_full)
       /* Verify there is enough space that even with the malloc
 	 hysteresis this call won't run out again.
 	 The code here is correct as long as SPARE_MEMORY
 	 is substantially larger than the block size malloc uses.  */
       && (bytes_used_when_full
-	  > BYTES_USED + max (malloc_hysteresis, 4) * SPARE_MEMORY))
-    spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
+	  > ((bytes_used_when_reconsidered = BYTES_USED)
+	     + max (malloc_hysteresis, 4) * SPARE_MEMORY)))
+    refill_memory_reserve ();
 
   __free_hook = emacs_blocked_free;
   UNBLOCK_INPUT_ALLOC;
@@ -3381,6 +3352,83 @@
 
 
 /************************************************************************
+			   Memory Full Handling
+ ************************************************************************/
+
+
+/* Called if malloc returns zero.  */
+
+void
+memory_full ()
+{
+  int i;
+
+  Vmemory_full = Qt;
+
+  memory_full_cons_threshold = sizeof (struct cons_block);
+
+  /* The first time we get here, free the spare memory.  */
+  for (i = 0; i < sizeof (spare_memory) / sizeof (char *); i++)
+    if (spare_memory[i])
+      {
+	if (i == 0)
+	  free (spare_memory[i]);
+	else if (i >= 1 && i <= 4)
+	  lisp_align_free (spare_memory[i]);
+	else
+	  lisp_free (spare_memory[i]);
+	spare_memory[i] = 0;
+      }
+
+  /* Record the space now used.  When it decreases substantially,
+     we can refill the memory reserve.  */
+#ifndef SYSTEM_MALLOC
+  bytes_used_when_full = BYTES_USED;
+#endif
+
+  /* This used to call error, but if we've run out of memory, we could
+     get infinite recursion trying to build the string.  */
+  while (1)
+    Fsignal (Qnil, Vmemory_signal_data);
+}
+
+/* If we released our reserve (due to running out of memory),
+   and we have a fair amount free once again,
+   try to set aside another reserve in case we run out once more.
+
+   This is called when a relocatable block is freed in ralloc.c,
+   and also directly from this file, in case we're not using ralloc.c.  */
+
+void
+refill_memory_reserve ()
+{
+#ifndef SYSTEM_MALLOC
+  if (spare_memory[0] == 0)
+    spare_memory[0] = (char *) malloc ((size_t) SPARE_MEMORY);
+  if (spare_memory[1] == 0)
+    spare_memory[1] = (char *) lisp_align_malloc (sizeof (struct cons_block),
+						  MEM_TYPE_CONS);
+  if (spare_memory[2] == 0)
+    spare_memory[2] = (char *) lisp_align_malloc (sizeof (struct cons_block),
+						  MEM_TYPE_CONS);
+  if (spare_memory[3] == 0)
+    spare_memory[3] = (char *) lisp_align_malloc (sizeof (struct cons_block),
+						  MEM_TYPE_CONS);
+  if (spare_memory[4] == 0)
+    spare_memory[4] = (char *) lisp_align_malloc (sizeof (struct cons_block),
+						  MEM_TYPE_CONS);
+  if (spare_memory[5] == 0)
+    spare_memory[5] = (char *) lisp_malloc (sizeof (struct string_block),
+					    MEM_TYPE_STRING);
+  if (spare_memory[6] == 0)
+    spare_memory[6] = (char *) lisp_malloc (sizeof (struct string_block),
+					    MEM_TYPE_STRING);
+  if (spare_memory[0] && spare_memory[1] && spare_memory[5])
+    Vmemory_full = Qnil;
+#endif
+}
+
+/************************************************************************
 			   C Stack Marking
  ************************************************************************/
 
@@ -6008,7 +6056,7 @@
   malloc_hysteresis = 0;
 #endif
 
-  spare_memory = (char *) malloc (SPARE_MEMORY);
+  refill_memory_reserve ();
 
   ignore_warnings = 0;
   gcprolist = 0;
@@ -6109,7 +6157,7 @@
 	     build_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs"));
 
   DEFVAR_LISP ("memory-full", &Vmemory_full,
-	       doc: /* Non-nil means we are handling a memory-full error.  */);
+	       doc: /* Non-nil means Emacs cannot get much more Lisp memory.  */);
   Vmemory_full = Qnil;
 
   staticpro (&Qgc_cons_threshold);
@@ -6124,7 +6172,6 @@
   DEFVAR_INT ("gcs-done", &gcs_done,
 	      doc: /* Accumulated number of garbage collections done.  */);
 
-  defsubr (&Smemory_full_p);
   defsubr (&Scons);
   defsubr (&Slist);
   defsubr (&Svector);
--- a/src/bytecode.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/bytecode.c	Mon Nov 07 14:56:19 2005 +0000
@@ -861,11 +861,11 @@
 
 	case Bcondition_case:
 	  {
-	    Lisp_Object v1;
-	    v1 = POP;
-	    v1 = Fcons (POP, v1);
+	    Lisp_Object handlers, body;
+	    handlers = POP;
+	    body = POP;
 	    BEFORE_POTENTIAL_GC ();
-	    TOP = Fcondition_case (Fcons (TOP, v1));
+	    TOP = internal_lisp_condition_case (TOP, body, handlers);
 	    AFTER_POTENTIAL_GC ();
 	    break;
 	  }
--- a/src/data.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/data.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1721,14 +1721,20 @@
 DEFUN ("make-variable-frame-local", Fmake_variable_frame_local, Smake_variable_frame_local,
        1, 1, "vMake Variable Frame Local: ",
        doc: /* Enable VARIABLE to have frame-local bindings.
-When a frame-local binding exists in the current frame,
-it is in effect whenever the current buffer has no buffer-local binding.
-A frame-local binding is actually a frame parameter value;
-thus, any given frame has a local binding for VARIABLE if it has
-a value for the frame parameter named VARIABLE.  Return VARIABLE.
-
-This function does not in itself create any frame-local bindings for
-VARIABLE.  See `modify-frame-parameters' for how to set frame parameters.  */)
+This does not create any frame-local bindings for VARIABLE,
+it just makes them possible.
+
+A frame-local binding is actually a frame parameter value.
+If a frame F has a value for the frame parameter named VARIABLE,
+that also acts as a frame-local binding for VARIABLE in F--
+provided this function has been called to enable VARIABLE
+to have frame-local bindings at all.
+
+The only way to create a frame-local binding for VARIABLE in a frame
+is to set the VARIABLE frame parameter of that frame.  See
+`modify-frame-parameters' for how to set frame parameters.
+
+Buffer-local bindings take precedence over frame-local bindings.  */)
      (variable)
      register Lisp_Object variable;
 {
--- a/src/editfns.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/editfns.c	Mon Nov 07 14:56:19 2005 +0000
@@ -3662,7 +3662,7 @@
 		    ++nchars;
 		  }
 
-	      start = nchars;
+	      info[n].start = start = nchars;
 	      nchars += nchars_string;
 	      end = nchars;
 
@@ -3677,6 +3677,8 @@
 			      nbytes,
 			      STRING_MULTIBYTE (args[n]), multibyte);
 
+	      info[n].end = nchars;
+
 	      if (negative)
 		while (padding-- > 0)
 		  {
@@ -3713,9 +3715,9 @@
 	      else
 		p += this_nchars;
 	      nchars += this_nchars;
+	      info[n].end = nchars;
 	    }
 
-	  info[n].end = nchars;
 	}
       else if (STRING_MULTIBYTE (args[0]))
 	{
--- a/src/eval.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/eval.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1343,15 +1343,28 @@
      (args)
      Lisp_Object args;
 {
-  Lisp_Object val;
-  struct catchtag c;
-  struct handler h;
   register Lisp_Object bodyform, handlers;
   volatile Lisp_Object var;
 
   var      = Fcar (args);
   bodyform = Fcar (Fcdr (args));
   handlers = Fcdr (Fcdr (args));
+
+  return internal_lisp_condition_case (var, bodyform, handlers);
+}
+
+/* Like Fcondition_case, but the args are separate
+   rather than passed in a list.  Used by Fbyte_code.  */
+
+Lisp_Object
+internal_lisp_condition_case (var, bodyform, handlers)
+     volatile Lisp_Object var;
+     Lisp_Object bodyform, handlers;
+{
+  Lisp_Object val;
+  struct catchtag c;
+  struct handler h;
+
   CHECK_SYMBOL (var);
 
   for (val = handlers; CONSP (val); val = XCDR (val))
@@ -2094,8 +2107,10 @@
     return form;
 
   QUIT;
-  if (consing_since_gc > gc_cons_threshold
-      && consing_since_gc > gc_relative_threshold)
+  if ((consing_since_gc > gc_cons_threshold
+       && consing_since_gc > gc_relative_threshold)
+      ||
+      (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold))
     {
       GCPRO1 (form);
       Fgarbage_collect ();
@@ -2795,8 +2810,10 @@
   register int i;
 
   QUIT;
-  if (consing_since_gc > gc_cons_threshold
-      && consing_since_gc > gc_relative_threshold)
+  if ((consing_since_gc > gc_cons_threshold
+       && consing_since_gc > gc_relative_threshold)
+      ||
+      (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold))
     Fgarbage_collect ();
 
   if (++lisp_eval_depth > max_lisp_eval_depth)
--- a/src/fringe.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/fringe.c	Mon Nov 07 14:56:19 2005 +0000
@@ -861,7 +861,7 @@
 
 	      if (!done_bot)
 		{
-		  if (row->ends_at_zv_p
+		  if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
 		      && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
 		    row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1;
 		  else if (y + row->height >= yb)
@@ -907,9 +907,12 @@
 	left = LEFT_TRUNCATION_BITMAP;
       else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
 	left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
-		? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP);
+		? (row->ends_at_zv_p
+		   ? TOP_RIGHT_ANGLE_BITMAP : LEFT_BRACKET_BITMAP)
+		: TOP_LEFT_ANGLE_BITMAP);
       else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
-	left = BOTTOM_LEFT_ANGLE_BITMAP;
+	left = (row->ends_at_zv_p
+		? TOP_RIGHT_ANGLE_BITMAP : BOTTOM_LEFT_ANGLE_BITMAP);
       else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
 	left = CONTINUATION_LINE_BITMAP;
       else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
@@ -933,9 +936,12 @@
 	right = RIGHT_TRUNCATION_BITMAP;
       else if (row->indicate_bob_p && EQ (boundary_top, Qright))
 	right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
-		 ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP);
+		 ? (row->ends_at_zv_p
+		    ? TOP_LEFT_ANGLE_BITMAP : RIGHT_BRACKET_BITMAP)
+		 : TOP_RIGHT_ANGLE_BITMAP);
       else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
-	right = BOTTOM_RIGHT_ANGLE_BITMAP;
+	right = (row->ends_at_zv_p
+		 ? TOP_LEFT_ANGLE_BITMAP : BOTTOM_RIGHT_ANGLE_BITMAP);
       else if (row->continued_p)
 	right = CONTINUED_LINE_BITMAP;
       else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
--- a/src/keyboard.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/keyboard.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1480,8 +1480,6 @@
 	safe_run_hooks (Qdeferred_action_function);
     }
 
-  Vmemory_full = Qnil;
-
   /* Do this after running Vpost_command_hook, for consistency.  */
   current_kboard->Vlast_command = Vthis_command;
   current_kboard->Vreal_last_command = real_this_command;
--- a/src/lisp.h	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/lisp.h	Mon Nov 07 14:56:19 2005 +0000
@@ -1882,6 +1882,8 @@
 
 extern EMACS_INT gc_relative_threshold;
 
+extern EMACS_INT memory_full_cons_threshold;
+
 /* Structure for recording stack slots that need marking.  */
 
 /* This is a chain of structures, each of which points at a Lisp_Object variable
@@ -2664,6 +2666,7 @@
 EXFUN (Fdo_auto_save, 2);
 extern Lisp_Object apply_lambda P_ ((Lisp_Object, Lisp_Object, int));
 extern Lisp_Object internal_catch P_ ((Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object));
+extern Lisp_Object internal_lisp_condition_case P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
 extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)));
 extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
 extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
--- a/src/lread.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/lread.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1417,7 +1417,8 @@
     }
 
   build_load_history (sourcename, 
-		      stream || (start == BEG && end == Z));
+		      stream || (INTEGERP (start) && INTEGERP (end)
+				 && XINT (start) == BEG && XINT (end) == Z));
 
   UNGCPRO;
 
--- a/src/m/gould.h	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/m/gould.h	Mon Nov 07 14:56:19 2005 +0000
@@ -5,7 +5,7 @@
 * RELEASE2_1 in config.h. This may also be necessary with un-updated
 * official releases of 2.1
 
-   Copyright (C) 1986, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
--- a/src/macfns.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/macfns.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1,5 +1,6 @@
 /* Graphical user interface functions for Mac OS.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004,
+                 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
--- a/src/puresize.h	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/puresize.h	Mon Nov 07 14:56:19 2005 +0000
@@ -42,7 +42,7 @@
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1200000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1170000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
--- a/src/sheap.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/sheap.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1,5 +1,5 @@
-/* simulate sbrk() with an array in .bss, for unexec() support for Cygwin;
-   complete rewrite of xemacs Cygwin unexec() code
+/* simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin;
+   complete rewrite of xemacs Cygwin `unexec' code
 
    Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
@@ -27,9 +27,9 @@
 #include <unistd.h>
 
 #ifdef HAVE_X_WINDOWS
-#define STATIC_HEAP_SIZE	(7 * 1024 * 1024)
+#define STATIC_HEAP_SIZE	(8 * 1024 * 1024)
 #else
-#define STATIC_HEAP_SIZE	(7 * 1024 * 1024)
+#define STATIC_HEAP_SIZE	(8 * 1024 * 1024)
 #endif
 
 int debug_sheap = 0;
--- a/src/syntax.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/syntax.c	Mon Nov 07 14:56:19 2005 +0000
@@ -3020,7 +3020,7 @@
  point is set to where parsing stops.
 If fifth arg OLDSTATE is omitted or nil,
  parsing assumes that FROM is the beginning of a function.
-Value is a list of ten elements describing final state of parsing:
+Value is a list of elements describing final state of parsing:
  0. depth in parens.
  1. character address of start of innermost containing list; nil if none.
  2. character address of start of last complete sexp terminated.
@@ -3039,7 +3039,7 @@
 in parentheses becomes equal to TARGETDEPTH.
 Fourth arg STOPBEFORE non-nil means stop when come to
  any character that starts a sexp.
-Fifth arg OLDSTATE is a nine-element list like what this function returns.
+Fifth arg OLDSTATE is a list like what this function returns.
  It is used to initialize the state of the parse.  Elements number 1, 2, 6
  and 8 are ignored; you can leave off element 8 (the last) entirely.
 Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
--- a/src/unexelf.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/unexelf.c	Mon Nov 07 14:56:19 2005 +0000
@@ -682,7 +682,7 @@
   ElfW(Addr) new_data2_addr;
 
   int n, nn;
-  int old_bss_index, old_sbss_index;
+  int old_bss_index, old_sbss_index, old_plt_index;
   int old_data_index, new_data2_index;
   int old_mdebug_index;
   struct stat stat_buf;
@@ -740,15 +740,34 @@
   old_sbss_index = find_section (".sbss", old_section_names,
 				 old_name, old_file_h, old_section_h, 1);
   if (old_sbss_index != -1)
-    if (OLD_SECTION_H (old_sbss_index).sh_type == SHT_PROGBITS)
+    if (OLD_SECTION_H (old_sbss_index).sh_type != SHT_NOBITS)
       old_sbss_index = -1;
 
-  if (old_sbss_index == -1)
+  /* PowerPC64 has .plt in the BSS section.  */
+  old_plt_index = find_section (".plt", old_section_names,
+				old_name, old_file_h, old_section_h, 1);
+  if (old_plt_index != -1)
+    if (OLD_SECTION_H (old_plt_index).sh_type != SHT_NOBITS)
+      old_plt_index = -1;
+
+  if (old_sbss_index == -1 && old_plt_index == -1)
     {
       old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr;
       old_bss_size = OLD_SECTION_H (old_bss_index).sh_size;
       new_data2_index = old_bss_index;
     }
+  else if (old_plt_index != -1
+	   && (old_sbss_index == -1
+	       || (OLD_SECTION_H (old_sbss_index).sh_addr
+		   > OLD_SECTION_H (old_plt_index).sh_addr)))
+    {
+      old_bss_addr = OLD_SECTION_H (old_plt_index).sh_addr;
+      old_bss_size = OLD_SECTION_H (old_bss_index).sh_size
+	+ OLD_SECTION_H (old_plt_index).sh_size;
+      if (old_sbss_index != -1)
+	old_bss_size += OLD_SECTION_H (old_sbss_index).sh_size;
+      new_data2_index = old_plt_index;
+    }
   else
     {
       old_bss_addr = OLD_SECTION_H (old_sbss_index).sh_addr;
@@ -934,7 +953,7 @@
       if (n == old_bss_index
 	  /* The new bss and sbss section's size is zero, and its file offset
 	     and virtual address should be off by NEW_DATA2_SIZE.  */
-	  || n == old_sbss_index
+	  || n == old_sbss_index || n == old_plt_index
 	  )
 	{
 	  /* NN should be `old_s?bss_index + 1' at this point. */
--- a/src/window.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/window.c	Mon Nov 07 14:56:19 2005 +0000
@@ -1998,11 +1998,13 @@
 	    break;
 
 	  case GET_LRU_WINDOW:
-	    /* t as arg means consider only full-width windows */
-	    if (!NILP (obj) && !WINDOW_FULL_WIDTH_P (w))
-	      break;
-	    /* Ignore dedicated windows and minibuffers.  */
-	    if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt))
+	    /* `obj' is an integer encoding a bitvector.
+	       `obj & 1' means consider only full-width windows.
+	       `obj & 2' means consider also dedicated windows. */
+	    if (((XINT (obj) & 1) && !WINDOW_FULL_WIDTH_P (w))
+		|| (!(XINT (obj) & 2) && EQ (w->dedicated, Qt))
+		/* Minibuffer windows are always ignored.  */
+		|| MINI_WINDOW_P (w))
 	      break;
 	    if (NILP (best_window)
 		|| (XFASTINT (XWINDOW (best_window)->use_time)
@@ -2053,9 +2055,9 @@
 	    break;
 
 	  case GET_LARGEST_WINDOW:
-	    {
+	    { /* nil `obj' means to ignore dedicated windows.  */
 	      /* Ignore dedicated windows and minibuffers.  */
-	      if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt))
+	      if (MINI_WINDOW_P (w) || (NILP (obj) && EQ (w->dedicated, Qt)))
 		break;
 
 	      if (NILP (best_window))
@@ -2149,43 +2151,47 @@
   window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
 }
 
-DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0,
+DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 2, 0,
        doc: /* Return the window least recently selected or used for display.
 Return a full-width window if possible.
 A minibuffer window is never a candidate.
-A dedicated window is never a candidate, so if all windows are dedicated,
-the value is nil.
+A dedicated window is never a candidate, unless DEDICATED is non-nil,
+  so if all windows are dedicated, the value is nil.
 If optional argument FRAME is `visible', search all visible frames.
 If FRAME is 0, search all visible and iconified frames.
 If FRAME is t, search all frames.
 If FRAME is nil, search only the selected frame.
 If FRAME is a frame, search only that frame.  */)
-     (frame)
-     Lisp_Object frame;
+  (frame, dedicated)
+     Lisp_Object frame, dedicated;
 {
   register Lisp_Object w;
   /* First try for a window that is full-width */
-  w = window_loop (GET_LRU_WINDOW, Qt, 0, frame);
+  w = window_loop (GET_LRU_WINDOW,
+		   NILP (dedicated) ? make_number (1) : make_number (3),
+		   0, frame);
   if (!NILP (w) && !EQ (w, selected_window))
     return w;
   /* If none of them, try the rest */
-  return window_loop (GET_LRU_WINDOW, Qnil, 0, frame);
+  return window_loop (GET_LRU_WINDOW,
+		      NILP (dedicated) ? make_number (0) : make_number (2),
+		      0, frame);
 }
 
-DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0,
+DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 2, 0,
        doc: /* Return the largest window in area.
 A minibuffer window is never a candidate.
-A dedicated window is never a candidate, so if all windows are dedicated,
-the value is nil.
+A dedicated window is never a candidate unless DEDICATED is non-nil,
+  so if all windows are dedicated, the value is nil.
 If optional argument FRAME is `visible', search all visible frames.
 If FRAME is 0, search all visible and iconified frames.
 If FRAME is t, search all frames.
 If FRAME is nil, search only the selected frame.
 If FRAME is a frame, search only that frame.  */)
-     (frame)
-     Lisp_Object frame;
-{
-  return window_loop (GET_LARGEST_WINDOW, Qnil, 0,
+    (frame, dedicated)
+     Lisp_Object frame, dedicated;
+{
+  return window_loop (GET_LARGEST_WINDOW, dedicated, 0,
 		      frame);
 }
 
@@ -3505,15 +3511,17 @@
       if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame))
 	{
 	  /* Try visible frames first.  */
-	  window = Fget_largest_window (Qvisible);
+	  window = Fget_largest_window (Qvisible, Qt);
 	  /* If that didn't work, try iconified frames.  */
 	  if (NILP (window))
-	    window = Fget_largest_window (make_number (0));
+	    window = Fget_largest_window (make_number (0), Qt);
+#if 0     /* Don't try windows on other displays.  */
 	  if (NILP (window))
-	    window = Fget_largest_window (Qt);
+	    window = Fget_largest_window (Qt, Qt);
+#endif
 	}
       else
-	window = Fget_largest_window (frames);
+	window = Fget_largest_window (frames, Qt);
 
       /* If we got a tall enough full-width window that can be split,
 	 split it.  */
@@ -3526,7 +3534,7 @@
 	{
 	  Lisp_Object upper, lower, other;
 
-	  window = Fget_lru_window (frames);
+	  window = Fget_lru_window (frames, Qt);
 	  /* If the LRU window is selected, and big enough,
 	     and can be split, split it.  */
 	  if (!NILP (window)
@@ -3535,23 +3543,27 @@
 		  || EQ (XWINDOW (window)->parent, Qnil))
 	      && window_height (window) >= window_min_height << 1)
 	    window = Fsplit_window (window, Qnil, Qnil);
+	  else
+	    window = Fget_lru_window (frames, Qnil);
 	  /* If Fget_lru_window returned nil, try other approaches.  */
 
 	  /* Try visible frames first.  */
 	  if (NILP (window))
 	    window = Fget_buffer_window (buffer, Qvisible);
 	  if (NILP (window))
-	    window = Fget_largest_window (Qvisible);
+	    window = Fget_largest_window (Qvisible, Qnil);
 	  /* If that didn't work, try iconified frames.  */
 	  if (NILP (window))
 	    window = Fget_buffer_window (buffer, make_number (0));
 	  if (NILP (window))
-	    window = Fget_largest_window (make_number (0));
-	  /* Try invisible frames.  */
+	    window = Fget_largest_window (make_number (0), Qnil);
+
+#if 0     /* Don't try frames on other displays.  */
 	  if (NILP (window))
 	    window = Fget_buffer_window (buffer, Qt);
 	  if (NILP (window))
-	    window = Fget_largest_window (Qt);
+	    window = Fget_largest_window (Qt, Qnil);
+#endif
 	  /* As a last resort, make a new frame.  */
 	  if (NILP (window))
 	    window = Fframe_selected_window (call0 (Vpop_up_frame_function));
@@ -3578,7 +3590,7 @@
 	}
     }
   else
-    window = Fget_lru_window (Qnil);
+    window = Fget_lru_window (Qnil, Qnil);
 
   Fset_window_buffer (window, buffer, Qnil);
   return display_buffer_1 (window);
@@ -3868,15 +3880,16 @@
        doc: /* Make current window ARG lines bigger.
 From program, optional second arg non-nil means grow sideways ARG columns.
 Interactively, if an argument is not given, make the window one line bigger.
+If HORIZONTAL is non-nil, enlarge horizontally instead of vertically.
 
 Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size
 of the siblings above or to the left of the selected window.  Only
 siblings to the right or below are changed.  */)
-     (arg, side, preserve_before)
-     register Lisp_Object arg, side, preserve_before;
+     (arg, horizontal, preserve_before)
+     register Lisp_Object arg, horizontal, preserve_before;
 {
   CHECK_NUMBER (arg);
-  enlarge_window (selected_window, XINT (arg), !NILP (side),
+  enlarge_window (selected_window, XINT (arg), !NILP (horizontal),
 		  !NILP (preserve_before));
 
   if (! NILP (Vwindow_configuration_change_hook))
@@ -3924,40 +3937,43 @@
 
 
 #define CURBEG(w) \
-  *(widthflag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line))
+  *(horiz_flag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line))
 
 #define CURSIZE(w) \
-  *(widthflag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines))
-
-
-/* Enlarge WINDOW by DELTA.  WIDTHFLAG non-zero means
-   increase its width.  Siblings of the selected window are resized to
-   fulfill the size request.  If they become too small in the process,
-   they will be deleted.
+  *(horiz_flag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines))
+
+
+/* Enlarge WINDOW by DELTA.
+   HORIZ_FLAG nonzero means enlarge it horizontally;
+   zero means do it vertically.
+
+   Siblings of the selected window are resized to fulfill the size
+   request.  If they become too small in the process, they will be
+   deleted.
 
    If PRESERVE_BEFORE is nonzero, that means don't alter
    the siblings to the left or above WINDOW.  */
 
 static void
-enlarge_window (window, delta, widthflag, preserve_before)
+enlarge_window (window, delta, horiz_flag, preserve_before)
      Lisp_Object window;
-     int delta, widthflag, preserve_before;
+     int delta, horiz_flag, preserve_before;
 {
   Lisp_Object parent, next, prev;
   struct window *p;
   Lisp_Object *sizep;
   int maximum;
   int (*sizefun) P_ ((Lisp_Object))
-    = widthflag ? window_width : window_height;
+    = horiz_flag ? window_width : window_height;
   void (*setsizefun) P_ ((Lisp_Object, int, int))
-    = (widthflag ? set_window_width : set_window_height);
+    = (horiz_flag ? set_window_width : set_window_height);
 
   /* Check values of window_min_width and window_min_height for
      validity.  */
   check_min_window_sizes ();
 
   /* Give up if this window cannot be resized.  */
-  if (window_fixed_size_p (XWINDOW (window), widthflag, 1))
+  if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1))
     error ("Window is not resizable");
 
   /* Find the parent of the selected window.  */
@@ -3968,12 +3984,12 @@
 
       if (NILP (parent))
 	{
-	  if (widthflag)
+	  if (horiz_flag)
 	    error ("No other window to side of this one");
 	  break;
 	}
 
-      if (widthflag
+      if (horiz_flag
 	  ? !NILP (XWINDOW (parent)->hchild)
 	  : !NILP (XWINDOW (parent)->vchild))
 	break;
@@ -3999,7 +4015,7 @@
 	else
 	  maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next)
 					 - window_min_size (XWINDOW (p->next),
-							    widthflag, 0, 0))
+							    horiz_flag, 0, 0))
 		      : (delta = 0));
       }
     else
@@ -4007,11 +4023,11 @@
 		  /* This is a main window followed by a minibuffer.  */
 		  : !NILP (p->next) ? ((*sizefun) (p->next)
 				       - window_min_size (XWINDOW (p->next),
-							  widthflag, 0, 0))
+							  horiz_flag, 0, 0))
 		  /* This is a minibuffer following a main window.  */
 		  : !NILP (p->prev) ? ((*sizefun) (p->prev)
 				       - window_min_size (XWINDOW (p->prev),
-							  widthflag, 0, 0))
+							  horiz_flag, 0, 0))
 		  /* This is a frame with only one window, a minibuffer-only
 		     or a minibufferless frame.  */
 		  : (delta = 0));
@@ -4023,7 +4039,7 @@
       delta = maxdelta;
   }
 
-  if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), widthflag, 0, 0))
+  if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), horiz_flag, 0, 0))
     {
       delete_window (window);
       return;
@@ -4036,11 +4052,11 @@
   maximum = 0;
   for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
     maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
-						    widthflag, 0, 0);
+						    horiz_flag, 0, 0);
   if (! preserve_before)
     for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
       maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
-						      widthflag, 0, 0);
+						      horiz_flag, 0, 0);
 
   /* If we can get it all from them without deleting them, do so.  */
   if (delta <= maximum)
@@ -4062,7 +4078,7 @@
 	    {
 	      int this_one = ((*sizefun) (next)
 			      - window_min_size (XWINDOW (next),
-						 widthflag, 0, &fixed_p));
+						 horiz_flag, 0, &fixed_p));
 	      if (!fixed_p)
 		{
 		  if (this_one > delta)
@@ -4084,7 +4100,7 @@
 	    {
 	      int this_one = ((*sizefun) (prev)
 			      - window_min_size (XWINDOW (prev),
-						 widthflag, 0, &fixed_p));
+						 horiz_flag, 0, &fixed_p));
 	      if (!fixed_p)
 		{
 		  if (this_one > delta)
@@ -4187,10 +4203,10 @@
 	  int n = 1;
 
 	  for (s = w->next; !NILP (s); s = XWINDOW (s)->next)
-	    if (!window_fixed_size_p (XWINDOW (s), widthflag, 0))
+	    if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
 	      ++n;
 	  for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
-	    if (!window_fixed_size_p (XWINDOW (s), widthflag, 0))
+	    if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
 	      ++n;
 
 	  delta1 = n * delta;
--- a/src/xdisp.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/xdisp.c	Mon Nov 07 14:56:19 2005 +0000
@@ -3163,6 +3163,9 @@
   Lisp_Object prop, pos;
   enum prop_handled handled = HANDLED_NORMALLY;
 
+  if (!NILP (Vmemory_full))
+    return handled;
+
   /* Get the value of the `fontified' property at IT's current buffer
      position.  (The `fontified' property doesn't have a special
      meaning in strings.)  If the value is nil, call functions from
@@ -8618,7 +8621,7 @@
 static Lisp_Object Vmode_line_unwind_vector;
 
 static Lisp_Object
-format_mode_line_unwind_data (obuf)
+format_mode_line_unwind_data (obuf, save_proptrans)
      struct buffer *obuf;
 {
   Lisp_Object vector;
@@ -8634,7 +8637,7 @@
   AREF (vector, 0) = make_number (mode_line_target);
   AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0));
   AREF (vector, 2) = mode_line_string_list;
-  AREF (vector, 3) = mode_line_proptrans_alist;
+  AREF (vector, 3) = (save_proptrans ? mode_line_proptrans_alist : Qt);
   AREF (vector, 4) = mode_line_string_face;
   AREF (vector, 5) = mode_line_string_face_prop;
 
@@ -8653,7 +8656,8 @@
   mode_line_target = XINT (AREF (vector, 0));
   mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
   mode_line_string_list = AREF (vector, 2);
-  mode_line_proptrans_alist = AREF (vector, 3);
+  if (! EQ (AREF (vector, 3), Qt))
+    mode_line_proptrans_alist = AREF (vector, 3);
   mode_line_string_face = AREF (vector, 4);
   mode_line_string_face_prop = AREF (vector, 5);
 
@@ -8776,7 +8780,7 @@
 	 mode_line_target so that display_mode_element will output into
 	 mode_line_noprop_buf; then display the title.  */
       record_unwind_protect (unwind_format_mode_line,
-			     format_mode_line_unwind_data (current_buffer));
+			     format_mode_line_unwind_data (current_buffer, 0));
 
       set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer));
       fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
@@ -10575,7 +10579,8 @@
     clear_garbaged_frames ();
 
   /* Build menubar and tool-bar items.  */
-  prepare_menu_bars ();
+  if (NILP (Vmemory_full))
+    prepare_menu_bars ();
 
   if (windows_or_buffers_changed)
     update_mode_lines++;
@@ -15686,7 +15691,9 @@
 			produce_special_glyphs (it, IT_CONTINUATION);
 		      row->continued_p = 1;
 
+		      it->current_x = x_before;
 		      it->continuation_lines_width += x;
+		      extend_face_to_end_of_line (it);
 
 		      if (nglyphs > 1 && i > 0)
 			{
@@ -16171,7 +16178,7 @@
     it.base_face_id = it.face_id = DEFAULT_FACE_ID;
 
   record_unwind_protect (unwind_format_mode_line,
-			 format_mode_line_unwind_data (NULL));
+			 format_mode_line_unwind_data (NULL, 0));
 
   mode_line_target = MODE_LINE_DISPLAY;
 
@@ -16206,6 +16213,44 @@
   return it.glyph_row->height;
 }
 
+/* Move element ELT in LIST to the front of LIST.
+   Return the updated list.  */
+
+static Lisp_Object
+move_elt_to_front (elt, list)
+     Lisp_Object elt, list;
+{
+  register Lisp_Object tail, prev;
+  register Lisp_Object tem;
+
+  tail = list;
+  prev = Qnil;
+  while (CONSP (tail))
+    {
+      tem = XCAR (tail);
+
+      if (EQ (elt, tem))
+	{
+	  /* Splice out the link TAIL.  */
+	  if (NILP (prev))
+	    list = XCDR (tail);
+	  else
+	    Fsetcdr (prev, XCDR (tail));
+
+	  /* Now make it the first.  */
+	  Fsetcdr (tail, list);
+	  return tail;
+	}
+      else
+	prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
+
+  /* Not found--return unchanged LIST.  */
+  return list;
+}
+
 /* Contribute ELT to the mode line for window IT->w.  How it
    translates into text depends on its data type.
 
@@ -16255,7 +16300,8 @@
 	unsigned char c;
 	int offset = 0;
 
-	if (!NILP (props) || risky)
+	if (SCHARS (elt) > 0
+	    && (!NILP (props) || risky))
 	  {
 	    Lisp_Object oprops, aelt;
 	    oprops = Ftext_properties_at (make_number (0), elt);
@@ -16286,14 +16332,22 @@
 		aelt = Fassoc (elt, mode_line_proptrans_alist);
 		if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt))))
 		  {
+		    /* AELT is what we want.  Move it to the front
+		       without consing.  */
+		    elt = XCAR (aelt);
 		    mode_line_proptrans_alist
-		      = Fcons (aelt, Fdelq (aelt, mode_line_proptrans_alist));
-		    elt = XCAR (aelt);
+		      = move_elt_to_front (aelt, mode_line_proptrans_alist);
 		  }
 		else
 		  {
 		    Lisp_Object tem;
 
+		    /* If AELT has the wrong props, it is useless.
+		       so get rid of it.  */
+		    if (! NILP (aelt))
+		      mode_line_proptrans_alist
+			= Fdelq (aelt, mode_line_proptrans_alist);
+
 		    elt = Fcopy_sequence (elt);
 		    Fset_text_properties (make_number (0), Flength (elt),
 					  props, elt);
@@ -16818,8 +16872,11 @@
   if (XBUFFER (buffer) != current_buffer)
     old_buffer = current_buffer;
 
+  /* Save things including mode_line_proptrans_alist,
+     and set that to nil so that we don't alter the outer value.  */
   record_unwind_protect (unwind_format_mode_line,
-			 format_mode_line_unwind_data (old_buffer));
+			 format_mode_line_unwind_data (old_buffer, 1));
+  mode_line_proptrans_alist = Qnil;
 
   if (old_buffer)
     set_buffer_internal_1 (XBUFFER (buffer));
@@ -17204,6 +17261,18 @@
 	return decode_mode_spec_buf;
       }
 
+    case 'e':
+#ifndef SYSTEM_MALLOC
+      {
+	if (NILP (Vmemory_full))
+	  return "";
+	else
+	  return "!MEM FULL! ";
+      }
+#else
+      return "";
+#endif
+
     case 'F':
       /* %F displays the frame name.  */
       if (!NILP (f->title))
@@ -18723,19 +18792,15 @@
 {
   /* If the face of this glyph string has to be drawn to the end of
      the drawing area, set S->extends_to_end_of_line_p.  */
-  struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID);
 
   if (start == s->row->used[s->area]
       && s->area == TEXT_AREA
-      && ((s->hl == DRAW_NORMAL_TEXT
-	   && (s->row->fill_line_p
-	       || s->face->background != default_face->background
-	       || s->face->stipple != default_face->stipple
-	       || s->row->mouse_face_p))
-	  || s->hl == DRAW_MOUSE_FACE
-	  || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN)
-	      && s->row->fill_line_p)))
-      s->extends_to_end_of_line_p = 1;
+      && ((s->row->fill_line_p
+	   && (s->hl == DRAW_NORMAL_TEXT
+	       || s->hl == DRAW_IMAGE_RAISED
+	       || s->hl == DRAW_IMAGE_SUNKEN))
+	  || s->hl == DRAW_MOUSE_FACE))
+    s->extends_to_end_of_line_p = 1;
 
   /* If S extends its face to the end of the line, set its
      background_width to the distance to the right edge of the drawing
@@ -21279,7 +21344,11 @@
 	  if (row == last)
 	    end_hpos = dpyinfo->mouse_face_end_col;
 	  else
-	    end_hpos = row->used[TEXT_AREA];
+	    {
+	      end_hpos = row->used[TEXT_AREA];
+	      if (draw == DRAW_NORMAL_TEXT)
+		row->fill_line_p = 1; /* Clear to end of line */
+	    }
 
 	  if (end_hpos > start_hpos)
 	    {
--- a/src/xfns.c	Mon Nov 07 14:17:18 2005 +0000
+++ b/src/xfns.c	Mon Nov 07 14:56:19 2005 +0000
@@ -5743,6 +5743,8 @@
 variable `use-file-dialog'.  */);
   x_use_old_gtk_file_dialog = 0;
 
+  Fprovide (intern ("x"), Qnil);
+
 #ifdef USE_X_TOOLKIT
   Fprovide (intern ("x-toolkit"), Qnil);
 #ifdef USE_MOTIF